code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Layer(object): <NEW_LINE> <INDENT> def __init__(self, parms = [None, None, None]): <NEW_LINE> <INDENT> super(Layer, self).__init__() <NEW_LINE> self.W, self.b, self.activation = parms <NEW_LINE> <DEDENT> def _set(self, parms): <NEW_LINE> <INDENT> self.W, self.b, self.activation = parms <NEW_LINE> <DEDENT> def _fi...
Layer class which will hold W, b, and activation function. Only users planning on extending functionality should modify or interact with this class.
6259905d16aa5153ce401b22
class Strength(object): <NEW_LINE> <INDENT> def __init__(self, valid, strength, message): <NEW_LINE> <INDENT> self.valid = valid <NEW_LINE> self.strength = strength <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.strength <NEW_LINE> <DEDENT> def __str__(self): <...
Measure the strength of a password. Here are some common usages of strength:: >>> strength = Strength(True, 'strong', 'password is perfect') >>> bool(strength) True >>> repr(strength) 'strong' >>> str(strength) 'password is perfect' :param valid: if the password is valid to use :param str...
6259905d3617ad0b5ee0778b
class Map: <NEW_LINE> <INDENT> pass
Provides waypoints and other map data. Class Tests: >>> instance = Map()
6259905dcc0a2c111447c5ee
class TestMaxAverageII(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.test_object = [{ 'test_nums': [1,12,-5,-6,50,3], 'test_k': 4, 'test_output': 12.75 }, { 'test_nums': [1, 2, 3, 4], 'test_k': 1, 'test_output': 4 }, { 'test_nums': [5], 'test_k': 1, 'test_output': 5 }] <NEW_LINE> <DEDENT> def...
Regtest
6259905d442bda511e95d879
class SearchFolderError(Exception): <NEW_LINE> <INDENT> pass
Raised when search an extra item method fails
6259905d10dbd63aa1c7219a
class OtterKeymaster(object): <NEW_LINE> <INDENT> def __init__(self, host="localhost", port=9160, setup_generator=None): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.setup_generator = ( setup_generator or CQLGenerator(schema_dir + '/setup')) <NEW_LINE> self._keys = {} <NEW_LINE> self...
Object that keeps track of created keyspaces, PauseableSilverbergClients, and is a factory for PausableSilverbergClients
6259905d7cff6e4e811b7084
class ShortestSeekFirstQueue(Queue): <NEW_LINE> <INDENT> def __init__(self, sort_by='id', queue=None, sort_first_obj=True): <NEW_LINE> <INDENT> self.sort_by = sort_by <NEW_LINE> self._queue = [] <NEW_LINE> self.sort_first_obj = sort_first_obj <NEW_LINE> if queue is not None: <NEW_LINE> <INDENT> self._queue = queue <NEW...
Base interface for ssf queue based on python list
6259905d21a7993f00c675ac
class Point: <NEW_LINE> <INDENT> def __init__(self, x: int, y: int): <NEW_LINE> <INDENT> if not isinstance(x, int) or not isinstance(y, int): <NEW_LINE> <INDENT> raise TypeError <NEW_LINE> <DEDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str.format('({}, {})', ...
Реализует класс 'точка'.
6259905d435de62698e9d444
class PreExecuteNotebooksCommand(Command): <NEW_LINE> <INDENT> description = "Pre-executes Jupyther notebooks included in the documentation" <NEW_LINE> user_options = [ ('notebooks=', 'n', "patterns to match (i.e. 'protocols/SAPDiag*')"), ] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> self.notebooks = N...
Custom command for pre-executing Jupyther notebooks included in the documentation.
6259905dd99f1b3c44d06ce1
class MyTopo( Topo ): <NEW_LINE> <INDENT> def __init__( self ): <NEW_LINE> <INDENT> Topo.__init__( self ) <NEW_LINE> Host1 = self.addHost('h1') <NEW_LINE> Host2 = self.addHost('h2') <NEW_LINE> s1 = self.addSwitch('s1') <NEW_LINE> s2 = self.addSwitch('s2') <NEW_LINE> s3 = self.addSwitch('s3') <NEW_LINE> s4 = self.addSwi...
Simple topology example.
6259905d097d151d1a2c26ad
class PlotWin(tk.Toplevel): <NEW_LINE> <INDENT> def __init__(self, masterWin, obj, methodNum, year=0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._enrollmentObj = obj <NEW_LINE> self._year = year <NEW_LINE> self._fig = plt.figure(figsize=(8,4)) <NEW_LINE> if methodNum == 1: <NEW_LINE> <INDENT> xData = self....
creates a plot window depending on the Enrollment Method chosen
6259905d498bea3a75a5911d
class Fedora20GenericJenkinsSlave( FedoraGenericJenkinsSlave, GenericFedora20Box ): <NEW_LINE> <INDENT> pass
A generic Jenkins slave for Fedora 20
6259905d379a373c97d9a664
class BaseTokenLimiter: <NEW_LINE> <INDENT> def __init__(self, resource_name, default_limit): <NEW_LINE> <INDENT> self.resource_name = resource_name <NEW_LINE> self.default_limit = default_limit <NEW_LINE> self._manager = None
Base class for both fungible and non-fungible token limiters. Args: resource_name (str): Name of the resource being rate-limited. default_limit (str): Number of tokens to use if no explicit limit is defined in the limits table.
6259905da8ecb03325872857
class Support(Unit): <NEW_LINE> <INDENT> def __init__(self, **characteristics): <NEW_LINE> <INDENT> self.heal = characteristics['heal'] <NEW_LINE> self.increase_attack = characteristics['increase_attack'] <NEW_LINE> self.increase_defence = characteristics['increase_defence'] <NEW_LINE> super().__init__(**characteristic...
docstring for Support
6259905da79ad1619776b5dd
class Fuel(object): <NEW_LINE> <INDENT> CO2emissions = {"gas": .058, "coal": .108, "oil": .081, "other": 0, "none": 0} <NEW_LINE> def __init__(self, type = "none", price = 0, startDate = 0, timeStep = "M", GHGcost = 0, units = "$/MMBtu"): <NEW_LINE> <INDENT> if type in generator.Generator.fuels: <NEW_LINE> <INDENT> sel...
The time series data for a fuel type
6259905d0fa83653e46f6527
class ScipyOptimizerInterface(ExternalOptimizerInterface): <NEW_LINE> <INDENT> _DEFAULT_METHOD = 'L-BFGS-B' <NEW_LINE> def _minimize(self, initial_val, loss_grad_func, equality_funcs, equality_grad_funcs, inequality_funcs, inequality_grad_funcs, step_callback, optimizer_kwargs): <NEW_LINE> <INDENT> def loss_grad_func_w...
Wrapper allowing `scipy.optimize.minimize` to operate a `tf.Session`. Example: ```python vector = tf.Variable([7., 7.], 'vector') # Make vector norm as small as possible. loss = tf.reduce_sum(tf.square(vector)) optimizer = ScipyOptimizerInterface(loss, options={'maxiter': 100}) with tf.Session() as session: opti...
6259905dfff4ab517ebcee65
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'header_image11.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.got_filename = test_dir + '_test_' + filename <NEW_LINE> self.image_dir = test_dir...
Test file created by XlsxWriter against a file created by Excel.
6259905d435de62698e9d445
class DeviceCmp(DeviceEq): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(DeviceCmp, self).__init__(**kwargs) <NEW_LINE> input_signals_len = max(len(self.first_signals), len(self.second_signals)) <NEW_LINE> functions_eq = self.functions <NEW_LINE> functions_eq_parts = [reduce(And, functions...
Digital comparator device
6259905d07f4c71912bb0a7c
class Monster(Card): <NEW_LINE> <INDENT> def __init__(self, name, desc, level, attack, defense): <NEW_LINE> <INDENT> super().__init__(name, desc) <NEW_LINE> self.level = level <NEW_LINE> self.attack = attack <NEW_LINE> self.defense = defense <NEW_LINE> self.position = None <NEW_LINE> self.turn_count = 0 <NEW_LINE> self...
This is a class to represent a monster card. Attributes: name (str): The name of the card. desc (str): The description of the card. is_set (bool): Whether the card is Face-down or not. level (int): The level of the monster. attack (int): The attack of the monster. defense (int): The defense of ...
6259905d24f1403a926863ee
@register_action <NEW_LINE> class DistinctAction(QuerysetAction): <NEW_LINE> <INDENT> name = 'distinct' <NEW_LINE> properties = { "fields": Schema.array(Schema.str) } <NEW_LINE> def handle(self, queryset: QuerySet, fragment: dict): <NEW_LINE> <INDENT> if 'fields' not in fragment: <NEW_LINE> <INDENT> fragment['fields'] ...
Action version of a QuerySet.distinct(...) Example: { "action": "distinct" }
6259905d56b00c62f0fb3f0c
class CrossValSplitter(): <NEW_LINE> <INDENT> def __init__(self, *, numel: int, k_folds: int, shuffled: bool = False): <NEW_LINE> <INDENT> inidicies = np.array([i for i in range(numel)]) <NEW_LINE> if shuffled: <NEW_LINE> <INDENT> np.random.shuffle(inidicies) <NEW_LINE> <DEDENT> self.folds = np.array(np.array_split(ini...
Class that creates cross validation splits. The train and val splits can be used in pytorch DataLoaders. The splits can be updated by calling next(self) or using a loop: for _ in self: .... Parameters --------- numel : int Number of elements in the training set k_folds : in...
6259905d10dbd63aa1c7219b
class Subsystem(ClientObject): <NEW_LINE> <INDENT> def modifyParams(self, command, params, options={}): <NEW_LINE> <INDENT> result = self.obj.modifyParams(command, params, options) <NEW_LINE> if result.status != 0: <NEW_LINE> <INDENT> raise ClientError(result.status, result.text) <NEW_LINE> <DEDENT> return
com.redhat.grid.config:Subsystem
6259905d56ac1b37e6303807
class RawFilter(CachedRawPipe): <NEW_LINE> <INDENT> def __init__(self, source, l_freq=None, h_freq=None, cache=True, **kwargs): <NEW_LINE> <INDENT> CachedRawPipe.__init__(self, source, cache) <NEW_LINE> self.args = (l_freq, h_freq) <NEW_LINE> self.kwargs = kwargs <NEW_LINE> if 'use_kwargs' in kwargs: <NEW_LINE> <INDENT...
Filter raw pipe Parameters ---------- source : str Name of the raw pipe to use for input data. l_freq : scalar | None Low cut-off frequency in Hz. h_freq : scalar | None High cut-off frequency in Hz. cache : bool Cache the resulting raw files (default ``True``). ... :meth:`mne.io.Raw.filter` parame...
6259905d21a7993f00c675ae
class AliasType(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'paths': {'key': 'paths', 'type': '[AliasPathType]'}, } <NEW_LINE> def __init__( self, *, name: Optional[str] = None, paths: Optional[List["AliasPathType"]] = None, **kwargs ): <NEW_LINE> <INDENT>...
The alias type. :ivar name: The alias name. :vartype name: str :ivar paths: The paths for an alias. :vartype paths: list[~azure.mgmt.resource.resources.v2016_09_01.models.AliasPathType]
6259905d8e7ae83300eea6cf
class SafeHttpProtocol(eventlet.wsgi.HttpProtocol): <NEW_LINE> <INDENT> def finish(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> eventlet.green.BaseHTTPServer.BaseHTTPRequestHandler.finish(self) <NEW_LINE> <DEDENT> except IOError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> eventlet.greenio.shutdown_safe(self.co...
HttpProtocol wrapper to suppress IOErrors. The proxy code above always shuts down client connections, so we catch the IOError that raises when the SocketServer tries to flush the connection.
6259905da219f33f346c7e47
class HolderTable(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=2): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self.bounds = list(zip([-10.0] * self.dimensions, [10.0] * self.dimensions)) <NEW_LINE> self.global_optimum = [(8.055023472141116 , 9.664590028909654), (-8.055023472141...
HolderTable test objective function. This class defines the HolderTable global optimization problem. This is a multimodal minimization problem defined as follows: .. math:: f_{\text{HolderTable}}(\mathbf{x}) = - \left|{e^{\left|{1 - \frac{\sqrt{x_{1}^{2} + x_{2}^{2}}}{\pi} }\right|} \sin\left(x_{1}\right) \cos\...
6259905dd53ae8145f919aa3
@store.command(name="animate/stop") <NEW_LINE> class StopAnimateCommand(store.Command): <NEW_LINE> <INDENT> animations = store.injected("animations") <NEW_LINE> animation_id = dictobj.Field(sb.string_spec, wrapper=sb.required) <NEW_LINE> async def execute(self): <NEW_LINE> <INDENT> self.animations.stop(self.animation_i...
Stop a tile animation
6259905d009cb60464d02b78
class LeCunNormal(WeightInitializer): <NEW_LINE> <INDENT> def weights(self, shape): <NEW_LINE> <INDENT> fan_in, fan_out = self.compute_fans(shape) <NEW_LINE> scale = np.sqrt(1. / fan_in) <NEW_LINE> return np.random.normal(low = -scale, high = scale, size = shape) <NEW_LINE> <DEDENT> @property <NEW_LINE> def init_name(s...
**LeCun Normal (LeCunNormal)** Weights should be randomly chosen but in such a way that the sigmoid is primarily activated in its linear region. LeCun uniform is the implementation based on Gaussian distribution References: [1] Efficient Backprop [LeCun, 1998][PDF] http://yann.lecun.com/exdb/publis/pdf/le...
6259905d1f037a2d8b9e538c
class IMacroTaskStartDate(IStartDate): <NEW_LINE> <INDENT> pass
Adapts a TaskContainer into the start date used to compute the macro task due date.
6259905d0fa83653e46f6529
class SimpleLatticeTestHarness(TestHarness): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SimpleLatticeTestHarness, self).__init__() <NEW_LINE> self.input_set = SimpleLatticeInput(num_dimensions=3) <NEW_LINE> self.num_polar = 4 <NEW_LINE> self.azim_spacing = 0.12 <NEW_LINE> self.z_spacing = 0.14 <N...
An eigenvalue calculation in a 3D lattice with 7-group C5G7 data.
6259905d379a373c97d9a666
class CheckACLTerms(unittest.TestCase): <NEW_LINE> <INDENT> def testEmptyAnonymousTerms(self): <NEW_LINE> <INDENT> a = acl.ACL() <NEW_LINE> for i in range(5): <NEW_LINE> <INDENT> a.terms.append(acl.Term()) <NEW_LINE> self.assertEqual(a.terms[i].name, None) <NEW_LINE> <DEDENT> self.assertEqual(len(a.terms), 5) <NEW_LINE...
Test insertion of Term objects into an ACL object
6259905d435de62698e9d447
class RegexTokenizer(DDFSketch): <NEW_LINE> <INDENT> def __init__(self, pattern=r'\s+', min_token_length=2, to_lowercase=True): <NEW_LINE> <INDENT> super(RegexTokenizer, self).__init__() <NEW_LINE> self.settings = dict() <NEW_LINE> self.settings['min_token_length'] = min_token_length <NEW_LINE> self.settings['to_lowerc...
A regex based tokenizer that extracts tokens either by using the provided regex pattern (in Java dialect) to split the text. :Example: >>> ddf2 = RegexTokenizer(input_col='col_0', pattern=r"(?u)\w\w+") ... .transform(ddf_input)
6259905d29b78933be26abe5
class EdgeResizingHandle(ResizingHandle): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super(EdgeResizingHandle, self).__init__(parent) <NEW_LINE> self.setPen(self.parentResizable.getEdgeResizingHandleHiddenPen()) <NEW_LINE> <DEDENT> def hoverEnterEvent(self, event): <NEW_LINE> <INDENT> super(Edg...
Resizing handle positioned on one of the 4 edges
6259905d0c0af96317c57880
class TestInvoiceTable(TableTest): <NEW_LINE> <INDENT> table = model.billing.tables.invoice <NEW_LINE> samples = [dict(person_id=1, issue_date=datetime.datetime(2006, 11, 21), ), dict(person_id=2, issue_date=datetime.datetime(2006, 11, 22), ), ] <NEW_LINE> not_nullables = ['person_id']
Test the ``invoice`` table.
6259905d32920d7e50bc7689
class TrackLoader(object): <NEW_LINE> <INDENT> write_batch_size = 1000 <NEW_LINE> def __init__(self, session, tags, id_cache): <NEW_LINE> <INDENT> self._session = session <NEW_LINE> self._tags = tags <NEW_LINE> self._id_cache = id_cache <NEW_LINE> <DEDENT> def insert(self, cls, id_gen): <NEW_LINE> <INDENT> for batch in...
Create and insert entries for each tag and associated IDs. :cvar int write_batch_size: How many tracks to insert into a session at a time (between calls to flush the session).
6259905d7b25080760ed8801
class MelTopicData(MelGroups): <NEW_LINE> <INDENT> def __init__(self, attr): <NEW_LINE> <INDENT> MelGroups.__init__(self, attr, MelUnion({ 0: MelStruct(b'PDTO', [u'2I'], u'data_type', (FID, u'topic_ref')), 1: MelStruct(b'PDTO', [u'I', u'4s'], u'data_type', u'topic_subtype'), }, decider=PartialLoadDecider( loader=MelUIn...
Occurs twice in PACK, so moved here to deduplicate the definition a bit. Can't be placed inside MrePack, since one of its own subclasses depends on this.
6259905df548e778e596cbcc
class VosiCapabilityRenderer(BaseRenderer): <NEW_LINE> <INDENT> charset = 'utf-8' <NEW_LINE> ns_vosicap = 'http://www.ivoa.net/xml/VOSICapabilities/v1.0' <NEW_LINE> ns_vs = 'http://www.ivoa.net/xml/VODataService/v1.1' <NEW_LINE> ns_xsi = "http://www.w3.org/2001/XMLSchema-instance" <NEW_LINE> ns_vr = "http://www.ivoa.ne...
Takes capability data (from a queryset) and returns an xmlstream for VOSI capabilities/ endpoint
6259905da17c0f6771d5d6c4
class CategorySerializer2(serializers.ModelSerializer): <NEW_LINE> <INDENT> sub_cat = CategorySerializer3(many=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = GoodsCategory <NEW_LINE> fields = "__all__"
商品类别序列化
6259905d7047854f46340a03
class AnnotationTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(AnnotationTestCase, self).setUp() <NEW_LINE> self.client = APIClient() <NEW_LINE> self.index_create_url = reverse("annotations-list") <NEW_LINE> self.annotation = { "annotator_schema_version": "v1.0", "text": "A note I wr...
Base class with a few utility methods. The `documentation <http://docs.annotatorjs.org/en/v1.2.x/storage.html>`_ at forms the basis for many of the tests.
6259905d76e4537e8c3f0bd0
class PolyErrorMessage(PolyMessage): <NEW_LINE> <INDENT> def __init__(self, message_code, file_name, line, start_pos, end_pos, text): <NEW_LINE> <INDENT> self.message_code = message_code <NEW_LINE> self.location = PolyLocation(file_name, line, start_pos, end_pos) <NEW_LINE> self.text = text
A message detailing an error (or warning) from Poly/ML
6259905d10dbd63aa1c7219c
class LogParametersCountHook(tf.train.SessionRunHook): <NEW_LINE> <INDENT> def begin(self): <NEW_LINE> <INDENT> tf.logging.info("Number of trainable parameters: %d", misc.count_parameters())
Simple hook that logs the number of trainable parameters.
6259905d30dc7b76659a0da2
class Student(User): <NEW_LINE> <INDENT> student_registration = models.IntegerField()
Student's docstring.
6259905d8e7ae83300eea6d1
class TestProjectRoleView(ProjectMixin, RoleAssignmentMixin, TestViewsBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.project = self._make_project( 'TestProject', PROJECT_TYPE_PROJECT, None ) <NEW_LINE> self.owner_as = self._make_assignment( self.project, self.user, self....
Tests for project roles view
6259905dd268445f2663a67e
class Client(object): <NEW_LINE> <INDENT> def __init__(self, api_base_url, auth): <NEW_LINE> <INDENT> self._api_base_url = api_base_url <NEW_LINE> self._auth = auth <NEW_LINE> <DEDENT> def trigger_dag(self, dag_id, run_id=None, conf=None, execution_date=None): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> ...
Base API client for all API clients.
6259905d4a966d76dd5f0536
class MonitorBiAccessAnalysis(BaseModel): <NEW_LINE> <INDENT> access_source = models.IntegerField(default=0) <NEW_LINE> table_content = models.CharField(max_length=5000, default='') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'monitor_bi_access_analysis'
通过网页/API访问BI的日志统计数据, 从数据库 bi 分析 bi_permission_logs(web)/ bi_permission_api_log(api) 数据表获得的统计信息
6259905d097d151d1a2c26b2
class MockElasticCluster(object): <NEW_LINE> <INDENT> def stats(self, node_id=None): <NEW_LINE> <INDENT> raise TransportError("custom error", 123)
Mock of Elasticsearch ClusterClient
6259905d435de62698e9d449
class _TileTranslateTask: <NEW_LINE> <INDENT> def __init__(self, src, targ, dx, dy): <NEW_LINE> <INDENT> self._src = src <NEW_LINE> self._targ = targ <NEW_LINE> self._dx = int(dx) <NEW_LINE> self._dy = int(dy) <NEW_LINE> self._slices_x = tiledsurface.calc_translation_slices(self._dx) <NEW_LINE> self._slices_y = tiledsu...
Translate/move tiles (compressed strokemap -> uncompressed tmp) Calling this task is destructive to the source strokemap, so it must be paired with a _TileRecompressTask queued up to fire when it has completely finished. Tiles are translated by slicing and recombining, so this task must be called to completion before...
6259905d3eb6a72ae038bca3
class Gas(BinarySensor): <NEW_LINE> <INDENT> def __init__(self, block, position): <NEW_LINE> <INDENT> super(Gas, self).__init__( block, position, 'gas', 'gas_sensor/alarm_state')
Class to represent a Gas sensor
6259905d379a373c97d9a669
class AzureFirewallFqdnTagsOperations(object): <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <NEW...
AzureFirewallFqdnTagsOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.network.v2021_05_01.models...
6259905d7b25080760ed8802
class Venue(Media): <NEW_LINE> <INDENT> def __init__(self, location, title, address, foursquare_id=None): <NEW_LINE> <INDENT> super(Venue, self).__init__() <NEW_LINE> from pytgbot.api_types.receivable.media import Location <NEW_LINE> assert(location is not None) <NEW_LINE> assert(isinstance(location, Location)) <NEW_LI...
This object represents a venue. https://core.telegram.org/bots/api#venue
6259905d99cbb53fe6832525
class Controller: <NEW_LINE> <INDENT> def __init__(self, engine): <NEW_LINE> <INDENT> self.engine = engine <NEW_LINE> self.max_video_number = 20 <NEW_LINE> self.running_vid = 0 <NEW_LINE> <DEDENT> def play(self, file, speed, vid_number): <NEW_LINE> <INDENT> self.engine.play(file, speed) <NEW_LINE> self.running_vid = vi...
freemix controller class. Acts like a man in the middle between interfaces and the gstreamer engine.
6259905d6e29344779b01c93
class ImageList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> permission_classes = (IsAdminOrReadOnly,) <NEW_LINE> queryset = Image.objects.all().order_by('id') <NEW_LINE> serializer_class = ImageSerializer
List all images, or create a new image.
6259905d3617ad0b5ee07791
class RDFFindSpec(rdfvalue.FindSpec): <NEW_LINE> <INDENT> pass
Clients prior to 2.9.1.0 used this name for this protobuf. We need to understand it on the server as well if a response from an old client comes in so we define an alias here.
6259905d442bda511e95d87c
class FunctionTypedSingle(FunctionSingle, FunctionTyped): <NEW_LINE> <INDENT> pass
A Postgresql function that returns a single row having a single (typically composite) column
6259905d45492302aabfdb1e
@typing.final <NEW_LINE> class Vendor(int, Enum): <NEW_LINE> <INDENT> ZAVALA = 69482069 <NEW_LINE> XUR = 2190858386 <NEW_LINE> BANSHE = 672118013 <NEW_LINE> SPIDER = 863940356 <NEW_LINE> SHAXX = 3603221665 <NEW_LINE> KADI = 529635856 <NEW_LINE> YUNA = 1796504621 <NEW_LINE> EVERVERSE = 3361454721 <NEW_LINE> AMANDA = 460...
An Enum for all available vendors in Destiny 2.
6259905d7d847024c075da17
class Environment: <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._state_cache = {} <NEW_LINE> self._observation_cache = {} <NEW_LINE> self._action_cache = {} <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def get_state(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_L...
A reinforcement learning environment.
6259905d627d3e7fe0e084d0
class UriSchemes: <NEW_LINE> <INDENT> FTP = "ftp" <NEW_LINE> HTTP = "http" <NEW_LINE> HTTPS = "https" <NEW_LINE> IMAP = "imap" <NEW_LINE> MAILTO = "mailto" <NEW_LINE> SFTP = "sftp" <NEW_LINE> SMS = "sms" <NEW_LINE> SSH = "ssh" <NEW_LINE> TEL = "tel" <NEW_LINE> TELNET = "telnet"
Common URI schemes. See https://en.wikipedia.org/wiki/List_of_URI_schemes.
6259905de64d504609df9ef1
class ProviderOf(object): <NEW_LINE> <INDENT> def __init__(self, interface): <NEW_LINE> <INDENT> self.interface = interface
Can be used to get a :class:`BoundProvider` of an interface, for example: >>> def provide_int(): ... print('providing') ... return 123 >>> >>> def configure(binder): ... binder.bind(int, to=provide_int) >>> >>> injector = Injector(configure) >>> provider = injector.get(ProviderOf(int)) >>> type(provider) <...
6259905d16aa5153ce401b29
class ODSTableSet(object): <NEW_LINE> <INDENT> def __init__(self, fileobj, window=None, **kw): <NEW_LINE> <INDENT> if hasattr(fileobj, "read"): <NEW_LINE> <INDENT> fileobj = io.BytesIO(fileobj.read()) <NEW_LINE> <DEDENT> self.window = window <NEW_LINE> zf = zipfile.ZipFile(fileobj).open("content.xml") <NEW_LINE> self.c...
A wrapper around ODS files. Because they are zipped and the info we want is in the zipped file as content.xml we must ensure that we either have a seekable object (local file) or that we retrieve all of the content from the remote URL.
6259905d38b623060ffaa372
class ResourceResolverOperations(NamedTuple): <NEW_LINE> <INDENT> parent_urn: Optional[str] <NEW_LINE> serialized_props: Dict[str, Any] <NEW_LINE> dependencies: Set[str] <NEW_LINE> provider_ref: Optional[str]
The set of properties resulting from a successful call to prepare_resource.
6259905d097d151d1a2c26b4
class StrList(Type, click.ParamType): <NEW_LINE> <INDENT> name = "comma_sep_str_list" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.allowed_values = None <NEW_LINE> <DEDENT> def __or__(self, other) -> t.Union[Either, 'StrList']: <NEW_LINE> <INDENT> if isinstance(other, Exact) and...
A comma separated string list which contains elements from a fixed set of allowed values.
6259905da79ad1619776b5e0
class ShortcutManagerPlugin: <NEW_LINE> <INDENT> def __init__(self, iface): <NEW_LINE> <INDENT> self.iface = iface <NEW_LINE> self.plugin_dir = os.path.dirname(__file__).decode(sys.getfilesystemencoding()) <NEW_LINE> locale = QSettings().value('locale/userLocale')[0:2] <NEW_LINE> locale_path = os.path.join( self.plugin...
QGIS Plugin Implementation.
6259905dd6c5a102081e3768
class FileField: <NEW_LINE> <INDENT> def __init__( self, name: str, value: typing.Union[typing.IO[typing.AnyStr], tuple] ) -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> if not isinstance(value, tuple): <NEW_LINE> <INDENT> self.filename = Path(str(getattr(value, "name", "upload"))).name <NEW_LINE> self.file =...
A single file field item, within a multipart form field.
6259905d379a373c97d9a66a
class Lstm(nn.Module): <NEW_LINE> <INDENT> def __init__(self, weights): <NEW_LINE> <INDENT> super(Lstm, self).__init__() <NEW_LINE> self.n_code: int = 16 <NEW_LINE> self.lstm_size: int = 128 <NEW_LINE> self.batch_size: int = 64 <NEW_LINE> self.n_epochs: int = 10 <NEW_LINE> if isinstance(weights, BertModel): <NEW_LINE> ...
An LSTM implementation with sklearn-like methods.
6259905dac7a0e7691f73b28
class PlanItem(EntityItem): <NEW_LINE> <INDENT> def __init__(self, patients, workspace_id, patient_id, entity): <NEW_LINE> <INDENT> super(PlanItem, self).__init__(patients, workspace_id, patient_id, entity) <NEW_LINE> <DEDENT> def _wait_delivery_information(self): <NEW_LINE> <INDENT> start = datetime.datetime.now() <NE...
This class represents a plan. It's instantiated by the :class:`proknow.Patients.EntitySummary` class as a complete representation of a plan entity. Attributes: id (str): The id of the entity (readonly). data (dict): The complete representation of the entity as returned from the API (readonly).
6259905d3d592f4c4edbc523
class FileLinkShareForm(forms.Form): <NEW_LINE> <INDENT> email = forms.CharField(max_length=512, error_messages={ 'required': _("Email is required"), 'max_length': _("Email is not longer than 512 characters"), }) <NEW_LINE> file_shared_link = forms.CharField()
Form for sharing file shared link to emails.
6259905d56b00c62f0fb3f12
class Node: <NEW_LINE> <INDENT> def __init__(self, state, parent=None, action=None, path_cost=0): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def exapand(self, problem): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def child_node(self, problem, action): <NEW_LINE> <INDENT> rai...
A node in a search tree. Contains a pointer to the parent (the node that this is a successor of) and to the actual state for this node. Note that if a state is arrived at by two paths, then there are two nodes with the same state. Also includes the action that got us to this state, and the total path_cost (also known ...
6259905d004d5f362081fb12
class OlderUpgrade(Exception): <NEW_LINE> <INDENT> def __init__(self, version, latest): <NEW_LINE> <INDENT> self.msg = "Upgrade version is older than latest version" <NEW_LINE> self.msg += "\n<upgrade version: '{}'>".format(version) <NEW_LINE> self.msg += "\n<latest version: '{}'>".format(latest) <NEW_LINE> super(self...
Raised if a dataset already exists with submitted version.
6259905d7d847024c075da19
class AvatarServiceTests(SpyAgency, TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(AvatarServiceTests, self).setUp() <NEW_LINE> self.user = User(username='username', email='username@example.com', first_name='User', last_name='Name') <NEW_LINE> <DEDENT> def test_default_urls(self): <NEW_LINE> ...
Tests for djblets.avatars.services.base.
6259905d4f88993c371f1042
class FileHandler(Handler): <NEW_LINE> <INDENT> def __init__(self, filename, mode="a"): <NEW_LINE> <INDENT> Handler.__init__(self) <NEW_LINE> self.stream = open(filename, mode) <NEW_LINE> self.baseFilename = filename <NEW_LINE> self.mode = mode <NEW_LINE> <DEDENT> def reopen(self): <NEW_LINE> <INDENT> self.close() <NEW...
File handler which supports reopening of logs.
6259905d0a50d4780f7068e2
class ProfileCompletionMiddleware: <NEW_LINE> <INDENT> def __init__(self, get_response): <NEW_LINE> <INDENT> self.get_response = get_response <NEW_LINE> <DEDENT> def __call__(self, request): <NEW_LINE> <INDENT> if not request.user.is_anonymous: <NEW_LINE> <INDENT> if not request.user.is_staff: <NEW_LINE> <INDENT> profi...
Profile completion middleware Ensure that every user that is interacting with the platform has their profile picture and biography
6259905d01c39578d7f1425a
class TestCrawler(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.site = MockServer() <NEW_LINE> self.site.start() <NEW_LINE> self.settings = get_settings() <NEW_LINE> self.settings['EXTENSIONS']['scrapy.contrib.corestats.CoreStats'] = 0 <NEW_LINE> self.engine_status = [] <NEW_LINE> <D...
Spider shouldn't make start requests if list of start_requests wasn't passed to 'crawl' method.
6259905dd486a94d0ba2d60f
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.CharField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = UserManager(...
custom user model that supports using email address instead of username
6259905dd268445f2663a680
class IscsiSessionEndpoints(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'local_endpoint': 'ScsiProtocolEndpoint', 'remote_endpoint': 'ScsiProtocolEndpoint' } <NEW_LINE> self.attribute_map = { 'local_endpoint': 'localEndpoint', 'remote_endpoint': 'remoteEndpoint' } <NEW_LI...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259905d097d151d1a2c26b5
class Curve(IdentifiedObject): <NEW_LINE> <INDENT> y2_unit = UnitSymbol <NEW_LINE> x_unit = UnitSymbol <NEW_LINE> curve_style = CurveStyle <NEW_LINE> y1_unit = UnitSymbol <NEW_LINE> pass
Relationship between an independent variable (X-axis) and one or two dependent variables (Y1-axis and Y2-axis). Curves can also serve as schedules.
6259905df548e778e596cbd1
class TFMT5Model(TFT5Model): <NEW_LINE> <INDENT> model_type = "mt5" <NEW_LINE> config_class = MT5Config
This class overrides :class:`~transformers.TFT5Model`. Please check the superclass for the appropriate documentation alongside usage examples. Examples:: >>> from transformers import TFMT5Model, T5Tokenizer >>> model = TFMT5Model.from_pretrained("google/mt5-small") >>> tokenizer = T5Tokenizer.from_pretrain...
6259905d7d847024c075da1a
class VBox(Gtk.VBox): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> Gtk.VBox.__init__(self) <NEW_LINE> self.set_spacing(6) <NEW_LINE> self.set_border_width(0) <NEW_LINE> for widget in args: <NEW_LINE> <INDENT> self.pack_start(widget)
A vertical container
6259905d097d151d1a2c26b6
class FlatBottomReceptorLigandRestraint(ReceptorLigandRestraint): <NEW_LINE> <INDENT> energy_function = 'lambda_restraints * step(r-r0) * (K/2)*(r-r0)^2' <NEW_LINE> bond_parameter_names = ['K', 'r0'] <NEW_LINE> def _determineBondParameters(self): <NEW_LINE> <INDENT> x_unit = self.coordinates.unit <NEW_LINE> x = self.co...
An alternative choice to receptor-ligand restraints that uses a flat potential inside most of the protein volume with harmonic restraining walls outside of this. EXAMPLE >>> # Create a test system. >>> from repex import testsystems >>> system_container = testsystems.LysozymeImplicit() >>> (system, positions) = sy...
6259905d8da39b475be0482e
class Solution: <NEW_LINE> <INDENT> def copyRandomList(self, head: 'Node') -> 'Node': <NEW_LINE> <INDENT> def copyList(head: Node) ->Node: <NEW_LINE> <INDENT> if head is None: <NEW_LINE> <INDENT> return head <NEW_LINE> <DEDENT> if head in visited: <NEW_LINE> <INDENT> return visited[head] <NEW_LINE> <DEDENT> node = Node...
使用DFS,并记录遍历过的节点,否则的话递归栈会溢出(因为可能存在环)
6259905d1f037a2d8b9e538f
class NoWarnFilter(logging.Filter): <NEW_LINE> <INDENT> def filter(self, record): <NEW_LINE> <INDENT> return not (record.levelno == logging.WARN or record.levelno == logging.ERROR)
Filter out any records that are warnings or errors. (This is useful if your warnings and errors are sent to their own handler, e.g. stderr.)
6259905dd6c5a102081e376a
class BookmarkTypeInputHandler(sublime_plugin.ListInputHandler): <NEW_LINE> <INDENT> names = { "file": "Current file", "topic": "Current topic", "view": "Current view" } <NEW_LINE> descs = { "file": "Bookmark the current help file", "topic": "Bookmark the topic currently under the cursor", "view": "Bookmark the current...
Allow the user to select what type of bookmark they want to create by displaying a list of the available bookmark types that are valid in the current context.
6259905d07f4c71912bb0a84
class TokenAuthentication(BaseAuthentication): <NEW_LINE> <INDENT> model = Token <NEW_LINE> def authenticate(self, request): <NEW_LINE> <INDENT> auth = get_authorization_header(request).split() <NEW_LINE> if not auth or auth[0].lower() != b'token': <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if len(auth) == 1: ...
Simple token based authentication. Clients should authenticate by passing the token key in the "Authorization" HTTP header, prepended with the string "Token ". For example: Authorization: Token 401f7ac837da42b97f613d789819ff93537bee6a
6259905d3539df3088ecd8e4
class DataIntegration(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data
Data Integration
6259905d1f5feb6acb164232
class PRO_001c: <NEW_LINE> <INDENT> play = Summon(CONTROLLER, RandomEntourage())
Power of the Horde
6259905d2ae34c7f260ac72f
class GameHandler(WSHandlerMixin, WebSocketHandler): <NEW_LINE> <INDENT> def _take_action(self, json, user_id): <NEW_LINE> <INDENT> action_name = json.pop("action", "") <NEW_LINE> action_class = phase.get_action(self.state.phase.current, action_name) <NEW_LINE> if not action_class: <NEW_LINE> <INDENT> return False <NEW...
Returns a game state which any player can get. Every time a player change a state, including a private state, all the player have to update the public state. Also there are some audience, and then they have to update it.
6259905d7b25080760ed8804
class Float(MapUnary): <NEW_LINE> <INDENT> def __init__(self, publisher: Publisher) -> None: <NEW_LINE> <INDENT> MapUnary.__init__(self, publisher, float)
Implementing the functionality of float() for publishers.
6259905d63b5f9789fe867bb
class DFSTree: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root: Node = None <NEW_LINE> <DEDENT> def _insertHelper(self, root, node): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> root = node <NEW_LINE> return node <NEW_LINE> <DEDENT> if node.data < root.data: <NEW_LINE> <INDENT> root.le...
Depth-First Binary Search Tree implementation class. Attributes: ----------- root : Node Root node of the tree.
6259905d6e29344779b01c97
class Stack(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.items = [] <NEW_LINE> <DEDENT> def push (self, item): <NEW_LINE> <INDENT> self.items.append(item); <NEW_LINE> <DEDENT> def pop (self): <NEW_LINE> <INDENT> return self.items.pop() <NEW_LINE> <DEDENT> def size (self): <NEW_LINE> <INDENT...
(numb or operand) -> list реализует стек
6259905d3c8af77a43b68a65
class AuthPageLocators(object): <NEW_LINE> <INDENT> USERNAME_LOCATOR = (By.ID, 'username') <NEW_LINE> PASSWORD_LOCATOR = (By.NAME, 'password') <NEW_LINE> LOGIN_BUTTON_LOCATOR = (By.NAME, 'submit') <NEW_LINE> LOGIN_FORM_LOCATOR = (By.ID, 'loginform')
Локаторы страницы аутентификации
6259905d3617ad0b5ee07795
class DateRangeScraper(Scraper): <NEW_LINE> <INDENT> def __init__(self, min_date, max_date, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> assert(isinstance(min_date, datetime.date)) <NEW_LINE> assert(isinstance(max_date, datetime.date)) <NEW_LINE> assert(not isinstance(min_date, datetime.datetime...
Omits any articles that haven't been published in a given period. Provides a first_date and last_date option which children classes can use to select data from their resource.
6259905da17c0f6771d5d6c7
class IntegerValidator(Validator): <NEW_LINE> <INDENT> def validate(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> result = int(value) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> return self.error(value) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return result
Check is value can be safelly converted to int
6259905d45492302aabfdb22
class IMyLayer(Interface): <NEW_LINE> <INDENT> pass
marker interface for a layer for testing purposes
6259905d8e7ae83300eea6d7
class DefaultRouter(routers.DefaultRouter): <NEW_LINE> <INDENT> def extend(self, router): <NEW_LINE> <INDENT> self.registry.extend(router.registry)
Extends `DefaultRouter` class to add a method for extending url routes from another router.
6259905dd268445f2663a681
class myFieldStorage(cgi.FieldStorage): <NEW_LINE> <INDENT> def make_file(self, binary=None): <NEW_LINE> <INDENT> return tempfile.NamedTemporaryFile()
Our version uses a named temporary file instead of the default non-named file; keeping it visibile (named), allows us to create a 2nd link after the upload is done, thus avoiding the overhead of making a copy to the destination filename.
6259905d4a966d76dd5f053c
class Quantizer(pipeline.Pipeline): <NEW_LINE> <INDENT> def __init__(self, steps_per_quarter=4): <NEW_LINE> <INDENT> super(Quantizer, self).__init__( input_type=music_pb2.NoteSequence, output_type=music_pb2.NoteSequence) <NEW_LINE> self._steps_per_quarter = steps_per_quarter <NEW_LINE> <DEDENT> def transform(self, note...
A Module that quantizes NoteSequence data.
6259905dd7e4931a7ef3d6a9
class BookTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.app = create_app() <NEW_LINE> self.client = self.app.test_client <NEW_LINE> self.database_path = 'postgres://john@localhost:5432/bookshelf' <NEW_LINE> setup_db(self.app, self.database_path) <NEW_LINE> self.new_book = { ...
This class represents the trivia test case
6259905d097d151d1a2c26b8
class InvalidTemplateError(Exception): <NEW_LINE> <INDENT> pass
Raised on Graphite template configuration validation errors
6259905d8da39b475be04830
class Parameters(HasObservers): <NEW_LINE> <INDENT> pass
This object is used to get and set the values of named parameters for a vehicle. See the following links for information about the supported parameters for each platform: `Copter <http://copter.ardupilot.com/wiki/configuration/arducopter-parameters/>`_, `Plane <http://plane.ardupilot.com/wiki/arduplane-parameters/>`_, ...
6259905dac7a0e7691f73b2c
class TestRelated(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testRelated(self): <NEW_LINE> <INDENT> pass
Related unit test stubs
6259905d3eb6a72ae038bca9
class Root(Solver): <NEW_LINE> <INDENT> def solve(self, vars, consts=(), *, func: Callable = None, all_out: bool = False, **kwargs): <NEW_LINE> <INDENT> if func is None: <NEW_LINE> <INDENT> func = self.func <NEW_LINE> <DEDENT> vars = np.asarray(vars, dtype=float) <NEW_LINE> if not isinstance(consts, (tuple)): <NEW_LINE...
Scipy Solver root - return only final value
6259905d7b25080760ed8805