gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import logging
import os
import sys
from collections import namedtuple
import six
import yaml
from .errors import CircularReference
from .errors import ComposeFileNotFound
from .errors import ConfigurationError
from .interpolation import interpolate_environment_variables
from .validation import validate_against_field... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Testing the Gap Statistic to find the k in k-means
http://datasciencelab.wordpress.com/2013/12/27/finding-the-k-in-k-means-clustering/
"""
from __future__ import division
import sys
import numpy as np
from sklearn.cluster import KMeans
import matplotlib.pyplot as p... | |
"""Pytest fixtures for main test suite."""
import os
import pytest
from pycounter import csvhelper
from pycounter import report
import pycounter.sushi
def parsedata(filename):
"""Helper function returns a report from a filename relative to data directory."""
return report.parse(os.path.join(os.path.dirname(... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
# -*- coding: utf-8 -*-
#
# Script to execute test cases from one suite in parallel
# by thomas klein / 2009
#
# imports
from robot.running import TestSuite
from robot import utils
from robot.conf import settings
import os, glob
import subprocess
import time
from datetime import datetime
import sys
import getopt
impo... | |
"""
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
import warnings
from scipy.spatial import distance
from scipy import sparse
import pytest
from sklearn.utils._testing import assert_array_equal
from sklearn.neighbors import NearestNeighbors
from sklearn.cluster import DBSCAN
from skle... | |
# Plugin: core
# Date: 20th December 2014
# Author: James Mills, prologic at shortcircuit dot net dot au
"""Core Plugin"""
__version__ = "0.0.1"
__author__ = "James Mills, prologic at shortcircuit dot net dot au"
from os import getcwd
from uuid import uuid4 as uuid
from tempfile import NamedTemporaryFile
... | |
#
# Copyright (c) 2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code mu... | |
#!/usr/bin/env python3
import asyncio
import functools
import logging
import traceback
from thrift.server.TServer import TServerEventHandler
from thrift.Thrift import (
TException,
TProcessor,
)
from thrift.util.async_common import (
AsyncioRpcConnectionContext,
FramedProtocol,
THeaderProtocol,
... | |
"""
txcons.py
Transaction Constructors for the blockchain.
"""
from collections import defaultdict
from asset import AssetTarget
from coloredcoinlib import (ColorSet, ColorTarget, SimpleColorValue,
ComposedTxSpec, OperationalTxSpec,
UNCOLORED_MARKER, OBColorDefi... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import qrl.generated.qrlwallet_pb2 as qrlwallet__pb2
class WalletAPIStub(object):
"""//////////////////////////
//////////////////////////
//////////////////////////
//// API ///////
//////////////////////////
///... | |
"""
tests.components.device_tracker.test_owntracks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests Owntracks device tracker.
"""
import json
import os
import unittest
from collections import defaultdict
from homeassistant.components import device_tracker
from homeassistant.const import (STATE_NOT_HOME, CONF_PL... | |
# -*- coding: utf-8 -*-
import sys, os
import sphinx
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
DIR = os.path.dirname(__file... | |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=================
Threading Classes
=================
:Author:
Moritz Emanuel Beber
:Date:
2011-02-26
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:
threaded.py
Notes
-----
Most classes (unless they inherit fro... | |
from __future__ import unicode_literals
import unittest
import spotify
from spotify import compat
import tests
from tests import mock
@mock.patch('spotify.album.lib', spec=spotify.lib)
class AlbumTest(unittest.TestCase):
def setUp(self):
self.session = tests.create_session_mock()
def test_create_w... | |
from __future__ import print_function, division
from sympy import (sympify, diff, sin, cos, Matrix, Symbol, integrate,
trigsimp, Function, symbols)
from sympy.core.basic import S
from sympy.core.compatibility import reduce
from .vector import Vector, _check_vector
from .frame import CoordinateSym, _... | |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import gc
import opcode
import inspect
import theano
import numpy as np
from collections import OrderedDict
from inspect import getcallargs
#import theano
#from theano.sandbox.cuda import cuda_ndarray
#cuda_ndarray = cuda_ndarray.cuda_ndarray
def orderedcallargs(fn, *args, **kwargs):
"""
Returns an OrderedD... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import logging
from dateutil import parser
import math
import json
from get_database import get_mode_db, get_section_db
from datetime import datetime, timedelta
from userclient import getClientSpecificQueryFilter
import stats
import time
# TODO: Argh! Until now, we just had the data collector import the webapp.
# Now ... | |
from __future__ import unicode_literals
from collections import OrderedDict
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.core.exceptions import FieldDoesNotExist
from django.core.serializers.json import DjangoJSONEncoder
from django.contrib.contenttypes.m... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MediaType'
db.create_table('medialibrary_mediatype', (
('id', self.gf('django.db... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | |
import copy
import os
import re
import pytest
import time
from subprocess import CalledProcessError
from rancher import ApiError
from .test_auth import enable_ad, load_setup_data
from .common import add_role_to_user
from .common import auth_get_user_token
from .common import auth_resource_cleanup
from .common impor... | |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
import os
import sys
import Options
import CommodityPrice
import threading
import time
class EdceWrapper:
_commodityNameTranslationTable = {
"Fruit And Vegetables" : "Fruit and Vegetables",
"Atmospheric Extractors" : "Atmospheric Processors",
"Marine Supplies" : "Marine Equipment",
... | |
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from django.core.files import File
import PIL
from PIL import Image
from mock import patch, MagicMock
from webapp.forms import PhotoForm
class DashboardTestCase(TestCase):
"""
Testcase for the Dashboard View .
"""
... | |
"""Support for Amcrest IP cameras."""
import asyncio
from datetime import timedelta
import logging
from urllib3.exceptions import HTTPError
from amcrest import AmcrestError
import voluptuous as vol
from homeassistant.components.camera import (
Camera, CAMERA_SERVICE_SCHEMA, SUPPORT_ON_OFF, SUPPORT_STREAM)
from ho... | |
import abc
import asyncio
import collections
import inspect
import keyword
import os
import re
import sys
import warnings
from collections.abc import Container, Iterable, Sized
from pathlib import Path
from types import MappingProxyType
from yarl import URL, quote, unquote
from . import hdrs
from .abc import Abstract... | |
from django import forms
from django.core.urlresolvers import reverse
from django.core import exceptions
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _, ugettext
from django.utils.http import int_to_base36
from django.utils.importlib import import_module
from django.contrib.auth... | |
import os, io, sys, re
from .utils import CodeGenerator, camel_to_snake_case, camel_to_screaming_snake_case, delegate_type, which
from .registry import BaseTypeElem, Member, Typed, TypeRef, DispatchTable
PREDEFINED_TYPES = {
'int8_t': 'i8',
'uint8_t': 'u8',
'int16_t': 'i16',
'uint16_t': 'u16',
'int... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""URL endpoint to allow Buildbot slaves to post data to the dashboard."""
import copy
import json
import logging
import math
import re
from google.appengi... | |
# -*- coding: utf-8 -*-
"""
Installs and configures puppet
"""
import sys
import logging
import os
import platform
import time
from packstack.installer import utils
from packstack.installer import basedefs, output_messages
from packstack.installer.exceptions import ScriptRuntimeError, PuppetError
from packstack.mod... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import json
import pytest
import krisk.plot as kk
import numpy as np
DATA_DIR = 'krisk/tests/data'
read_option_tests = lambda f: json.load(open(DATA_DIR + '/' + f, 'r'))
def assert_barline_data(plot, true_option, test_legend=True):
assert plot.option['series'][0] == true_option['series'][0]
assert plot.option... | |
# Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | |
#file calibration.py
#calibration with a convolutional neural net
import os
import cv2
import numpy as np
import Tkinter as tk
import time
from random import randint
import tensorflow as tf
import openface
import dlib
from six.moves import cPickle
printing=False
def scale(img):
img = cv2.cvtColor(img, cv2.COLOR... | |
"""Module containing python functions, which generate second order RTD kernels."""
class KernelHandler(object):
"""Class responsible for inserting matrix elements into the various matrices used."""
def __init__(self, si):
self.si = si
self.ndm0 = si.ndm0
self.ndm0r = si.ndm0r
s... | |
import sys
import bisect
import copy
import contextlib
import pkg_resources
import numpy
from PyQt4.QtGui import (
QWidget, QButtonGroup, QGroupBox, QRadioButton, QSlider,
QDoubleSpinBox, QComboBox, QSpinBox, QListView,
QVBoxLayout, QHBoxLayout, QFormLayout, QSpacerItem, QSizePolicy,
QCursor, QIcon, ... | |
#!/usr/bin/python
# Copyright (c) 2009, Purdue University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list ... | |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
# Copyright (c) 2016 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import absolute_import
from six import binary_type
from typing import Any, AnyStr, Callable, Dict, Iterable, List, MutableMapping, Optional, Text
from django.conf import settings
from django.core.exceptions import DisallowedHost
from django.utils.translation import ugettext as _
from zerver.lib.respo... | |
import numba
from numba.tests.support import TestCase, unittest
from numba.core.registry import cpu_target
from numba.core.compiler import CompilerBase, Flags
from numba.core.compiler_machinery import PassManager
from numba.core import types, ir, bytecode, compiler, ir_utils, registry
from numba.core.untyped_passes imp... | |
"""
Action creates a new RDS instance and stores its data as an attribute on the
new deployed service.
"""
import json
from infrastructure.models import CustomField, Environment
from orders.models import CustomFieldValue
from resourcehandlers.aws.models import AWSHandler
from common.methods import set_progress
def cr... | |
#!/usr/bin/python3
import json
import os
import getopt
import sys, inspect
this_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
src_folder = os.path.realpath(os.path.abspath(os.path.join(this_folder,"..", "src")))
if src_folder not in sys.path:
sys.path.inser... | |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import logging
log = logging.getLogger(__name__)
import random
import string
from zope.interface import implementer
from pyramid.interfaces import (
IAuthenticationPolicy,
IDebugLogger,
)
from pyramid.security import (
Authenticated,
Everyone,
)
from webob.cookies import SignedCookieProfile... | |
from pymeta.grammar import OMeta
from pymeta.runtime import character, ParseError, EOFError
from terml.common import CommonParser
termLGrammar = r"""
literal ::= (<string>:x => TermLiteral(".String.", x)
| <character>:x => TermLiteral(".char.", x)
| <number>:x => TermLiteral(numberType(x), x))
... | |
"""Scrapy Shell
See documentation in docs/topics/shell.rst
"""
import os
import signal
import warnings
from twisted.internet import threads, defer
from twisted.python import threadable
from w3lib.url import any_to_uri
from scrapy.crawler import Crawler
from scrapy.exceptions import IgnoreRequest, ScrapyDeprecationW... | |
#! /usr/local/bin/python
"""
See LICENSE file for copyright and license details.
"""
from sqlalchemy import Table, MetaData, Column, Integer, or_, and_
from sqlalchemy.types import VARCHAR
#from sqlalchemy.sql import exisst
from sqlalchemy.orm import sessionmaker
from sqlalchemy import func
from decimal impor... | |
from __future__ import absolute_import
import socket
import types
from collections import defaultdict
from itertools import count
from kombu import Connection, Exchange, Queue, Consumer, Producer
from kombu.exceptions import InconsistencyError, VersionMismatch
from kombu.five import Empty, Queue as _Queue
from kombu... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
import os
import random
import time
import WifiConnUtility
from NativeLog import NativeLog
from TCAction import TCActionBase
from Utility import Encoding
from Utility import MakeFolder
STEPS = {"SCAN1": 0x01, "JAP": 0x02, "SCAN2": 0x04, "RECONNECT": 0x08}
AP_PROP = ("ssid", "ssid_len", "pwd",
"pwd_len", "... | |
""" Tests on the DAG implementation """
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import threading
import pytest
from stacker.dag import (
DAG,
DAGValidationError,
ThreadedWalker,
UnlimitedSemaphore
)
@pytest.fixture
def empty_dag():... | |
##
# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
# -*- coding: utf-8 -*-
# Copyright (c)2014 Rackspace US, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
#!/usr/bin/env python2
#
# ESP8266 luatool
# Author e-mail: 4ref0nt@gmail.com
# Site: http://esp8266.ru
# Contributions from: https://github.com/sej7278
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Fou... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Note.title'
db.alter_column(u'catalog_note', 'title', ... | |
"""Open ports in your router for Home Assistant and provide statistics."""
from __future__ import annotations
import asyncio
from collections.abc import Mapping
from datetime import timedelta
from ipaddress import ip_address
from typing import Any
import voluptuous as vol
from homeassistant import config_entries
fro... | |
# monitoring v3 for topology 2
# Jack Zhao
# s.zhao.j@gmail.com
from __future__ import division
from operator import attrgetter
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER, DEAD_DISPATCHER
from ryu.controller.handler import CONFIG_DISPATCHE... | |
from crispy_forms.utils import TEMPLATE_PACK
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.db import models
from django.db.models.query import QuerySet
from django.forms.models imp... | |
import datetime
from collections import OrderedDict
import warnings
import numpy as np
from numpy import array, nan
import pandas as pd
import pytest
from numpy.testing import assert_almost_equal, assert_allclose
from pvlib import irradiance
from .conftest import (
assert_frame_equal,
assert_series_equal,
... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
"""Test the Enphase Envoy config flow."""
from unittest.mock import MagicMock, patch
import httpx
from homeassistant import config_entries, setup
from homeassistant.components.enphase_envoy.const import DOMAIN
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_form... | |
"""A module to help manage coordinate frames and objects attached to them.
Similar to the tf module in ROS.
You may attach points / vectors to frames and determine relative or world
coordinates in a straightforward, object-oriented way.
The ``coordinates`` module is set up with a default coordinate manager so that
if... | |
from pandac.PandaModules import *
from toontown.toonbase import ToontownGlobals
from direct.showbase import DirectObject
from direct.fsm import StateData
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
from toontown.effects import DistributedFireworkShow
fr... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Unit tests for grit.gather.chrome_html'''
import os
import re
import sys
if __name__ == '__main__':
sys.path.append(os.path.... | |
import time
import json
import random
from snapchat_agent import SnapchatAgent
from snapchat_cache import SnapchatCache
from pprint import pprint
class Snapchat(SnapchatAgent):
#Media Flags
MEDIA_IMAGE = 0
MEDIA_VIDEO = 1
MEDIA_VIDEO_NOAUDIO = 2
MEDIA_FRIEND_REQUEST = 3
MEDIA_FRIEND_REQUES... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2012 Grid Dynamics
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
"""
# Copyright 2016-2022 The Johns Hopkins University Applied Physics Laboratory
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
# Authentication tests based on airmozilla
# https://github.com/mozilla/airmozilla/blob/master/airmozilla/\
# auth/tests/test_views.py
import json
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.test import RequestFactory
fro... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010 OpenStack Foundation
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with ... | |
"""Kernelized Incremental Feature Dependency Discovery"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import super
from future import standard_library
standard_library.install_aliases()
from builtins ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
import os
import sys
import re
import platform
import time
import requests
def strike(string):
"""
Make a string strikethrough but assure that it can be printed.
Args:
string (str): string to apply strikethrough to.
"""
if platform.system() != "Windows":
return '\u0336'.join(st... | |
"""
Tests of the permissions on specific models in the auth app. For tests of the permissions system itself, see test_permission_classes.py
"""
from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from .helpers import create_dummy_facility_data
from ..constants i... | |
# Copyright (c) 2013-2018, Rethink Robotics Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
"""Tests for Plex sensors."""
from datetime import datetime, timedelta
from http import HTTPStatus
from unittest.mock import patch
import requests.exceptions
from homeassistant.components.plex.const import PLEX_UPDATE_LIBRARY_SIGNAL
from homeassistant.config_entries import RELOAD_AFTER_UPDATE_DELAY
from homeassistant... | |
# Python
import collections
import urlparse
# Django
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
# Django REST Framework
from rest_framework import serializers
# Tower
from awx.conf import register, register_validate
from awx.s... | |
import glcommon
import glinit
import visualization
from ..math import vectorops,so3,se3
from ..robotsim import WidgetSet,RobotPoser,ObjectPoser,TransformPoser,PointPoser,WorldModel,RobotModelLink,RigidObjectModel,IKObjective
from ..model.subrobot import SubRobotModel
from ..model import collide
from OpenGL.GL import *
... | |
"""
Django settings for bughouse-rankings project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DI... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A utility script for automating the beets release process.
"""
import click
import os
import re
import subprocess
from contextlib import contextmanager
import datetime
BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
CHANGELOG = os.path.join(BASE, 'd... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | |
"""Support for an exposed aREST RESTful API of a device."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_MONITORED_VARIABLES,
CONF_NAME,
CONF_RESOURCE,
CONF_UNIT... | |
try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
import processout
import json
from processout.networking.request import Request
from processout.networking.response import Response
# The content of this file was automatically generated
class Transaction(object):
... | |
# coding=utf-8
# Copyright 2022 The Balloon Learning Environment Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
"""
vtk window short cuts:
- j: joystick (continuous) mode
- t: trackball mode
- c: camera move mode
- a: actor move mode
- left mouse: rotate x,y
- ctrl_left mouse: rotate z
- middle mouse: pan
- right mouse: zoom
- r: reset camera
- s/w: surface/wireframe
- u: command windo... | |
#!/usr/bin/env python
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
""" Module: writer
Provide an API for storing data in a graph database, including create,
update, and delete actions on nodes and edges.
Provides:
def create_node
def update_node
def delete_node
def create_edge
def update_edge
def delete_edge
"""
from time import time
from model.constants im... | |
'''
Created on 21.01.2016
@author: fabian
'''
import unittest
import logging
import os
import datetime
from pymongo import MongoClient
import uuid
from pyvcsshark.config import Config
from pyvcsshark.datastores.mongostore import MongoStore
from pyvcsshark.dbmodels.models import CommitModel, BranchModel, TagModel,\
... | |
# -*- coding: utf-8 -*-
"""
flask.ext.security.datastore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains an user datastore classes.
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from .utils import get_identity_attributes, string_types
class Datastore(ob... | |
import datetime
import decimal
import itertools
import sys
import time
from wtforms import widgets
from wtforms.validators import StopValidation, u, unicode, next
__all__ = (
'BooleanField', 'DecimalField', 'DateField', 'DateTimeField', 'FieldList',
'FileField', 'FloatField', 'FormField', 'HiddenField', 'Int... | |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.