code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ClockEvent(object): <NEW_LINE> <INDENT> def __init__(self, clock, loop, callback, timeout, starttime, cid, trigger=False): <NEW_LINE> <INDENT> self.clock = clock <NEW_LINE> self.cid = cid <NEW_LINE> self.loop = loop <NEW_LINE> self.weak_callback = None <NEW_LINE> self.callback = callback <NEW_LINE> self.timeout =...
A class that describes a callback scheduled with kivy's :attr:`Clock`. This class is never created by the user; instead, kivy creates and returns an instance of this class when scheduling a callback. .. warning:: Most of the methods of this class are internal and can change without notice. The only exception a...
62598fa476e4537e8c3ef459
class IndirectMpich(Package): <NEW_LINE> <INDENT> homepage = "http://www.example.com" <NEW_LINE> url = "http://www.example.com/indirect_mpich-1.0.tar.gz" <NEW_LINE> version(1.0, 'foobarbaz') <NEW_LINE> depends_on('mpi') <NEW_LINE> depends_on('direct-mpich')
Test case for a package that depends on MPI and one of its dependencies requires a *particular version* of MPI.
62598fa4e64d504609df930f
class PooledDedicatedDBConnection: <NEW_LINE> <INDENT> def __init__(self, pool, con): <NEW_LINE> <INDENT> self._con = None <NEW_LINE> if not con.threadsafety(): <NEW_LINE> <INDENT> raise NotSupportedError("Database module is not thread-safe.") <NEW_LINE> <DEDENT> self._pool = pool <NEW_LINE> self._con = con <NEW_LINE> ...
Auxiliary proxy class for pooled dedicated connections.
62598fa421bff66bcd722b12
class CNN(Chain): <NEW_LINE> <INDENT> def __init__(self, input_channel, output_channel, filter_height, filter_width, mid_units, n_units, n_label): <NEW_LINE> <INDENT> super(CNN, self).__init__( conv1 = L.Convolution2D(input_channel, output_channel, (filter_height, filter_width)), l1 = L.Linear(mid_units, n_units), l...
Convolutional Neural Network のモデル input_channel : 入力するチャンネル数(通常のカラー画像なら3) output_channel : 畳み込み後のチャンネル数 filter_height : 畳み込みに使用するフィルターの縦方向のサイズ filter_width : 畳み込みに使用するフィルターの横方向のサイズ mid_units : 全結合の隠れ層1のノード数 n_units : 全結合の隠れ層2のノード数 n_label : ラベルの出力数(今回は2)
62598fa410dbd63aa1c70a5c
class TestingConfig(Config): <NEW_LINE> <INDENT> TESTING = True <NEW_LINE> DEBUG = True <NEW_LINE> DATABASE_URL = os.getenv("DATABASE_TEST_URL")
Configurations for Testing,
62598fa40a50d4780f705288
class Alphabet: <NEW_LINE> <INDENT> def __init__(self, chars, encoding, chars_rc=None, encoding_rc=None, missing=255): <NEW_LINE> <INDENT> self.chars = np.frombuffer(chars, dtype=np.uint8) <NEW_LINE> self.encoding = np.zeros(256, dtype=np.uint8) + missing <NEW_LINE> self.encoding[self.chars] = encoding <NEW_LINE> if ch...
biological sequence encoder
62598fa47d847024c075c272
class SeriesForm(forms.Form): <NEW_LINE> <INDENT> host = forms.CharField(max_length=constants.NAME_MAX_LENGTH) <NEW_LINE> timestamp = forms.FloatField(min_value=0) <NEW_LINE> samples = forms.Field() <NEW_LINE> def clean_samples(self): <NEW_LINE> <INDENT> cleaned = [] <NEW_LINE> for row in self.data['samples']: <NEW_LIN...
Roughly validates received series of data.
62598fa46fb2d068a7693d8b
class AntiTank(fAirDefenceAntiTank): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.unitID = 18
...
62598fa42c8b7c6e89bd3672
class BrokerConnection(object): <NEW_LINE> <INDENT> def __init__(self, host, port, handler, buffer_size=1024 * 1024, source_host='', source_port=0, ssl_config=None): <NEW_LINE> <INDENT> self._buff = bytearray(buffer_size) <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self._handler = handler <NEW_LI...
BrokerConnection thinly wraps a `socket.create_connection` call and handles the sending and receiving of data that conform to the kafka binary protocol over that socket.
62598fa41f5feb6acb162ace
class MissingImage(Exception): <NEW_LINE> <INDENT> pass
Raised when an expected image is not present.
62598fa401c39578d7f12c2b
class QualityRunner(Executor): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def _get_quality_scores(self, asset): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def _read_result(self, asset): <NEW_LINE> <INDENT> result = {} <NEW_LINE> result.update(self._get_quali...
QualityRunner takes in a list of assets, and run quality assessment on them, and return a list of corresponding results. A QualityRunner must specify a unique type and version combination (by the TYPE and VERSION attribute), so that the Result generated by it can be identified and stored by ResultStore class. There ar...
62598fa4009cb60464d013d1
class BgpPeerStatus(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'local_address': {'readonly': True}, 'neighbor': {'readonly': True}, 'asn': {'readonly': True, 'maximum': 4294967295, 'minimum': 0}, 'state': {'readonly': True}, 'connected_duration': {'readonly': True}, 'routes_received': {'readonly':...
BGP peer status details. Variables are only populated by the server, and will be ignored when sending a request. :ivar local_address: The virtual network gateway's local address. :vartype local_address: str :ivar neighbor: The remote BGP peer. :vartype neighbor: str :ivar asn: The autonomous system number of the remo...
62598fa432920d7e50bc5f03
class VOCSegmentation(Dataset): <NEW_LINE> <INDENT> NUM_CLASSES = 6 <NEW_LINE> def __init__(self, args, base_dir=Path.db_root_dir('pascal'), split='train', ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._base_dir = base_dir <NEW_LINE> self._image_dir = os.path.join(self._base_dir, 'JPEGImages') <NEW_LINE> se...
PascalVoc dataset
62598fa4442bda511e95c302
class itkContourMeanDistanceImageFilterIUC3IUC3(itkImageToImageFilterAPython.itkImageToImageFilterIUC3IUC3): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor de...
Proxy of C++ itkContourMeanDistanceImageFilterIUC3IUC3 class
62598fa43539df3088ecc161
class PluginUrlRewriting(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.disabled_rewriters = [] <NEW_LINE> <DEDENT> def on_task_urlrewrite(self, task, config): <NEW_LINE> <INDENT> log.debug('Checking %s entries', len(task.accepted)) <NEW_LINE> for entry in task.accepted: <NEW_LINE> <INDENT> t...
Provides URL rewriting framework
62598fa4d7e4931a7ef3bf48
class LayerIterator(object): <NEW_LINE> <INDENT> def __init__(self, layer): <NEW_LINE> <INDENT> self.layer = layer <NEW_LINE> self.i, self.j = 0, 0 <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> if self.i == self.layer.width: <NEW_LINE> <INDENT> self.j += 1 <NEW_LINE> self.i = 0 <NEW_LINE> <DEDENT> if self...
Iterates over all the cells in a layer in column,row order.
62598fa497e22403b383adb9
class InitializeOAuthInputSet(InputSet): <NEW_LINE> <INDENT> def set_ConsumerKey(self, value): <NEW_LINE> <INDENT> super(InitializeOAuthInputSet, self)._set_input('ConsumerKey', value) <NEW_LINE> <DEDENT> def set_ConsumerSecret(self, value): <NEW_LINE> <INDENT> super(InitializeOAuthInputSet, self)._set_input('ConsumerS...
An InputSet with methods appropriate for specifying the inputs to the InitializeOAuth Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598fa4eab8aa0e5d30bc36
class _Coordinate: <NEW_LINE> <INDENT> def __init__(self, coord): <NEW_LINE> <INDENT> self.coord = coord <NEW_LINE> <DEDENT> def cart(self): <NEW_LINE> <INDENT> return self.coord <NEW_LINE> <DEDENT> def frac(self, lat): <NEW_LINE> <INDENT> return _xtal.cartesian_to_fractional(self.coord, lat) <NEW_LINE> <DEDENT> @class...
Base class for both mutable and immutable Coordinate classes. Defines the functions that should be common for both.
62598fa491f36d47f2230df9
class JobsQueue(object): <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> self.env = env <NEW_LINE> self._serialized_jobs = [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def job(self): <NEW_LINE> <INDENT> assert self._serialized_jobs, "Cannot create queue job for empty list" <NEW_LINE> return functools.pa...
Jobs queue collects jobs list to run one-by-one
62598fa44f6381625f199414
class TestEnvironment(unittest.TestCase): <NEW_LINE> <INDENT> def rounded_compare(self, val1, val2): <NEW_LINE> <INDENT> print('Comparing {} and {} using round()'.format(val1, val2)) <NEW_LINE> return builtins.round(val1) == builtins.round(val2) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE...
Base class for tests.
62598fa47047854f4633f286
class ApiError(Error): <NEW_LINE> <INDENT> def __init__(self, response): <NEW_LINE> <INDENT> self.response = response
Exception raised for errors in a GET request. Attributes: response -- response object
62598fa4d7e4931a7ef3bf49
class Cell(LdapObject): <NEW_LINE> <INDENT> _master_host_schema = [ ('master-idx', 'idx', int), ('master-hostname', 'hostname', str), ('master-zk-client-port', 'zk-client-port', int), ('master-zk-jmx-port', 'zk-jmx-port', int), ('master-zk-followers-port', 'zk-followers-port', int), ('master-zk-election-port', 'zk-elec...
Cell object.
62598fa4009cb60464d013d2
class TimeThrottle(object): <NEW_LINE> <INDENT> def __init__(self, min_time_delta): <NEW_LINE> <INDENT> self.min_time_delta = total_seconds(min_time_delta) <NEW_LINE> self.previous_time = None <NEW_LINE> <DEDENT> def is_throttled(self): <NEW_LINE> <INDENT> if not self.previous_time: <NEW_LINE> <INDENT> self._update() <...
Time based throttling class. >>> import datetime >>> from pytoolbox.unittest import asserts >>> def slow_range(*args): ... for i in xrange(*args): ... time.sleep(0.5) ... yield i >>> t1, t2 = (TimeThrottle(t) for t in (datetime.timedelta(minutes=1), 0.2)) >>> asserts.list_equal(list(t1.throttle_ite...
62598fa43539df3088ecc162
class SelectorBIC(ModelSelector): <NEW_LINE> <INDENT> def calculate_bic(self, state_num, l, n_features): <NEW_LINE> <INDENT> p = state_num**2 + (2*state_num*n_features) - 1 <NEW_LINE> return (-2) * l + p * math.log(len(self.X)) <NEW_LINE> <DEDENT> def select(self): <NEW_LINE> <INDENT> warnings.filterwarnings("ignore", ...
select the model with the lowest Bayesian Information Criterion(BIC) score http://www2.imm.dtu.dk/courses/02433/doc/ch6_slides.pdf Bayesian information criteria: BIC = -2 * logL + p * logN
62598fa460cbc95b063641f9
class BravoIRCClient(IRCClient): <NEW_LINE> <INDENT> def __init__(self, worlds, config): <NEW_LINE> <INDENT> self.factories = worlds <NEW_LINE> for factory in self.factories.itervalues(): <NEW_LINE> <INDENT> factory.chat_consumers.add(self) <NEW_LINE> <DEDENT> self.config = "irc %s" % config <NEW_LINE> self.name = self...
Simple bot. This bot is heavily inspired by Cory Kolbeck's mc-bot, available at https://github.com/ckolbeck/mc-bot.
62598fa410dbd63aa1c70a5e
class Spectrogram(torch.nn.Module): <NEW_LINE> <INDENT> __constants__ = ['n_fft', 'win_length', 'hop_length', 'pad', 'power', 'normalized'] <NEW_LINE> def __init__(self, n_fft=400, win_length=None, hop_length=None, pad=0, window_fn=torch.hann_window, power=2, normalized=False, wkwargs=None): <NEW_LINE> <INDENT> super(S...
Create a spectrogram from a audio signal Args: n_fft (int, optional): Size of FFT, creates ``n_fft // 2 + 1`` bins win_length (int): Window size. (Default: ``n_fft``) hop_length (int, optional): Length of hop between STFT windows. ( Default: ``win_length // 2``) pad (int): Two sided padding of ...
62598fa4e5267d203ee6b7bb
class JavaGradleWorkflow(BaseWorkflow): <NEW_LINE> <INDENT> NAME = "JavaGradleWorkflow" <NEW_LINE> CAPABILITY = Capability(language="java", dependency_manager="gradle", application_framework=None) <NEW_LINE> INIT_FILE = "lambda-build-init.gradle" <NEW_LINE> def __init__(self, source_dir, artifacts_dir, scratch_dir, man...
A Lambda builder workflow that knows how to build Java projects using Gradle.
62598fa463d6d428bbee2660
class BundlesField(datatype('BundlesField', ['address', 'bundles', 'filespecs_list', 'path_globs_list', 'excluded_path_globs_list']), Field): <NEW_LINE> <INDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return type(self) == type(other) and self.address == other.address <NEW_LINE> <DEDENT> def __ne__(self, other): <...
Represents the `bundles` argument, each of which has a PathGlobs to represent its `fileset`.
62598fa4d486a94d0ba2be7b
class pattern_matched_exceptions(CodeTransformer): <NEW_LINE> <INDENT> def __init__(self, matcher=match): <NEW_LINE> <INDENT> self._matcher = matcher <NEW_LINE> <DEDENT> def visit_COMPARE_OP(self, instr): <NEW_LINE> <INDENT> if instr.arg == Comparisons.EXCEPTION_MATCH: <NEW_LINE> <INDENT> yield ROT_TWO().steal(instr) <...
Allows usage of arbitrary expressions and matching functions in `except` blocks. When an exception is raised in an except block in a function decorated with `pattern_matched_exceptions`, a matching function will be called with the block's expression and the three values returned by sys.exc_info(). If the matching fun...
62598fa42c8b7c6e89bd3673
class LexicalError(Error): <NEW_LINE> <INDENT> def __init__(self, error_info, error_line): <NEW_LINE> <INDENT> super().__init__(error_info) <NEW_LINE> self.line = error_line
词法错误
62598fa40c0af96317c56230
class ManageExistingTask(flow_utils.CinderTask): <NEW_LINE> <INDENT> default_provides = set(['volume']) <NEW_LINE> def __init__(self, db, driver): <NEW_LINE> <INDENT> super(ManageExistingTask, self).__init__(addons=[ACTION]) <NEW_LINE> self.db = db <NEW_LINE> self.driver = driver <NEW_LINE> <DEDENT> def execute(self, c...
Brings an existing volume under Cinder management.
62598fa4be383301e02536a6
class recipe: <NEW_LINE> <INDENT> def __init__(self, name = None, id = 0, meta_data = {'preptime':0, 'cooktime':0, 'serve':0, 'type':[], 'tags':[]}, ingredient_list = [], instruction = ''): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._id = id <NEW_LINE> self._meta_data = meta_data <NEW_LINE> self._ingredient_...
A class representing a recipe.
62598fa43d592f4c4edbad7c
class GroupWithName(Matcher): <NEW_LINE> <INDENT> def __init__( self, name ): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __eq__(self, group): <NEW_LINE> <INDENT> if not isinstance(group, Group): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return group.name == self.name
Matches any Group with the given name.
62598fa438b623060ffa8f43
class findQuestionByID_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'qid', None, None, ), ) <NEW_LINE> def __init__(self, qid=None,): <NEW_LINE> <INDENT> self.qid = qid <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated an...
Attributes: - qid
62598fa4d268445f26639ada
class VolumeGetResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'continuation_token': 'str', 'total_item_count': 'int', 'items': 'list[Volume]' } <NEW_LINE> attribute_map = { 'continuation_token': 'continuation_token', 'total_item_count': 'total_item_count', 'items': 'items' } <NEW_LINE> required_args = { } <NEW...
Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition.
62598fa41f5feb6acb162ad0
class BaseModel(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _get_keys(cls): <NEW_LINE> <INDENT> return class_mapper(cls).c.keys() <NEW_LINE> <DEDENT> def get_dict(self): <NEW_LINE> <INDENT> d = {} <NEW_LINE> for k in self._get_keys(): <NEW_LINE> <INDENT> d[k] = getattr(self, k) <NEW_LINE> <DEDENT> _json_at...
Base Model for all classess
62598fa4f548e778e596b453
class MonitoringSupport(cap.CapabilityNegotiationSupport): <NEW_LINE> <INDENT> def _reset_attributes(self): <NEW_LINE> <INDENT> super()._reset_attributes() <NEW_LINE> self._monitoring = set() <NEW_LINE> <DEDENT> def _destroy_user(self, nickname, channel=None, monitor_override=False): <NEW_LINE> <INDENT> if channel: <NE...
Support for monitoring the online/offline status of certain targets.
62598fa4d486a94d0ba2be7c
class shmarray(numpy.ndarray): <NEW_LINE> <INDENT> def __new__(cls, ctypesArray, shape, dtype=float, strides=None, offset=0, order=None): <NEW_LINE> <INDENT> tp = type(ctypesArray) <NEW_LINE> try: tp.__array_interface__ <NEW_LINE> except AttributeError: ctypeslib.prep_array(tp) <NEW_LINE> obj = numpy.ndarray.__new__(cl...
subclass of ndarray with overridden pickling functions which record dtype, shape etc... but defer pickling of the underlying data to the original data source. Doesn't actually handle allocation of the shared memory - this is done in create, and zeros, ones, (or create_copy) are the functions which should be used for cr...
62598fa456ac1b37e630209b
class RegressDims(keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, mean=None, std=None, *args, **kwargs): <NEW_LINE> <INDENT> if mean is None: <NEW_LINE> <INDENT> mean = np.array([1.6570, 1.7999, 4.2907]) <NEW_LINE> <DEDENT> if std is None: <NEW_LINE> <INDENT> std = np.array([0.2681, 0.2243, 0.6281]) <NEW_LI...
Keras layer for applying regression values to dimensions.
62598fa4b7558d58954634de
class Token: <NEW_LINE> <INDENT> pass
An individual token.
62598fa48da39b475be03090
class AdminUserTest(base_test.BaseTest): <NEW_LINE> <INDENT> FAKE_ADMIN_EMAIL = 'fake_admin@email.com' <NEW_LINE> FAKE_ADMIN_EMAIL_2 = 'fake_admin_2@email.com' <NEW_LINE> FAKE_ADMIN_PASSWORD = 'fake admin password' <NEW_LINE> def testAdminUserToDict(self): <NEW_LINE> <INDENT> admin_user = models.AdminUser() <NEW_LINE> ...
Test for admin user model class functionality.
62598fa46aa9bd52df0d4d79
class User(Base, UserMixin): <NEW_LINE> <INDENT> __tablename__ = 'user' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> username = Column(String(250), nullable=True) <NEW_LINE> password = Column(String(250), nullable=True) <NEW_LINE> email = Column(String(250), nullable=True) <NEW_LINE> isoauth = Column(Bo...
Model of a user. The UserMixin allows flask_login to use this class for a global authentication check mechanism.
62598fa456b00c62f0fb2761
class JSONField(six.with_metaclass(models.SubfieldBase, models.TextField)): <NEW_LINE> <INDENT> def to_python(self, value): <NEW_LINE> <INDENT> if value == "": <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> if isinstance(value, six.string_types): <NEW_LINE> <INDENT> return json.loads(value...
JSONField is a generic textfield that neatly serializes/unserializes JSON objects seamlessly. Django snippet #1478
62598fa4ac7a0e7691f723ba
class CustomSlide(BaseModel): <NEW_LINE> <INDENT> def __lt__(self, other): <NEW_LINE> <INDENT> return get_locale_key(self.title) < get_locale_key(other.title) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return get_locale_key(self.title) == get_locale_key(other.title) <NEW_LINE> <DEDENT> def __hash_...
CustomSlide model
62598fa4eab8aa0e5d30bc38
class CouldNotCompile(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, message, stderr): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> self.stderr = stderr <NEW_LINE> RuntimeError.__init__(self) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> output = [ self.message, "---BEGIN STDERR---", self.s...
Exception raised when a student's code could not be compiled into a single library file. :ivar message: A short message describing the exception. :ivar stderr: The output that was received through standard error. This is output by ``distutils.core.setup``.
62598fa499cbb53fe6830d84
class NamespaceFormatter(Formatter): <NEW_LINE> <INDENT> def __init__(self, namespace): <NEW_LINE> <INDENT> Formatter.__init__(self) <NEW_LINE> self.initial_namespace = namespace <NEW_LINE> self.namespace = self.initial_namespace <NEW_LINE> <DEDENT> def format(self, format_string, *args, **kwargs): <NEW_LINE> <INDENT> ...
String formatter that, as well as expanding '{variable}' strings, also protects environment variable references such as ${THIS} so they do not get expanded as though {THIS} is a formatting target. Also, environment variable references such as $THIS are converted to ${THIS}, which gives consistency across shells, and av...
62598fa48e7ae83300ee8f50
class ShowPolicyMapTargetClass(ShowPolicyMapTypeSuperParser, ShowPolicyMapTypeSchema): <NEW_LINE> <INDENT> cli_command = ['show policy-map target service-group {num}'] <NEW_LINE> def cli(self, num='', output=None): <NEW_LINE> <INDENT> if output is None: <NEW_LINE> <INDENT> if num : <NEW_LINE> <INDENT> cmd = self.cli_co...
Parser for: * 'show policy-map target service-group {num}'
62598fa4cc0a2c111447aebe
class CarListPlugin(CMSPluginBase): <NEW_LINE> <INDENT> name = _("List of all cars") <NEW_LINE> render_template = "plugins/car_list.html" <NEW_LINE> def render(self, context, instance, placeholder): <NEW_LINE> <INDENT> context['plugin_id'] = instance.pk <NEW_LINE> car_details = {c.engage_id: c for c in VehicleDetails.o...
Plugin that displays a list of all the cars, with pictures and live availability.
62598fa4d53ae8145f91833c
class TestCustomerSort(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 testCustomerSort(self): <NEW_LINE> <INDENT> model = squareconnect.models.customer_sort.CustomerSort()
CustomerSort unit test stubs
62598fa456ac1b37e630209c
class ComponentRegistry(object): <NEW_LINE> <INDENT> log.info('Registry loaded') <NEW_LINE> __instance__ = None <NEW_LINE> def __new__(cls): <NEW_LINE> <INDENT> if not cls.__instance__: <NEW_LINE> <INDENT> cls.__instance__ = object.__new__(cls) <NEW_LINE> <DEDENT> return cls.__instance__ <NEW_LINE> <DEDENT> @classmetho...
This is the Component Registry. It is a singleton object and is used to provide a look up component for common objects.
62598fa4a79ad16197769f11
class BaseFeature(ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def apply(self, audio_data): <NEW_LINE> <INDENT> raise NotImplementedError
Base class for audio feature extraction All abstractmethod needs to be common methods in feature extractors
62598fa4627d3e7fe0e06d5c
class Pin(object): <NEW_LINE> <INDENT> __VALID_PORT_DIR = ['input', 'output'] <NEW_LINE> def __init__(self, name=None, direction=None, description=''): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._description = description <NEW_LINE> self.direction = direction <NEW_LINE> <DEDENT> @property <NEW_LINE> def name...
Pin class defines I/O of a circuit. Note that only "input" and "output" are valid io type of the system. Since Verilog only allows uni-directional signal flow, "inout" pin is not allowed.
62598fa4e5267d203ee6b7bd
class CrawledResource: <NEW_LINE> <INDENT> def __init__(self, resource, origin_urls:list, id_in_origin=""): <NEW_LINE> <INDENT> if not origin_urls: <NEW_LINE> <INDENT> raise ValueError("Expected the resource to have an origin.") <NEW_LINE> <DEDENT> self._resource = resource <NEW_LINE> self._origin_urls = origin_urls <N...
A resource crawled by the crawler. This is an adapter bewteen crawler and API. The id is computed by the originating url and the id it has in the url.
62598fa42c8b7c6e89bd3675
class PortfolioModule(BarGraphModule): <NEW_LINE> <INDENT> def __init__(self, series: List[Dict[str, str]], height: int = 150, width: int = 500, data_collector_name: str = "datacollector", fiat_values: bool = False, desc: str = "", title: str = "", group: str = "") -> None: <NEW_LINE> <INDENT> super().__init__(series, ...
A bar graph that will show the bars stacked in terms of wealth of different types: escrowed_havvens, unescrowed_havvens, nomins, fiat
62598fa43cc13d1c6d46561c
class ScoreForm(messages.Message): <NEW_LINE> <INDENT> user_name = messages.StringField(1, required=True) <NEW_LINE> date = messages.StringField(2, required=True) <NEW_LINE> won = messages.BooleanField(3, required=True) <NEW_LINE> guesses = messages.IntegerField(4, required=True) <NEW_LINE> performance=messages.FloatFi...
ScoreForm for outbound Score information
62598fa40c0af96317c56232
class KarmaAssistantUnitTests(BaseTest): <NEW_LINE> <INDENT> def test_check_if_correlates_to_userid(self): <NEW_LINE> <INDENT> mock_handler_succeed = mock.MagicMock(name="MockSlackHandler") <NEW_LINE> mock_handler_succeed.get_userid_from_name.return_value = "SOME USER ID" <NEW_LINE> mock_handler_succeed.get_user_obj_fr...
Tests for the KarmaAssistant.
62598fa43617ad0b5ee06003
class RecomResultItem(object): <NEW_LINE> <INDENT> swagger_types = { 'item': 'Item', 'rank': 'float', 'recommendation_id': 'str' } <NEW_LINE> attribute_map = { 'item': 'item', 'rank': 'rank', 'recommendation_id': 'recommendationId' } <NEW_LINE> def __init__(self, item=None, rank=None, recommendation_id=None, _configura...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fa43d592f4c4edbad7e
class ConcreteClientData(ClientData): <NEW_LINE> <INDENT> def __init__( self, client_ids: Iterable[str], create_tf_dataset_for_client_fn: Callable[[str], tf.data.Dataset], ): <NEW_LINE> <INDENT> py_typecheck.check_type(client_ids, collections.Iterable) <NEW_LINE> py_typecheck.check_callable(create_tf_dataset_for_client...
A generic `ClientData` object. This is a simple implementation of client_data, where Datasets are specified as a function from client_id to Dataset. The `ConcreteClientData.preprocess` classmethod is provided as a utility used to wrap another `ClientData` with an additional preprocessing function.
62598fa4460517430c431fb3
class Order(BaseModel, db.Model): <NEW_LINE> <INDENT> __tablename__ = "ih_order_info" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> user_id = db.Column(db.Integer, db.ForeignKey("ih_user_profile.id"), nullable=False) <NEW_LINE> house_id = db.Column(db.Integer, db.ForeignKey("ih_house_info.id"), nul...
订单
62598fa44e4d5625663722d5
class timelogEvent(object): <NEW_LINE> <INDENT> def __init__(self, name, timestamp, duration): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.timestamp = timestamp <NEW_LINE> self.duration = duration <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "{name: %s, date: %s, duration: %s}" % (self.na...
a custom data structure for shotgun time log
62598fa48c0ade5d55dc35e8
class TestProcessingStateContext(unittest.TestCase): <NEW_LINE> <INDENT> def tearDown(self): <NEW_LINE> <INDENT> state.reset_instance() <NEW_LINE> <DEDENT> def test_basic_functionality(self): <NEW_LINE> <INDENT> with processing_state_context(): <NEW_LINE> <INDENT> n_jobs = 2 <NEW_LINE> pool = multiprocessing.Pool(proce...
Test the processing_state_context
62598fa44428ac0f6e6583dc
@attr.s(auto_attribs=True) <NEW_LINE> class ThirdPartyReleaseInfoValidator(ReleaseInfoValidatorBase): <NEW_LINE> <INDENT> def __attrs_post_init__(self): <NEW_LINE> <INDENT> self.content_validator = ContentFileValidator( scheme=ThirdPartyReleaseInfoContentScheme, content_type=self.content_type)
Special alias for `THIRD_PARTY_RELEASE.INFO` file validator.
62598fa4e5267d203ee6b7be
class TestPrettyPrintRows(unittest.TestCase): <NEW_LINE> <INDENT> def test_pretty_print_rows_empty_inputs(self): <NEW_LINE> <INDENT> self.assertEqual(pretty_print_rows([]),"") <NEW_LINE> <DEDENT> def test_pretty_print_rows_single_row(self): <NEW_LINE> <INDENT> rows = [['hello:','A salutation']] <NEW_LINE> self.assertEq...
Tests for the pretty_print_rows function
62598fa4d486a94d0ba2be7e
class TestInlineResponse20088Site(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 testInlineResponse20088Site(self): <NEW_LINE> <INDENT> pass
InlineResponse20088Site unit test stubs
62598fa4aad79263cf42e689
class ElementWrapper(object): <NEW_LINE> <INDENT> def __init__(self, wrapped): <NEW_LINE> <INDENT> self.wrapped = wrapped <NEW_LINE> <DEDENT> def xpath(self, xpath): <NEW_LINE> <INDENT> return [ElementWrapper(sel) for sel in self.wrapped.find_elements_by_xpath(xpath)] <NEW_LINE> <DEDENT> def text_content(self): <NEW_LI...
Wrapper to Selenium element to ressemble lxml. Some differences: - only a subset of lxml's Element class are available - cannot access XPath "text()", only Elements See https://seleniumhq.github.io/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.webelement.html
62598fa4236d856c2adc9393
@python_2_unicode_compatible <NEW_LINE> class Heuristic(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=200) <NEW_LINE> category_code = models.CharField(max_length=20, choices=HEURISTIC_CATEGORIES.items()) <NEW_LINE> @property <NEW_LINE> def category(self): <NEW_LINE> <INDENT> return HEURISTIC_CAT...
A heuristic, measured by answers to questions
62598fa432920d7e50bc5f07
class AddressCompleteness: <NEW_LINE> <INDENT> implements(ICompleteness) <NEW_LINE> adapts(IAddress) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> def isComplete(self): <NEW_LINE> <INDENT> if self.context.address_1 and self.context.zip_code and self.contex...
Provides ICompleteness for address content objects
62598fa497e22403b383adbd
class BaseGeometry: <NEW_LINE> <INDENT> def area(self): <NEW_LINE> <INDENT> raise Exception("area() is not implemented")
BaseGeometry: empty class
62598fa4435de62698e9bca6
class UploadForm(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.form_fields = [] <NEW_LINE> self.files = [] <NEW_LINE> self.boundary = self.make_upload_from_boundary() <NEW_LINE> self.content_type = 'multipart/form-data; boundary=%s' % self.boundary <NEW_LINE> <DEDENT> def make_upload_from_bo...
上传对象构造
62598fa491f36d47f2230dfb
class PerfectForecastConfig(ConfigBase): <NEW_LINE> <INDENT> def __init__(self, source, derived): <NEW_LINE> <INDENT> self._observed = GHCN_CAMS_PRECL(source) <NEW_LINE> self._forecast = {'Observed': PerfectForecast(self._observed)} <NEW_LINE> self._static = DefaultStatic(source) <NEW_LINE> self._workspace = paths.Defa...
Configuration that uses observed data as a forecast. Can be used for evaluating the agricultural assessment (which must use forecasts) retrospectively.
62598fa48e7ae83300ee8f52
class TOCMacro(List): <NEW_LINE> <INDENT> grammar = contiguous( "TableOfContents", optional( "(", optional(attr("maxDepth", re.compile(r"\d+"))), ")")) <NEW_LINE> def compose(self, parser, attr_of): <NEW_LINE> <INDENT> global pageYaml <NEW_LINE> pageYaml["autotoc"] = "true" <NEW_LINE> return("") <NEW_LINE> <DEDENT> @cl...
TableOfContents Macros insert TOC's. There ya go. <<TableOfContents>> <<TableOfContents([maxdepth])>> <<TableOfContents(2)>>
62598fa491af0d3eaad39cbf
class CodeContext(object): <NEW_LINE> <INDENT> def __init__(self, code, path): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.path = path <NEW_LINE> self._file = None <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> if self.code is None: <NEW_LINE> <INDENT> self._file = open(self.path, 'rU') <NEW_LINE...
Read file if code is None.
62598fa463d6d428bbee2663
class ValuesXLS(Values): <NEW_LINE> <INDENT> __doc__ %= QUERY_LIMIT <NEW_LINE> def header(self, ctx, req): <NEW_LINE> <INDENT> return ['ID', 'Language', 'Concept', 'Form', 'Reference', 'Comment'] <NEW_LINE> <DEDENT> def row(self, ctx, req, item): <NEW_LINE> <INDENT> res = super(Values, self).row(ctx, req, item) <NEW_LI...
Represent table of Value instances as excel sheet (maximal %d rows).
62598fa476e4537e8c3ef45f
class LRUCache1: <NEW_LINE> <INDENT> def __init__(self, capacity: int): <NEW_LINE> <INDENT> self.cache = OrderedDict() <NEW_LINE> self.capacity = capacity <NEW_LINE> <DEDENT> def get(self, key: int) -> int: <NEW_LINE> <INDENT> val = self.cache.get(key, -1) <NEW_LINE> if val != -1: self.cache.move_to_end(key, last=False...
基于顺序哈希表,通过
62598fa4498bea3a75a579d4
class FreeType(_MetaType): <NEW_LINE> <INDENT> def __init__(self, **options): <NEW_LINE> <INDENT> _MetaType.__init__(self, FreeType.FreeTypeInstance) <NEW_LINE> keys = list(options.keys()) <NEW_LINE> keys.sort() <NEW_LINE> orderedopts = [(k, options[k]) for k in keys if isinstance(options[k], Forward)] + ...
Free type declaration Z: Ans ::= ok<<Z>> | error Python: Ans = FreeType(ok=int, error=None) Z: Degree ::= status <<0..3>> ba = status 0 Python: Degree = FreeType(status=range(0,4)) ba = Degree('status', 0)
62598fa460cbc95b063641fd
@skipIf(HAS_BOTO is False, "The boto module must be installed.") <NEW_LINE> @skipIf( _has_required_boto() is False, ( "The boto3 module must be greater than or equal to version {}, " "and botocore must be greater than or equal to {}".format( required_boto3_version, required_botocore_version ) ), ) <NEW_LINE> class Boto...
TestCase for salt.modules.boto_lambda state.module aliases
62598fa4e76e3b2f99fd88e8
class FairModel: <NEW_LINE> <INDENT> def __init__(self, model, inds, times, last_hist=5, nsteps=6, nydims=None): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.y_hist_inds = inds <NEW_LINE> self.times = times <NEW_LINE> self.last_hist = last_hist <NEW_LINE> self.nsteps = nsteps <NEW_LINE> self.nydims = nydims <...
returns sequential prediction
62598fa4925a0f43d25e7ef0
class Action: <NEW_LINE> <INDENT> def __init__(self, data, limit=None): <NEW_LINE> <INDENT> self._data = data <NEW_LINE> self._limit = limit <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return self._data <NEW_LINE> <DEDENT> @property <NEW_LINE> def limit(self): <NEW_LINE> <INDENT> return...
The class for the action object that is returned by each task. The action object encapsulates the information that is returned by a task to the system. It contains the data that should be passed on to the successor tasks and a list of immediate successor tasks that should be executed. The latter allows to limit the ex...
62598fa4e1aae11d1e7ce77c
class Dialog_Info(Gtk.Dialog): <NEW_LINE> <INDENT> def __init__(self, parent, title, message): <NEW_LINE> <INDENT> Gtk.Dialog.__init__(self, title, parent, 0, (Gtk.STOCK_OK, Gtk.ResponseType.OK)) <NEW_LINE> self.set_default_size(150, 100) <NEW_LINE> self.label = Gtk.Label(message) <NEW_LINE> self.box = self.get_content...
A simple dialog to inform about the process of saving the current list. It pops up after fullfilled saving of the list.
62598fa43d592f4c4edbad80
class StringSplitter(DFPBase): <NEW_LINE> <INDENT> def __init__( self, inputs=[], outputs=[], separator=None, index=None, keep=0 ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.inputs = inputs <NEW_LINE> self.outputs = outputs <NEW_LINE> self.separator = separator <NEW_LINE> self.index = index <NEW_LINE> self...
Split strings in a colum. Parameters ---------- inputs : List of strings Column labels. outputs: List of strings Column labels. separator: String A string to separate a string. index: Int An index to split a string. keep: Int (0 or -1), default is 0 When this value is 0, the first string is sto...
62598fa4fff4ab517ebcd697
class CLMFitter(MultiScaleParametricFitter): <NEW_LINE> <INDENT> def __init__(self, clm, algorithms): <NEW_LINE> <INDENT> self._model = clm <NEW_LINE> super(CLMFitter, self).__init__( scales=clm.scales, reference_shape=clm.reference_shape, holistic_features=clm.holistic_features, algorithms=algorithms) <NEW_LINE> <DEDE...
Abstract class for defining a CLM fitter. .. note:: When using a method with a parametric shape model, the first step is to **reconstruct the initial shape** using the shape model. The generated reconstructed shape is then used as initialisation for the iterative optimisation. This step t...
62598fa47cff6e4e811b58da
class PlainPickle(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.pjc = {} <NEW_LINE> self.pjd = {} <NEW_LINE> <DEDENT> def save(self, name='params.txt'): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open(name, 'w') as save_file: <NEW_LINE> <INDENT> for key, value in self.pjd.items(): <NE...
A class to create and read sets of project parameters in a readable text format. The pickled files can be externally edited and re-read.
62598fa4f548e778e596b456
class Attrib(object): <NEW_LINE> <INDENT> NetType = enum(WIRELESS = 'wireless', ETHERNET = 'ethernet', PTP_WIRED = 'point-to-point-wired', PTP_WIRELESS = 'point-to-point-wireless') <NEW_LINE> MembType = enum(INTERFACE = 'interface', CHANNEL = 'channel', SWITCH = 'switch', HUB = 'hub', TUNNEL = 'tunnel', NETWORK = "netw...
scenario plan attribute constants
62598fa4dd821e528d6d8de6
class MaxRowReducer(MultiStatementReducer): <NEW_LINE> <INDENT> prepare_first = ( "if {0} is not None:", " %(result)s = ({0}, %(row)s)", ) <NEW_LINE> reduce = ( "if {1} is not None and {0}[0] < {1}:", " %(result)s = ({1}, %(row)s)", ) <NEW_LINE> default = None <NEW_LINE> post_conversion = GetItem(1)
Reducer which finds an item with max value of the expression and returns this item
62598fa4be8e80087fbbef14
class ResearchExperimentReplicateListFilter(FilterSet): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = ResearchExperimentReplicate <NEW_LINE> fields = {'experimentreplicate': ['exact'], 'object_id': ['exact'], 'content_type': ['exact'], } <NEW_LINE> order_by = ['experimentreplicate']
Filter query list from research experiment replicate database table
62598fa4d486a94d0ba2be80
class AnnounceThread(StoppableThread): <NEW_LINE> <INDENT> name = "Announcer" <NEW_LINE> announceInterval = 60 <NEW_LINE> def run(self): <NEW_LINE> <INDENT> lastSelfAnnounced = 0 <NEW_LINE> while not self._stopped and state.shutdown == 0: <NEW_LINE> <INDENT> processed = 0 <NEW_LINE> if lastSelfAnnounced < time.time() -...
A thread to manage regular announcing of this node
62598fa4009cb60464d013d7
class Insert(ValuesBase): <NEW_LINE> <INDENT> __visit_name__ = 'insert' <NEW_LINE> _supports_multi_parameters = True <NEW_LINE> def __init__(self, table, values=None, inline=False, bind=None, prefixes=None, returning=None, **kwargs): <NEW_LINE> <INDENT> ValuesBase.__init__(self, table, values, prefixes) <NEW_LINE> self...
Represent an INSERT construct. The :class:`.Insert` object is created using the :func:`~.expression.insert()` function. .. seealso:: :ref:`coretutorial_insert_expressions`
62598fa4aad79263cf42e68a
class FileLikeTests(unittest.TestCase): <NEW_LINE> <INDENT> def testReadFileGivenFileObject(self): <NEW_LINE> <INDENT> f = open(ct_name, 'rb') <NEW_LINE> ct = read_file(f) <NEW_LINE> got = ct.ImagePositionPatient <NEW_LINE> DS = pydicom.valuerep.DS <NEW_LINE> expected = [DS('-158.135803'), DS('-179.035797'), DS('-75.69...
Test that can read DICOM files with file-like object rather than filename
62598fa43539df3088ecc167
class PdfError(LookupError): <NEW_LINE> <INDENT> pass
raise this when there's a pdf error for my app
62598fa4097d151d1a2c0eda
class ChannelType(IntEnum): <NEW_LINE> <INDENT> GUILD_TEXT = 0 <NEW_LINE> DM = 1 <NEW_LINE> GUILD_VOICE = 2 <NEW_LINE> GROUP_DM = 3 <NEW_LINE> GUILD_CATEGORY = 4 <NEW_LINE> GUILD_NEWS = 5 <NEW_LINE> GUILD_STORE = 6 <NEW_LINE> GUILD_NEWS_THREAD = 10 <NEW_LINE> GUILD_PUBLIC_THREAD = 11 <NEW_LINE> GUILD_PRIVATE_THREAD = 1...
An enumerable object representing the type of channels.
62598fa45fdd1c0f98e5de4b
class _OutputTextBoxWidget(QPlainTextEdit): <NEW_LINE> <INDENT> def __init__(self, master, light_up_plug, letter_group_plug): <NEW_LINE> <INDENT> super().__init__(master) <NEW_LINE> self.setPlaceholderText("Encrypted message will appear here") <NEW_LINE> self.setReadOnly(True) <NEW_LINE> self.setStyleSheet("background-...
Displays read-only text, allows synchronized scrolling and text selection
62598fa466673b3332c3027c
class PyLintCodeReviewer(CodeReviewer): <NEW_LINE> <INDENT> def __init__(self, out_stream): <NEW_LINE> <INDENT> super().__init__(out_stream) <NEW_LINE> <DEDENT> def _name(self): <NEW_LINE> <INDENT> return "PyLint Code Reviewer" <NEW_LINE> <DEDENT> def _execute_review(self, file_path, out_stream): <NEW_LINE> <INDENT> tr...
A code reviewer class, which uses a PyLint tool to review python scripts.
62598fa4cc0a2c111447aec3
class Base: <NEW_LINE> <INDENT> __nb_objects = 0 <NEW_LINE> def __init__(self, id=None): <NEW_LINE> <INDENT> if id is not None: <NEW_LINE> <INDENT> self.id = id <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> Base.__nb_objects += 1 <NEW_LINE> self.id = Base.__nb_objects <NEW_LINE> <DEDENT> <DEDENT> @staticmethod <NEW_LIN...
A `Base` class using a private class attribute `__nb_objects` to manage the public instance attribute `id` in all our future classes and to avoid duplicating the same code (by extension, same bugs).
62598fa4090684286d593635
class ReplicapoolupdaterUpdatesCancelRequest(messages.Message): <NEW_LINE> <INDENT> instanceGroupManager = messages.StringField(1, required=True) <NEW_LINE> project = messages.StringField(2, required=True) <NEW_LINE> update = messages.StringField(3, required=True) <NEW_LINE> zone = messages.StringField(4, required=True...
A ReplicapoolupdaterUpdatesCancelRequest object. Fields: instanceGroupManager: Name of the instance group manager for this request. project: Project ID for this request. update: Unique (in the context of a group) handle of an update. zone: Zone for the instance group manager.
62598fa421bff66bcd722b19
class TestRecurring: <NEW_LINE> <INDENT> def test_print_recurring_report( self, runner: CliRunner, repo_e2e: Repository ) -> None: <NEW_LINE> <INDENT> parent = RecurrentTaskFactory.create(description="D", priority=1, area="A") <NEW_LINE> repo_e2e.add(parent) <NEW_LINE> repo_e2e.commit() <NEW_LINE> expected_output = [ r...
Test the implementation of the recurring report. It's an alias to `report open`, so we only need to test that it works as expected by default and that it accepts a task filter.
62598fa445492302aabfc384
class UrlDispatcherNonRootTests(AppTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTree(cls): <NEW_LINE> <INDENT> cls.root = SimpleTextPage.objects.create( title="Text1", slug="sibling1", status=SimpleTextPage.PUBLISHED, author=cls.user, contents="TEST_CONTENTS", ) <NEW_LINE> <DEDENT> @override_settings...
Tests for URL resolving with a non-root URL include.
62598fa410dbd63aa1c70a64
class MixtureNQExpr(nql.NeuralQueryExpression): <NEW_LINE> <INDENT> def _follow_relation_set(self, rel_expr, inverted): <NEW_LINE> <INDENT> if not self.context.is_group(rel_expr.type_name): <NEW_LINE> <INDENT> raise nql.RelationNameError(rel_expr.type_name, 'Expression type is not a relation group.') <NEW_LINE> <DEDENT...
Implements x.follow(r) as sum_i r[i] x.dot(M_i). Here r[i] is scalar weight of relation i in vector r, M_i is sparse matrix for relation i, and x.dot(M_i) is vector-matrix product. This is the 'late mixing' method.
62598fa4fff4ab517ebcd698
class DeviceResource(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> return map(Device.to_json, Device.query.all())
The device resource handles API requests relating to robomussel data. Will output all device information.
62598fa4627d3e7fe0e06d60
class Solution: <NEW_LINE> <INDENT> def findFirstBadVersion(self, n): <NEW_LINE> <INDENT> pass
@param n: An integer @return: An integer which is the first bad version.
62598fa44a966d76dd5eed96
class EnCat(PetCat): <NEW_LINE> <INDENT> def eat(self): <NEW_LINE> <INDENT> print("英短啥都吃")
英国短毛猫
62598fa4851cf427c66b817d