code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ADVraw(dbvel.Velocity): <NEW_LINE> <INDENT> @property <NEW_LINE> def make_model(self,): <NEW_LINE> <INDENT> return self.props['inst_make'] + ' ' + self.props['inst_model'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def body2imu_vec(self,): <NEW_LINE> <INDENT> return body2imu[self.make_model] <NEW_LINE> <DEDENT> def...
The base class for ADV data objects.
62598f7fec188e330fdf82a9
class IApp(Interface): <NEW_LINE> <INDENT> pass
Base application context class
62598f7ffb3f5b602db47eb5
class MKCTFWebHandler: <NEW_LINE> <INDENT> def __init__(self, api): <NEW_LINE> <INDENT> self._api = api <NEW_LINE> <DEDENT> async def enum_challenges(self, _): <NEW_LINE> <INDENT> slugs = [challenge['slug'] for challenge in self._api.enum()] <NEW_LINE> return web.json_response({'challenges': slugs}) <NEW_LINE> <DEDENT>...
[summary]
62598f7f8e05c05ec3f6eb4c
class IVPComputationType(Enum): <NEW_LINE> <INDENT> UNKNOWN = 'unknown' <NEW_LINE> MIX = 'mixed-bound' <NEW_LINE> COMPUTE = 'compute-bound' <NEW_LINE> MEMORY = 'memory-bound'
Characterizes behaviour/boundaries of the computation(s) of an IVP.
62598f7f9b70327d1c57e7a9
class OrderedSet(MutableSet): <NEW_LINE> <INDENT> def __init__(self, iterable=None): <NEW_LINE> <INDENT> self.end = end = [] <NEW_LINE> end += [None, end, end] <NEW_LINE> self.map = {} <NEW_LINE> if iterable is not None: <NEW_LINE> <INDENT> self |= iterable <NEW_LINE> <DEDENT> <DEDENT> def __len__(self): <NEW_LINE> <IN...
Set that remembers original insertion order Based on the following code: http://code.activestate.com/recipes/576694/
62598f7fa79ad16197769a6a
class ResultLoggerThread(TerminatableThread): <NEW_LINE> <INDENT> __slots__ = ('inq',) <NEW_LINE> def __init__(self, inq): <NEW_LINE> <INDENT> super(ResultLoggerThread, self).__init__() <NEW_LINE> self.daemon = True <NEW_LINE> self.inq = inq <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> ...
A thread which pulls from worker's result queue, logging the result accordingly Currently it will only log exceptions. It's just a consumer to assure the output queue doesn't run full (or consume vast amount of memory) @note we are a daemon thread and will not block a shutdown of python
62598f7fc432627299fa29d9
class MockTransformDiaSourceCatalogTask(PipelineTask): <NEW_LINE> <INDENT> ConfigClass = TransformDiaSourceCatalogConfig <NEW_LINE> _DefaultName = "notTransformDiaSourceCatalog" <NEW_LINE> def __init__(self, initInputs, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def runQuantum(self, b...
A do-nothing substitute for TransformDiaSourceCatalogTask.
62598f7f94891a1f408b93f4
class MultRightMatrix(MultMatrix): <NEW_LINE> <INDENT> def __init__(self, A, r=None, verbose=False): <NEW_LINE> <INDENT> super(MultRightMatrix, self).__init__(A, verbose) <NEW_LINE> if r is None: <NEW_LINE> <INDENT> self._r = pgcore.RVector(self.cols(), 1.0) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._r = r <NE...
Some Matrix, multiplied with a right hand side vector r.
62598f7f21a7993f00c6597b
class LocalFileLoader(Loader): <NEW_LINE> <INDENT> loader = open <NEW_LINE> loader_args = ['r', ] <NEW_LINE> loader_kwargs = {} <NEW_LINE> def open(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with self.loader(self.source, *self.loader_args, **self.loader_kwargs) as f: <NEW_LINE> <INDENT> return f.readlines() <N...
Loads from a local file path
62598f7f7c178a314d78ceb5
class InvalidTemplate(Exception): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Exception.__init__(self, "The given template is either invalid or " + "not available locally!")
Exception class to raise in case of a invalid template
62598f7fac7a0e7691f71f24
class Subscriber(Topic): <NEW_LINE> <INDENT> def __init__(self, name, data_class, callback=None, callback_args=None, queue_size=None, buff_size=DEFAULT_BUFF_SIZE, tcp_nodelay=False): <NEW_LINE> <INDENT> super(Subscriber, self).__init__(name, data_class, Registration.SUB) <NEW_LINE> if queue_size is not None: <NEW_LINE>...
Class for registering as a subscriber to a specified topic, where the messages are of a given type.
62598f7f442bda511e95be66
class WebServer(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.kwargs = kwargs <NEW_LINE> self.ready = False <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> from gevent.wsgi import WSGIServer <NEW_LINE> self.ready = True <NEW_LINE> LOGGER....
Adapter for a gevent.wsgi.WSGIServer.
62598f7fa17c0f6771d5bc4f
class APIConnectionError(Exception): <NEW_LINE> <INDENT> pass
APIConnectionError. Raises when response['success'] == False.
62598f7f76d4e153a661c61d
class Feature(object): <NEW_LINE> <INDENT> class Type: <NEW_LINE> <INDENT> CLASS = 'CLASS' <NEW_LINE> ID = 'ID' <NEW_LINE> BINARY = 'BINARY' <NEW_LINE> NOMINAL = 'NOMINAL' <NEW_LINE> CONTINUOUS = 'CONTINUOUS' <NEW_LINE> <DEDENT> def __init__(self, name, ftype, values=None): <NEW_LINE> <INDENT> self....
Describes a feature by name, type, and values
62598f7f379a373c97d98a1d
class SimStudyNonLinearPH(SimStudyLinearPH): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def g(covs): <NEW_LINE> <INDENT> x = covs <NEW_LINE> x0, x1, x2 = x[:, 0], x[:, 1], x[:, 2] <NEW_LINE> beta = 2/3 <NEW_LINE> linear = SimStudyLinearPH.g(x) <NEW_LINE> nonlinear = beta * (x0**2 + x2**2 + x0*x1 + x1*x2 + x1*x2) <NE...
Survival simulations study for non-linear prop. hazard model h(t | x) = h0 exp[g(x)], where g(x) is non-linear. Parameters: h0: Is baseline constant. right_c: Time for right censoring.
62598f7f50485f2cf55da97d
class SessionInitializationFailed(RunnerException): <NEW_LINE> <INDENT> pass
This exception is raised by :class:`.autorecoveringterminal.AutoRecoveringTerminal` when the initialization of the terminal fails during :meth:`.autorecoveringterminal.AutoRecoveringTerminal.initialize_terminal`. The original exception is stored into the first argument of the exception.
62598f7f15baa7234946198b
class RequestWrapper: <NEW_LINE> <INDENT> base_url = 'https://cms-gen-dev.cern.ch/xsdb' <NEW_LINE> api_url = base_url + '/api' <NEW_LINE> subprocess.call(['bash', 'getCookie.sh']) <NEW_LINE> c = pycurl.Curl() <NEW_LINE> c.setopt(pycurl.FOLLOWLOCATION, 1) <NEW_LINE> c.setopt(pycurl.COOKIEJAR, os.path.expanduser("~/priva...
Wrapper for making http requests to xsdb api
62598f7f8e05c05ec3f6eb4d
class TestPropertiesResourceProperties(TestProperties): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> self.fail("Not implemented yet.")
Test resource.properties
62598f7fc432627299fa29da
class UserCreationForm(forms.ModelForm): <NEW_LINE> <INDENT> password1 = forms.CharField(label='Password', widget=forms.PasswordInput) <NEW_LINE> password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = MyUser <NEW_LINE> fields = ('name', ...
A form for creating new users. Includes all the required fields, plus a repeated password.
62598f7ff7d966606f7479f4
class ColorViewsTestCase(TestCase): <NEW_LINE> <INDENT> def test_color_form(self): <NEW_LINE> <INDENT> with app.test_client() as client: <NEW_LINE> <INDENT> resp = client.get('/') <NEW_LINE> html = resp.get_data(as_text=True) <NEW_LINE> self.assertEqual(resp.status_code, 200) <NEW_LINE> self.assertIn('<h1>Color Form</h...
Examples of integration tests: testing Flask app.
62598f7fc432627299fa29db
class get_args(object): <NEW_LINE> <INDENT> def __init__(self, pairInfo=None, request=None, replicaInfo=None,): <NEW_LINE> <INDENT> self.pairInfo = pairInfo <NEW_LINE> self.request = request <NEW_LINE> self.replicaInfo = replicaInfo <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is...
Attributes: - pairInfo - request - replicaInfo
62598f7f596a89723612767d
class Number(Primitive): <NEW_LINE> <INDENT> _num_pattern = re.compile(b'^\d+$') <NEW_LINE> def __init__(self, num): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.value = num <NEW_LINE> self._raw = bytes(str(self.value), 'ascii') <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def parse(cls, buf, **kwargs): <NEW_L...
Represents a number object from an IMAP stream. :param int num: The number for the datum.
62598f7f4e696a045264db07
class ITestFolderSchema(Schema): <NEW_LINE> <INDENT> pass
Schema interface for TestFolder
62598f7f23e79379d538bf06
class Platform(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.image = pygame.Surface([50, 10]) <NEW_LINE> self.image.fill(MAGENTA) <NEW_LINE> self.rect = self.image.get_rect()
Platform that can be jumped on from underneath
62598f7f07f4c71912baee5c
class PremierAddOnOfferCollection(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'required': True}, 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[PremierAddOnOffer]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __i...
Collection of premier add-on offers. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar value: Required. Collection of resources. :vartype value: list[~azure.mgmt.web.v2018_02_01.models.PremierAddOnOffer] ...
62598f7f91af0d3eaad39818
class OrderItem(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.AmountHasTax = None <NEW_LINE> self.Discount = None <NEW_LINE> self.Name = None <NEW_LINE> self.Models = None <NEW_LINE> self.Total = None <NEW_LINE> self.Unit = None <NEW_LINE> self.Status = None <NEW_LINE> self.Price = No...
线下查票-订单明细
62598f7fe76e3b2f99fd8441
class NotEqualQueryOperator(QueryOperator): <NEW_LINE> <INDENT> def to_query(self, field_name, value): <NEW_LINE> <INDENT> return { field_name: {"$ne": value} }
Query operator used to return all documents that have the specified field with a value that's not equal to the specified value. For more information on `$ne` go to http://docs.mongodb.org/manual/reference/operator/query/ne/. Usage: .. testsetup:: ne_query_operator from datetime import datetime import async...
62598f7f287bf620b62715c0
class NetworkSecurityGroup(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'network_interfaces': {'readonly': True}, 'subnets': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {...
NetworkSecurityGroup 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: ...
62598f7f30c21e258be98217
class Category(object): <NEW_LINE> <INDENT> def __init__(self, name, uid=None): <NEW_LINE> <INDENT> self.uid = uid <NEW_LINE> self.name = self.normalized_name(name) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def normalized_name(name): <NEW_LINE> <INDENT> return " ".join(name.split()).title()
Represents a spending category
62598f7f8e71fb1e983bb4c6
class TestNetworkByteLimits(test_lib.EmptyActionTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestNetworkByteLimits, self).setUp() <NEW_LINE> pathspec = rdf_paths.PathSpec(path="/nothing", pathtype=rdf_paths.PathSpec.PathType.OS) <NEW_LINE> self.buffer_ref = rdf_client.BufferReference(pathspec=p...
Test CopyPathToFile client actions.
62598f7ffbf16365ca793ab7
class Physics2d(object): <NEW_LINE> <INDENT> def __init__(self, mass=1, friction=100, gravity=(0, -10), terminal_velocity=(100, 100)): <NEW_LINE> <INDENT> super(Physics2d, self).__init__() <NEW_LINE> self.velocity = geometry.Point2d(0, 0) <NEW_LINE> self.acceleration = geometry.Point2d(0, 0) <NEW_LINE> self.friction = ...
Simple two dimensional physics simulation. Attributes: mass (int): Mass of the object in arbitrary units. velocity (:obj:`engine.geometry.Point2d`): Velocity along the x and y axes in units per second. acceleration (:obj:`engine.geometry.Point2d`): Acceleration along the x and y axe...
62598f7f1d351010ab8f354d
class LineOfSight(pygame.sprite.Sprite): <NEW_LINE> <INDENT> side = 2 <NEW_LINE> maxlifetime = 10.0 <NEW_LINE> def __init__(self, boss, target): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.boss = boss <NEW_LINE> self.angle = 0 <NEW_LINE> self.target = target <NEW_LINE> self.lifetime = 0.0 <N...
a big projectile fired by the tank's main cannon
62598f7f8c3a8732951f5f55
@register <NEW_LINE> class ThreadEventBody(BaseSchema): <NEW_LINE> <INDENT> __props__ = { "reason": { "type": "string", "description": "The reason for the event.", "_enum": [ "started", "exited" ] }, "threadId": { "type": "integer", "description": "The identifier of the thread." } } <NEW_LINE> __refs__ = set() <NEW_LIN...
"body" of ThreadEvent Note: automatically generated code. Do not edit manually.
62598f7fa4f1c619b294dffb
class PrivateTopicRead(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Message privé lu' <NEW_LINE> verbose_name_plural = 'Messages privés lus' <NEW_LINE> <DEDENT> privatetopic = models.ForeignKey(PrivateTopic, db_index=True) <NEW_LINE> privatepost = models.ForeignKey(PrivatePost, db_...
Small model which keeps track of the user viewing private topics. It remembers the topic he looked and what was the last private Post at this time.
62598f7f07f4c71912baee5e
class PARAMETER_REFERENCE(CIMElement): <NEW_LINE> <INDENT> def __init__(self, name, reference_class = None, qualifiers = []): <NEW_LINE> <INDENT> Element.__init__(self, 'PARAMETER.REFERENCE') <NEW_LINE> self.setName(name) <NEW_LINE> self.setOptionalAttribute('REFERENCECLASS', reference_class) <NEW_LINE> self.appendChil...
The PARAMETER.REFERENCE element defines a single reference Parameter to a CIM Method. The parameter MAY have zero or more Qualifiers. <!ELEMENT PARAMETER.REFERENCE (QUALIFIER*)> <!ATTLIST PARAMETER.REFERENCE %CIMName; %ReferenceClass;>
62598f7fd10714528d69d8de
class ConflictObject(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super(ConflictObject, self).__init__(message) <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.message)
Define the exception for creating an existing object.
62598f7f21bff66bcd722677
class HomematicipIlluminanceSensor(HomematicipGenericDevice): <NEW_LINE> <INDENT> def __init__(self, home: AsyncHome, device) -> None: <NEW_LINE> <INDENT> super().__init__(home, device, 'Illuminance') <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_class(self) -> str: <NEW_LINE> <INDENT> return DEVICE_CLASS_ILLUMIN...
Represenation of a HomematicIP Illuminance device.
62598f7f8a43f66fc4bf1b8f
@method_decorator(my_decorator, name='dispatch') <NEW_LINE> class DemoView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> return HttpResponse('get') <NEW_LINE> <DEDENT> def post(self, request): <NEW_LINE> <INDENT> return HttpResponse('post') <NEW_LINE> <DEDENT> def put(self, request): <NEW_LINE>...
类视图:处理注册
62598f7fd10714528d69d8df
class UserModelCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.app = create_app('testing') <NEW_LINE> self.app_context = self.app.app_context() <NEW_LINE> self.app_context.push() <NEW_LINE> db.create_all() <NEW_LINE> self.logger = logging.create_logger(self.app) <NEW_LINE> <DEDENT...
用户模型相关测试 setUp 会在每个测试测试函数前执行一次 tearDown 则在每个测试函数结束后执行
62598f7fd6c5a102081e1b57
class AggregateOperationNotAllowedException(RestException): <NEW_LINE> <INDENT> status_code = 459
Missing Description
62598f7f50485f2cf55da981
class Book(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=300) <NEW_LINE> pages = models.IntegerField() <NEW_LINE> price = models.FloatField() <NEW_LINE> rating = models.FloatField() <NEW_LINE> author = models.ForeignKey(Author, on_delete=models.CASCADE) <NEW_LINE> publisher = models.ForeignKey(P...
图书模型
62598f7f004d5f362081ed03
class HelpfulFunctionsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_index_to_letter(self): <NEW_LINE> <INDENT> output = [] <NEW_LINE> input_variables = [1, 2, 3, 4, 5, 6, 7, 8] <NEW_LINE> expected_output = ["a", "b", "c", "d", "e", "f", "g", "h"] <NEW_LINE> for index in input_variables: <NEW_LINE> <INDENT> ...
Tests functionality of index to letter and letter to index functions
62598f7fdc8b845886d52fc6
class PetLoyalty(Structure): <NEW_LINE> <INDENT> fields = Skeleton( IDField(), LocalizedField("name"), )
PetLoyalty.dbc Hunter pet loyalty
62598f7f29b78933be269de3
class Availability(Base): <NEW_LINE> <INDENT> __table_args__ = {'schema': 'regional_protected_botanical_objects'} <NEW_LINE> __tablename__ = 'availability' <NEW_LINE> fosnr = sa.Column(sa.String, primary_key=True, autoincrement=False) <NEW_LINE> available = sa.Column(sa.Boolean, nullable=False, default=False) <NEW_LINE...
A simple bucket for achieving a switch per municipality. Here you can configure via the imported data if a public law restriction is available or not. You need to fill it with the data you provided in the app schemas municipality table (fosnr). Attributes: fosnr (int): The identifier of the municipality in your sy...
62598f7fa79ad16197769a70
@register("stable") <NEW_LINE> @dataclass <NEW_LINE> class StableQuery: <NEW_LINE> <INDENT> dummy: str
A dummy query whose results will not change
62598f7f26238365f5fac580
class Agent(Record): <NEW_LINE> <INDENT> agent_type = Text(required) <NEW_LINE> title = Text() <NEW_LINE> job_title = Text() <NEW_LINE> last_name = Text() <NEW_LINE> first_name = Text() <NEW_LINE> middle_initial = Text() <NEW_LINE> abbreviation = Text() <NEW_LINE> email = Text() <NEW_LINE> url = Text() <NEW_LINE> @many...
A person, group or organization that objects in collection refer to.
62598f7f1d351010ab8f354f
class Card: <NEW_LINE> <INDENT> def __init__(self, message, function): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> self.function = function <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.message + ' ' + self.function <NEW_LINE> <DEDENT> def actFunction(self, player, board): <NEW_LINE>...
Represents a card. Has an effect on `Player` objects.
62598f7fe64d504609df90b8
class ImageCreator(object): <NEW_LINE> <INDENT> def __init__(self, tile_size=256, tile_overlap=1, tile_format="jpg", image_quality=0.95, resize_filter=None): <NEW_LINE> <INDENT> self.tile_size = int(tile_size) <NEW_LINE> self.tile_format = tile_format <NEW_LINE> self.tile_overlap = _clamp(int(tile_overlap), 0, 10) <NEW...
Creates Deep Zoom images.
62598f7ff7d966606f7479f8
class Encryption(Model): <NEW_LINE> <INDENT> _validation = { 'key_source': {'required': True}, } <NEW_LINE> _attribute_map = { 'services': {'key': 'services', 'type': 'EncryptionServices'}, 'key_source': {'key': 'keySource', 'type': 'str'}, 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperti...
The encryption settings on the storage account. :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices :param key_source: The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Poss...
62598f7f94891a1f408b93f7
class RemoteDigiMeshDevice(RemoteXBeeDevice): <NEW_LINE> <INDENT> def __init__(self, local_xbee_device, x64bit_addr=None, node_id=None): <NEW_LINE> <INDENT> if local_xbee_device.get_protocol() != XBeeProtocol.DIGI_MESH: <NEW_LINE> <INDENT> raise XBeeException("Invalid protocol.") <NEW_LINE> <DEDENT> super().__init__(lo...
This class represents a remote DigiMesh XBee device.
62598f7f21a7993f00c65981
class GangliaContentHandler(sax.ContentHandler): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.current = { 'grid': None, 'cluster': None, 'host': None } <NEW_LINE> sax.ContentHandler.__init__(self) <NEW_LINE> <DEDENT> def _handle_grid(self, attrs): <NEW_LINE> <INDENT> name = attrs['NAME'] <NEW_LINE> ...
Base Ganglia content handler. Does not do anything with the data, but it will execute logic to filter out data that doesn't match ``grid_expr``, ``cluster_expr``, or ``host_expr``.
62598f7f7c178a314d78cebb
class DataTemplate(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Number = None <NEW_LINE> self.String = None <NEW_LINE> self.Enum = None <NEW_LINE> self.Bool = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Number") is not None: <NEW_LINE> ...
数据模版
62598f7f38b623060ffa8aa7
class ContribDialog(BasicDialog): <NEW_LINE> <INDENT> def __init__(self, form_module, parent=None): <NEW_LINE> <INDENT> super(ContribDialog, self).__init__(form_module=form_module, parent=parent) <NEW_LINE> <DEDENT> def _setupUI(self): <NEW_LINE> <INDENT> formatLabels(self, self._linkHandler) <NEW_LINE> <DEDENT> def _s...
Add-on agnostic dialog that presents user with a number of options to support the development of the add-on.
62598f7f596a897236127681
class TwistedInternalCodeTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_install_conch(self): <NEW_LINE> <INDENT> pass
This is the unittest for the pymodbus3.internal.ptwisted code
62598f7f6aa9bd52df0d48ea
class StackUnderflow(ValueError): <NEW_LINE> <INDENT> pass
栈下溢(空栈访问)时抛出此异常, 由于操作时栈不满足需要 (如空栈弹出)可以看作参数值错误, 故继承 ValueError
62598f7f45492302aabfbeee
class DownloadDocumentInputSet(InputSet): <NEW_LINE> <INDENT> def set_APIKey(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'APIKey', value) <NEW_LINE> <DEDENT> def set_DocumentId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'DocumentId', value) <NEW_LINE> <DEDENT> def set_DownloadFormat(sel...
An InputSet with methods appropriate for specifying the inputs to the DownloadDocument Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598f7f07f4c71912baee5f
class Solution: <NEW_LINE> <INDENT> def reverse(self, head): <NEW_LINE> <INDENT> prev = None <NEW_LINE> cur = head <NEW_LINE> print(cur.val) <NEW_LINE> while cur: <NEW_LINE> <INDENT> after = cur.next <NEW_LINE> cur.next = prev <NEW_LINE> prev = cur <NEW_LINE> cur = after <NEW_LINE> <DEDENT> return prev
@param head: n @return: The new head of reversed linked list.
62598f7fd164cc6175820989
class PaintingGenreBot(WikidataBot): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(PaintingGenreBot, self).__init__() <NEW_LINE> self.use_from_page = False <NEW_LINE> self.genres = { 'Q1400853' : 'Q134307', 'Q2414609' : 'Q2864737', 'Q214127' : 'Q1047337', 'Q107425' : 'Q191163', 'Q333357' : 'Q128115'...
A bot to normalize painting genre. Uses the WikidataBot for the basics.
62598f7f21bff66bcd722679
class Node(object): <NEW_LINE> <INDENT> def __init__(self, _norm): <NEW_LINE> <INDENT> self.tokendata = {} <NEW_LINE> self.norm = _norm <NEW_LINE> self.rank = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.norm <NEW_LINE> <DEDENT> def __lt__(self, other): <NEW_LINE> <INDENT> return self.no...
Node in topologically ordered list
62598f7f8a43f66fc4bf1b91
class OriginatingOrTerminatingInTheUS(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(OriginatingOrTerminatingInTheUS, self).__init__() <NEW_LINE> self.num_of_messages = 0 <NEW_LINE> self.num_of_minutes = 0 <NEW_LINE> self.receipt_from_foreign_carriers = 0
docstring for OriginatingOrTerminatingInTheUS
62598f7f7b25080760ed6eb6
class Chance3(ChanceCommunityChest): <NEW_LINE> <INDENT> def execute(self, player): <NEW_LINE> <INDENT> self.log(player) <NEW_LINE> player.move_to('Mayfair')
Advance to Mayfair
62598f7fb830903b9686e17a
class S3ProjectTaskHRMModel(S3Model): <NEW_LINE> <INDENT> names = ("project_task_job_title", "project_task_human_resource", ) <NEW_LINE> def model(self): <NEW_LINE> <INDENT> define_table = self.define_table <NEW_LINE> task_id = self.project_task_id <NEW_LINE> tablename = "project_task_human_resource" <NEW_LINE> define_...
Project Task HRM Model This class holds the tables used to link Tasks to Human Resources - either individuals or Job Roles
62598f7ffb3f5b602db47eb9
class GoogleAuthAPISerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> access_token = serializers.CharField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ['access_token'] <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def validate_access_token(access_token): <NEW_LINE> <INDENT> id...
Handles serialization and deserialization of User objects.
62598f7f8e05c05ec3f6eb50
class Match(Base): <NEW_LINE> <INDENT> home_player = ForeignKeyField(Player, backref="matches") <NEW_LINE> away_player = ForeignKeyField(Player, backref="matches") <NEW_LINE> home_score = IntegerField(default=0) <NEW_LINE> away_score = IntegerField(default=0) <NEW_LINE> sudden_death = BooleanField(default=False) <NEW_L...
Database schema for Match table.
62598f7f4e696a045264db09
class DeVilliersGlasser01(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=4): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self._bounds = list(zip([1.0] * self.N, [100.0] * self.N)) <NEW_LINE> self.global_optimum = [[60.137, 1.371, 3.112, 1.761]] <NEW_LINE> self.fglob = 0.0 <NEW_LIN...
DeVilliers-Glasser 1 objective function. This class defines the DeVilliers-Glasser 1 [1]_ function global optimization problem. This is a multimodal minimization problem defined as follows: .. math:: f_{ ext{DeVilliersGlasser01}}(x) = \sum_{i=1}^{24} \left[ x_1x_2^{t_i} \sin(x_3t_i + x_4) - y_i ight ]^2 ...
62598f7f1d351010ab8f3551
class ShuangAnKe(BaseType): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ShuangAnKe, self).__init__() <NEW_LINE> <DEDENT> def is_this_type(self, hand_card, card_analyse): <NEW_LINE> <INDENT> ret = card_analyse.get_jiang_ke_shun_plus(hand_card.hand_card_vals) <NEW_LINE> for index in range(len(ret)):...
5) 双暗刻: 胡牌时,手上有两个暗刻。。
62598f7f0383005118f6d114
class AqsmOLED(): <NEW_LINE> <INDENT> def __init__(self,*args, **kwargs): <NEW_LINE> <INDENT> self.colWidth = 24 <NEW_LINE> self.iconOffset=3 <NEW_LINE> self.headers =["oC","LED","FLT","AIR","FDR"] <NEW_LINE> self.oled = OLEDDisp() <NEW_LINE> <DEDENT> def shutd(self): <NEW_LINE> <INDENT> self.oled.flush() <NEW_LINE> <...
This just enacapsulates the OLEDDisp to have the domain logic of this specific project All the layouting information is in here,and all what we now need is some interface by which this connects to the switchboard to get all the information
62598f7f8c3a8732951f5f59
class Status(Method): <NEW_LINE> <INDENT> interfaces = ['aggregate', 'slicemgr', 'component'] <NEW_LINE> accepts = [ Parameter(type([str]), "Slice or sliver URNs"), Parameter(type([dict]), "credentials"), Parameter(dict, "Options") ] <NEW_LINE> returns = Parameter(dict, "Status details") <NEW_LINE> def call(self, xrns,...
Get the status of a sliver @param slice_urn (string) URN of slice to allocate to
62598f7f23e79379d538bf0b
class ProposalDoesNotExistException(Exception): <NEW_LINE> <INDENT> pass
The proposal does not exist
62598f7fa4f1c619b294dfff
class Protocol(Enum): <NEW_LINE> <INDENT> ICMP = 0x01 <NEW_LINE> TCP = 0x06 <NEW_LINE> UDP = 0x11
Packet Protocol
62598f7fb5575c28eb7129d0
class SentinelChannel(Channel): <NEW_LINE> <INDENT> from_transport_options = Channel.from_transport_options + ( 'sentinels', 'service_name', 'socket_timeout', ) <NEW_LINE> @cached_property <NEW_LINE> def sentinel_pool(self): <NEW_LINE> <INDENT> params = self._connparams() <NEW_LINE> params.update({ 'sentinels': self.se...
Redis Channel for interacting with Redis Sentinel .. note:: In order to correctly configure the sentinel, this channel expects specific broker transport options to be provided via ``BROKER_TRANSPORT_OPTIONS``. Here is are sample transport options:: BROKER_TRANSPORT_OPTIONS = { 'sen...
62598f7f45492302aabfbef0
class PokemonType(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'types' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column('identifier', db.String(30), nullable=False, unique=True) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return ( "<{class_name}(" "id={self.id}, " "name=\"{se...
Pokemon type database model.
62598f7fd10714528d69d8e3
class VHF: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.df = pd.DataFrame() <NEW_LINE> <DEDENT> def info(self): <NEW_LINE> <INDENT> info = ( "VHF is an indicator which is used in identifying trend activity.\n" "\n Links:\n" "http://www.ta-guru.com/Book/TechnicalAnalysis/TechnicalIndicators/TypicalPr...
VHF -> Vertical Horizontal Filter VHF is an indicator which is used in identifying trend activity. Links: http://www.ta-guru.com/Book/TechnicalAnalysis/TechnicalIndicators/TypicalPrice.php5
62598f7ff8510a7c17d7de81
class TestMMLRaschMethods(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> rng = np.random.default_rng(5578134322131629) <NEW_LINE> difficulty = np.linspace(-1.5, 1.5, 5) <NEW_LINE> discrimination = 1.12 <NEW_LINE> thetas = rng.standard_normal(600) <NEW_LINE> syn_data = create_synthetic_irt_...
Setup synthetic data.
62598f7f76d4e153a661c625
class ASGD(Optimizer): <NEW_LINE> <INDENT> def __init__(self, params, lr=1e-2, lambd=1e-4, alpha=0.75, t0=1e6, weight_decay=0): <NEW_LINE> <INDENT> defaults = dict(lr=lr, lambd=lambd, alpha=alpha, t0=t0, weight_decay=weight_decay) <NEW_LINE> super(ASGD, self).__init__(params, defaults) <NEW_LINE> <DEDENT> def step(self...
Implements Averaged Stochastic Gradient Descent. It has been proposed in `Acceleration of stochastic approximation by averaging`_. Arguments: params (iterable): iterable of parameters to optimize or dicts defining parameter groups lr (float, optional): learning rate (default: 1e-2) lambd (float, o...
62598f7fd6c5a102081e1b5b
class Particle: <NEW_LINE> <INDENT> def __init__(self,position=[0,0],velocity=[0,0],acceleration=[0,0],mass=1,radius=1, density=1,DEPFactor=1, name='particle'): <NEW_LINE> <INDENT> self.position = array(position) <NEW_LINE> self.velocity = array(velocity) <NEW_LINE> self.acceleration = array(acceleratio...
The 2D particle object (SI units). Attributes: position : 2D numpy.array for particle's initial position (defaults to array([0,0])) velocity : 2D numpy.array for particle's initial velocity (defaults to array([0,0])) acceleration : 2D numpy.array for particle's initial acceleration (defaults to array([0,0]...
62598f7fb57a9660fecd1491
class SOC: <NEW_LINE> <INDENT> def __init__(self, socHexStr, debug=False): <NEW_LINE> <INDENT> self.dbg = debug <NEW_LINE> self.socHex = socHexStr <NEW_LINE> self.secCount = int(socHexStr, 16) <NEW_LINE> self.parseSecCount() <NEW_LINE> print("SOC: ", self.secCount, " - ", self.formatted) if self.dbg else None <NEW_LINE...
Class for second-of-century (SOC) word (32 bit unsigned) :param socHexStr: Second-of-century byte array in hex str format :type socHexStr: str :param debug: Print debug statements :type debug: bool
62598f7fb830903b9686e17b
class StopOrderMonitor(BasicMonitor): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(StopOrderMonitor, self).__init__( parent) <NEW_LINE> d = OrderedDict() <NEW_LINE> d['symbol'] = {'chinese': u"合约", 'cellType':BasicCell} <NEW_LINE> d['orderTime'] = {'chinese': u"时间", 'cellType':BasicCel...
日志监控
62598f7f498bea3a75a57538
class StrictCuratorAuthorization(CuratorAuthorization): <NEW_LINE> <INDENT> allow_public_safe_requests = False <NEW_LINE> curator_verbs = CuratorAuthorization.curator_verbs + SAFE_METHODS
The same as CuratorAuthorization, with GET / HEAD / OPTIONS requests disallowed for unauthorized users.
62598f7f71ff763f4b5e7180
class ClockProcess(multiprocessing.Process): <NEW_LINE> <INDENT> def __init__(self, interval): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.interval = interval <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> print("this time is %s" % ctime()) <NEW_LINE> sleep(self.interv...
两个函数比较重要 1.init构造函数 2.run函数
62598f7fec188e330fdf82b3
class AnonymousSurvey(): <NEW_LINE> <INDENT> def __init__(self, question): <NEW_LINE> <INDENT> self.question = question <NEW_LINE> self.responses = [] <NEW_LINE> <DEDENT> def show_question(self): <NEW_LINE> <INDENT> print(self.question) <NEW_LINE> <DEDENT> def store_response(self, new_response): <NEW_LINE> <INDENT> sel...
收集匿名调查问卷的答案
62598f7fa05bb46b3848a28f
class IntendedFinalVersion(FinalVersion): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self._namespace = ONTOLOGY_NS <NEW_LINE> self._project_id = PROJECT_ID <NEW_LINE> self._name = "IntendedFinalVersion"
Person's creation as intended last version, e.g. of a development. Labels: beabsichtigte Endversion (de) / intended final version (en)
62598f7f15fb5d323ce7e73e
class PlotStack_SG(ScatterGather): <NEW_LINE> <INDENT> appname = 'stack-plot-stack-sg' <NEW_LINE> usage = "%s [options]" % (appname) <NEW_LINE> description = "Make castro plots for set of targets" <NEW_LINE> clientclass = PlotStack <NEW_LINE> job_time = 60 <NEW_LINE> default_options = dict(ttype=defaults.common['ttype'...
Small class to generate configurations for `PlotStack` This does a quadruple nested loop over targets, profiles, j-factor priors and specs
62598f7fdc8b845886d52fca
class KLDivergenceLayer(Layer): <NEW_LINE> <INDENT> def _init_(self,*args,**kwargs): <NEW_LINE> <INDENT> self.is_placeholder=True <NEW_LINE> super(KLDivergenceLayer,self)._init_(*args,**kwargs) <NEW_LINE> <DEDENT> def call(self,inputs): <NEW_LINE> <INDENT> Mu,LogSigma=inputs <NEW_LINE> klbatch=-0.5*(1*(2/784))*K.sum(1+...
Custom KL loss layer
62598f7ffbf16365ca793abd
class Normalizer(): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> @abc.abstractmethod <NEW_LINE> def normalize(self, X): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def unnormalize(self, X): <NEW_LINE> <INDENT> raise NotImplementedError()
Abstract Base Class for Normalizers
62598f7fc432627299fa29e3
class ConnectivitySpec(object): <NEW_LINE> <INDENT> pass
Specifies an arbitrary connection between (groups of) layers in a `NetworkGraph`. This warrants its own class because any of the layers may have an arbitrary number of inputs and outputs.
62598f7f596a897236127685
class MetadataStatement(JsonWebToken): <NEW_LINE> <INDENT> c_param = JsonWebToken.c_param.copy() <NEW_LINE> c_param.update({ "signing_keys": SINGLE_OPTIONAL_JSON, 'signing_keys_uri': SINGLE_OPTIONAL_STRING, 'metadata_statements': OPTIONAL_MESSAGE, 'metadata_statement_uris': OPTIONAL_MESSAGE, 'signed_jwks_uri': SINGLE_O...
A base class for metadata statements based on JSON web token
62598f7f30c21e258be9821e
class User(Chat): <NEW_LINE> <INDENT> def __init__(self, raw, bot): <NEW_LINE> <INDENT> super(User, self).__init__(raw, bot) <NEW_LINE> <DEDENT> @property <NEW_LINE> def remark_name(self): <NEW_LINE> <INDENT> return self.raw.get('RemarkName') <NEW_LINE> <DEDENT> @property <NEW_LINE> def sex(self): <NEW_LINE> <INDENT> r...
好友(:class:`Friend`)、群聊成员(:class:`Member`),和公众号(:class:`MP`) 的基础类
62598f7fb5575c28eb7129d1
class GameWithObjects(GameMode): <NEW_LINE> <INDENT> def __init__(self, objects=[]): <NEW_LINE> <INDENT> GameMode.__init__(self) <NEW_LINE> self.objects = objects <NEW_LINE> <DEDENT> def locate(self, pos): <NEW_LINE> <INDENT> return [obj for obj in self.objects if obj.rect.collidepoint(pos)] <NEW_LINE> <DEDENT> def Eve...
Game mode with active objects
62598f7fa4f1c619b294e001
class CarTagItem(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Serial = None <NEW_LINE> self.Brand = None <NEW_LINE> self.Type = None <NEW_LINE> self.Color = None <NEW_LINE> self.Confidence = None <NEW_LINE> self.Year = None <NEW_LINE> self.CarLocation = None <NEW_LINE> self.PlateCont...
车辆属性识别的结果
62598f7f45492302aabfbef2
class TestSubnetsSubnetPoolsExtended(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 testSubnetsSubnetPoolsExtended(self): <NEW_LINE> <INDENT> pass
SubnetsSubnetPoolsExtended unit test stubs
62598f7f5f7d997b871f90e2
class SetOwnerSubCommand(CommonContainerSubCommand): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super( DaosCommandBase.ContainerSubCommand.SetOwnerSubCommand, self).__init__("set-owner") <NEW_LINE> self.user = FormattedParameter("--user={}") <NEW_LINE> self.group = FormattedParameter("--group={}")
Defines an object for the daos container set-owner command.
62598f7fd53ae8145f917ea6
class HTTPInvalidHeader(HTTPBadRequest): <NEW_LINE> <INDENT> def __init__(self, msg, header_name, **kwargs): <NEW_LINE> <INDENT> description = ('The value provided for the {0} header is ' 'invalid. {1}') <NEW_LINE> description = description.format(header_name, msg) <NEW_LINE> super(HTTPInvalidHeader, self).__init__('In...
A header in the request is invalid. Inherits from ``HTTPBadRequest``. Args: msg (str): A description of why the value is invalid. header_name (str): The name of the header. kwargs (optional): Same as for ``HTTPError``.
62598f7f8a349b6b43685c59
class DeleteVip(quantumv20.DeleteCommand): <NEW_LINE> <INDENT> resource = 'vip' <NEW_LINE> log = logging.getLogger(__name__ + '.DeleteVip')
Delete a given vip.
62598f7f82261d6c5272fbde
class _FocusPoint(object): <NEW_LINE> <INDENT> def __init__(self, pos, axis, factor, extent): <NEW_LINE> <INDENT> self.pos = pos <NEW_LINE> self.axis = axis.lower() <NEW_LINE> self.factor = factor <NEW_LINE> self.extent = extent <NEW_LINE> if self.pos > 1.0 or self.pos < 0: <NEW_LINE> <INDENT> raise ValueError('`pos` m...
Return a transformed, uniform grid, focused in the x- or y-direction. This class may be called with a uniform grid, with limits from [0, 1]. To create a focused grid in the ``axis`` direction centered about ``pos``. The output grid is also uniform from [0, 1] in both x and y. Parameters ---------- pos : float Rel...
62598f7f15baa72349461994
class ExpertProfileDetail(APIView): <NEW_LINE> <INDENT> permission_classes = (IsSuperUser,) <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> expert_profile = get_object_or_404( ExpertProfile, expert=self.kwargs['pk'], review_status__in=[ExpertProfileReviewStatus.SUBMITTED_FOR_REVIEW.value, Expert...
API for viewing the Expert Profile Detail.
62598f7fd99f1b3c44d050c3
class GPSLoggerView(HomeAssistantView): <NEW_LINE> <INDENT> url = '/api/gpslogger' <NEW_LINE> name = 'api:gpslogger' <NEW_LINE> def __init__(self, async_see, config): <NEW_LINE> <INDENT> self.async_see = async_see <NEW_LINE> self._password = config.get(CONF_PASSWORD) <NEW_LINE> self.requires_auth = self._password is No...
View to handle GPSLogger requests.
62598f7fec188e330fdf82b5
@register <NEW_LINE> class Select(_Selection): <NEW_LINE> <INDENT> _view_name = Unicode('SelectView').tag(sync=True) <NEW_LINE> _model_name = Unicode('SelectModel').tag(sync=True) <NEW_LINE> rows = Int(5, help="The number of rows to display.").tag(sync=True)
Listbox that only allows one item to be selected at any given time.
62598f7fa05bb46b3848a291
class Tikz (BaseLaTeXNamedContainer): <NEW_LINE> <INDENT> def __init__(self, options=None, argument=None, **kwargs): <NEW_LINE> <INDENT> packages = [Package('tikz')] <NEW_LINE> BaseLaTeXNamedContainer.__init__(self,'tikzpicture', options, argument, packages=packages, **kwargs)
Enumerate class for numbered list
62598f7f1f5feb6acb16264a
class TcpQuery_b(modbus_tcp.TcpQuery,modbus.Query): <NEW_LINE> <INDENT> last_transaction_id = 0 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> modbus.Query.__init__(self) <NEW_LINE> self._request_mbap = TcpMbap_b() <NEW_LINE> self._response_mbap = TcpMbap_b() <NEW_LINE> <DEDENT> def get_transaction_id_b(self): <NEW...
Subclass of a Query. Adds the Modbus TCP specific part of the protocol
62598f7f73bcbd0ca4bc9c67