code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Column(MappedSequence): <NEW_LINE> <INDENT> def __init__(self, index, name, data_type, rows, row_names=None): <NEW_LINE> <INDENT> self._index = index <NEW_LINE> self._name = name <NEW_LINE> self._data_type = data_type <NEW_LINE> self._rows = rows <NEW_LINE> self._row_names = row_names <NEW_LINE> <DEDENT> @propert...
Proxy access to column data. Instances of :class:`Column` should not be constructed directly. They are created by :class:`.Table` instances and are unique to them. Columns are implemented as subclass of :class:`.MappedSequence`. They deviate from the underlying implementation in that loading of their data is deferred ...
62598f1a187af65679d292a1
class TestTplink4DeviceScanner(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.hass = get_test_home_assistant() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.hass.stop() <NEW_LINE> try: <NEW_LINE> <INDENT> os.remove(self.hass.config.path(device_tracker.YAML_DEVICES))...
Tests for the Tplink4DeviceScanner class.
62598f1a283ffb24f3cf25dc
class EyeTracking(): <NEW_LINE> <INDENT> def __init__(self, buffersync): <NEW_LINE> <INDENT> self.buffersync = buffersync <NEW_LINE> <DEDENT> def start(self, peer): <NEW_LINE> <INDENT> self.sock = net_utils.mksock(peer) <NEW_LINE> self.sock.setblocking(0) <NEW_LINE> self.keepalive = KeepAlive(self.sock, peer, 'data') <...
Read eye-tracking position from data stream
62598f1a9f28863672817532
class Polynomial: <NEW_LINE> <INDENT> terms: [Monomial, ] = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass
A collection of polynomials
62598f1a099cdd3c63674a73
class TimeLogicAdapter(LogicAdapter): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(TimeLogicAdapter, self).__init__(**kwargs) <NEW_LINE> from nltk import NaiveBayesClassifier <NEW_LINE> self.positive = [ 'what time is it', 'do you know the time', 'do you know what time it is', 'what is th...
The TimeLogicAdapter returns the current time.
62598f1aec188e330fdf75f1
class Cipher: <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> count = 0 <NEW_LINE> for _ in self.value: <NEW_LINE> <INDENT> count += 1 <NEW_LINE> <DEDENT> return count <NEW_LINE> <DEDENT> def shift(self, shift_number): <NEW...
main class- ceaser cipher
62598f1a187af65679d292a2
class BoyScout(Analysis): <NEW_LINE> <INDENT> def __init__(self, cookiesize=1): <NEW_LINE> <INDENT> self.arch = None <NEW_LINE> self.endianness = None <NEW_LINE> self.votes = None <NEW_LINE> self.cookiesize = cookiesize <NEW_LINE> self._reconnoiter() <NEW_LINE> <DEDENT> def _reconnoiter(self): <NEW_LINE> <INDENT> strid...
Try to determine the architecture and endieness of a binary blob
62598f1afbf16365ca792ddb
class GroupsBaseTestClass(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.username = 'X' <NEW_LINE> cls.password = 'XX' <NEW_LINE> cls.admin = User(username=cls.username, email='X@X.com') <NEW_LINE> cls.admin.set_password(cls.password) <NEW_LINE> cls.admin.save() <NEW...
Base class for testing Groups UI views
62598f1a283ffb24f3cf25de
class BeerViewSet(CacheResponseMixin, viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Beer.objects.all() <NEW_LINE> serializer_class = BeerSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly, ) <NEW_LINE> lookup_field = 'slug' <NEW_LINE> page_size = 25 <NEW_LINE> paginate_by_param =...
Basic ViewSet for Beer API endpoints.
62598f1a50812a4eaa62028a
class ByteChomper: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data if isinstance(data, bytes) else bytes() <NEW_LINE> self.pos = 0 <NEW_LINE> <DEDENT> def get_field(self, num_bytes): <NEW_LINE> <INDENT> if not self.data: <NEW_LINE> <INDENT> return bytes() <NEW_LINE> <DEDENT> field = s...
Class for splitting up data strings according to different-sized fields
62598f1a4c34283577619011
class UnroutableError(AMQPChannelError): <NEW_LINE> <INDENT> def __init__(self, messages): <NEW_LINE> <INDENT> super(UnroutableError, self).__init__( "%s unroutable message(s) returned" % (len(messages))) <NEW_LINE> self.messages = messages <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s: %i unro...
Exception containing one or more unroutable messages returned by broker via Basic.Return. Used by BlockingChannel. In publisher-acknowledgements mode, this is raised upon receipt of Basic.Ack from broker; in the event of Basic.Nack from broker, `NackError` is raised instead
62598f1a9f28863672817535
class ProIspPlaySumInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Name = None <NEW_LINE> self.TotalFlux = None <NEW_LINE> self.TotalRequest = None <NEW_LINE> self.AvgFluxPerSecond = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Name = params.get...
获取省份/运营商的播放信息
62598f1a091ae35668703945
class QMPError(Exception): <NEW_LINE> <INDENT> pass
Abstract error class for all errors originating from this package.
62598f1a97e22403b3839c1f
class GefAlias(gdb.Command): <NEW_LINE> <INDENT> def __init__(self, alias, command, completer_class=gdb.COMPLETE_NONE, command_class=gdb.COMMAND_NONE): <NEW_LINE> <INDENT> p = command.split() <NEW_LINE> if not p: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if list(filter(lambda x: x._alias == alias, __aliases__)): <...
Simple aliasing wrapper because GDB doesn't do what it should.
62598f1afbf16365ca792ddd
class CollegeHome(Home): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def at_home(cls): <NEW_LINE> <INDENT> CollegeStudent.learn() <NEW_LINE> CollegeStudent.play()
Class for a home of college student Methods: at_home
62598f1a3617ad0b5ee04e6b
class CustomSerial(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, com, baud, root, context): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.s = serial.Serial(com, baud) <NEW_LINE> self.root = root <NEW_LINE> self.context = context <NEW_LINE> self.pointData = {} <NEW_LINE> self.seriesData...
自定义串口类
62598f1a0fa83653e46f3c21
class SubversionClient(AbstractVcsClient): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SubversionClient, self).__init__(name='Subversion', command='svn') <NEW_LINE> <DEDENT> def commit(self, message): <NEW_LINE> <INDENT> self._svn('commit', '-m', message) <NEW_LINE> <DEDENT> def detect(self): <NEW...
Subversion vcs client.
62598f1a099cdd3c63674a75
class VirtualPrivateCloud(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.VpcId = None <NEW_LINE> self.SubnetId = None <NEW_LINE> self.AsVpcGateway = None <NEW_LINE> self.PrivateIpAddresses = None <NEW_LINE> self.Ipv6AddressCount = None <NEW_LINE> <DEDENT> def _deserialize(self, params)...
Describes information on VPC, including subnets, IP addresses, etc.
62598f1aab23a570cc2d440b
class DirectTankHeatingSource(BSElement): <NEW_LINE> <INDENT> class Other(OtherType): <NEW_LINE> <INDENT> pass
Direct source of heat for hot water tank.
62598f1a97e22403b3839c21
class LinearDecay(object): <NEW_LINE> <INDENT> def __init__(self, start, saturate, decay_factor): <NEW_LINE> <INDENT> if isinstance(decay_factor, str): <NEW_LINE> <INDENT> decay_factor = float(decay_factor) <NEW_LINE> <DEDENT> if isinstance(start, str): <NEW_LINE> <INDENT> start = float(start) <NEW_LINE> <DEDENT> if is...
This is a callback for the SGD algorithm rather than the Train object. This anneals the learning rate to decay_factor times of the initial value during time start till saturate. Parameters ---------- start : int The step at which to start decreasing the learning rate saturate : int The step at which to stop de...
62598f1b0fa83653e46f3c23
class ConsumableString: <NEW_LINE> <INDENT> def __init__(self, string): <NEW_LINE> <INDENT> self.__this_string = string <NEW_LINE> self.__setup() <NEW_LINE> <DEDENT> def __setup(self): <NEW_LINE> <INDENT> if len(self.__this_string) > 0: <NEW_LINE> <INDENT> self.this = self.__this_string[0] <NEW_LINE> <DEDENT> else: <NE...
A simple string implementation with extras to help with parsing. This will contain the string to be parsed. or string in. There will only be one of these for each processed line.
62598f1b099cdd3c63674a76
class ContestSubmissionsHandler(BaseHandler): <NEW_LINE> <INDENT> @require_permission(BaseHandler.AUTHENTICATED) <NEW_LINE> def get(self, contest_id): <NEW_LINE> <INDENT> contest = self.safe_get_item(Contest, contest_id) <NEW_LINE> self.contest = contest <NEW_LINE> query = self.sql_session.query(Submission).join(Task) ...
Shows all submissions for this contest.
62598f1bfbf16365ca792de1
class Exporter(core.Loader): <NEW_LINE> <INDENT> dependencies = set([Downloader]) <NEW_LINE> saver = CifAtomSaver <NEW_LINE> def filename(self, pdb, **kwargs): <NEW_LINE> <INDENT> return os.path.join(self.config['locations']['fr3d_root'], "PDBFiles", pdb + ".cifatoms") <NEW_LINE> <DEDENT> def has_data(self, entry, **kw...
Will export files from the mmCIF format to a cifatom format readable by matlab programs.
62598f1b4c34283577619017
class SpanEncoder(torch.nn.Module): <NEW_LINE> <INDENT> def __init__( self, words_encoding_dim: int, hidden_dim: int, ffnn_dim: int, out_dim: int, hidden_depth: int = 2, attention_heads: int = 2, soft_dropout_rate: float = 0.2, hard_dropout_rate: float = 0.2, external_boundaries: bool = False, ): <NEW_LINE> <INDENT> su...
Text span embeddings
62598f1b9f2886367281753b
class GensimWord2VecVectorizer(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, size=100, alpha=0.025, window=5, min_count=5, max_vocab_size=None, sample=0.001, seed=1, workers=3, min_alpha=0.0001, sg=0, hs=0, negative=5, ns_exponent=0.75, cbow_mean=1, hashfxn=hash, iter=5, null_word=0, trim_rul...
Word vectors are averaged across to create the document-level vectors/features. gensim's own gensim.sklearn_api.W2VTransformer doesn't support out of vocabulary words, hence we roll out our own. All the parameters are gensim.models.Word2Vec's parameters. https://radimrehurek.com/gensim/models/word2vec.html#gensim.mo...
62598f1bd8ef3951e32c74f6
class phpobject(object): <NEW_LINE> <INDENT> __slots__ = ('__name__', '__php_vars__') <NEW_LINE> def __init__(self, name, d=None): <NEW_LINE> <INDENT> if d is None: <NEW_LINE> <INDENT> d = {} <NEW_LINE> <DEDENT> object.__setattr__(self, '__name__', name) <NEW_LINE> object.__setattr__(self, '__php_vars__', d) <NEW_LINE>...
Simple representation for PHP objects. This is used
62598f1bad47b63b2c5a6552
class MediaFinished(MediaEvent): <NEW_LINE> <INDENT> pass
Occurs when the media has finished playing.
62598f1b9f2886367281753c
class Incident: <NEW_LINE> <INDENT> def __init__(self, incident_id, comment): <NEW_LINE> <INDENT> self.incident_id = incident_id <NEW_LINE> self.comment = comment
Base class for incidents.
62598f1b7cff6e4e811b4730
class CommentViewSet(_ViewMixin, DeveloperErrorViewMixin, ViewSet): <NEW_LINE> <INDENT> lookup_field = "comment_id" <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> form = CommentListGetForm(request.GET) <NEW_LINE> if not form.is_valid(): <NEW_LINE> <INDENT> raise ValidationError(form.errors) <NEW_LINE> <DEDENT>...
**Use Cases** Retrieve the list of comments in a thread, create a comment, or modify or delete an existing comment. **Example Requests**: GET /api/discussion/v1/comments/?thread_id=0123456789abcdef01234567 POST /api/discussion/v1/comments/ { "thread_id": "0123456789abcdef01234567", ...
62598f1b26238365f5fab8d0
class UnauthorizedError(Exception): <NEW_LINE> <INDENT> pass
UnauthorizedError Exception.
62598f1b3617ad0b5ee04e75
class HydraPlugin(PluginBase): <NEW_LINE> <INDENT> def __init__(self, *arg, **kwargs): <NEW_LINE> <INDENT> super().__init__(*arg, **kwargs) <NEW_LINE> self.id = "Hydra" <NEW_LINE> self.name = "Hydra XML Output Plugin" <NEW_LINE> self.plugin_version = "0.0.1" <NEW_LINE> self.version = "7.5" <NEW_LINE> self.options = Non...
Example plugin to parse hydra output.
62598f1b50812a4eaa620290
class Loss_Reweighting_Base_Class(object): <NEW_LINE> <INDENT> def __init__(self, frac_pos2neg, frac_neg2pos, clf = None): <NEW_LINE> <INDENT> if frac_pos2neg is not None and frac_neg2pos is not None: <NEW_LINE> <INDENT> if frac_pos2neg + frac_neg2pos >= 1: <NEW_LINE> <INDENT> raise Exception("frac_pos2neg + frac_neg2p...
This class provides a base class for the following models: Liu16 - reweights the loss function using probabilities Nat13unbiased - Natarajan et al. (2013) first method Referred to as "unbiased loss function" Nat13 - Natarajan et al. (2013) second method Referred to as "alpha weighted loss function" Parameters ---...
62598f1b091ae35668703951
class FlowGoRelativeViscosityBubblesModelRigid(pyflowgo.base.flowgo_base_relative_viscosity_bubbles_model. FlowGoBaseRelativeViscosityBubblesModel): <NEW_LINE> <INDENT> def __init__(self, vesicle_fraction_model=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if vesicle_fraction_model == None: <NEW_LINE> <INDEN...
This methods permits to calculate the effect of undeformable bubbles on viscosity: they act as rigid spheres and increase bulk viscosity: Input data ----------- The vesicle fraction in the json file containing Variables ----------- The vesicle fraction Returns ------------ The effect of elongated bubbles on viscosit...
62598f1b31939e2706ed1106
class SerialFlashUnknownJedec(SerialFlashNotSupported): <NEW_LINE> <INDENT> def __init__(self, jedec): <NEW_LINE> <INDENT> SerialFlashNotSupported.__init__(self, "Unknown flash device: %s" % hexlify(jedec))
Exception thrown when a JEDEC identifier is not recognized
62598f1bc4546d3d9def690a
class BSON(str): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_dict(cls, dct, check_keys=False): <NEW_LINE> <INDENT> return cls(_dict_to_bson(dct, check_keys)) <NEW_LINE> <DEDENT> def to_dict(self, as_class=dict): <NEW_LINE> <INDENT> (document, _) = _bson_to_dict(self, as_class) <NEW_LINE> return document
BSON data. Represents binary data storable in and retrievable from Mongo.
62598f1bec188e330fdf7601
class TimeUnique(TimeFormat): <NEW_LINE> <INDENT> pass
Base class for time formats that can uniquely create a time object without requiring an explicit format specifier. This class does nothing but provide inheritance to identify a class as unique.
62598f1bd8ef3951e32c74fa
class PecanPluginImpl(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.log = py.log.Producer('pecan-%s' % self.name) <NEW_LINE> if not config.option.debug: <NEW_LINE> <INDENT> py.log.setconsumer(self.log._keywords, None) <NEW_LINE> <DEDENT> self.log('Crea...
Actual implementation of the Pecan plugin. This ensures the proper environment is configured for each session type.
62598f1bad47b63b2c5a655b
class Executable(_Generative): <NEW_LINE> <INDENT> supports_execution = True <NEW_LINE> _execution_options = util.immutabledict() <NEW_LINE> _bind = None <NEW_LINE> @_generative <NEW_LINE> def execution_options(self, **kw): <NEW_LINE> <INDENT> if 'isolation_level' in kw: <NEW_LINE> <INDENT> raise exc.ArgumentError( "'i...
Mark a ClauseElement as supporting execution. :class:`.Executable` is a superclass for all "statement" types of objects, including :func:`select`, :func:`delete`, :func:`update`, :func:`insert`, :func:`text`.
62598f1bab23a570cc2d4413
class OneByOneConv(nn.Module): <NEW_LINE> <INDENT> def __init__(self, dim): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.dim = dim <NEW_LINE> W, _ = sp.linalg.qr(np.random.randn(dim, dim)) <NEW_LINE> P, L, U = sp.linalg.lu(W) <NEW_LINE> self.P = torch.tensor(P, dtype = torch.float) <NEW_LINE> self.L = nn.Para...
Invertible 1x1 convolution. [Kingma and Dhariwal, 2018.]
62598f1b4c34283577619023
class Middleware(WSGIApp): <NEW_LINE> <INDENT> def __init__(self, engineio_app, wsgi_app=None, engineio_path='engine.io'): <NEW_LINE> <INDENT> super(Middleware, self).__init__(engineio_app, wsgi_app, engineio_path=engineio_path)
This class has been renamed to ``WSGIApp`` and is now deprecated.
62598f1b31939e2706ed110a
class MultipleFieldsDialog(QtWidgets.QDialog): <NEW_LINE> <INDENT> def __init__(self, labels=None, title="Demo", masks=None, parent=None): <NEW_LINE> <INDENT> super(MultipleFieldsDialog, self).__init__(None, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) <NEW_LINE> if parent is None: <NEW_LINE> <INDENT> ra...
Dialog with multiple fields stored in a dict, with the label being the key and the entry being the corresponding value
62598f1bd8ef3951e32c74fd
class FC(TensorToTensorLayer): <NEW_LINE> <INDENT> def __init__(self, num_units_out, activation=tf.nn.relu, initializer=None, input_keep_prob=None, output_keep_prob=None, normalization_fn=None, name=None): <NEW_LINE> <INDENT> self.set_constructor_args('td.FC', *get_local_arguments(FC.__init__, True)) <NEW_LINE> if not ...
A fully connected network layer. Fully connected layers require a `float32` vector (i.e. 1D tensor) as input, and build `float32` vector outputs. Layers can be applied to multiple inputs, provided they all have the same shape. For example, to apply the same hidden layer to two different input fields: ```python layer ...
62598f1b4c34283577619027
class TestInlineResponse2001Meta(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 testInlineResponse2001Meta(self): <NEW_LINE> <INDENT> pass
InlineResponse2001Meta unit test stubs
62598f1b0fa83653e46f3c37
class Plate: <NEW_LINE> <INDENT> def __init__(self, region, image=None): <NEW_LINE> <INDENT> self._image = image <NEW_LINE> self._region = region <NEW_LINE> self.segments = [] <NEW_LINE> self.guess = [] <NEW_LINE> if image is None: <NEW_LINE> <INDENT> self._image = region.image <NEW_LINE> <DEDENT> <DEDENT> @property <N...
Information about detected plate
62598f1bab23a570cc2d4416
class Command(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( 'domain', help='The custom domain disabled.', type=str, ) <NEW_LINE> <DEDENT> @transaction.atomic <NEW_LINE> def handle(self, *args, **options): <NEW_LINE> <INDENT> domain = options['domain'] <NEW_L...
Disable a custom domain Also requires running `disable_custom_domain` on AMC
62598f1b7cff6e4e811b4740
class SvTapStep(StateVariable): <NEW_LINE> <INDENT> def __init__(self, position=0.0, TapChanger=None, *args, **kw_args): <NEW_LINE> <INDENT> self.position = position <NEW_LINE> self._TapChanger = None <NEW_LINE> self.TapChanger = TapChanger <NEW_LINE> super(SvTapStep, self).__init__(*args, **kw_args) <NEW_LINE> <DEDENT...
State variable for transformer tap step. This class is to be used for taps of LTC (load tap changing) transformers, not fixed tap transformers. Normally a profile specifies only one of the attributes 'position'or 'tapRatio'.State variable for transformer tap step. This class is to be used for taps of LTC (load...
62598f1bc4546d3d9def6910
class Permiso(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'Permiso' <NEW_LINE> idPermiso = db.Column(db.Integer, primary_key=True,nullable=False) <NEW_LINE> nombre = db.Column(db.String(45), unique=True,nullable=False) <NEW_LINE> descripcion = db.Column(db.String(150)) <NEW_LINE> def __init__(self, nombre=None, desc...
Modelo de Permiso
62598f1b50812a4eaa620297
class BulkOutMessage(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def build_array(btag, eom, chunk): <NEW_LINE> <INDENT> size = len(chunk) <NEW_LINE> return struct.pack('BBBx', MSGID.DEV_DEP_MSG_OUT, btag, ~btag & 0xFF) + struct.pack("<LBxxx", size, eom) + chunk + b'\0...
The Host uses the Bulk-OUT endpoint to send USBTMC command messages to the device.
62598f1bfbf16365ca792df7
class Type(IntEnum): <NEW_LINE> <INDENT> unknown = -1 <NEW_LINE> none = 0 <NEW_LINE> relocatable = 1 <NEW_LINE> executable = 2 <NEW_LINE> shared = 3 <NEW_LINE> core = 4 <NEW_LINE> os = 0xfe00 <NEW_LINE> proc = 0xff00
Describes the object type.
62598f1b3617ad0b5ee04e85
class TimeStamp(DateTime): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(TimeStamp, self).__init__(*args, **kwargs) <NEW_LINE> self.sqlalchemy_type = types.TIMESTAMP(timezone=True) <NEW_LINE> <DEDENT> def getter_format_value(self, value): <NEW_LINE> <INDENT> value = convert_string_t...
TimeStamp column :: from datetime import datetime from anyblok.declarations import Declarations from anyblok.column import DateTime @Declarations.register(Declarations.Model) class Test: x = TimeStamp(default=datetime.now)
62598f1bad47b63b2c5a6566
class PassportElementError(base.TelegramObject): <NEW_LINE> <INDENT> source: base.String = fields.Field() <NEW_LINE> type: base.String = fields.Field() <NEW_LINE> message: base.String = fields.Field()
This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. https://core.telegram.org/bots/api#passportelementerror
62598f1bab23a570cc2d4418
class Timer(object): <NEW_LINE> <INDENT> service = None <NEW_LINE> next = None <NEW_LINE> fn = None <NEW_LINE> active = True <NEW_LINE> def __init__(self, due=None, context=None): <NEW_LINE> <INDENT> self.due = due <NEW_LINE> self.context = context <NEW_LINE> <DEDENT> def registered(self, registry): <NEW_LINE> <INDENT>...
Base class for timers which fire at the specified time
62598f1b7cff6e4e811b4744
class emp_getResInfo_info(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.emp = urlbase.list()[0] <NEW_LINE> test_data.ua_role_insert(1) <NEW_LINE> test_data.ua_emp_insert(1) <NEW_LINE> self.empid =test_data.ua_emp_search(value='id',type='β') <NEW_LINE> test_data.ua_roleemp_insert(empi...
添加编辑角色授权信息接口
62598f1bfbf16365ca792df9
class BinarySTLWriter(ASCIISTLWriter): <NEW_LINE> <INDENT> def __init__(self, stream): <NEW_LINE> <INDENT> self.counter = 0 <NEW_LINE> super(Binary_STL_Writer, self).__init__(stream) <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> self._write_header() <NEW_LINE> <DEDENT> def _write_header(self): <NEW_LINE> <IN...
Export 3D objects build of 3 or 4 vertices as binary STL file.
62598f1bad47b63b2c5a6569
class Database: <NEW_LINE> <INDENT> def __init__(self, clear_exceptions=True): <NEW_LINE> <INDENT> self.clear = clear_exceptions <NEW_LINE> self.db = pymongo.MongoClient(settings.MONGO_URI) <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> return self.db.__enter__()['ldch'] <NEW_LINE> <DEDENT> def __exit__(s...
Classe de acesso ao banco.
62598f1b26238365f5fab8e6
class T10ACSHelper(): <NEW_LINE> <INDENT> def __init__(self, user, password, key): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.user = user <NEW_LINE> self.password = password <NEW_LINE> self.__login() <NEW_LINE> self.clients = {} <NEW_LINE> <DEDENT> def __login(self): <NEW_LINE> <INDENT> payload = {'login':self....
Handles connections to Appcelerator Cloud Services and does push notifications
62598f1b4c34283577619032
class Profile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) <NEW_LINE> name = models.CharField(max_length=150) <NEW_LINE> email = models.EmailField(blank=True, null=True) <NEW_LINE> gender_CHOICES = ( ('male', 'MALE'), ('female', 'FEMALE') ) <NEW_LINE> ...
Профиль пользователя.
62598f1b50812a4eaa62029b
class WelcomeController(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> return jsonify({'result': 'Welcome to Ease Mart API!'})
Flask-resftul resource for returning a welcome response. :Example: >>> from flask import Flask >>> from flask_restful import Api >>> from app import default_config # Create flask app, config, and resftul api, then add WelcomeController route >>> app = Flask(__name__) >>> app.config.update(default_config) >>> api = Api(...
62598f1b091ae35668703967
class Attack(ABC): <NEW_LINE> <INDENT> def __init__(self, model=None, criterion=Misclassification()): <NEW_LINE> <INDENT> self._default_model = model <NEW_LINE> self._default_criterion = criterion <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def __call__(self, input_or_adv, label=None, unpack=True, **kwargs): <NEW_LI...
Abstract base class for adversarial attacks. The :class:`Attack` class represents an adversarial attack that searches for adversarial examples. It should be subclassed when implementing new attacks. Parameters ---------- model : :class:`adversarial.Model` The default model to which the attack is applied if it is ...
62598f1b0fa83653e46f3c41
class AutoUserSpecification(Model): <NEW_LINE> <INDENT> _attribute_map = { 'scope': {'key': 'scope', 'type': 'AutoUserScope'}, 'elevation_level': {'key': 'elevationLevel', 'type': 'ElevationLevel'}, } <NEW_LINE> def __init__(self, scope=None, elevation_level=None): <NEW_LINE> <INDENT> self.scope = scope <NEW_LINE> self...
Specifies the parameters for the auto user that runs a task on the Batch service. :param scope: The scope for the auto user. Values are: pool - specifies that the task runs as the common auto user account which is created on every node in a pool. task - specifies that the service should create a new user for the ta...
62598f1bad47b63b2c5a656c
class Parser: <NEW_LINE> <INDENT> def parse_data(self): <NEW_LINE> <INDENT> name = './data/data.csv' <NEW_LINE> f = open(name, 'w', encoding='UTF-8') <NEW_LINE> writer = csv.writer(f, delimiter='\t') <NEW_LINE> writer.writerow( ['Метро', 'Адрес', 'Планировка', 'Площадь, м2', 'Этаж', 'Этажность здания', 'Цена, руб.', 'О...
Класс объекта считывающего и выбирающего данные из файла, преобразующего в табличный формат сохраненный в csv
62598f1cad47b63b2c5a656e
@dataclass(frozen=True) <NEW_LINE> class Forecast(BaseModel, _ForecastDefaultsBase, _ForecastBase): <NEW_LINE> <INDENT> __blurb__: ClassVar[str] = 'Forecast' <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> __set_units__(self) <NEW_LINE> __site_or_agg__(self) <NEW_LINE> __check_interval_params__(self) <NEW_LINE>...
A class to hold metadata for Forecast objects. Parameters ---------- name : str Name of the Forecast issue_time_of_day : datetime.time The time of day that a forecast run is issued, e.g. 00:30. For forecast runs issued multiple times within one day (e.g. hourly), this specifies the first issue time of ...
62598f1cad47b63b2c5a656f
class triang_gen(rv_continuous): <NEW_LINE> <INDENT> def _rvs(self, c): <NEW_LINE> <INDENT> return self._random_state.triangular(0, c, 1, self._size) <NEW_LINE> <DEDENT> def _argcheck(self, c): <NEW_LINE> <INDENT> return (c >= 0) & (c <= 1) <NEW_LINE> <DEDENT> def _pdf(self, x, c): <NEW_LINE> <INDENT> r = _lazyselect([...
A triangular continuous random variable. %(before_notes)s Notes ----- The triangular distribution can be represented with an up-sloping line from ``loc`` to ``(loc + c*scale)`` and then downsloping for ``(loc + c*scale)`` to ``(loc+scale)``. `triang` takes :math:`c` as a shape parameter. %(after_notes)s The standa...
62598f1c3617ad0b5ee04e8f
class TaskListCommand(object): <NEW_LINE> <INDENT> name = 'list' <NEW_LINE> def __init__(self, parser): <NEW_LINE> <INDENT> parser.add_argument('--status', '-s', required=False, nargs='*', choices=['READY', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLED', 'UNKNOWN'], help=('List tasks only with a given status')) <NEW_LIN...
Lists the tasks submitted recently.
62598f1c099cdd3c63674a87
class Solicitud(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'Solicitud' <NEW_LINE> idSolicitud = db.Column(db.Integer, primary_key=True, nullable=False) <NEW_LINE> nombre = db.Column(db.String(45), unique=True, nullable=False) <NEW_LINE> descripcion = db.Column(db.String(150)) <NEW_LINE> estado = db.Column(db.String...
Modelo de Solicitud
62598f1cad47b63b2c5a6571
class FormatDataResponsePDU(ClipboardPDU): <NEW_LINE> <INDENT> def __init__(self, requestedFormatData, isSuccessful=True): <NEW_LINE> <INDENT> flags = ClipboardMessageFlags.CB_RESPONSE_OK if isSuccessful else ClipboardMessageFlags.CB_RESPONSE_FAIL <NEW_LINE> ClipboardPDU.__init__(self, ClipboardMessageType.CB_FORMAT_DA...
https://msdn.microsoft.com/en-us/library/cc241123.aspx
62598f1cab23a570cc2d441d
class Barrier(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def __init__(self, observe_dates: Optional[List[dt.date]] = None): <NEW_LINE> <INDENT> self.observe_dates = observe_dates or [] <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def observe(self, date: dt.date, price: Numerical) -> bool: <NEW_LINE> <INDENT> pas...
barrier base class
62598f1c31939e2706ed1113
class StatelessLSTM(LSTMBase): <NEW_LINE> <INDENT> def forward(self, c, h, x): <NEW_LINE> <INDENT> if self.upward.W.array is None: <NEW_LINE> <INDENT> in_size = x.size // x.shape[0] <NEW_LINE> with chainer.using_device(self.device): <NEW_LINE> <INDENT> self.upward._initialize_params(in_size) <NEW_LINE> self._initialize...
Stateless LSTM layer. This is a fully-connected LSTM layer as a chain. Unlike the :func:`~chainer.functions.lstm` function, this chain holds upward and lateral connections as child links. This link doesn't keep cell and hidden states. Args: in_size (int or None): Dimension of input vectors. If ``None``, p...
62598f1cfbf16365ca792e03
class ParamIntervalInput: <NEW_LINE> <INDENT> def __init__( self, theta_init, theta_num, loss_func, loss_crit, scale, theta_bounds, scan_bounds, scan_tol, loss_tol, local_alg, fitter_options): <NEW_LINE> <INDENT> self.theta_init = theta_init <NEW_LINE> self.theta_num = theta_num <NEW_LINE> self.loss_func = loss_func <N...
Calculates right or left endpoint of CI for parameter component. It is a wripper of `get_right_endpoint` functions for selection of direction and using different transformations for faster optimization. Parameters ---------- theta_init : Array[Float64] initial parameters vector theta_num : Int number of the pa...
62598f1cc4546d3d9def6917
class _TimeoutThread(PyDBDaemonThread): <NEW_LINE> <INDENT> def __init__(self, py_db): <NEW_LINE> <INDENT> PyDBDaemonThread.__init__(self, py_db) <NEW_LINE> self._event = threading.Event() <NEW_LINE> self._handles = [] <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> <DEDENT> def _on_run(self): <NEW_LINE> <INDENT> w...
The idea in this class is that it should be usually stopped waiting for the next event to be called (paused in a threading.Event.wait). When a new handle is added it sets the event so that it processes the handles and then keeps on waiting as needed again. This is done so that it's a bit more optimized than creating ...
62598f1c50812a4eaa62029e
class FastestGunInTheWest(Achievement): <NEW_LINE> <INDENT> def on_commit(self, author, commit): <NEW_LINE> <INDENT> return any(abs(commit.time - parent.time) < timedelta(seconds=1) for parent in commit.parents)
Shoot, shoot.
62598f1c26238365f5fab8ee
class TouchProxy(object): <NEW_LINE> <INDENT> TOUCH_METHODS = OrderedDict() <NEW_LINE> def __init__(self, touch_method): <NEW_LINE> <INDENT> self.touch_method = touch_method <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> if name == "method_name": <NEW_LINE> <INDENT> return self.touch_method.METHOD...
Perform touch operation according to the specified method
62598f1c4c34283577619039
class ApiError(Error): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_response(cls, json): <NEW_LINE> <INDENT> if 'success' not in json: <NEW_LINE> <INDENT> return ApiError('Unexpected Response') <NEW_LINE> <DEDENT> if json['success']: <NEW_LINE> <INDENT> return ApiError('Success') <NEW_LINE> <DEDENT> if 'errors'...
Exception Raised when the Fitbit API returns an error
62598f1c187af65679d292b7
class Ealign(BaseError): <NEW_LINE> <INDENT> def __init__(self, select, attr): <NEW_LINE> <INDENT> self.select = select <NEW_LINE> self.attr = attr <NEW_LINE> self.name = '{}<{}>'.format(select.get('range'), attr) <NEW_LINE> <DEDENT> def set(self, model, value): <NEW_LINE> <INDENT> cmd = model.madx.command <NEW_LINE> c...
Alignment error.
62598f1c099cdd3c63674a89
class TestDirectoryParticipantItem(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 testDirectoryParticipantItem(self): <NEW_LINE> <INDENT> pass
DirectoryParticipantItem unit test stubs
62598f1cab23a570cc2d441f
class GlobalShellConfigs(Artifact): <NEW_LINE> <INDENT> SUPPORTED_OS = ["Linux"] <NEW_LINE> LABELS = ["Configuration Files"] <NEW_LINE> COLLECTORS = [ Collector(action="GetFiles", args={"path_list": ["/etc/bash.bashrc", "/etc/csh.cshrc", "/etc/csh.login", "/etc/csh.logout", "/etc/profile", "/etc/zsh/zlogin", "/etc/zsh/...
Linux global shell configuration files.
62598f1c187af65679d292b8
class TestXmlDomBuilder(BaseWriterTest, unittest.TestCase): <NEW_LINE> <INDENT> @property <NEW_LINE> def adapter(self): <NEW_LINE> <INDENT> return xml4h.XmlDomImplAdapter
Tests building with the standard library xml.dom module, or with any library that augments/clobbers this module.
62598f1cad47b63b2c5a6574
class Solution(ArchiveQuestion): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> proxy = True <NEW_LINE> <DEDENT> def test(self, tests): <NEW_LINE> <INDENT> code = self.solution <NEW_LINE> self.passed = True <NEW_LINE> for test, fail, result in [t.evaluate(code) for t in tests]: <NEW_LINE> <INDENT> self.passed = se...
Solution objects provide custom comparators for ArchiveQuestions which allows them to be hashed and ordered based on the code and version
62598f1c3617ad0b5ee04e99
@public <NEW_LINE> class InvalidEmailAddressError(EmailError): <NEW_LINE> <INDENT> pass
Email address is invalid.
62598f1c31939e2706ed1118
class InvalidPropValueError(PropError, TypeError): <NEW_LINE> <INDENT> def __init__( self, tag_name: str, prop_name: str, value: Any, expected_type: Any ) -> None: <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.expected_type = expected_type <NEW_LINE> super().__init__( tag_name, prop_name, f"`{value}` is not a ...
Exception raised when a value is not valid for a prop. Bases: ``PropError, TypeError``.
62598f1c50812a4eaa6202a3
class MovingPixel: <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.hdir = 0 <NEW_LINE> self.vdir = 0 <NEW_LINE> <DEDENT> def choose_direction(self, dir=(0, 0), free=False): <NEW_LINE> <INDENT> if not free: <NEW_LINE> <INDENT> self.hdir, self.vdir = dir ...
A moving pixel class.
62598f1cad47b63b2c5a657a
class Diceware: <NEW_LINE> <INDENT> def __init__(self, words_file, word_id_length): <NEW_LINE> <INDENT> self.__word_list = [] <NEW_LINE> self.__word = '' <NEW_LINE> self.__word_list_file = words_file <NEW_LINE> self.__word_id_length = word_id_length <NEW_LINE> <DEDENT> def generate_wordlist(self, num_of_words): <NEW_LI...
Used to generate Diceware pass phrases.
62598f1c7cff6e4e811b475a
class CallBuilder(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.executable = None <NEW_LINE> self.parameters = dict() <NEW_LINE> self.configure() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def factory(cls, builder_name): <NEW_LINE> <INDENT> if builder_name == 'ubuntu_kvm': <NEW_LINE> <INDEN...
Many host systems differ in a way the run kvm. This helper class provides generic workarounds for construction of command line parameters according to such differences.
62598f1c091ae35668703977
class SymlinkStorage(FileSystemStorage): <NEW_LINE> <INDENT> def _save(self, name, content): <NEW_LINE> <INDENT> full_path_dst = self.path(name) <NEW_LINE> directory = os.path.dirname(full_path_dst) <NEW_LINE> if not os.path.exists(directory): <NEW_LINE> <INDENT> os.makedirs(directory) <NEW_LINE> <DEDENT> elif not os.p...
Stores symlinks to files instead of actual files whenever possible When a file that's being saved is currently stored in the symlink_within directory, then symlink the file. Otherwise, copy the file.
62598f1cad47b63b2c5a657c
class DataThread(Thread): <NEW_LINE> <INDENT> def __init__(self, data_loader, logger): <NEW_LINE> <INDENT> super().__init__(name="Data Loader") <NEW_LINE> self.queue = Queue(maxsize=8) <NEW_LINE> self._run = Event() <NEW_LINE> self._kill_pill = Event() <NEW_LINE> self._data_loader = data_loader <NEW_LINE> self._current...
Internal class to handle data loading in a separate thread.
62598f1cc4546d3d9def691d
class ManagerProxy (dbus.service.Object): <NEW_LINE> <INDENT> def __init__ (self, manager, **kwargs): <NEW_LINE> <INDENT> if not kwargs.has_key ("object_path"): <NEW_LINE> <INDENT> kwargs["object_path"] = "/connectors" <NEW_LINE> <DEDENT> dbus.service.Object.__init__ (self, **kwargs) <NEW_LINE> self.__manager = manager...
The MPRIS object that exposes methods that fetch information about all the connectors. By default, it will appear at /connectors.
62598f1c0fa83653e46f3c53
class GetTaskDetailRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Id = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Id = params.get("Id") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in vars(self).items(): <NEW_LINE...
GetTaskDetail请求参数结构体
62598f1cfbf16365ca792e11
class WorkspacePage(BasePage): <NEW_LINE> <INDENT> expectedTitle = "P2UX Builder" <NEW_LINE> def does_title_match(self): <NEW_LINE> <INDENT> return self.expectedTitle in self.driver.title <NEW_LINE> <DEDENT> def click_add_app_tile(self): <NEW_LINE> <INDENT> self.click_object(*WorkspacePageLocators.add_app_tile) <NEW_LI...
Workspace page action methods go here
62598f1cab23a570cc2d4424
class SocketIO(io.RawIOBase): <NEW_LINE> <INDENT> def __init__(self, sock, mode): <NEW_LINE> <INDENT> if mode not in ("r", "w", "rw", "rb", "wb", "rwb"): <NEW_LINE> <INDENT> raise ValueError("invalid mode: %r" % mode) <NEW_LINE> <DEDENT> io.RawIOBase.__init__(self) <NEW_LINE> self._sock = sock <NEW_LINE> if "b" not in ...
Raw I/O implementation for stream sockets. This class supports the makefile() method on sockets. It provides the raw I/O interface on top of a socket object.
62598f1c0fa83653e46f3c55
class _ByteCounter(object): <NEW_LINE> <INDENT> _count = 0 <NEW_LINE> def write(self, bytes): <NEW_LINE> <INDENT> self._count += len(bytes) <NEW_LINE> <DEDENT> def getCount(self): <NEW_LINE> <INDENT> return self._count
auxiliary file like class which just counts the bytes written.
62598f1c26238365f5fab8fc
class AcquisitionLCB(AcquisitionBase): <NEW_LINE> <INDENT> analytical_gradient_prediction = True <NEW_LINE> def __init__(self, model, space, optimizer=None, cost_withGradients=None, exploration_weight=2): <NEW_LINE> <INDENT> self.optimizer = optimizer <NEW_LINE> super(AcquisitionLCB, self).__init__(model, space, optimi...
GP-Lower Confidence Bound acquisition function :param model: GPyOpt class of model :param space: GPyOpt class of domain :param optimizer: optimizer of the acquisition. Should be a GPyOpt optimizer :param cost_withGradients: function :param jitter: positive value to make the acquisition more explorative .. Note:: does...
62598f1cab23a570cc2d4425
class LDA(_LDA): <NEW_LINE> <INDENT> pass
Alias for :class:`sklearn.discriminant_analysis.LinearDiscriminantAnalysis`. .. deprecated:: 0.17 This class will be removed in 0.19. Use :class:`sklearn.discriminant_analysis.LinearDiscriminantAnalysis` instead.
62598f1cc4546d3d9def691f
class TwoLayerNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=3*32*32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.params['W1'] = np.random.normal(size=(input_dim, hidden_dim)) * weight_scale <NEW_LINE> self.pa...
A two-layer fully-connected neural network with ReLU nonlinearity and softmax loss that uses a modular layer design. We assume an input dimension of D, a hidden dimension of H, and perform classification over C classes. The architecure should be affine - relu - affine - softmax. Note that this class does not implemen...
62598f1cad47b63b2c5a6581
@python_2_unicode_compatible <NEW_LINE> class Aggregate(ChangeLoggedModel, CustomFieldModel): <NEW_LINE> <INDENT> family = models.PositiveSmallIntegerField( choices=AF_CHOICES ) <NEW_LINE> prefix = IPNetworkField() <NEW_LINE> rir = models.ForeignKey( to='ipam.RIR', on_delete=models.PROTECT, related_name='aggregates', v...
An aggregate exists at the root level of the IP address space hierarchy in NetBox. Aggregates are used to organize the hierarchy and track the overall utilization of available address space. Each Aggregate is assigned to a RIR.
62598f1c187af65679d292bf
class CombineWorkspacesFactory(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CombineWorkspacesFactory, self).__init__() <NEW_LINE> <DEDENT> def create_add_algorithm(self, isOverlay): <NEW_LINE> <INDENT> if isOverlay: <NEW_LINE> <INDENT> return OverlayWorkspaces() <NEW_LINE> <DEDENT> else: <...
Factory to determine how to add workspaces
62598f1c9f28863672817568
class GUIHandler(DelayedHandler): <NEW_LINE> <INDENT> from tkinter import NORMAL,DISABLED,END <NEW_LINE> def __init__(self, console, delay=False): <NEW_LINE> <INDENT> DelayedHandler.__init__(self,delay) <NEW_LINE> self.setFormatter(logging.Formatter('%(levelname)s %(message)s')) <NEW_LINE> self.console = console <NEW_L...
A log handler that buffers messages and folds repeats into a single line. It expects a tkinter widget as input.
62598f1c0fa83653e46f3c59
class Service: <NEW_LINE> <INDENT> def __init__(self, queries: batch_queries.Queries, recipe_queries: recipe_queries.Queries): <NEW_LINE> <INDENT> self._recipe_queries = recipe_queries <NEW_LINE> self._batch_queries = queries <NEW_LINE> <DEDENT> async def create(self, batch: batch_schemas.Create) -> batch_schemas.DB: <...
Service.
62598f1c26238365f5fab900
class Car(): <NEW_LINE> <INDENT> def __init__(self, make, model, year): <NEW_LINE> <INDENT> self.make = make <NEW_LINE> self.model = model <NEW_LINE> self.year = year <NEW_LINE> self.odometer_reading = 0 <NEW_LINE> <DEDENT> def get_descriptive_name(self): <NEW_LINE> <INDENT> long_name = str(self.year) + " " + self.make...
一次模拟汽车的简单尝试
62598f1cfbf16365ca792e17
class Custom_Parser(): <NEW_LINE> <INDENT> def parse( s ): <NEW_LINE> <INDENT> global RE_NEWLINE <NEW_LINE> global RE_ENDBLOCK <NEW_LINE> rootObj = {} <NEW_LINE> ctx = Context(rootObj, None, T_MAP) <NEW_LINE> lines = re.split(RE_NEWLINE, str(s)) <NEW_LINE> for line in lines: <NEW_LINE> <INDENT> line = line.strip() <NEW...
Custom parser for Python
62598f1c97e22403b3839c59
class TemperatureSensorFactory(object): <NEW_LINE> <INDENT> def getTemperatureSensor(sensorConfig): <NEW_LINE> <INDENT> if (sensorConfig['type'] == Type.DS18B20): <NEW_LINE> <INDENT> sensor = Ds18b20(sensorConfig['name'], sensorConfig['units'], sensorConfig['path']) <NEW_LINE> return sensor <NEW_LINE> <DEDENT> else: <N...
Factory to create TemperatureSensor objects
62598f1cc4546d3d9def6921