code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class po2ini(object): <NEW_LINE> <INDENT> SourceStoreClass = po.pofile <NEW_LINE> TargetStoreClass = ini.inifile <NEW_LINE> TargetUnitClass = ini.iniunit <NEW_LINE> MissingTemplateMessage = "A template INI file must be provided." <NEW_LINE> def __init__(self, input_file, output_file, template_file=None, include_fuzzy=F...
Convert a PO file and a template INI file to a INI file.
625990560fa83653e46f6439
class Eigenvectors(Builtin): <NEW_LINE> <INDENT> messages = { 'eigenvecnotimplemented': ( "Eigenvectors is not yet implemented for the matrix `1`."), } <NEW_LINE> def apply(self, m, evaluation): <NEW_LINE> <INDENT> matrix = to_sympy_matrix(m) <NEW_LINE> if matrix is None or matrix.cols != matrix.rows or matrix.cols == ...
<dl> <dt>'Eigenvectors[$m$]' <dd>computes the eigenvectors of the matrix $m$. </dl> >> Eigenvectors[{{1, 1, 0}, {1, 0, 1}, {0, 1, 1}}] = {{1, 1, 1}, {1, -2, 1}, {-1, 0, 1}} >> Eigenvectors[{{1, 0, 0}, {0, 1, 0}, {0, 0, 0}}] = {{0, 1, 0}, {1, 0, 0}, {0, 0, 1}} >> Eigenvectors[{{2, 0, 0}, {0, -1, 0}, {0, 0, 0}}] ...
625990563eb6a72ae038bbb4
@implementer(ILogObserver) <NEW_LINE> class LegacyLogObserverWrapper(object): <NEW_LINE> <INDENT> def __init__(self, legacyObserver): <NEW_LINE> <INDENT> self.legacyObserver = legacyObserver <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return ( "{self.__class__.__name__}({self.legacyObserver})" .format(s...
L{ILogObserver} that wraps an L{twisted.python.log.ILogObserver}. Received (new-style) events are modified prior to forwarding to the legacy observer to ensure compatibility with observers that expect legacy events.
6259905623849d37ff852619
class RequestIDMiddleware(BaseHTTPMiddleware): <NEW_LINE> <INDENT> async def dispatch(self, request: Request, call_next: RequestResponseEndpoint): <NEW_LINE> <INDENT> request = Request(request.scope, request.receive) <NEW_LINE> return await call_next(request)
API Server middleware to include a unique X-Request-ID in incoming requests headers.
62599056b57a9660fecd2fd0
class AzureFirewall(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': '...
Azure Firewall resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param location: Resource location. :type location: str :param tags: A set ...
625990568e71fb1e983bd01e
class Contacts(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'contact_list': {'key': 'contacts', 'type': '[Contact]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(Contacts, self)._...
The contacts for the vault certificates. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Identifier for the contacts collection. :vartype id: str :ivar contact_list: The contact list for the vault certificates. :vartype contact_list: list[~azure.keyvault.v2016_10_01.m...
62599056baa26c4b54d507f8
class Jogador( Nave ): <NEW_LINE> <INDENT> def __init__( self, posicao, explosao, vidas=10, imagem=None ): <NEW_LINE> <INDENT> Nave.__init__( self, posicao, explosao, vidas, [ 0, 0 ], imagem ) <NEW_LINE> self.set_XP( 0 ) <NEW_LINE> <DEDENT> def update( self, dt ): <NEW_LINE> <INDENT> velocidade_mov = ( self.velocidade[...
A classe Jogador é uma classe derivada da classe GameObject.
625990563539df3088ecd7fb
class _AA1(_GaitPolicy): <NEW_LINE> <INDENT> def __init__(self, gait, param_name): <NEW_LINE> <INDENT> super(_AA1, self).__init__(gait, 1) <NEW_LINE> self.param = param_name <NEW_LINE> <DEDENT> def initial_action(self): <NEW_LINE> <INDENT> value = self.gait.params[self.param][0] <NEW_LINE> return np.atleast_2d([value])...
All legs; One parameter
62599056d7e4931a7ef3d5d3
class PicFetchFailedException(Exception): <NEW_LINE> <INDENT> pass
Thrown when a category fails to download an image
62599056baa26c4b54d507f9
class TestLPathConverter(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_LpathParser(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_LpathToSparql(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_LpathChild(self): <NEW_LINE> <INDENT...
LPath+ to SPARQL converter
625990568da39b475be04741
class MessageDataFinder(MetaPathFinder): <NEW_LINE> <INDENT> expr = re.compile(r"message_ix_models\.(?P<name>(model|project)\..*)") <NEW_LINE> @classmethod <NEW_LINE> def find_spec(cls, name, path, target=None): <NEW_LINE> <INDENT> match = cls.expr.match(name) <NEW_LINE> try: <NEW_LINE> <INDENT> new_name = f"message_da...
Load model and project code from :mod:`message_data`.
62599056fff4ab517ebced78
class PublicationsList(ListView): <NEW_LINE> <INDENT> model = Publication <NEW_LINE> template_name = 'news/publications_list.html' <NEW_LINE> context_object_name = 'publications' <NEW_LINE> ordering = ['-published_date'] <NEW_LINE> paginate_by = 5
This class is a child of ListView (declared in django class) Used when View should use a template to show a list of instances of single object (model in this context)
625990564a966d76dd5f0446
class AnnotateCycles(Transformation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def apply(self, model): <NEW_LINE> <INDENT> graph = model.graph <NEW_LINE> for node in graph.node: <NEW_LINE> <INDENT> if _is_fpgadataflow_node(node): <NEW_LINE> <INDENT> op_inst = re...
Annotate the estimate of clock cycles per sample taken by each fpgadataflow node as an attribute on the node.
625990568e7ae83300eea5e3
class element(VegaSchema): <NEW_LINE> <INDENT> _schema = {'$ref': '#/refs/element'} <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> super(element, self).__init__(*args)
element schema wrapper string
6259905699cbb53fe6832435
class Pipe: <NEW_LINE> <INDENT> def __init__(self, prumer=50): <NEW_LINE> <INDENT> self.prumer = prumer <NEW_LINE> <DEDENT> def objem(self, delka=1): <NEW_LINE> <INDENT> from math import pi <NEW_LINE> r = (self.prumer / 2) / 100 <NEW_LINE> h = delka * 10 <NEW_LINE> return int(pi * r**2 * h)
Vypocita objem vody v trubce. Zadej __init__(prumer v mm) objem(delka v metrech)
625990564e696a045264e8cd
class ProjectsConfigsOperationsService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'projects_configs_operations' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(RuntimeconfigV1beta1.ProjectsConfigsOperationsService, self).__init__(client) <NEW_LINE> self._method_configs = { 'Get': base_api.A...
Service class for the projects_configs_operations resource.
625990564e4d56256637395d
class Column(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Column, self).__init__(**kwargs) <NEW_LINE> self.name = kwargs.get('name', None) <NEW_LINE> self.type = kwargs....
A table column. A column in a table. :param name: The name of this column. :type name: str :param type: The data type of this column. :type type: str
625990567b25080760ed878a
class Register(Qobj): <NEW_LINE> <INDENT> def __init__(self,N,state=None): <NEW_LINE> <INDENT> if state==None: <NEW_LINE> <INDENT> reg=tensor([basis(2) for k in range(N)]) <NEW_LINE> <DEDENT> if isinstance(state,str): <NEW_LINE> <INDENT> state=_reg_str2array(state,N) <NEW_LINE> reg=tensor([basis(2,state[k]) for k in st...
A class for representing quantum registers. Subclass of the quantum object (Qobj) class.
6259905624f1403a9268637a
class _JSONEncoder(_json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, _date): <NEW_LINE> <INDENT> encoded_obj = _toString(obj) <NEW_LINE> <DEDENT> elif isinstance(obj, _cursors.Record): <NEW_LINE> <INDENT> encoded_obj = super(_JSONEncoder, self).default(obj.copy()) <N...
JSONEncoder that handles dates.
6259905623e79379d538da52
class KerasLayersModelExample(KerasModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> x = Input([1]) <NEW_LINE> y = np.array([[2.0]]) <NEW_LINE> b = np.array([0.0]) <NEW_LINE> mult = Dense(1, weights=(y, b)) <NEW_LINE> z = mult(x) <NEW_LINE> self.x = x <NEW_LINE> self.mult = mult <NEW_LINE> self.z = z ...
A Model that is defined using Keras layers from beginning to end.
62599056435de62698e9d35a
class MiniSeqKernel(GenericKernelMixin, StationaryKernelMixin, Kernel): <NEW_LINE> <INDENT> def __init__(self, baseline_similarity=0.5, baseline_similarity_bounds=(1e-5, 1)): <NEW_LINE> <INDENT> self.baseline_similarity = baseline_similarity <NEW_LINE> self.baseline_similarity_bounds = baseline_similarity_bounds <NEW_L...
A minimal (but valid) convolutional kernel for sequences of variable length.
6259905632920d7e50bc759e
class TableDataInsertAllRequest(_messages.Message): <NEW_LINE> <INDENT> class RowsValueListEntry(_messages.Message): <NEW_LINE> <INDENT> insertId = _messages.StringField(1) <NEW_LINE> json = _messages.MessageField('JsonObject', 2) <NEW_LINE> <DEDENT> ignoreUnknownValues = _messages.BooleanField(1) <NEW_LINE> kind = _me...
A TableDataInsertAllRequest object. Messages: RowsValueListEntry: A RowsValueListEntry object. Fields: ignoreUnknownValues: [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors. kind: The resource...
6259905645492302aabfda2e
class TSVCorpusReader(object): <NEW_LINE> <INDENT> def __init__(self, sentence_file, preload=True, file_reader=open): <NEW_LINE> <INDENT> self._open = file_reader <NEW_LINE> self._sentence_file = sentence_file <NEW_LINE> self._sentence_cache = [] <NEW_LINE> if preload: <NEW_LINE> <INDENT> self._sentence_cache = list(se...
Corpus reader for TSV files. Input files are assumed to contain one sentence per line, with tokens separated by tabs: foo[tab]bar[tab]baz span[tab]eggs Would correspond to the two-sentence corpus: ["foo", "bar", "baz"], ["spam", "eggs"]
62599056dd821e528d6da42b
class Category(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=512, null=False) <NEW_LINE> slug = models.SlugField(null=False, unique=True, max_length=255) <NEW_LINE> description = models.TextField(null=True, blank=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "Category: %s" % se...
This model represent a category of posts
62599056fff4ab517ebced7a
class Modbus_WriteMultipleCoilsResp(scapy_all.Packet): <NEW_LINE> <INDENT> pass
Layer for wite multiple coils response
625990568e7ae83300eea5e5
class Money: <NEW_LINE> <INDENT> def __init__(self, amount, currency): <NEW_LINE> <INDENT> self.amount = amount <NEW_LINE> self.currency = currency <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if self.currency.symbol != None: <NEW_LINE> <INDENT> return f"{self.currency.symbol}{self.amount:.{self.currency....
Represents an amount of money. Requires an amount and a currency.
62599056a79ad1619776b569
class ToneChatEnums: <NEW_LINE> <INDENT> class ContentLanguage(str, Enum): <NEW_LINE> <INDENT> EN = 'en' <NEW_LINE> FR = 'fr' <NEW_LINE> <DEDENT> class AcceptLanguage(str, Enum): <NEW_LINE> <INDENT> AR = 'ar' <NEW_LINE> DE = 'de' <NEW_LINE> EN = 'en' <NEW_LINE> ES = 'es' <NEW_LINE> FR = 'fr' <NEW_LINE> IT = 'it' <NEW_L...
Enums for tone_chat parameters.
6259905607f4c71912bb0992
class TestSameTree(unittest.TestCase): <NEW_LINE> <INDENT> def test_same_tree(self): <NEW_LINE> <INDENT> s = Solution() <NEW_LINE> self.assertEqual(True, s.isSameTree(TreeNode.generate([1, 2, 3]), TreeNode.generate([1, 2, 3]))) <NEW_LINE> self.assertEqual(False, s.isSameTree(TreeNode.generate([1, 2]), TreeNode.generate...
Test q100_same_tree.py
625990568a43f66fc4bf36e5
class TypedSequence(MutableSequence): <NEW_LINE> <INDENT> def __init__(self, cls, args, allow_none=True): <NEW_LINE> <INDENT> self.cls = cls <NEW_LINE> self.allowed_types = (cls, type(None)) if allow_none else cls <NEW_LINE> self.list = [] <NEW_LINE> self.extend(args) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <...
Custom list type that checks the instance type of new values. reference: http://stackoverflow.com/a/3488283
6259905601c39578d7f141e3
class LList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._len = 0 <NEW_LINE> self._head = None <NEW_LINE> self._tail = None
Linked List class that mostly just is an interface to LLNode
6259905663b5f9789fe866ca
class Podcast: <NEW_LINE> <INDENT> PATH_TO_PODCASTS_YAML = os.path.join(os.path.dirname(__file__), 'podcasts.yaml') <NEW_LINE> def __init__( self, key: str, index: str) -> None: <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.index = index <NEW_LINE> self.name = self.get_name_from_key(key) <NEW_LINE> self.epi...
Object representation of a podcast.
6259905621a7993f00c674c5
class PCommand(Mbase_cmd.DebuggerCommand): <NEW_LINE> <INDENT> aliases = ('print', 'pr') <NEW_LINE> category = 'data' <NEW_LINE> min_args = 1 <NEW_LINE> max_args = None <NEW_LINE> name = os.path.basename(__file__).split('.')[0] <NEW_LINE> need_stack = True <NEW_LINE> short_help = 'Pr...
**print** *expression* Print the value of the expression. Variables accessible are those of the environment of the selected stack frame, plus globals. The expression may be preceded with */fmt* where *fmt* is one of the format letters 'c', 'x', 'o', 'f', or 's' for chr, hex, oct, float or str respectively. If the le...
6259905694891a1f408ba1a2
class OleCfPluginTestCase(test_lib.ParserTestCase): <NEW_LINE> <INDENT> def _OpenOleCfFile(self, path, codepage=u'cp1252'): <NEW_LINE> <INDENT> file_entry = self._GetTestFileEntryFromPath([path]) <NEW_LINE> file_object = file_entry.GetFileObject() <NEW_LINE> olecf_file = pyolecf.file() <NEW_LINE> olecf_file.set_ascii_c...
The unit test case for OLE CF based plugins.
625990562ae34c7f260ac63f
class TestCalendarCreate(Base): <NEW_LINE> <INDENT> expected_title = "fedocal.calendar.new" <NEW_LINE> expected_subti = 'ralph created a whole new "awesome" calendar' <NEW_LINE> expected_link = "https://apps.fedoraproject.org/calendar/awesome/" <NEW_LINE> expected_icon = ("https://apps.fedoraproject.org/calendar/" "sta...
These messages are published when someone creates a whole calendar from `fedocal <https://apps.fedoraproject.org/calendar>`_.
625990563eb6a72ae038bbb8
class Token(object): <NEW_LINE> <INDENT> def __init__(self, type, val, pos,lineno): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> self.val = val <NEW_LINE> self.pos = pos <NEW_LINE> self.lineno=lineno <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '%s(%s) at %s in %s' % (self.type, self.val, self.p...
A simple Token structure. Token type, value and position.
62599056435de62698e9d35c
class EvergreenProjectConfig(object): <NEW_LINE> <INDENT> def __init__(self, conf): <NEW_LINE> <INDENT> self._conf = conf <NEW_LINE> self.tasks = [Task(task_dict) for task_dict in self._conf["tasks"]] <NEW_LINE> self._tasks_by_name = {task.name: task for task in self.tasks} <NEW_LINE> self.task_groups = [ TaskGroup(tas...
Represent an Evergreen project configuration file.
62599056cb5e8a47e493cc33
class MqttSwitch(MqttEntity, SwitchEntity, RestoreEntity): <NEW_LINE> <INDENT> def __init__(self, hass, config, config_entry, discovery_data): <NEW_LINE> <INDENT> self._state = False <NEW_LINE> self._state_on = None <NEW_LINE> self._state_off = None <NEW_LINE> self._optimistic = None <NEW_LINE> MqttEntity.__init__(self...
Representation of a switch that can be toggled using MQTT.
62599056adb09d7d5dc0bac3
class WebsocketJsonRpcProtocol(object): <NEW_LINE> <INDENT> version = '1.0.0' <NEW_LINE> def __init__(self, _type): <NEW_LINE> <INDENT> self._type = _type.lower() <NEW_LINE> if self._type != 'request' and self._type != 'response': <NEW_LINE> <INDENT> raise Exception('Wrong protocol type, "request" or "response" expecte...
Definition of Json-rpc protocol structure.
62599056e64d504609df9e7c
class EncodedArrayItem : <NEW_LINE> <INDENT> def __init__(self, buff, cm) : <NEW_LINE> <INDENT> self.__CM = cm <NEW_LINE> self.offset = buff.get_idx() <NEW_LINE> self.value = EncodedArray( buff, cm ) <NEW_LINE> <DEDENT> def get_value(self) : <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> def set_off(self, of...
This class can parse an encoded_array_item of a dex file :param buff: a string which represents a Buff object of the encoded_array_item :type buff: Buff object :param cm: a ClassManager object :type cm: :class:`ClassManager`
62599056596a89723612905c
class SymbolTable: <NEW_LINE> <INDENT> from .Node import Node as node <NEW_LINE> from .exceptions import ( NodeError, CircularReferenceError, EmptyExpressionError, ExpressionSyntaxError, EvaluationError, UnresolvedNodeError ) <NEW_LINE> @property <NEW_LINE> def keys(self): <NEW_LINE> <INDENT> return tuple(self._nodes.k...
Storage and naming services for algebraic nodes
625990560a50d4780f70686b
class Node(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Node, self).__init__() <NEW_LINE> <DEDENT> @property <NEW_LINE> def info(self): <NEW_LINE> <INDENT> return node_inf.retrieve_info() <NEW_LINE> <DEDENT> @property <NEW_LINE> def status(self): <NEW_LINE> <INDENT> return node_inf.retriev...
docstring for KongNode
625990568e71fb1e983bd022
@final <NEW_LINE> class ClearVariableAction(EventAction[ClearVariableActionParameters]): <NEW_LINE> <INDENT> name = "clear_variable" <NEW_LINE> param_class = ClearVariableActionParameters <NEW_LINE> def start(self) -> None: <NEW_LINE> <INDENT> player = self.session.player <NEW_LINE> key = self.parameters.variable <NEW_...
Clear the value of a variable from the game. Script usage: .. code-block:: clear_variable <variable> Script parameters: variable: The variable to clear.
6259905621bff66bcd7241bd
class ObjectIterator(_BaseIterator): <NEW_LINE> <INDENT> def __init__(self, bucket, prefix='', delimiter='', marker='', max_keys=100, max_retries=defaults.request_retries): <NEW_LINE> <INDENT> super(ObjectIterator, self).__init__(marker, max_retries) <NEW_LINE> self.bucket = bucket <NEW_LINE> self.prefix = prefix <NEW_...
遍历Bucket里文件的迭代器。 每次迭代返回的是 :class:`SimplifiedObjectInfo <oss2.models.SimplifiedObjectInfo>` 对象。 当 `SimplifiedObjectInfo.is_prefix()` 返回True时,表明是公共前缀(目录)。 :param bucket: :class:`Bucket <oss2.Bucket>` 对象 :param prefix: 只列举匹配该前缀的文件 :param delimiter: 目录分隔符 :param marker: 分页符 :param max_keys: 每次调用 `list_objects` 时的max_keys...
62599056507cdc57c63a62fe
class ApplicationGatewayBackendHealth(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ApplicationGatewayBackendHealth, self...
Response for ApplicationGatewayBackendHealth API service call. :param backend_address_pools: A list of ApplicationGatewayBackendHealthPool resources. :type backend_address_pools: list[~azure.mgmt.network.v2019_04_01.models.ApplicationGatewayBackendHealthPool]
6259905645492302aabfda31
class Box(object): <NEW_LINE> <INDENT> def __init__(self,boxType): <NEW_LINE> <INDENT> self.pos=(0,0,0) <NEW_LINE> self.boxType=boxType <NEW_LINE> self.xzBox=None <NEW_LINE> self.xyBox=None <NEW_LINE> self.yzBox=None <NEW_LINE> <DEDENT> def getType(self): <NEW_LINE> <INDENT> return self.boxType <NEW_LINE> <DEDENT> def ...
The base class for boxes.
62599056fff4ab517ebced7c
class InputFile(BaseTask): <NEW_LINE> <INDENT> def output(self): <NEW_LINE> <INDENT> return luigi.LocalTarget(self.input_file)
A Task wrapping up a Target object
62599056379a373c97d9a57e
@keras_export('keras.layers.experimental.preprocessing.Resizing') <NEW_LINE> class Resizing(PreprocessingLayer): <NEW_LINE> <INDENT> def __init__(self, height, width, interpolation='bilinear', name=None, **kwargs): <NEW_LINE> <INDENT> self.target_height = height <NEW_LINE> self.target_width = width <NEW_LINE> self.inte...
Image resizing layer. Resize the batched image input to target height and width. The input should be a 4-D tensor in the format of NHWC. Arguments: height: Integer, the height of the output shape. width: Integer, the width of the output shape. interpolation: String, the interpolation method. Defaults to `biline...
6259905616aa5153ce401a3d
class Perfect_Paddle: <NEW_LINE> <INDENT> Width = 20 <NEW_LINE> Height = 100 <NEW_LINE> def __init__(self, Width, Height, player): <NEW_LINE> <INDENT> self.screen_Width = Width <NEW_LINE> self.screen_Height = Height <NEW_LINE> self.player = player <NEW_LINE> self.y = self.screen_Width//2 <NEW_LINE> self.vy = 0 <NEW_LIN...
Takes ball object as input and sets paddle.y == ball.y
62599056460517430c432afe
@attr.s(slots=True, frozen=True) <NEW_LINE> class UnknownJob(UserError): <NEW_LINE> <INDENT> lead = "Jenkins error" <NEW_LINE> server_url = attr.ib(validator=instance_of(str)) <NEW_LINE> job_name = attr.ib(validator=instance_of(str)) <NEW_LINE> def __attr_post_init__(self): <NEW_LINE> <INDENT> super(UnknownJob, self)._...
No job with specified name was found on the server.
6259905601c39578d7f141e4
class SourceFileExtractor(FileExtractor): <NEW_LINE> <INDENT> def get_options(self): <NEW_LINE> <INDENT> return self.default_options().union(self.get_help_list_macro('HELP_SPEC_OPTIONS'))
An abstract extractor for a source file with usage message. This class does not offer a way to set a filename, which is expected to be defined in children classes.
6259905624f1403a9268637c
class Gaussian(Distribution): <NEW_LINE> <INDENT> def __init__(self, mu=0, sigma=1): <NEW_LINE> <INDENT> Distribution.__init__(self, mu, sigma) <NEW_LINE> <DEDENT> def calculate_mean(self): <NEW_LINE> <INDENT> avg = 1.0 * sum(self.data) / len(self.data) <NEW_LINE> self.mean = avg <NEW_LINE> return self.mean <NEW_LINE> ...
Gaussian distribution class for calculating and visualizing a Gaussian distribution. Attributes: mean (float) representing the mean value of the distribution stdev (float) representing the standard deviation of the distribution data_list (list of floats) a list of floats extracted from the data file
625990568da39b475be04746
class GalleryView(object): <NEW_LINE> <INDENT> def __call__(self, environ): <NEW_LINE> <INDENT> html = '' <NEW_LINE> req = Request(environ) <NEW_LINE> filename, ext = os.path.splitext(req.path_info) <NEW_LINE> markdown_file = content + filename + '.md' <NEW_LINE> if os.path.isfile(markdown_file): <NEW_LINE> <INDENT> _b...
Read markdown file and render template.
6259905655399d3f05627a79
class SimpleUploadForm(forms.Form): <NEW_LINE> <INDENT> file = forms.FileField(label=_('File')) <NEW_LINE> method = forms.ChoiceField( label=_('Merge method'), choices=( ('', _('Add as translation')), ('suggest', _('Add as a suggestion')), ('fuzzy', _('Add as fuzzy translation')), ), required=False ) <NEW_LINE> merge_h...
Base form for uploading a file.
62599056a219f33f346c7d5f
class Element(ClonableArray): <NEW_LINE> <INDENT> def check(self): <NEW_LINE> <INDENT> if self not in self.parent(): <NEW_LINE> <INDENT> raise ValueError("Invalid permutation")
A length-`k` partial permutation of `[n]`.
625990563eb6a72ae038bbba
class Movement_card(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, x, y, x_mov, y_mov, color, order): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image = pygame.Surface((width / 7.5, height / 6.66)) <NEW_LINE> self.color = color <NEW_LINE> self.image.fill(color) <NEW_LINE> sel...
Class for the cards that choose movement
625990566e29344779b01ba5
class registerOrganization_InputForm(messages.Message): <NEW_LINE> <INDENT> orgName = messages.StringField(1) <NEW_LINE> phoneNumber = messages.StringField(2)
OrganizationForm -- Organization outbound form message
6259905615baa723494634ec
class SmartMeter(object): <NEW_LINE> <INDENT> def __init__(self, retries=2, com_method='rtu', baudrate=19200, stopbits=1, parity='N', bytesize=8, timeout=0.1, logfile='sm.log'): <NEW_LINE> <INDENT> self.retries = retries <NEW_LINE> self.com_method = com_method <NEW_LINE> self.baudrate = baudrate <NEW_LINE> self.stopbit...
1. Sets up a smart meter connection 2. Specifies a serial port to connect to 3. Methods to read and write data (to csv)
625990567cff6e4e811b6f9c
class SNError(Exception): <NEW_LINE> <INDENT> pass
Superclass used for errors in the SNePS module.
62599056baa26c4b54d507fe
class ActionAbstract(models.Model): <NEW_LINE> <INDENT> state_db = models.ForeignKey(State) <NEW_LINE> person = models.ForeignKey(Person) <NEW_LINE> name = models.SlugField(max_length=8) <NEW_LINE> created = models.DateTimeField(editable=False) <NEW_LINE> comment = models.TextField(blank=True, null=True) <NEW_LINE> fil...
Common model for Action and ActionArchived
62599056dd821e528d6da42d
class DynamicSentenceEndingLabeler(workflow.ExactMatchLabeler): <NEW_LINE> <INDENT> def __init__(self, input_sequence: str, config: Optional[SentenceSegementationConfig]): <NEW_LINE> <INDENT> if config and config.dynamic_endings: <NEW_LINE> <INDENT> self.AC_AUTOMATION = self.build_ac_automation_from_strings(config.dyna...
Support dynamic sentence endings that will be built in runtime.
62599056d7e4931a7ef3d5d9
class ConfigurationParser(object): <NEW_LINE> <INDENT> CONFIG_OBJECT = None <NEW_LINE> @classmethod <NEW_LINE> def get_config_object(cls): <NEW_LINE> <INDENT> if not cls.CONFIG_OBJECT: <NEW_LINE> <INDENT> config = ConfigParser.ConfigParser() <NEW_LINE> try: <NEW_LINE> <INDENT> config.read("app_config.properties") <NEW_...
Utility class for configuration parser object provider
625990560a50d4780f70686c
class BleachCharField(models.CharField, BleachMixin): <NEW_LINE> <INDENT> def __init__(self, allowed_tags=None, allowed_attributes=None, allowed_styles=None, strip_tags=None, strip_comments=None, *args, **kwargs): <NEW_LINE> <INDENT> super(BleachCharField, self).__init__(*args, **kwargs) <NEW_LINE> self._do_init(allowe...
Bleach CharField.
62599056379a373c97d9a57f
class NodeAlias(object): <NEW_LINE> <INDENT> def __init__(self, alias): <NEW_LINE> <INDENT> self._alias = int(alias) <NEW_LINE> <DEDENT> def __int__(self): <NEW_LINE> <INDENT> return self._alias <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '0x{0:X}'.format(self._alias) <NEW_LINE> <DEDENT> def __rep...
Utility class for handling node alias * Calling ``int`` on an instance of :py:class:`NodeAlias` will return the integer value. * Calling ``str`` on an instance of :py:class:`NodeAlias` will return a hexidecimal number.
62599056baa26c4b54d507ff
class QSignalBlocker(__sip.simplewrapper): <NEW_LINE> <INDENT> def reblock(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def unblock(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> return object() <NEW_LINE> <DEDENT> def __exit__(self, p_object, p_object_1, p_object_2)...
QSignalBlocker(QObject)
625990568e71fb1e983bd024
class FunctionType(LittleScribeType): <NEW_LINE> <INDENT> def __init__(self, parameter_types, return_type): <NEW_LINE> <INDENT> self.parameter_types = parameter_types <NEW_LINE> self.parameter_count = len(parameter_types) <NEW_LINE> self.return_type = return_type <NEW_LINE> <DEDENT> def is_super_of(self, other): <NEW_L...
A callable type which runs code and returns a value. All functions are pure (having no side effects) and return exactly one value. This may change in later versions.
62599056be383301e0254d3a
class Command(NoArgsCommand): <NEW_LINE> <INDENT> def handle_noargs(self, **options): <NEW_LINE> <INDENT> addresses = BaseAddress.objects.filter(coordinates__isnull=True) <NEW_LINE> for address in addresses: <NEW_LINE> <INDENT> if address.fetch_coordinates(): <NEW_LINE> <INDENT> address.coordinates = address.fetch_coor...
Поиск адресов без координат и попытка их проставить.
6259905629b78933be26ab72
class FileError(GoghError): <NEW_LINE> <INDENT> pass
'{0}' does not exist.
6259905632920d7e50bc75a2
class TermsOfServiceCheckboxInput(CheckboxInput): <NEW_LINE> <INDENT> def render(self, name, value, attrs=None): <NEW_LINE> <INDENT> final_attrs = self.build_attrs(attrs, type='checkbox', name=name) <NEW_LINE> if self.check_test(value): <NEW_LINE> <INDENT> final_attrs['checked'] = 'checked' <NEW_LINE> <DEDENT> if not (...
Renders a checkbox with a label linking to the terms of service.
62599056e5267d203ee6ce4a
class SettingsDelete(generic.ObjectDeleteView): <NEW_LINE> <INDENT> queryset = Settings.objects.all()
Delete Cisco DNA Center Settings
62599056498bea3a75a59082
class LoggerMixin: <NEW_LINE> <INDENT> @cached_property <NEW_LINE> def full_slug(self): <NEW_LINE> <INDENT> return self.slug <NEW_LINE> <DEDENT> def log_hook(self, level, msg, *args): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> def log_debug(self, msg, *args): <NEW_LINE> <INDENT> self.log_hook("DEBUG", msg, *args) <...
Mixin for models with logging.
62599056097d151d1a2c25c7
class Base64: <NEW_LINE> <INDENT> digits = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1',...
Bacula specific implementation of a base64 decoder
625990564e4d562566373963
class InterfaceTypeFixture(TypeFixture): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.gfi = make_type_info('GF', typevars=['T'], is_abstract=True) <NEW_LINE> self.m1i = make_type_info('M1', is_abstract=True, mro=[self.gfi, self.oi], bases=[Instance(self.gfi, [self.a])])...
Extension of TypeFixture that contains additional generic interface types.
6259905607d97122c4218207
class MDSEventListener(models.Model): <NEW_LINE> <INDENT> event_name = models.CharField(max_length=50) <NEW_LINE> server = models.CharField(max_length=100) <NEW_LINE> description = models.CharField(max_length = 500, blank=True) <NEW_LINE> h1ds_signal = models.ManyToManyField(H1DSSignal, through='ListenerSignals') <NEW_...
Listens for an MDSplus event from a specified server.
62599056d99f1b3c44d06bfc
class Bool(Validator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._valid_values = [True, False] <NEW_LINE> <DEDENT> def validate(self, value, context=''): <NEW_LINE> <INDENT> if not isinstance(value, bool) and not isinstance(value, np.bool8): <NEW_LINE> <INDENT> raise TypeError( '{} is not Boolean...
requires a boolean
625990564e696a045264e8d0
class Interface(Entity): <NEW_LINE> <INDENT> host = entity_fields.OneToOneField('Host', required=True) <NEW_LINE> mac = entity_fields.MACAddressField(required=True) <NEW_LINE> ip = entity_fields.IPAddressField(required=True) <NEW_LINE> interface_type = entity_fields.StringField(required=True) <NEW_LINE> name = entity_f...
A representation of a Interface entity.
62599056b57a9660fecd2fd8
class Relocation(object): <NEW_LINE> <INDENT> def __init__(self, address, symbol, offset, reltype): <NEW_LINE> <INDENT> self.address = address <NEW_LINE> self.symbol = symbol <NEW_LINE> self.offset = offset <NEW_LINE> self.reltype = reltype <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '{:<#10x} {:<...
Represents a relocation entry in the COFF file.
62599056dc8b845886d54b21
class SemanticRolesResult(): <NEW_LINE> <INDENT> def __init__(self, *, sentence=None, subject=None, action=None, object=None): <NEW_LINE> <INDENT> self.sentence = sentence <NEW_LINE> self.subject = subject <NEW_LINE> self.action = action <NEW_LINE> self.object = object <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _f...
The object containing the actions and the objects the actions act upon. :attr str sentence: (optional) Sentence from the source that contains the subject, action, and object. :attr SemanticRolesResultSubject subject: (optional) The extracted subject from the sentence. :attr SemanticRolesResultAction action...
62599056d7e4931a7ef3d5db
class KernelManagerABC(object, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractproperty <NEW_LINE> def kernel(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def start_kernel(self, **kw): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def shutdown...
KernelManager ABC. The docstrings for this class can be found in the base implementation: `jupyter_client.kernelmanager.KernelManager`
62599056dd821e528d6da42e
class Article(Element): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("article")
An HTML article (<article>) element. A self-contained article on a page, like a blog entry or a comment in a blog system.
62599056b5575c28eb71377a
class SchemaError(ValueError): <NEW_LINE> <INDENT> pass
Raised when the validation schema is missing, has the wrong format or contains errors.
625990560c0af96317c5780e
class Model(object): <NEW_LINE> <INDENT> def is_equal(self, field, value): <NEW_LINE> <INDENT> const = getattr(self, field) <NEW_LINE> if const.value == value: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> o...
The model class represent the final output for each type of data
62599056379a373c97d9a582
class ProjectContextTests: <NEW_LINE> <INDENT> def test_no_filtration(self, samples, project): <NEW_LINE> <INDENT> _assert_samples(samples, project.samples) <NEW_LINE> with ProjectContext(project) as prj: <NEW_LINE> <INDENT> _assert_samples(project.samples, prj.samples) <NEW_LINE> <DEDENT> <DEDENT> @pytest.mark.paramet...
Tests for Project context manager wrapper
6259905632920d7e50bc75a4
class scenario_positive_default_role_added_permission_with_filter(APITestCase): <NEW_LINE> <INDENT> @pre_upgrade <NEW_LINE> def test_pre_default_role_added_permission_with_filter(self): <NEW_LINE> <INDENT> defaultrole = entities.Role().search( query={'search': 'name="Default role"'})[0] <NEW_LINE> domainfilter = entiti...
Default role extra added permission with filter should be intact post upgrade :id: b287b71c-42fd-4612-a67a-b93d47dbbb33 :steps: 1. In Preupgrade Satellite, Update existing 'Default role' by adding new permission with filter 2. Upgrade the satellite to next/latest version 3. Postupgrade, Verif...
625990567047854f4634091d
class NSNitroNserrConnfailoverService(NSNitroLbErrors): <NEW_LINE> <INDENT> pass
Nitro error code 1290 Connection failover can only be enabled on a virtual server of service type ANY
625990568e71fb1e983bd027
class QLearningAgent(ReinforcementAgent): <NEW_LINE> <INDENT> def __init__(self, **args): <NEW_LINE> <INDENT> ReinforcementAgent.__init__(self, **args) <NEW_LINE> "*** YOUR CODE HERE ***" <NEW_LINE> self.qValues = util.Counter() <NEW_LINE> <DEDENT> def getQValue(self, state, action): <NEW_LINE> <INDENT> qvalue = self.q...
Q-Learning Agent Functions you should fill in: - getQValue - getAction - getValue - getPolicy - update Instance variables you have access to - self.epsilon (exploration prob) - self.alpha (learning rate) - self.discount (discount rate) Functions you should use - self.getLegalActions(state) whic...
62599056004d5f362081fa9c
class CmdRestart(ClusterCompleter): <NEW_LINE> <INDENT> names = ['restart', 'reboot'] <NEW_LINE> tag = None <NEW_LINE> def execute(self, args): <NEW_LINE> <INDENT> if not args: <NEW_LINE> <INDENT> self.parser.error("please specify a cluster <tag_name>") <NEW_LINE> <DEDENT> for arg in args: <NEW_LINE> <INDENT> self.cm.r...
restart [options] <cluster_tag> Restart an existing cluster Example: $ starcluster restart mynewcluster This command will reboot each node (without terminating), wait for the nodes to come back up, and then reconfigures the cluster without losing any data on the node's local disk
6259905694891a1f408ba1a5
class Encoder(object): <NEW_LINE> <INDENT> def __init__(self, pin_x = 'GP4',pin_y = 'GP5', pin_mode=Pin.PULL_UP, scale=1, min=0, max=100, reverse=False): <NEW_LINE> <INDENT> self.pin_x = (pin_x if isinstance(pin_x, Pin) else Pin(pin_x, mode=Pin.IN, pull=pin_mode)) <NEW_LINE> self.pin_y = (pin_y if isinstance(pin_y, Pin...
Rotary encoder class
6259905607f4c71912bb0998
class RoomFactory(object): <NEW_LINE> <INDENT> def __init__(self, config, room_manager, server_name_model, map_meta_data_accessor, command_executer, event_subscription_fulfiller, metrics_service): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.room_manager = room_manager <NEW_LINE> self.room_manager.set_facto...
Initializes rooms from the config. If a room is in the room bindings section of the config it will be initialized with those settings. If a room type is specified the room will be initialized according to that registered room type if it exists. Otherwise it will be initialized with the default settings.
625990568a43f66fc4bf36eb
class AdminHouseEditHandler(session.SessionHandler, RequestHandler): <NEW_LINE> <INDENT> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> if self.session_obj['admin_is_login'] == 0: <NEW_LINE> <INDENT> self.redirect(r'/admin/login') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> id = self.get_argument('id') <NEW_LINE...
在房源管理列表中,点击编辑,对编辑的处理,首先跳转到编辑的页面,点击保存,更新数据库
625990560fa83653e46f6443
class IoaSimilarity(RegionSimilarityCalculator): <NEW_LINE> <INDENT> def _compare(self, boxlist1, boxlist2): <NEW_LINE> <INDENT> return box_list_ops.ioa(boxlist1, boxlist2)
Class to compute similarity based on Intersection over Area (IOA) metric. This class computes pairwise similarity between two BoxLists based on their pairwise intersections divided by the areas of second BoxLists.
625990563617ad0b5ee076a7
class Cinema(scrapy.Item): <NEW_LINE> <INDENT> id_mt = Field() <NEW_LINE> id_tb = Field() <NEW_LINE> id_lm = Field() <NEW_LINE> @classmethod <NEW_LINE> def get_table_name(cls): <NEW_LINE> <INDENT> return 'cinema'
汇总各个渠道
625990567d847024c075d939
class OutputError(_RuntimeError): <NEW_LINE> <INDENT> pass
Failure whilst gathering task outputs
6259905645492302aabfda36
class Run(Main): <NEW_LINE> <INDENT> synopsis = "run" <NEW_LINE> callLater = reactor.callLater <NEW_LINE> def postOptions(self): <NEW_LINE> <INDENT> tlog.startLogging(sys.stdout) <NEW_LINE> with createWeb() as webFactory: <NEW_LINE> <INDENT> epWeb = endpoints.serverFromString(reactor, 'tcp:%s' % DEFAULT_PORT) <NEW_LINE...
Command that runs the glyphs server
6259905663b5f9789fe866d1
class _DataServiceDatasetV2(dataset_ops.DatasetSource): <NEW_LINE> <INDENT> def __init__(self, input_dataset, dataset_id, processing_mode, address, protocol, max_outstanding_requests=None, task_refresh_interval_hint_ms=None): <NEW_LINE> <INDENT> if max_outstanding_requests is None: <NEW_LINE> <INDENT> max_outstanding_r...
A `Dataset` that reads elements from the tf.data service.
6259905621a7993f00c674cb
class Span(object): <NEW_LINE> <INDENT> def __init__(self, trace_context): <NEW_LINE> <INDENT> self.trace_context = trace_context <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_tb): <NEW_LINE> <INDENT> if exc_type: <NEW_LINE> <INDEN...
Span represents a unit of work executed on behalf of a trace. Examples of spans include a remote procedure call, or a in-process method call to a sub-component. A trace is required to have a single, top level "root" span, and zero or more children spans, which in turns can have their own children spans, thus forming a ...
62599056009cb60464d02a92
class WssClient(KrakenSocketManager): <NEW_LINE> <INDENT> def __init__(self, key=None, secret=None, nonce_multiplier=1.0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.key = key <NEW_LINE> self.secret = secret <NEW_LINE> self.nonce_multiplier = nonce_multiplier <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <...
Websocket client for Kraken
62599056adb09d7d5dc0bac9
class Habitatclass(models.Model): <NEW_LINE> <INDENT> site = models.ForeignKey(Site, null=True) <NEW_LINE> habitatcode = models.CharField(max_length=510, blank=True, null=True) <NEW_LINE> percentagecover = models.FloatField(blank=True, null=True) <NEW_LINE> description = models.CharField(max_length=510, blank=True, nul...
General habitat classes.
6259905621bff66bcd7241c3
class ProcessingException(EnsembleException): <NEW_LINE> <INDENT> pass
For general processing failures
625990560a50d4780f70686e
class BlockREST(REST): <NEW_LINE> <INDENT> grok.baseclass() <NEW_LINE> grok.adapts(PageAPI, IPage) <NEW_LINE> grok.require('silva.ChangeSilvaContent') <NEW_LINE> slot = None <NEW_LINE> slot_id = None <NEW_LINE> slot_validate = True <NEW_LINE> block = None <NEW_LINE> block_id = None <NEW_LINE> block_controller = None <N...
Traverse to a block on a page.
625990568e7ae83300eea5ec
class OrDefinitionItem(Item): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def is_item(cls, line): <NEW_LINE> <INDENT> return definition_regex.match(line) is not None <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def parse(cls, lines): <NEW_LINE> <INDENT> header = lines[0].strip() <NEW_LINE> term, classifiers = header_reg...
A docstring definition section item. In this section definition item there are two classifiers that are separated by ``or``. Syntax diagram:: +-------------------------------------------------+ | term [ " : " classifier [ " or " classifier] ] | +--+----------------------------------------------+---+ ...
625990562c8b7c6e89bd4d4d