code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class population: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.pop = [candidate() for i in xrange(size)] <NEW_LINE> self.children = []
Defines the population object. :Attributes: -pop: A list of randomly initialized candidates. -children: The list of children produced by pop after crossover and mutation.
6259905b45492302aabfdaca
class Data: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass
creates new instance of the data class
6259905b4e4d5625663739f9
class Server: <NEW_LINE> <INDENT> def __init__( self, app, args, work_dir, name="node", port=VAST_PORT, config_file=None, **kwargs, ): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> if config_file: <NEW_LINE> <INDENT> self.config_arg = f"--config={SET_DIR/config_file}" <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self....
Server fixture implementation details
6259905bd99f1b3c44d06c93
class ManagedClusterWindowsProfile(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'admin_username': {'required': True}, } <NEW_LINE> _attribute_map = { 'admin_username': {'key': 'adminUsername', 'type': 'str'}, 'admin_password': {'key': 'adminPassword', 'type': 'str'}, 'license_type': {'key': 'license...
Profile for Windows VMs in the managed cluster. All required parameters must be populated in order to send to Azure. :ivar admin_username: Required. Specifies the name of the administrator account. :code:`<br>`:code:`<br>` **Restriction:** Cannot end in "." :code:`<br>`:code:`<br>` **Disallowed values:** "administr...
6259905b91af0d3eaad3b41b
class CPF_service( cpppo.dfa ): <NEW_LINE> <INDENT> def __init__( self, name=None, **kwds ): <NEW_LINE> <INDENT> name = name or kwds.setdefault( 'context', self.__class__.__name__ ) <NEW_LINE> svcs = CPF( terminal=True ) <NEW_LINE> super( CPF_service, self ).__init__( name=name, initial=svcs, **kwds ) <NEW_LINE> <...
Handle Service request/reply that are encoded as a CPF list. We must deduce whether we are parsing a request or a reply. The request will have a 0 length; the reply (which must contain a CPF with at least an item count) will have a non-zero length. Even if the request is empty, we want to produce 'CIP.<service_name>...
6259905b0fa83653e46f64d9
class JointLiabilityGuaranteeCalcWeight(CalcWeight): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def calc_weight(cls, guarantee_sum: int, duration: int, state: loan_state): <NEW_LINE> <INDENT> return guarantee_sum
连带责任保证
6259905b8a43f66fc4bf3780
class AboutMeHdlr(MetriqueHdlr): <NEW_LINE> <INDENT> @authenticated <NEW_LINE> def get(self, owner): <NEW_LINE> <INDENT> result = self.aboutme(owner=owner) <NEW_LINE> self.write(result) <NEW_LINE> <DEDENT> def aboutme(self, owner): <NEW_LINE> <INDENT> self.user_exists(owner) <NEW_LINE> mask = ['passhash'] <NEW_LINE> if...
RequestHandler for seeing your user profile action can be addToSet, pull role can be read, write, admin
6259905b56b00c62f0fb3ebe
class NumericQueryField(NumericQueryMixin, QueryField): <NEW_LINE> <INDENT> def _expr(self, prefix): <NEW_LINE> <INDENT> return NumericQueryExpression(prefix + [self._field.name])
Class for expression-based numeric fields
6259905b097d151d1a2c2660
class CendariAuthPlugin(plugins.SingletonPlugin): <NEW_LINE> <INDENT> plugins.implements(plugins.IConfigurer) <NEW_LINE> plugins.implements(plugins.IAuthenticator) <NEW_LINE> def update_config(self, config): <NEW_LINE> <INDENT> toolkit.add_template_directory(config, 'templates') <NEW_LINE> <DEDENT> def get_auth_functio...
Main plugin class implemeting ``IConfigurer`` and ``IAuthenticator``.
6259905b2c8b7c6e89bd4de1
class Solution: <NEW_LINE> <INDENT> @timeit <NEW_LINE> def isBoomerang(self, points: List[List[int]]) -> bool: <NEW_LINE> <INDENT> a, b, c = points <NEW_LINE> if a == b or a == c or b == c: return False <NEW_LINE> x1, x2 = a[0] - b[0], a[0] - c[0] <NEW_LINE> if x1 == 0 or x2 == 0: return x1 == x2 <NEW_LINE> y1, y2 = a[...
[1037. 有效的回旋镖](https://leetcode-cn.com/problems/valid-boomerang/)
6259905b1b99ca4002290031
class GroupLeftCallback(NotificationCallback): <NEW_LINE> <INDENT> __slots__ = NotificationCallback.__slots__ <NEW_LINE> def test(self, node): <NEW_LINE> <INDENT> if not node.has_child("remove"): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return Super(GroupChangedCallback, self).test(node)
Callback for group left notifications.
6259905b0a50d4780f7068b8
class SRWLOptMirPl(SRWLOptMir): <NEW_LINE> <INDENT> def __init__(self, _size_tang=1, _size_sag=1, _ap_shape='r', _sim_meth=2, _treat_in_out=1, _ext_in=0, _ext_out=0, _nvx=0, _nvy=0, _nvz=-1, _tvx=1, _tvy=0, _x=0, _y=0, _refl=1, _n_ph_en=1, _n_ang=1, _n_comp=1, _ph_en_start=1000., _ph_en_fin=1000., _ph_en_scale_type='li...
Optical Element: Mirror: Plane
6259905b2ae34c7f260ac6db
class ActiveMeasurement(base_model.BaseModel): <NEW_LINE> <INDENT> __tablename__ = "active_measurements" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> network_interface_id = db.Column(db.Integer, db.ForeignKey("network_interfaces.id")) <NEW_LINE> date = db.Column(db.DateTime) <NEW_LINE> dispatched ...
Active measurement model class
6259905b29b78933be26abbe
class ModelViewTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> <DEDENT> def test_list_model(self): <NEW_LINE> <INDENT> url = reverse('catalog_model_list') <NEW_LINE> response = self.client.get(url) <NEW_LINE> self.assertEqual(response.status_code, 200)...
Tests for Model
6259905b99cbb53fe68324d4
class TestRadioVisServiceList(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self._test_radiovis_services = [] <NEW_LINE> tree = xml.etree.ElementTree.parse(filename) <NEW_LINE> for test_radiovis_service in tree.findall("test_radiovis_service"): <NEW_LINE> <INDENT> name = test_rad...
A list of test RadioVIS services (L{TestRadioVisService} objects).
6259905bd53ae8145f919a56
class PMPackageSet(ABCObject, BoolCompat): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __iter__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def filter(self, *args, **kwargs): <NEW_LINE> <INDENT> return PMFilteredPackageSet(self, args, kwargs) <NEW_LINE> <DEDENT> @property <NEW_LINE> def best(self): <NEW_...
A set of packages.
6259905b91f36d47f2231989
class RemoveTest(test_case.TestCase): <NEW_LINE> <INDENT> def test_not_found(self): <NEW_LINE> <INDENT> def delete_machine(*args, **kwargs): <NEW_LINE> <INDENT> self.fail('delete_machine called') <NEW_LINE> <DEDENT> self.mock(catalog.machine_provider, 'delete_machine', delete_machine) <NEW_LINE> catalog.remove(ndb.Key(...
Tests for catalog.remove.
6259905b32920d7e50bc763a
class Checker(): <NEW_LINE> <INDENT> def __init__(self, URL = URL_APPROVED, HEADER = HEADER): <NEW_LINE> <INDENT> self.URL = URL <NEW_LINE> self.HTML = '' <NEW_LINE> self.HEADER = HEADER <NEW_LINE> <DEDENT> def get_html(self): <NEW_LINE> <INDENT> self.HTML = requests.get(self.URL, headers = self.HEADER).text <NEW_LINE...
Class for checking storing and retrieving data from FDA susing URL_APPROVED but for that url data are updated in few days but this data can be used for analysis because it is much easier to extract name of Company and drug name from URL_APPROVED
6259905b7cff6e4e811b7038
class DistributionSysTypeSetIterator(APIObject,IDisposable,IEnumerator): <NEW_LINE> <INDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def MoveNext(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def next(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ReleaseManagedResources(sel...
An iterator to a DistributionSys type set. DistributionSysTypeSetIterator()
6259905b627d3e7fe0e08480
class Binomial(Distribution): <NEW_LINE> <INDENT> def __init__(self, prob=.5, size=20): <NEW_LINE> <INDENT> self.p = prob <NEW_LINE> self.n= size <NEW_LINE> mu = self.calculate_mean() <NEW_LINE> sigma = self.calculate_stdev() <NEW_LINE> Distribution.__init__(self, mu, sigma) <NEW_LINE> <DEDENT> def calculate_mean(self)...
Binomial distribution class for calculating and visualizing a Binomial distribution. Attributes: mean (float) representing the mean value of the distribution stdev (float) representing the standard deviation of the distribution data_list (list of floats) a list of floats to be extracted from the data file...
6259905b009cb60464d02b2a
class TONE(CheckerMixin): <NEW_LINE> <INDENT> MIXED = 'mixed' <NEW_LINE> NEGATIVE = 'negative' <NEW_LINE> NEUTRAL = 'neutral' <NEW_LINE> POSITIVE = 'positive'
Tone of a publication given by our algorithms
6259905bbe8e80087fbc0678
class Transaction(models.Model): <NEW_LINE> <INDENT> type = models.IntegerField(null=True, blank=True) <NEW_LINE> reward = models.IntegerField(null=True, blank=True) <NEW_LINE> user = models.ForeignKey(SiteUser, related_name='trans_user' ,null=True, blank=True) <NEW_LINE> current_balance = models.IntegerField(null=True...
交易
6259905b8e7ae83300eea682
class DictionaryManager(): <NEW_LINE> <INDENT> def __init__(self, dictionarySource): <NEW_LINE> <INDENT> from ntpath import basename, splitext <NEW_LINE> self.source = dictionarySource <NEW_LINE> self.dataStore = '{}.data'.format(splitext(basename(dictionarySource))[0]) <NEW_LINE> <DEDENT> def reprocess(self): <NEW_LIN...
used to retrieve and write pre-processed dictionaries to disk
6259905b097d151d1a2c2662
class Compile: <NEW_LINE> <INDENT> def __init__(self, op_list): <NEW_LINE> <INDENT> self.op_list = op_list <NEW_LINE> <DEDENT> def _iterops(self): <NEW_LINE> <INDENT> for ops in self.op_list: <NEW_LINE> <INDENT> if type(ops) == list: <NEW_LINE> <INDENT> for op in ops: <NEW_LINE> <INDENT> yield op <NEW_LINE> <DEDENT> <D...
Compiles a set of functions f_i : 2^T -> {0,1}^F_i to a single function 2^T -> {0,1}^F where F <= \sum_i F_i i.e. we can do filtering and/or merging at this point (?)
6259905badb09d7d5dc0bb5f
class ProtocolFile(BaseModel): <NEW_LINE> <INDENT> name: str = Field(..., description="The file's basename, including extension") <NEW_LINE> role: ProtocolFileRole = Field(..., description="The file's role in the protocol.")
A file in a protocol.
6259905b1b99ca4002290032
class TestSyncServiceTargetApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = isi_sdk_9_0_0.api.sync_service_target_api.SyncServiceTargetApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_policies_policy_cancel_item(self): ...
SyncServiceTargetApi unit test stubs
6259905b379a373c97d9a61a
class SBTypeSummaryOptions(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, SBTypeSummaryOptions, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, SBTypeSummaryOptions, name) <NEW...
Proxy of C++ lldb::SBTypeSummaryOptions class.
6259905ba8370b77170f19c4
class ContextMixin(object): <NEW_LINE> <INDENT> def get_rendering_context(self, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError("Subclasses must override this method.")
Defines a ``GET`` method that invokes :meth:`get_rendering_context()` and returns its result to the client.
6259905b99cbb53fe68324d6
class Resource(object): <NEW_LINE> <INDENT> _URL = 'https://graphql.anilist.co' <NEW_LINE> _METHOD = 'POST' <NEW_LINE> _ENDPOINT = '/' <NEW_LINE> _HEADERS = { 'Content-Type': 'application/json', 'Accept': 'application/json', } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._pool = urllib3.PoolManager(cert_reqs...
Abstract resource class. Works as a base class for all other resources, keeping the generic and re-usable functionality. Provides to the classes that inherit it with a connection pool (:any:`urllib3.connectionpool.HTTPSConnectionPool`) and methods to make requests to the anilist api through it. All resources **must*...
6259905b91f36d47f223198a
class ViewLiveButtonHelper(PageButtonHelper): <NEW_LINE> <INDENT> def get_buttons_for_obj(self, obj, exclude=None, classnames_add=None, classnames_exclude=None): <NEW_LINE> <INDENT> btns = super().get_buttons_for_obj( obj, exclude, classnames_add, classnames_exclude) <NEW_LINE> extra_btns = [ { 'url': obj.get_url(), 'l...
Override to add 'View Live' button
6259905bbaa26c4b54d5089b
@register_event('templatesendjobfinish') <NEW_LINE> class TemplateSendJobFinishEvent(BaseEvent): <NEW_LINE> <INDENT> event = 'templatesendjobfinish' <NEW_LINE> status = StringField('Status')
模板消息任务完成事件 详情请参阅 http://mp.weixin.qq.com/wiki/17/304c1885ea66dbedf7dc170d84999a9d.html
6259905b30dc7b76659a0d7b
class TestStream(FnStream): <NEW_LINE> <INDENT> def __init__(self, inp, domain, test, graph, **kwargs): <NEW_LINE> <INDENT> super(TestStream, self).__init__(inp, domain, lambda *args: tuple() if test(*args) else None, [], graph, **kwargs)
Function
6259905b23849d37ff8526bc
class UnexpectedResponseError(InteroperabilityError): <NEW_LINE> <INDENT> pass
Exception raised when the received message was not expected in the current step of the executed test.
6259905b004d5f362081fae9
class WarehouseGraph(Graph): <NEW_LINE> <INDENT> def __init__(self, storage, products): <NEW_LINE> <INDENT> super(WarehouseGraph, self).__init__() <NEW_LINE> self.order = products <NEW_LINE> self.gathered_products = {key: 0 for key in products.iterkeys()} <NEW_LINE> self.storage = storage <NEW_LINE> self.insufficient =...
Class implementing the connections and stocks of warehouses directly
6259905b01c39578d7f14232
class MockPostgresCursor(mock.Mock): <NEW_LINE> <INDENT> def __init__(self, existing_update_ids): <NEW_LINE> <INDENT> super(MockPostgresCursor, self).__init__() <NEW_LINE> self.existing = existing_update_ids <NEW_LINE> <DEDENT> def execute(self, query, params): <NEW_LINE> <INDENT> if query.startswith('SELECT 1 FROM tab...
Keeps state to simulate executing SELECT queries and fetching results.
6259905b32920d7e50bc763d
class YAKAPISettings(APISettings): <NEW_LINE> <INDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> if attr not in self.defaults.keys(): <NEW_LINE> <INDENT> raise AttributeError("Invalid API setting: '%s'" % attr) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> val = self.user_settings[attr] <NEW_LINE> <DEDENT> except...
Adds the ability to import strings in dictionaries
6259905b16aa5153ce401adb
class TelnetOption(object): <NEW_LINE> <INDENT> def __init__(self, serialised=None): <NEW_LINE> <INDENT> self.local = UNKNOWN <NEW_LINE> self.remote = UNKNOWN <NEW_LINE> self.pending = False <NEW_LINE> if serialised: <NEW_LINE> <INDENT> self.deserialise(serialised) <NEW_LINE> <DEDENT> <DEDENT> def serialise(self): <NEW...
Simple class used to track the status of a Telnet option
6259905b0a50d4780f7068ba
class SimpleLSTM(nn.Module): <NEW_LINE> <INDENT> def __init__(self, inp_size: int, out_size: int): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.lstm = nn.LSTM(input_size=inp_size, hidden_size=out_size) <NEW_LINE> <DEDENT> def forward(self, xs): <NEW_LINE> <INDENT> out, _ = self.lstm(xs.view(xs.shape[0], 1, xs...
Contextualise the input sequence of embedding vectors using unidirectional LSTM. Type: Tensor[N x Din] -> Tensor[N x Dout], where * `N` is is the length of the input sequence * `Din` is the input embedding size * `Dout` is the output embedding size Example: >>> lstm = SimpleLSTM(3, 5) # input size 3, output size 5...
6259905b63d6d428bbee3d83
class PioneerCoin(Bitcoin): <NEW_LINE> <INDENT> name = 'pioneercoin' <NEW_LINE> symbols = ('PCOIN', ) <NEW_LINE> seeds = ('seed5.cryptolife.net', 'seed2.cryptolife.net', 'seed3.cryptolife.net', 'electrum3.cryptolife.net') <NEW_LINE> port = 35514 <NEW_LINE> message_start = b'\xfe\xc3\xb9\xde' <NEW_LINE> base58_prefixes ...
Class with all the necessary PioneerCoin (PCOIN) network information based on https://github.com/PCOIN/PIONEERCOIN/blob/master/src/net.cpp (date of access: 02/17/2018)
6259905b2ae34c7f260ac6de
class MessageFlowError(SignalingError): <NEW_LINE> <INDENT> pass
Raised when an associated message is considered valid but it has been sent or received at a point in time where it's unexpected or other circumstances prevent it from being processed (such as a combined sequence number overflow).
6259905b24f1403a926863ca
class ExpressionDictOperationPop2(ExpressionChildrenHavingBase): <NEW_LINE> <INDENT> kind = "EXPRESSION_DICT_OPERATION_POP2" <NEW_LINE> named_children = ("dict_arg", "key") <NEW_LINE> __slots__ = ("known_hashable_key",) <NEW_LINE> def __init__(self, dict_arg, key, source_ref): <NEW_LINE> <INDENT> assert dict_arg is not...
This operation represents d.pop(key), i.e. default None.
6259905b8e7ae83300eea685
@ddt.ddt <NEW_LINE> class TestMicrosites(DatabaseMicrositeTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestMicrosites, self).setUp() <NEW_LINE> <DEDENT> @ddt.data(*MICROSITE_BACKENDS) <NEW_LINE> def test_get_value_for_org_when_microsite_has_no_org(self, site_backend): <NEW_LINE> <INDENT> wi...
Run through some Microsite logic
6259905b55399d3f05627b16
class OverwritePlugin(utils.OperationWrapper, plugins.ToolsPlugin): <NEW_LINE> <INDENT> menu = ('Misura', 'Overwrite datasets') <NEW_LINE> name = 'Overwrite' <NEW_LINE> description_short = 'Overwrite one dataset with another one' <NEW_LINE> description_full = ('Overwrite dataset A with dataset B.' 'Optionally delete B ...
Overwrite two datasets.
6259905b0c0af96317c5785b
class FunctionCall: <NEW_LINE> <INDENT> def __init__(self, fun_expr, args): <NEW_LINE> <INDENT> self.fun_expr = fun_expr <NEW_LINE> self.args = args <NEW_LINE> <DEDENT> def evaluate(self, scope): <NEW_LINE> <INDENT> fun = self.fun_expr.evaluate(scope) <NEW_LINE> new_scope = Scope(parent=scope) <NEW_LINE> for i in range...
FunctionCall - представляет вызов функции в программе. В результате вызова функции должен создаваться новый объект Scope, являющий дочерним для текущего Scope (т. е. текущий Scope должен стать для него родителем). Новый Scope станет текущим Scope-ом при вычислении тела функции.
6259905b91f36d47f223198b
class ExecuteAddressGoal(BaseGoal): <NEW_LINE> <INDENT> def __init__(self, addr): <NEW_LINE> <INDENT> super(ExecuteAddressGoal, self).__init__('execute_address') <NEW_LINE> self.addr = addr <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<ExecuteAddressCondition targeting %#x>" % self.addr <NEW_LINE...
A goal that prioritizes states reaching (or are likely to reach) certain address in some specific steps.
6259905b23e79379d538daf4
class SearchQuery(object): <NEW_LINE> <INDENT> def __init__(self, query, label=None): <NEW_LINE> <INDENT> self.query = stripAccents(query) <NEW_LINE> self.declared_label = stripAccents(label) <NEW_LINE> self.label = self.declared_label or self.query <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _get_label_delimiter(c...
Represents a query object that contains both a query and an optional label
6259905bf7d966606f7493b4
class BotInfoCommand(BaseCommand): <NEW_LINE> <INDENT> command_name = "botinfo" <NEW_LINE> @inlineCallbacks <NEW_LINE> def run(self, protocol, parsed_line, invoker_dbref): <NEW_LINE> <INDENT> bot_dbref = yield mux_commands.think(protocol, "%#") <NEW_LINE> bot_name = yield mux_commands.think(protocol, "[name(%#)]") <NEW...
Shows some assorted info about the bot.
6259905b8e71fb1e983bd0c2
class QueuedProxyLogger(StructuredLogger): <NEW_LINE> <INDENT> threads = {} <NEW_LINE> def __init__(self, logger): <NEW_LINE> <INDENT> StructuredLogger.__init__(self, logger.name) <NEW_LINE> if logger.name not in self.threads: <NEW_LINE> <INDENT> self.threads[logger.name] = LogQueueThread(Queue(), logger) <NEW_LINE> se...
Logger that logs via a queue. This is intended for multiprocessing use cases where there are some subprocesses which want to share a log handler with the main thread, without the overhead of having a multiprocessing lock for all logger access.
6259905b009cb60464d02b2e
class PersonProductRegisteredBranchesView(PersonProductBaseBranchesView): <NEW_LINE> <INDENT> label_template = ( 'Bazaar Branches of %(product)s registered by %(person)s') <NEW_LINE> def _getCollection(self): <NEW_LINE> <INDENT> return getUtility(IAllBranches).registeredBy( self.context.person).inProduct(self.context.p...
Branch listing for a person's registered branches of a product.
6259905b627d3e7fe0e08484
class Query(datastore.Query): <NEW_LINE> <INDENT> def __init__(self, kind, filters, orderings=None): <NEW_LINE> <INDENT> super(Query, self).__init__(kind, filters) <NEW_LINE> if orderings: <NEW_LINE> <INDENT> self.Order(*orderings) <NEW_LINE> <DEDENT> <DEDENT> def IsKeysOnly(self): <NEW_LINE> <INDENT> return False <NEW...
This class extends ``datastore.Query`` class to handles `key` filters.
6259905bd7e4931a7ef3d677
class YoutubeDialog(QDialog): <NEW_LINE> <INDENT> def __init__(self, videos, parent): <NEW_LINE> <INDENT> QDialog.__init__(self, parent) <NEW_LINE> self.videos = videos <NEW_LINE> self.setupUi(self) <NEW_LINE> <DEDENT> def setupUi(self, Dialog): <NEW_LINE> <INDENT> Dialog.resize(316, 238) <NEW_LINE> Dialog.setWindowTit...
This dialog is used to select which resolution to download
6259905b7d847024c075d9d5
class YamadaK4Test(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> k4 = instantiate_k_graph(4) <NEW_LINE> k4_yamada = yamada.Yamada(k4) <NEW_LINE> self.msts = k4_yamada.spanning_trees() <NEW_LINE> <DEDENT> def test_number_of_msts(self): <NEW_LINE> <INDENT> self.assertTrue(len(self.msts) == ...
Test the minimum spanning trees returned from K4. K4 is a complete graph of three nodes with fixed weights, w(e_i) = 1.
6259905b0fa83653e46f64de
class FrameServer(Service): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.port = kwargs.pop("port", 0) <NEW_LINE> super(FrameServer, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def main(self): <NEW_LINE> <INDENT> tornado.ioloop.IOLoop.current().clear_instance() <NEW_LINE> tor...
A service that run a mjpeg server with incoming message
6259905b8e71fb1e983bd0c3
class RazerBladeStealthLate2019(_RippleKeyboard): <NEW_LINE> <INDENT> EVENT_FILE_REGEX = re.compile(r'.*Razer_Blade_Stealth(-if01)?-event-kbd') <NEW_LINE> USB_VID = 0x1532 <NEW_LINE> USB_PID = 0x024A <NEW_LINE> METHODS = ['get_device_type_keyboard', 'set_static_effect', 'set_spectrum_effect', 'set_none_effect', 'set_br...
Class for the Razer Blade Stealth (Late 2019)
6259905b3cc13d1c6d466d39
class BuildProfileLocally(plugin.Command): <NEW_LINE> <INDENT> name = "build_local_profile" <NEW_LINE> @classmethod <NEW_LINE> def args(cls, parser): <NEW_LINE> <INDENT> super(BuildProfileLocally, cls).args(parser) <NEW_LINE> parser.add_argument( "module_name", help="The name of the module (without the .pdb extensilon)...
Download and builds a profile locally in one step. We store the profile in the first repository in the profile_path which must be writable. Usually this is a caching repository so the profile goes in the local cache.
6259905b3539df3088ecd895
class TestTakeCustomChartOptions: <NEW_LINE> <INDENT> def test_take_custom_chart_options(self): <NEW_LINE> <INDENT> assert take_custom_chart_options() is None
Function currently not implemented.
6259905b462c4b4f79dbcfff
class SubscriptionDiagnosticSettingsResource(SubscriptionProxyOnlyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': '...
The subscription diagnostic setting resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Azure resource Id. :vartype id: str :ivar name: Azure resource name. :vartype name: str :ivar type: Azure resource type. :vartype type: str :param location: Location of the r...
6259905b16aa5153ce401add
class ListHypervisor(command.Lister): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(ListHypervisor, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( "--matching", metavar="<hostname>", help="Filter hypervisors using <hostname> substring", ) <NEW_LINE> return parser <...
List hypervisors
6259905b63d6d428bbee3d84
class GetInfoInputSet(InputSet): <NEW_LINE> <INDENT> def set_APIKey(self, value): <NEW_LINE> <INDENT> super(GetInfoInputSet, self)._set_input('APIKey', value) <NEW_LINE> <DEDENT> def set_APISecret(self, value): <NEW_LINE> <INDENT> super(GetInfoInputSet, self)._set_input('APISecret', value) <NEW_LINE> <DEDENT> def set_A...
An InputSet with methods appropriate for specifying the inputs to the GetInfo Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
6259905b55399d3f05627b18
class ExactInference(InferenceModule): <NEW_LINE> <INDENT> def initializeUniformly(self, gameState): <NEW_LINE> <INDENT> self.beliefs = DiscreteDistribution() <NEW_LINE> for p in self.legalPositions: <NEW_LINE> <INDENT> self.beliefs[p] = 1.0 <NEW_LINE> <DEDENT> self.beliefs.normalize() <NEW_LINE> <DEDENT> def observeUp...
The exact dynamic inference module should use forward algorithm updates to compute the exact belief function at each time step.
6259905bb5575c28eb7137c9
class TczHourSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = TczHour <NEW_LINE> fields = ('id', 'tcz_date', 'tcz_user', 'tcz_user_change', 'tcz_court', 'tcz_hour', 'tcz_free', ) <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE> <INDENT> tcz_hour = TczH...
serializer for the reserved hour
6259905b45492302aabfdad2
class WikipediaAr(Platform): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.platformName = "Wikipedia (ar)" <NEW_LINE> self.parameterName = "wikipedia" <NEW_LINE> self.tags = ["education", "wiki"] <NEW_LINE> self.isValidMode = {} <NEW_LINE> self.isValidMode["phonefy"] = False <NEW_LINE> self.isValidMo...
A <Platform> object for WikipediaAr.
6259905bbaa26c4b54d5089f
class TDBException(TException): <NEW_LINE> <INDENT> def __init__(self, error_msg=None,): <NEW_LINE> <INDENT> self.error_msg = error_msg <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not ...
Attributes: - error_msg
6259905b99cbb53fe68324da
class NetworkTableConnection: <NEW_LINE> <INDENT> def __init__(self, stream, typeManager): <NEW_LINE> <INDENT> self.stream = stream <NEW_LINE> self.rstream = ReadStream(stream.getInputStream()) <NEW_LINE> self.wstream = stream.getOutputStream() <NEW_LINE> self.typeManager = typeManager <NEW_LINE> self.write_lock = _imp...
An abstraction for the NetworkTable protocol
6259905b009cb60464d02b2f
class SchemaSet(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.schemata = {} <NEW_LINE> for section in Schema.SECTIONS: <NEW_LINE> <INDENT> for name, sconfig in data.get(section, {}).items(): <NEW_LINE> <INDENT> if name in self.schemata: <NEW_LINE> <INDENT> raise TypeError("Duplicate sc...
A collection of schemata.
6259905ba8ecb03325872811
class DataWithOracleGivensLC(GivensLC): <NEW_LINE> <INDENT> def process(self, data, oracle, *args, target_names=None, prelabel_data=True, feature_groups=None, **kwargs): <NEW_LINE> <INDENT> if target_names is not None: <NEW_LINE> <INDENT> self.target_names = target_names <NEW_LINE> <DEDENT> if feature_groups is not Non...
Given LC for the usual explanation setting, where we have unlabeled training data and a predictor oracle.
6259905b32920d7e50bc7640
@pytest.mark.skipif(ARCH not in ("i686", "x86_64"), reason=f"Skipped for {ARCH}") <NEW_LINE> class SyscallArgsCommand(GefUnitTestGeneric): <NEW_LINE> <INDENT> @pytest.mark.online <NEW_LINE> def setUp(self) -> None: <NEW_LINE> <INDENT> self.tempdirfd = tempfile.TemporaryDirectory(prefix=GEF_DEFAULT_TEMPDIR) <NEW_LINE> s...
`syscall-args` command test module
6259905b23e79379d538daf6
class TempObj(Managed): <NEW_LINE> <INDENT> def as_input(self): <NEW_LINE> <INDENT> return TempInputObj(self.name, *self.axes, **self.kwargs) <NEW_LINE> <DEDENT> def as_output(self): <NEW_LINE> <INDENT> return TempOutputObj(self.name, *self.axes, **self.kwargs) <NEW_LINE> <DEDENT> def create_arg(self, job): <NEW_LINE> ...
Interface class used to represent a managed object
6259905b6e29344779b01c47
class Robot(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.x = 10 <NEW_LINE> self.y = 10 <NEW_LINE> self.fuel = 100 <NEW_LINE> <DEDENT> def moveLeft(self): <NEW_LINE> <INDENT> if self.fuel >= 5: <NEW_LINE> <INDENT> self.x -= 1 <NEW_LINE> self.fuel -= 5 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ...
Robot class to create and move robot around
6259905b435de62698e9d3ff
class ParkingLotFormView(CustomUserMixin, CreateView): <NEW_LINE> <INDENT> model = ParkingLot <NEW_LINE> form_class = ParkingLotForm <NEW_LINE> template_name = 'buildings/administrative/parking_lots/parkinglot_form.html' <NEW_LINE> def test_func(self): <NEW_LINE> <INDENT> return BuildingPermissions.can_edit_unit( user=...
Form view to create a new parking lot of a unit.
6259905b0fa83653e46f64e0
class WalletUserListView(generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = WalletUserSerializer <NEW_LINE> queryset = WalletUser.objects.all()[:1]
This view returns the details of a test admin. Click on the login button on the rest framework console. Enter "walletadmin"as username. Enter "mobilewallet2020" as password. You can also use these credentials to log into the admin console: https://walletcore.herokuapp.com/admin/ You can also navigate to /api/v1/do...
6259905b3cc13d1c6d466d3b
class DatabaseStatTracker(util.CursorDebugWrapper): <NEW_LINE> <INDENT> def execute(self, sql, params=()): <NEW_LINE> <INDENT> start = datetime.now() <NEW_LINE> try: <NEW_LINE> <INDENT> return self.cursor.execute(sql, params) <NEW_LINE> <DEDENT> finally: <NEW_LINE> <INDENT> stop = datetime.now() <NEW_LINE> duration = m...
Replacement for CursorDebugWrapper which stores additional information in `connection.queries`.
6259905badb09d7d5dc0bb65
class And( Validator ): <NEW_LINE> <INDENT> def __init__( self, *args ): <NEW_LINE> <INDENT> super( And, self ).__init__(u'') <NEW_LINE> self.validators = args <NEW_LINE> <DEDENT> def isValid( self, element ): <NEW_LINE> <INDENT> for validator in self.validators: <NEW_LINE> <INDENT> validator.validate( element ) <NEW_L...
Validate the given element. If an error is raised by the children it will delegate this exception to the parent element.
6259905b3c8af77a43b68a3e
class ManageUserView(generics.RetrieveUpdateAPIView): <NEW_LINE> <INDENT> serializer_class = UserSerializer <NEW_LINE> authentication_classes = (authentication.TokenAuthentication,) <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return self.request.us...
Manage the auth user
6259905b63b5f9789fe8676d
class CommandHistory(): <NEW_LINE> <INDENT> __history = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.__history.append("*** new history ***") <NEW_LINE> <DEDENT> def append(self, command:str): <NEW_LINE> <INDENT> self.__history.append(command) <NEW_LINE> <DEDENT> def clear(self): <NEW_LINE> <INDENT> self._...
Models the command history object This class can be used to capture each of the commands the Robot has performed into a list so that this can be displayed or used later.
6259905b460517430c432b50
class Circuit_Logic_operateur: <NEW_LINE> <INDENT> def AND(self, a, b): <NEW_LINE> <INDENT> if a + b == 2: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> <DEDENT> def OR(self, a, b): <NEW_LINE> <INDENT> if a + b >= 1: <NEW_LINE> <INDENT> return True <NEW_L...
class de logic de circuit
6259905be76e3b2f99fd9ffa
class DUIK_OT_swap_ikfk ( bpy.types.Operator ): <NEW_LINE> <INDENT> bl_idname = "armature.swap_ikfk" <NEW_LINE> bl_label = "Swap IK / FK" <NEW_LINE> bl_options = {'REGISTER','UNDO'} <NEW_LINE> mode: bpy.props.StringProperty( default = 'AUTO' ) <NEW_LINE> @classmethod <NEW_LINE> def poll( self, context ): <NEW_LINE> <IN...
Swaps the limb rigged in IK/FK between IK and FK
6259905b55399d3f05627b1a
class IThemeSpecific(IDefaultPloneLayer): <NEW_LINE> <INDENT> pass
Marker interface that defines a Zope 3 browser layer. If you need to register a viewlet only for the "uwosh_intranet_theme_clean" theme, this interface must be its layer (in intranet_theme/viewlets/configure.zcml).
6259905ba79ad1619776b5bb
class SentMessage(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'sent_messages' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> phone = db.Column(db.String) <NEW_LINE> date = db.Column(db.DateTime) <NEW_LINE> message = db.Column(db.String) <NEW_LINE> status = db.Column(db.String) <NEW_LINE> sid = db...
Record of a sent SMS message
6259905bd53ae8145f919a5e
class MediaType(Base): <NEW_LINE> <INDENT> __tablename__ = 'MediaType' <NEW_LINE> media_type_id = Column("MediaTypeId", Integer, primary_key=True) <NEW_LINE> name = Column("Name", Unicode(120))
SQLAlchemy model for the MediaType table in our database.
6259905b3539df3088ecd898
class ScaryThrower(ThrowerAnt): <NEW_LINE> <INDENT> name = 'Scary' <NEW_LINE> implemented = True <NEW_LINE> food_cost = 6 <NEW_LINE> def throw_at(self, target): <NEW_LINE> <INDENT> if target: <NEW_LINE> <INDENT> apply_effect(make_scare, target, 2)
ThrowerAnt that intimidates Bees, making them back away instead of advancing.
6259905bf7d966606f7493b6
class PersonTag(AbstractLabel): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _('tag')
Model that represents a tag that may be used to qualify people
6259905b23849d37ff8526c2
class AmcrestSensor(Entity): <NEW_LINE> <INDENT> def __init__(self, name, device, sensor_type): <NEW_LINE> <INDENT> self._name = '{} {}'.format(name, SENSORS[sensor_type][0]) <NEW_LINE> self._signal_name = name <NEW_LINE> self._api = device.api <NEW_LINE> self._sensor_type = sensor_type <NEW_LINE> self._state = None <N...
A sensor implementation for Amcrest IP camera.
6259905bb7558d5895464a2a
class MicrophoneDistanceValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> MICROPHONE_DISTANCE_UNSPECIFIED = 0 <NEW_LINE> NEARFIELD = 1 <NEW_LINE> MIDFIELD = 2 <NEW_LINE> FARFIELD = 3
The audio type that most closely describes the audio being recognized. Values: MICROPHONE_DISTANCE_UNSPECIFIED: Audio type is not known. NEARFIELD: The audio was captured from a closely placed microphone. Eg. phone, dictaphone, or handheld microphone. Generally if there speaker is within 1 meter of the mic...
6259905b3cc13d1c6d466d3d
class Heap(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._heap = [0] <NEW_LINE> self.size = 0 <NEW_LINE> <DEDENT> @property <NEW_LINE> def heap(self): <NEW_LINE> <INDENT> return self._heap <NEW_LINE> <DEDENT> def percUp(self, i): <NEW_LINE> <INDENT> while (i // 2) > 0: <NEW_LINE> <INDENT> if self....
An implementation of the min heap in Python3
6259905b16aa5153ce401ae0
class CategoryViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = Category.objects.all() <NEW_LINE> serializer_class = CategorySerializer
API endpoint that allows categories to be viewed.
6259905b07f4c71912bb0a38
class TestIsBuildslaveDir(misc.FileIOMixin, misc.LoggingMixin, unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.mocked_stdout = io.BytesIO() <NEW_LINE> self.patch(sys, "stdout", self.mocked_stdout) <NEW_LINE> self.setUpLogging() <NEW_LINE> self.tac_file_path = os.path.join("testdir", "b...
Test buildslave.scripts.base.isBuildslaveDir()
6259905b99cbb53fe68324dd
class Config(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> return util.getJSONFile(CONFIG_PATH) <NEW_LINE> <DEDENT> def save(self, config_object): <NEW_LINE> <INDENT> return util.saveJSONFile(CONFIG_PATH, config_object)
Class to handle configuration file
6259905b63b5f9789fe8676f
class TestFunctions(unittest.TestCase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _RunTests(mock_runner, tests): <NEW_LINE> <INDENT> results = [] <NEW_LINE> tests = shard._TestCollection([shard._Test(t) for t in tests]) <NEW_LINE> shard._RunTestsFromQueue(mock_runner, tests, results, watchdog_timer.WatchdogTimer...
Tests for shard._RunTestsFromQueue.
6259905b379a373c97d9a622
class Id(Field): <NEW_LINE> <INDENT> store = True <NEW_LINE> readonly = True <NEW_LINE> def __init__(self, string=None, **kwargs): <NEW_LINE> <INDENT> super(Id, self).__init__(type='integer', string=string, **kwargs) <NEW_LINE> <DEDENT> def to_column(self): <NEW_LINE> <INDENT> return fields.integer('ID') <NEW_LINE> <DE...
Special case for field 'id'.
6259905b7047854f463409be
class SubItemPuppetClassIds(SubItem): <NEW_LINE> <INDENT> objName = 'puppetclass_ids' <NEW_LINE> payloadObj = 'puppetclass_id' <NEW_LINE> index = 'id' <NEW_LINE> def getPayloadStruct(self, attributes, objType): <NEW_LINE> <INDENT> payload = {"puppetclass_id": attributes, objType + "_class": {"puppetclass_id": attribute...
ItemOverrideValues class Represent the content of a foreman smart class parameter as a dict
6259905b29b78933be26abc3
class GalicianAnalyzerLucene( SparklingJavaTransformer, HasInputCol, HasOutputCol, HasStopwords, HasStopwordCase): <NEW_LINE> <INDENT> package_name = "com.sparklingpandas.sparklingml.feature" <NEW_LINE> class_name = "GalicianAnalyzerLucene" <NEW_LINE> transformer_name = package_name + "." + class_name <NEW_LINE> @keywo...
>>> from pyspark.sql import SparkSession >>> spark = SparkSession.builder.master("local[2]").getOrCreate() >>> df = spark.createDataFrame([("hi boo",), ("bye boo",)], ["vals"]) >>> transformer = GalicianAnalyzerLucene() >>> transformer.setParams(inputCol="vals", outputCol="out") GalicianAnalyzerLucene_... >>> result = ...
6259905b507cdc57c63a63a4
@dataclass <NEW_LINE> class ActiveLogEvents(betterproto.Message): <NEW_LINE> <INDENT> id: List[int] = betterproto.uint32_field(1)
Note: NextLogEvents has a custom equality operator in the firmware which must be updated if you add/remove/modify the fields of the protobuf definition!
6259905bf548e778e596cb91
class MeanCovTracker(object): <NEW_LINE> <INDENT> def __init__(self, x): <NEW_LINE> <INDENT> self.N = x.shape[0] <NEW_LINE> self.sx = x.sum(axis=0) <NEW_LINE> self.sxxT = np.dot(x.T, x) <NEW_LINE> self.update_mean_cov() <NEW_LINE> <DEDENT> def update_mean_cov(self): <NEW_LINE> <INDENT> self.mean = self.sx / self.N <NEW...
Tracks mean and cov of a set of points. Note: points must be given as a (N,d) np.array
6259905b4a966d76dd5f04f0
class Memory(object): <NEW_LINE> <INDENT> def __init__(self, models): <NEW_LINE> <INDENT> self.models = models <NEW_LINE> self.orig_positions = [m.pos for m in models] <NEW_LINE> <DEDENT> def restore_models(self): <NEW_LINE> <INDENT> for pos, model in zip(self.orig_positions, self.models): <NEW_LINE> <INDENT> model.pos...
It remebers falls and pushes to know what the dangerous moves.
6259905bac7a0e7691f73ae0
class VoteHandler(BaseHandler): <NEW_LINE> <INDENT> @web.authenticated <NEW_LINE> @gen.coroutine <NEW_LINE> def get(self): <NEW_LINE> <INDENT> _id = self.get_argument('_id', None) <NEW_LINE> content = self.get_argument('content', None) <NEW_LINE> vote = self.get_argument('vote', None) <NEW_LINE> _id = self.mongo_check_...
handler for /ajax/vote. Store vote under user collection.
6259905bd99f1b3c44d06c9f
@adapter(IClient) <NEW_LINE> @implementer(ILocalRoleProvider) <NEW_LINE> class ClientLocalRolesProvider(object): <NEW_LINE> <INDENT> def __init__(self, client): <NEW_LINE> <INDENT> self.context = client <NEW_LINE> <DEDENT> def getRoles(self, principal_id): <NEW_LINE> <INDENT> if principal_id == self.context.getId(): <N...
`borg.localrole` provider for :obj:`IClient` instances. This local role provider gives the client user itself the `CountryManager` local role. This allows publication of surveys inside the client since the publication machinery always runs under the client user.
6259905b91f36d47f223198e
class LinearMove(Movable): <NEW_LINE> <INDENT> def __init__(self, **options): <NEW_LINE> <INDENT> Movable.__init__(self, **options) <NEW_LINE> self.__speed = options.get("speed", 5) <NEW_LINE> angle = options.get("angle", 0) <NEW_LINE> self.__angle = 2 * math.pi - math.radians(angle) <NEW_LINE> self.__dx = 0 <NEW_LINE>...
Move an object linearly.
6259905bf7d966606f7493b7
class FruitEditView(LoginRequiredMixin, UpdateView): <NEW_LINE> <INDENT> model = models.Fruit <NEW_LINE> template_name = 'fruits/fruit_edit.html' <NEW_LINE> fields = ('name', 'price') <NEW_LINE> login_url = 'login'
果物マスタ編集ビュー
6259905bbe8e80087fbc0682
class GlusterNFSVolHelper(GlusterNFSHelper): <NEW_LINE> <INDENT> def __init__(self, execute, config_object, **kwargs): <NEW_LINE> <INDENT> self.gluster_manager = kwargs.pop('gluster_manager') <NEW_LINE> super(GlusterNFSHelper, self).__init__(execute, config_object, **kwargs) <NEW_LINE> <DEDENT> def _get_vol_exports(sel...
Manage shares with Gluster-NFS server, volume mapped variant.
6259905b009cb60464d02b34