code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class BaseSurcharge: <NEW_LINE> <INDENT> def calculate(self, basket, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError | Surcharge interface class
This is the superclass to the classes in surcharges.py. This allows using all
surcharges interchangeably (aka polymorphism).
The interface is all properties. | 6259908aad47b63b2c5a9449 |
class Surface(object): <NEW_LINE> <INDENT> def __init__(self, model, lidcontrol): <NEW_LINE> <INDENT> self._model = model <NEW_LINE> self._lidcontrol = lidcontrol <NEW_LINE> self._lidcontrolid = lidcontrol._lidcontrolid <NEW_LINE> <DEDENT> @property <NEW_LINE> def thickness(self): <NEW_LINE> <INDENT> return self._model... | +--------------------+--------------------+--------------------+--------------------+
| Layer | Parameter | Setter Before Sim | Setter During Sim |
+====================+====================+====================+====================+
| Surface | thickness | enabled ... | 6259908a55399d3f0562810b |
class UuidMixin(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._uuid = None <NEW_LINE> <DEDENT> def get_uuid(self): <NEW_LINE> <INDENT> if not self._uuid: <NEW_LINE> <INDENT> self._uuid = hashlib.sha1(b("%s:%d" % (self.id, self.driver.type))).hexdigest() <NEW_LINE> <DEDENT> return self._uuid ... | Mixin class for get_uuid function. | 6259908a3346ee7daa33845e |
class MasterOfIntrigue(Feature): <NEW_LINE> <INDENT> name = "Master of Intrigue" <NEW_LINE> source = "Rogue (Mastermind)" | When you choose this archetype at 3rd level, you gain proficiency with the
disguise kit, the forgery kit, and one gaming set Of your choice. You also
learn two languages of your choice. Additionally, you can unerringly mimic
the speech patterns and accent of a creature that you hear speak for at
least 1 minute, enablin... | 6259908adc8b845886d551b0 |
class TestUrlsApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = lockss_metadata.api.urls_api.UrlsApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_urls_doi(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_url... | UrlsApi unit test stubs | 6259908a50812a4eaa6219c1 |
class Group(TokenConverter): <NEW_LINE> <INDENT> def __init__( self, expr ): <NEW_LINE> <INDENT> super(Group,self).__init__( expr ) <NEW_LINE> self.saveAsList = True <NEW_LINE> <DEDENT> def postParse( self, instring, loc, tokenlist ): <NEW_LINE> <INDENT> return [ tokenlist ] | Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions. | 6259908aa8370b77170f1fc5 |
class ServiceMetadata(Model): <NEW_LINE> <INDENT> def __init__(self, display_name: str=None, image_url: str=None, long_description: str=None, provider_display_name: str=None, documentation_url: str=None, support_url: str=None, extras: object=None): <NEW_LINE> <INDENT> self.swagger_types = { 'display_name': str, 'image_... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259908ae1aae11d1e7cf610 |
class SyncMapFormatJSON(SyncMapFormatBase): <NEW_LINE> <INDENT> TAG = u"SyncMapFormatJSON" <NEW_LINE> DEFAULT = "json" <NEW_LINE> def parse(self, input_text, syncmap): <NEW_LINE> <INDENT> contents_dict = json.loads(input_text) <NEW_LINE> for fragment in contents_dict["fragments"]: <NEW_LINE> <INDENT> self._add_fragment... | Handler for JSON I/O format. | 6259908a97e22403b383caf0 |
class ValidateAttributesTest(TestCase): <NEW_LINE> <INDENT> def test_running_ok(self): <NEW_LINE> <INDENT> svc_systemv.SvcSystemV(MagicMock(), "foo", {'running': True}) <NEW_LINE> svc_systemv.SvcSystemV(MagicMock(), "foo", {'running': False}) <NEW_LINE> <DEDENT> def test_running_not_ok(self): <NEW_LINE> <INDENT> with s... | Tests bundlewrap.items.svc_systemv.SvcSystemV.validate_attributes. | 6259908aadb09d7d5dc0c153 |
class TextDumper(RecvmsgDatagramProtocol): <NEW_LINE> <INDENT> def __init__(self, outfile, protocol=None): <NEW_LINE> <INDENT> self._outfile = outfile <NEW_LINE> self._outfile.write("# Generated by aiocoap.dump %s\n"%datetime.now()) <NEW_LINE> self._outfile.write("# Convert to pcap-ng by using:\n#\n") <NEW_LINE> self._... | Plain text network data dumper
A TextDumper can be used to log network traffic into a file that can be
converted to a PCAP-NG file as described in its header.
Currently, this discards information like addresses; it is unknown how that
information can be transferred into a dump reader easily while
simultaneously stayi... | 6259908a656771135c48ae2d |
class XapiCredentialsListSchema(object): <NEW_LINE> <INDENT> swagger_types = { 'xapi_credentials': 'list[XapiCredentialSchema]', 'more': 'str' } <NEW_LINE> attribute_map = { 'xapi_credentials': 'xapiCredentials', 'more': 'more' } <NEW_LINE> def __init__(self, xapi_credentials=None, more=None): <NEW_LINE> <INDENT> self.... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259908aec188e330fdfa4a7 |
class UsersAvgManager(object): <NEW_LINE> <INDENT> lock = threading.Lock() <NEW_LINE> _total_num = 0 <NEW_LINE> _total_count = 0.0 <NEW_LINE> users_avg = dict() <NEW_LINE> last_updated_ts = -1 <NEW_LINE> last_reported_ts = -1 <NEW_LINE> @classmethod <NEW_LINE> def add(cls, user_id, num): <NEW_LINE> <INDENT> with cls.lo... | manages the average for each user | 6259908af9cc0f698b1c60c8 |
class EnumSubset(InterfaceItemBase): <NEW_LINE> <INDENT> def __init__(self, name, enum, description=None, design_description=None, issues=None, todos=None, platform=None, allowed_elements=None, since=None, until=None, deprecated=None, removed=None, history=None): <NEW_LINE> <INDENT> super(EnumSubset, self).__init__( na... | Enumeration subset.
:param name: item name
:param description: list of string description elements
:param design_description: list of string design description elements
:param issues: list of issues
:param todos: list of string todo elements
:param platform: optional platform (string or None)
:param since: string that... | 6259908a167d2b6e312b8394 |
class TestApplicationCustomer(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return Application... | ApplicationCustomer unit test stubs | 6259908a3617ad0b5ee07d4c |
class SamplerSender(object): <NEW_LINE> <INDENT> def __init__(self, namebook, net_type='socket'): <NEW_LINE> <INDENT> assert len(namebook) > 0, 'namebook cannot be empty.' <NEW_LINE> assert net_type in ('socket', 'mpi'), 'Unknown network type.' <NEW_LINE> self._namebook = namebook <NEW_LINE> self._sender = _create_send... | SamplerSender for DGL distributed training.
Users use SamplerSender to send sampled subgraphs (NodeFlow)
to remote SamplerReceiver. Note that, a SamplerSender can connect
to multiple SamplerReceiver currently. The underlying implementation
will send different subgraphs to different SamplerReceiver in parallel
via ... | 6259908a2c8b7c6e89bd53e1 |
class RecordsStatistics: <NEW_LINE> <INDENT> def __init__(self, records): <NEW_LINE> <INDENT> self._records = records <NEW_LINE> <DEDENT> @property <NEW_LINE> def count(self): <NEW_LINE> <INDENT> return len(self._records) <NEW_LINE> <DEDENT> @property <NEW_LINE> def total_defect(self): <NEW_LINE> <INDENT> return sum(re... | Review records statistics class.
Args:
records: A list of record. | 6259908a7cff6e4e811b763d |
class DnsName(vstruct.VArray): <NEW_LINE> <INDENT> def __init__(self, name=None): <NEW_LINE> <INDENT> vstruct.VArray.__init__(self) <NEW_LINE> if name != None: <NEW_LINE> <INDENT> for part in name.split('.'): <NEW_LINE> <INDENT> self.vsAddElement( DnsNameLabel( part ) ) <NEW_LINE> <DEDENT> self.vsAddElement( DnsNameLab... | The contiguous labels (DnsNameLabel()) in a DNS Name field. Note that the
last label may simply be a pointer to an offset earlier in the DNS message. | 6259908a3346ee7daa338460 |
class RNNDecoder(nn.Module): <NEW_LINE> <INDENT> def __init__( self, num_features, embeddingsize, hiddensize, padding_idx=0, rnn_class='lstm', numlayers=2, dropout=0.1, bidir_input=False, attn_type='none', attn_time='pre', attn_length=-1, sparse=False, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.dropout =... | Recurrent decoder module.
Can be used as a standalone language model or paired with an encoder. | 6259908af9cc0f698b1c60c9 |
class SortableDict(dict): <NEW_LINE> <INDENT> def sortedkeys(self): <NEW_LINE> <INDENT> keys = sorted(self.keys()) <NEW_LINE> return keys <NEW_LINE> <DEDENT> def sortedvalues(self): <NEW_LINE> <INDENT> return [self[key] for key in self.sortedkeys()] | Dictionary with additional sorting methods
Tip: use key starting with with '_' for sorting before small letters
and with '~' for sorting after small letters. | 6259908a167d2b6e312b8395 |
class Node(object): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> super(Node, self).__init__() <NEW_LINE> self.value = value <NEW_LINE> self.left = None <NEW_LINE> self.right= None <NEW_LINE> <DEDENT> def inOrder(self): <NEW_LINE> <INDENT> def findNext(node): <NEW_LINE> <INDENT> stack = [] <NEW_LIN... | docstring for node | 6259908a23849d37ff852cb7 |
class MockBaseTest(tests.support.DnfBaseTestCase): <NEW_LINE> <INDENT> REPOS = ["main"] <NEW_LINE> def test_add_remote_rpms(self): <NEW_LINE> <INDENT> pkgs = self.base.add_remote_rpms([tests.support.TOUR_50_PKG_PATH]) <NEW_LINE> self.assertIsInstance(pkgs[0], dnf.package.Package) <NEW_LINE> self.assertEqual(pkgs[0].nam... | Test the Base methods that need a Sack. | 6259908a7b180e01f3e49e63 |
class LARMORMultiPeriodEventModeLoading(stresstesting.MantidStressTest): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LARMORMultiPeriodEventModeLoading, self).__init__() <NEW_LINE> self.success = True <NEW_LINE> <DEDENT> def _get_position_and_rotation(self, workspace): <NEW_LINE> <INDENT> instrumen... | This test checks if the positioning of all workspaces of a
multi-period event-type file are the same. | 6259908a099cdd3c636761f8 |
class TestController(unittest.TestCase): <NEW_LINE> <INDENT> def test_index(self): <NEW_LINE> <INDENT> c = Client() <NEW_LINE> response = c.get('/') <NEW_LINE> self.assertEqual(response.status_code, 200) <NEW_LINE> <DEDENT> def test_API_stoplist(self): <NEW_LINE> <INDENT> c = Client() <NEW_LINE> response = c.get('/api/... | Testclass for Controllerfunctions | 6259908a60cbc95b06365b6a |
class Assignatura: <NEW_LINE> <INDENT> def __init__(self, nom, codi,f): <NEW_LINE> <INDENT> self.nom = nom <NEW_LINE> self.codi = codi <NEW_LINE> self.grups = [] <NEW_LINE> self.facu = f <NEW_LINE> <DEDENT> def afegeixGrup(self,grup): <NEW_LINE> <INDENT> for x in range(0,len(self.grups)): <NEW_LINE> <INDENT> if self.gr... | docstring for assignatura. | 6259908a4527f215b58eb79e |
class TaskHandler(logging.Handler): <NEW_LINE> <INDENT> def emit(self, record): <NEW_LINE> <INDENT> task = _tasks.get(task_key()) <NEW_LINE> if not task: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> task[1].write("%s\n" % self.format(record)) | Per-task logger.
Used to log all task specific events to a per-task cuckoo.log log file. | 6259908a283ffb24f3cf549e |
class UnknownResponse(SuggestedResponse): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_json(cls, json): <NEW_LINE> <INDENT> response = super(UnknownResponse, cls).from_json(json) <NEW_LINE> response.raw_response = json <NEW_LINE> return response <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def property_mapping(c... | This response type is returned by the response factory when it encounters an unknown response type.
It's `type` attribute is set to the type of the response, and it's `raw_response` attribute contains the raw JSON
response received | 6259908a23849d37ff852cb9 |
class MultiPointField(ShapelyField): <NEW_LINE> <INDENT> @property <NEW_LINE> def shape(self) -> MultiPointType: <NEW_LINE> <INDENT> return MultiPoint <NEW_LINE> <DEDENT> def validate(self, value: MultiPoint): <NEW_LINE> <INDENT> super(MultiPointField, self).validate(value) <NEW_LINE> <DEDENT> def to_mongo(self, value:... | Substitution for :class:`mongoengine.MultiPointField`
utilizing :class:`MultiPoint` geometry type.
Instead of storing GeoJSON-like mapping as a value, a
`shapely`__ geometry instance is used instead via
the `__geo_interface__`__ protocol.
__ https://shapely.readthedocs.io/en/stable/
__ https://gist.github.com/zzpwelk... | 6259908a3346ee7daa338462 |
class VariableNameGenerator(set): <NEW_LINE> <INDENT> KEYFORM = "$var%s" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(VariableNameGenerator, self).__init__() <NEW_LINE> self.__iNum = 0 <NEW_LINE> <DEDENT> def generate_name(self): <NEW_LINE> <INDENT> sName = self.KEYFORM % self.__iNum <NEW_LINE> while sName ... | Generate a unique name for a variable in a filter. | 6259908adc8b845886d551b8 |
class EmbeddingLayer(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_dim, embed_dim): <NEW_LINE> <INDENT> super(EmbeddingLayer, self).__init__() <NEW_LINE> self.embedding = torch.nn.Embedding(input_dim, embed_dim) <NEW_LINE> torch.nn.init.xavier_uniform_(self.embedding.weight.data) <NEW_LINE> <DEDENT> de... | Embedding module.
It is a sparse to dense operation that lookup embedding for given features. | 6259908a167d2b6e312b8397 |
class TestSearchTMResponseDtoV3(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 testSearchTMResponseDtoV3(self): <NEW_LINE> <INDENT> pass | SearchTMResponseDtoV3 unit test stubs | 6259908a283ffb24f3cf54a0 |
class StationOperationGroup(models.Model): <NEW_LINE> <INDENT> station = models.ForeignKey('seisnet.Station', on_delete=models.CASCADE) <NEW_LINE> operation_time = models.DateTimeField() | 在同一个台站的一次操作 | 6259908a99fddb7c1ca63bdc |
class Globals: <NEW_LINE> <INDENT> def building_requirements(self, unit_type, requirement=True, one_at_time=False): <NEW_LINE> <INDENT> if one_at_time and self.already_pending(unit_type): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return requirement and self.can_afford(unit_type) <NEW_LINE> <DEDENT> def can_b... | Global wrappers | 6259908aa05bb46b3848bf26 |
class TestAlertResourceAttributes(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 testAlertResourceAttributes(self): <NEW_LINE> <INDENT> pass | AlertResourceAttributes unit test stubs | 6259908a3617ad0b5ee07d52 |
class MapMemHook(Hook): <NEW_LINE> <INDENT> def __init__(self, se_obj, emu_eng, cb, begin=1, end=0): <NEW_LINE> <INDENT> super(MapMemHook, self).__init__(se_obj, emu_eng, cb) <NEW_LINE> self.begin = begin <NEW_LINE> self.end = end <NEW_LINE> <DEDENT> def add(self): <NEW_LINE> <INDENT> self.added = True <NEW_LINE> self.... | This hook will fire each time a chunk of memory is mapped | 6259908a26068e7796d4e543 |
class MuninPHPfpmPlugin(MuninPlugin): <NEW_LINE> <INDENT> plugin_name = 'phpfpmstats' <NEW_LINE> isMultigraph = True <NEW_LINE> def __init__(self, argv=(), env={}, debug=False): <NEW_LINE> <INDENT> MuninPlugin.__init__(self, argv, env, debug) <NEW_LINE> self._host = self.envGet('host') <NEW_LINE> self._port = self.envG... | Multigraph Munin Plugin for monitoring PHP Fast Process Manager (FPM).
| 6259908ad486a94d0ba2dbb6 |
class Token(AuthenticatedMessage): <NEW_LINE> <INDENT> __magic__ = ord("t") <NEW_LINE> __fields__ = ( ("valid_from", TypeInfo(int)), ("valid_to", TypeInfo(int)), ("username", TypeInfo(str)) ) | Represents a token used to authenticate the user | 6259908aaad79263cf4303bb |
class LC_temperature_control(Instrument): <NEW_LINE> <INDENT> def __init__(self, name, reset=False): <NEW_LINE> <INDENT> Instrument.__init__(self, name) <NEW_LINE> self.FP = LVApp("DRTempControl.Application", "DR TempControl.exe\TC.vi") <NEW_LINE> self._channels = range(10) <NEW_LINE> self._currents = range(3) <NEW_LIN... | Driver for the Leiden Cryogenics TemperatureControl application
Install pywin32 using downloadable 2.7 32-bit installer
If using an environment, put the path to it in the following
registery key:
HKEY_CURRENT_USER/Software/Python/PythonCore/2.7/InstallPath | 6259908ad8ef3951e32c8c5e |
class SharedCount(object): <NEW_LINE> <INDENT> def __init__(self, initial_count=0): <NEW_LINE> <INDENT> self._count = initial_count <NEW_LINE> self._count_lock = Lock() <NEW_LINE> <DEDENT> def incre(self, delta=1): <NEW_LINE> <INDENT> with self._count_lock: <NEW_LINE> <INDENT> self._count += delta <NEW_LINE> <DEDENT> <... | 线程调度本质上是不确定的,因此,在多线程程序中错误地使用锁机制可能会导致
随机数据损坏或者其他的异常行为,我们称之为竞争条件。
为了避免竞争条件,最好只在临界区(对临界资源进行操作的那部分代码)使用锁。 | 6259908a63b5f9789fe86d6b |
class ControlFlowContext(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._outer_context = ops.get_default_graph()._get_control_flow_context() <NEW_LINE> self._context_stack = [] <NEW_LINE> self._values = set() <NEW_LINE> self._external_values = {} <NEW_LINE> <DEDENT> @property <NEW_LINE> def o... | The base class for control flow context.
The usage pattern is a sequence of (Enter, Exit) followed by a final
ExitResult.
We maintain the following state for control flow contexts during graph
construction:
1. graph has _control_flow_context: the current context used to
construct new nodes. Changed by ctxt.Enter... | 6259908a99fddb7c1ca63bdd |
class LockAssetTestCase(AssetsTestCase): <NEW_LINE> <INDENT> def test_locking(self): <NEW_LINE> <INDENT> def verify_asset_locked_state(locked): <NEW_LINE> <INDENT> asset_location = StaticContent.get_location_from_path('/c4x/edX/toy/asset/sample_static.html') <NEW_LINE> content = contentstore().find(asset_location) <NEW... | Unit test for locking and unlocking an asset. | 6259908aa05bb46b3848bf27 |
class Goolf(Gcc, OpenMPI, OpenBLAS, ScaLAPACK, Fftw): <NEW_LINE> <INDENT> NAME = 'goolf' <NEW_LINE> BLACS_MODULE_NAME = [] <NEW_LINE> BLACS_LIB = [] <NEW_LINE> BLACS_LIB_MT = [] | Compiler toolchain with GCC, OpenMPI, OpenBLAS, ScaLAPACK and FFTW. | 6259908a091ae35668706846 |
class BaseTestMockedCFABManager(base.BaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(BaseTestMockedCFABManager, self).setUp() <NEW_LINE> self.manager = cfabdriver._CFABManager() <NEW_LINE> self.manager.close_session = mock.MagicMock() <NEW_LINE> <DEDENT> def assert_wrote(self, lines): <NEW... | Base class to test Fujitsu C-Fabric manager. | 6259908a23849d37ff852cbd |
class UpdateModelMixin(object): <NEW_LINE> <INDENT> def update(self, request, *args, **kwargs): <NEW_LINE> <INDENT> partial = kwargs.pop('partial', False) <NEW_LINE> self.object = self.get_object_or_none() <NEW_LINE> if self.object is None: <NEW_LINE> <INDENT> created = True <NEW_LINE> save_kwargs = {'force_insert': Tr... | Update a model instance. | 6259908aaad79263cf4303bd |
class Game: <NEW_LINE> <INDENT> def __init__(self, player, opponent_trainers, cities, potential_legendary_creatures): <NEW_LINE> <INDENT> self.player: Player = player <NEW_LINE> self.__opponent_trainers: list = opponent_trainers <NEW_LINE> self.__cities: list = cities <NEW_LINE> self.__potential_legendary_creatures: li... | This class contains attributes of the saved game data. | 6259908a4c3428357761bebe |
class RevisionsFeed(DocumentsFeed): <NEW_LINE> <INDENT> title = _("MDN recent revisions") <NEW_LINE> subtitle = _("Recent revisions to MDN documents") <NEW_LINE> def items(self): <NEW_LINE> <INDENT> return Revision.objects.order_by('-created')[:50] <NEW_LINE> <DEDENT> def item_title(self, item): <NEW_LINE> <INDENT> ret... | Feed of recent revisions | 6259908a7c178a314d78e9eb |
class IsOwner(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> if isinstance(view,views.UserProfileViewSet) and request.method == "POST": <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> elif request.auth is not None: <NEW_LINE> <INDENT> return True <NEW_L... | This is the base permission class for all the requests so that they are authenticated | 6259908a5fc7496912d4906d |
class ProductionConfig(Config): <NEW_LINE> <INDENT> DEBUG = False <NEW_LINE> TESTING = False <NEW_LINE> DATABASE_URL = os.getenv("DATABASE_URL") | Production environment configurations | 6259908ad486a94d0ba2dbba |
class Meta: <NEW_LINE> <INDENT> model = Shelfbook <NEW_LINE> fields = ["id", "shelf", "book", "status"] | Meta of shelfbook serializer. | 6259908a7c178a314d78e9ec |
class FilterSection(BaseSection): <NEW_LINE> <INDENT> _fields = ['ДатаНачала', 'ДатаКонца', 'РасчСчет', 'Документ'] <NEW_LINE> _mandatory_fields = ['ДатаНачала', 'ДатаКонца', 'РасчСчет'] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> BaseSection.__init__(self) <NEW_LINE> for name in self._fields: <NEW_LINE> <INDENT... | Секция `Фильтров` | 6259908a63b5f9789fe86d6e |
class TriggerEfficiencyContainer(ComparisonData): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ComparisonData.__init__(self) <NEW_LINE> <DEDENT> def AddEfficiency(self, trclasstype, key, efficiencyCurve, style): <NEW_LINE> <INDENT> triggerdata = None <NEW_LINE> if trclasstype == "pthat": <NEW_LINE> <INDE... | Underlying data structure for the comparison plot | 6259908abf627c535bcb30d9 |
class OptimizerCrab(Optimizer): <NEW_LINE> <INDENT> def reset(self): <NEW_LINE> <INDENT> Optimizer.reset(self) <NEW_LINE> self.id_text = 'CRAB' <NEW_LINE> self.num_optim_vars = 0 <NEW_LINE> <DEDENT> def init_optim(self, term_conds): <NEW_LINE> <INDENT> Optimizer.init_optim(self, term_conds) <NEW_LINE> dyn = self.dynami... | Optimises the pulse using the CRAB algorithm [1].
It uses the scipy.optimize.minimize function with the method specified
by the optim_method attribute. See Optimizer.run_optimization for details
It minimises the fidelity error function with respect to the CRAB
basis function coefficients.
AJGP ToDo: Add citation here | 6259908aaad79263cf4303c1 |
class EngineKnowledgeComponent(EngineApiModelMixin, ApiModel): <NEW_LINE> <INDENT> model_name = 'knowledge_component' <NEW_LINE> lookup_field = 'kc_id' <NEW_LINE> def add_prerequisite_knowledge_component(self, prerequisite, connection_strength): <NEW_LINE> <INDENT> self.model.prerequisite_knowledge_components[prerequis... | Knowledge component | 6259908a4527f215b58eb7a3 |
class NoMoreStepsError(Exception): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) | No more undos/redos. | 6259908a7c178a314d78e9ed |
class PodmanError(DockerException): <NEW_LINE> <INDENT> pass | Base class for PodmanPy exceptions. | 6259908a99fddb7c1ca63be0 |
class Group(): <NEW_LINE> <INDENT> def __init__(self, id, name, description, capabilities, required, editable): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.capabilities = capabilities <NEW_LINE> self.required = required <NEW_LINE> self.editable ... | Class that helps interact an existing group on the Log Insight server. | 6259908afff4ab517ebcf41e |
class ProjectSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> projectfiles = ProjectFileSerializer(many=True, read_only=True) <NEW_LINE> model = Project <NEW_LINE> fields = ('id', 'project_name', 'project_description', 'created_date','commandline','public','user', 'projectfil... | ProjectSerializer allows easy validation of Project Submission Data | 6259908ad486a94d0ba2dbbe |
class LazyflowVectorwiseClassifierABC(with_metaclass(abc.ABCMeta, object)): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def predict_probabilities(self, X): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @abc.abstractproperty <NEW_LINE> def known_classes(self): <NEW_LINE> <INDENT> raise NotImpl... | Defines an interface for "vector-wise" classifier objects that can be used by the lazyflow classifier operators.
A "vector-wise" classifier is trained with a 2D feature matrix and a 1D label vector.
All scikit-learn classifiers already satisfy this interface. | 6259908a97e22403b383cb00 |
class TEGettextExtractInterface(object): <NEW_LINE> <INDENT> name = None <NEW_LINE> exts = None <NEW_LINE> def __init__(self, **options): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def setup_parser(self, parser): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def extract_keys(self): <NEW_LINE> <INDENT> raise NotImpleme... | Templating Engines Gettext Extract interface that needs to be inherited
by a templating engine to provide the extraction code. | 6259908a656771135c48ae35 |
@functools.total_ordering <NEW_LINE> class LineSet: <NEW_LINE> <INDENT> def __init__( self, name, lines, ignore_comments=False, ignore_docstrings=False, ignore_imports=False, ignore_signatures=False, ): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self._real_lines = lines <NEW_LINE> self._stripped_lines = stripped_l... | Holds and indexes all the lines of a single source file | 6259908a167d2b6e312b839c |
class ProcessStep(ModelBase): <NEW_LINE> <INDENT> __dump_attributes__ = ["type", "options"] <NEW_LINE> type = None <NEW_LINE> options = None <NEW_LINE> def __str__(self, *args, **kwargs): <NEW_LINE> <INDENT> return "ProcessStep Type: %s" % (self.type) | Object representing a process step | 6259908aa05bb46b3848bf2b |
class RenewalRequirementMissing(Exception): <NEW_LINE> <INDENT> pass | Gets raised when a OCSP renewal is run while not all requirements are met. | 6259908ae1aae11d1e7cf619 |
class UndefinedAttrDependencyError(Exception): <NEW_LINE> <INDENT> pass | Raised when no dependency could be found for a given attribute. | 6259908ad8ef3951e32c8c63 |
class RequiredIfNot(Required): <NEW_LINE> <INDENT> def __init__(self, other_field_name, *args, **kwargs): <NEW_LINE> <INDENT> self.other_field_name = other_field_name <NEW_LINE> super(RequiredIfNot, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def __call__(self, form, field): <NEW_LINE> <INDENT> other_field = fo... | A validator which makes a field mutually exclusive with another | 6259908a71ff763f4b5e93b9 |
class ExpressBus(IVehicle): <NEW_LINE> <INDENT> def running(self): <NEW_LINE> <INDENT> print("坐快速公交(经济绿色)", end='') | 快速公交 | 6259908a4527f215b58eb7a5 |
class Stock(models.Model): <NEW_LINE> <INDENT> name = models.CharField( max_length=20, blank=True, null=True, verbose_name='Name') <NEW_LINE> avatar = models.ImageField( default='img/stocks/stock.png', verbose_name='Avatar', upload_to='img/stocks', null=True, blank=True) <NEW_LINE> cost = models.FloatField( default=0, ... | Stock model. | 6259908aec188e330fdfa4b9 |
class Andand(object): <NEW_LINE> <INDENT> def __init__(self, item=None): <NEW_LINE> <INDENT> self.item = item <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> item = getattr(self.item, name) <NEW_LINE> return item if name is 'item' else Andand(item) <NEW_LINE> <DEDENT> excep... | A Ruby inspired null soaking object
Examples:
>>> kwargs = {'key': 'value'}
>>> kw = Objectify(kwargs)
>>> kw.key == 'value'
True
>>> Andand(kw).key.missing.undefined.item
>>> Andand(kw).key.missing.undefined() | 6259908a5fdd1c0f98e5fb82 |
class PseGru(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_dim=10, mlp1=[10, 32, 64], pooling='mean_std', mlp2=[132, 128], with_extra=True, extra_size=4, hidden_dim=128, mlp4=[128, 64, 32, 20], positions=None): <NEW_LINE> <INDENT> super(PseGru, self).__init__() <NEW_LINE> self.spatial_encoder = PixelSetEncod... | Pixel-Set encoder + GRU | 6259908a7b180e01f3e49e6a |
class DescribeSubnetRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DescribeSubnetRequest, self).__init__( '/regions/{regionId}/subnets/{subnetId}', 'GET', header, version) <NEW_LINE> self.parameters = parameters | 查询子网详情 | 6259908a656771135c48ae36 |
class WxMenu(Jsonable): <NEW_LINE> <INDENT> def __init__(self, dic): <NEW_LINE> <INDENT> self.items = [] <NEW_LINE> if dic is None or len(dic) == 0: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if "menu" in dic.keys(): <NEW_LINE> <INDENT> buttons = dic["menu"]["button"] <NEW_LINE> <DEDENT> elif "button" in dic.keys()... | 自定义菜单对象,
能够帮助公众号丰富界面,让用户更好更快地理解公众号的功能 | 6259908af9cc0f698b1c60d1 |
class MPILog(object): <NEW_LINE> <INDENT> def __init__(self, rank=0, log_dir='./logs'): <NEW_LINE> <INDENT> self.disabled = False <NEW_LINE> self.root_logger = logging.getLogger() <NEW_LINE> self.root_logger.setLevel(logging.WARNING) <NEW_LINE> if not os.path.exists(log_dir): <NEW_LINE> <INDENT> os.makedirs(log_dir, ex... | Class to log messages coming from other classes. Messages contain
{Time stamp} {Class name} {Log level} {Message}. Errors, warnings and info
are logged into the console. To disable logging, call Logger().disable()
Parameters
----------
debug : bool
Log DEBUG messages in 'debug.log'; default is False | 6259908a3346ee7daa338468 |
class UnknownProperties(results.VersionResult, results.Warning): <NEW_LINE> <INDENT> def __init__(self, properties, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.properties = tuple(properties) <NEW_LINE> <DEDENT> @property <NEW_LINE> def desc(self): <NEW_LINE> <INDENT> properties = ' '.join(... | Package's PROPERTIES metadata has unknown entries. | 6259908a4a966d76dd5f0af2 |
class LED(Phidget): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Phidget.__init__(self) <NEW_LINE> try: <NEW_LINE> <INDENT> PhidgetLibrary.getDll().CPhidgetLED_create(byref(self.handle)) <NEW_LINE> <DEDENT> except RuntimeError: <NEW_LINE> <INDENT> raise <NEW_LINE> <DEDENT> <DEDENT> def getDiscreteLED(sel... | This class represents a Phidget LED. All methods to control a Phidget LED are implemented in this class.
The Phidget LED is a board that is meant for driving LEDs. Currently, the only available version drives 64 LEDs, but other versions may become available so this number is not absolute.
LEDs can be controlled indiv... | 6259908abf627c535bcb30df |
class Kubectl: <NEW_LINE> <INDENT> def create_namespace(self, namespace, timeout=30): <NEW_LINE> <INDENT> cmd = ["kubectl", "create", "namespace", namespace] <NEW_LINE> return subprocess.run(cmd, timeout=timeout, check=True, shell=False, text=True) <NEW_LINE> <DEDENT> def get_pods(self, namespace=None, timeout=30): <NE... | Kubectl cli wrapper | 6259908a091ae35668706850 |
class _ApiOfficial(ApiBase): <NEW_LINE> <INDENT> channel = Api.OFFICIAL <NEW_LINE> def __init__(self, entry_point: Any) -> None: <NEW_LINE> <INDENT> logging.warning('Using official version!') <NEW_LINE> self.streaming_api = entry_point.GetStreamFilter <NEW_LINE> <DEDENT> def get_tweets(self, where: List, lang: List=['e... | Official Twitter API | 6259908aaad79263cf4303c7 |
class Agent(NeutronAPIDictWrapper): <NEW_LINE> <INDENT> def __init__(self, apiresource): <NEW_LINE> <INDENT> _init_apiresource(apiresource) <NEW_LINE> super(Agent, self).__init__(apiresource) | Wrapper for neutron agents. | 6259908badb09d7d5dc0c169 |
class Slate(System): <NEW_LINE> <INDENT> def __init__(self, source_dir=None, database=None, pattern=r'sla_([\d]{6})\.csv'): <NEW_LINE> <INDENT> super().__init__(source_dir, database, pattern) <NEW_LINE> self.create_table() <NEW_LINE> <DEDENT> def create_table(self): <NEW_LINE> <INDENT> connection = sqlite3.connect(self... | Slate is responsible for generating new Stevens identifications for newly admitted students
of Steven. There are two general types of students, brand new students and continuing students.
However there are some continuing students forget to imply that they are former students of
Stevens and Slate generate a set of new ... | 6259908b97e22403b383cb06 |
class ResultsSet(): <NEW_LINE> <INDENT> def __init__( self, client, handle, input_type=None, output_type=None, query=None): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.handle = handle <NEW_LINE> self.input_type = input_type <NEW_LINE> self.output_type = output_type <NEW_LINE> self.query = query <NEW_LINE> ... | Instances of ResultsSet subclasses can be combined with set operators,
and then prepared for evaluation by calling get_list(),
which returns a ResultsList. | 6259908bd8ef3951e32c8c65 |
class GameLogicError(Error): <NEW_LINE> <INDENT> rc = 11 <NEW_LINE> def __init__(self, msg_key, msg_value=""): <NEW_LINE> <INDENT> self.msg = utils.get_msg(msg_key, msg_value) or msg_key | 游戏逻辑错误异常
在游戏逻辑处理中发现逻辑不通时,抛出此异常
Attributes:
msg: 具体给前端显示的错误信息
Args:
msg_key: 出错所属计算逻辑类别
msg_value: 此类别类别的具体出错原因 | 6259908b167d2b6e312b839f |
class EDTestCasePluginExecuteExecGnomv0_2_list(EDTestCasePluginExecute): <NEW_LINE> <INDENT> def __init__(self, _strTestName=None): <NEW_LINE> <INDENT> EDTestCasePluginExecute.__init__(self, "EDPluginExecGnomv0_2") <NEW_LINE> self.setConfigurationFile(self.getRefConfigFile()) <NEW_LINE> self.setDataInputFile(os.path.jo... | Those are all execution tests for the EDNA Exec plugin Gnomv0_2 | 6259908b99fddb7c1ca63be4 |
class AutoGraderException(Exception): <NEW_LINE> <INDENT> pass | Base class for exceptions in this module | 6259908bfff4ab517ebcf426 |
class ShowChassisFirmwareNoForwarding(ShowChassisFirmware): <NEW_LINE> <INDENT> cli_command = [ 'show chassis firmware no-forwarding' ] <NEW_LINE> def cli(self, output=None): <NEW_LINE> <INDENT> if not output: <NEW_LINE> <INDENT> out = self.device.execute(self.cli_command[0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDEN... | Parser for:
- show chassis firmware no-forwarding | 6259908bbf627c535bcb30e3 |
class Identifier(CIStr): <NEW_LINE> <INDENT> def __new__(cls, value): <NEW_LINE> <INDENT> if not value: <NEW_LINE> <INDENT> raise ValueError("PostgreSQL identifiers cannot be blank") <NEW_LINE> <DEDENT> if not Identifier._re_chk.match(value): <NEW_LINE> <INDENT> value = '"%s"' % value.replace('"', '""') <NEW_LINE> <DED... | A string modeling a PostgreSQL identifier. | 6259908b5fcc89381b266f66 |
class PvmSEAMechanismDriver(mech_pvm_base.PvmMechanismDriverBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(PvmSEAMechanismDriver, self).__init__(pconst.AGENT_TYPE_PVM_SEA, pconst.VIF_TYPE_PVM_SEA) <NEW_LINE> <DEDENT> def try_to_bind_segment_for_agent(self, context, segment, agent): <NEW_LINE> ... | Attach to networks using PowerVM Shared Ethernet agent.
The PvmSEAMechanismDriver integrates the ml2 plugin with the
PowerVM Shared Ethernet Agent. | 6259908bd486a94d0ba2dbc5 |
class TextMessage: <NEW_LINE> <INDENT> notification_message_max_len = 12 <NEW_LINE> def __init__(self, sent_by, time, content): <NEW_LINE> <INDENT> self.sent_by = sent_by <NEW_LINE> self.time = time <NEW_LINE> self.content = content <NEW_LINE> <DEDENT> def notification(self): <NEW_LINE> <INDENT> noti_string = "{}, {}\n... | 문자 메시지 클래스 | 6259908b4527f215b58eb7a8 |
class Deck(CardCollection): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Deck, self).__init__() <NEW_LINE> for rank in range(1, 105): <NEW_LINE> <INDENT> self.add(Card(rank)) | Initialize Deck and fill with Cards. | 6259908b5fdd1c0f98e5fb88 |
class FlowControl(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, mks_instance, mfcs, devices, name): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.mfcs = mfcs <NEW_LINE> self.mks = mks_instance <NEW_LINE> self.pullsocket = DateDataPullSocket(name, devices, timeouts=3.0, port=9000) <NEW_... | Keep updated values of the current flow | 6259908b283ffb24f3cf54b2 |
class ShippingAddressUpdateView(UpdateView): <NEW_LINE> <INDENT> model = ShippingAddress <NEW_LINE> context_object_name = 'address' <NEW_LINE> template_name = 'dashboard/orders/shippingaddress_form.html' <NEW_LINE> form_class = forms.ShippingAddressForm <NEW_LINE> def get_object(self, queryset=None): <NEW_LINE> <INDENT... | Dashboard view to update an order's shipping address.
Supports the permission-based dashboard. | 6259908b4a966d76dd5f0af8 |
class ReportMagneticField(ReportVariableTask): <NEW_LINE> <INDENT> title = "Magnetic Field" <NEW_LINE> _minimum_time_between_samples = 0.3 <NEW_LINE> def __init__(self, gauge: Lakeshore475, store: Store) -> None: <NEW_LINE> <INDENT> super(ReportMagneticField, self).__init__(store) <NEW_LINE> self.gauge = gauge <NEW_LIN... | Implements a task to return the magnetic field | 6259908b63b5f9789fe86d7c |
class DossierSource(_DossierBase): <NEW_LINE> <INDENT> def reader(self, chemin_relatif): <NEW_LINE> <INDENT> return csv.reader(self._open(chemin_relatif, "r"), delimiter=self.delimiteur, quotechar=self.quotechar) <NEW_LINE> <DEDENT> def DictReader(self, chemin_relatif): <NEW_LINE> <INDENT> return csv.DictReader(self._o... | Source de données.
Une instance représente un répertoire de données source avec tous les réglages
idoines du parseur (délimiteur, format de caractères). La méthode reader()
permet d'ouvrir un CSV par nom relatif. | 6259908b167d2b6e312b83a1 |
class Generator: <NEW_LINE> <INDENT> def __init__(self, template_dir, template_name, context=None): <NEW_LINE> <INDENT> self.template_dir = template_dir <NEW_LINE> self.template_path = os.path.join(template_dir, template_name + '.docx') <NEW_LINE> self.document_path_doc = os.path.join(settings.MEDIA_ROOT, template_name... | Class to create Word-documents from templates and incoming data | 6259908ba8370b77170f1fe0 |
class HueBridge(object): <NEW_LINE> <INDENT> def __init__(self, host, hass, filename, allow_unreachable=False, allow_in_emulated_hue=True, allow_hue_groups=True): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.hass = hass <NEW_LINE> self.filename = filename <NEW_LINE> self.allow_unreachable = allow_unreachable <N... | Manages a single Hue bridge. | 6259908b23849d37ff852ccf |
class UserRegisterForm(UserCreationForm): <NEW_LINE> <INDENT> email = forms.EmailField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ['username', 'email', 'password1', 'password2'] | Form which adds the Email field to the sign up process | 6259908b63b5f9789fe86d7e |
class Story(models.Model): <NEW_LINE> <INDENT> title = models.CharField( max_length=90, help_text='The title of the survey.' ) <NEW_LINE> is_public = models.BooleanField( default=True, help_text='Determines if the survey is public for users to take.' ) <NEW_LINE> start = models.TextField( blank=True, help_text='The beg... | A database model representing a survey. | 6259908bd8ef3951e32c8c68 |
class BciCompetitionDataset(BaseDataset): <NEW_LINE> <INDENT> def __init__(self, dataset_md=None, **kwargs): <NEW_LINE> <INDENT> super(BciCompetitionDataset, self).__init__(dataset_md=dataset_md) <NEW_LINE> self.data_directory = dataset_md["dataset_directory"] <NEW_LINE> self.file_path = dataset_md["mat_file"] <NEW_LIN... | Class for reading the Berlin BrainComputerInterface-competition data
This module contains a class (*BciCompetitionDataset*) that encapsulates
most relevant code to use the data from the BCI competition.
Currently, only reading of the data is supported. | 6259908b656771135c48ae3b |
class RestAPIContext(object): <NEW_LINE> <INDENT> def __init__(self, _domain, _model_path, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> self.kwargs['http_domain'] = _domain <NEW_LINE> self.domain = _domain <NEW_LINE> self.model_path = _model_path <NEW_LINE> <DEDENT> @property <NEW_LINE> def context(se... | 6259908baad79263cf4303d0 | |
class ListOfQueues(FixedTypeList): <NEW_LINE> <INDENT> def __init__(self, items=None): <NEW_LINE> <INDENT> super().__init__(pyof_class=PacketQueue, items=items) | List of queues.
Represented by instances of :class:`PacketQueue` and used on
:class:`QueueGetConfigReply` objects. | 6259908ba05bb46b3848bf31 |
class test_user(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.APP = APP.test_client() <NEW_LINE> <DEDENT> def test_user_registration(self): <NEW_LINE> <INDENT> reg_response = self.APP.post('/api/v2/signup', data=json.dumps( dict(username="Dag", email="Dag@me.com", password="Dag1234")... | This Tests user registration | 6259908bd486a94d0ba2dbcb |
class yqout1(models.Model): <NEW_LINE> <INDENT> publish_time = models.CharField(max_length=32,verbose_name='发布时间') <NEW_LINE> title = models.CharField(max_length=300,verbose_name='标题') <NEW_LINE> hf = models.CharField(max_length=30,verbose_name='回复数量') <NEW_LINE> ck = models.CharField(max_length=32,verbose_name='查看量') ... | 咨询投诉列表 | 6259908b099cdd3c63676205 |
class GenerativeModel(object): <NEW_LINE> <INDENT> def __init__(self, brain_name): <NEW_LINE> <INDENT> self._model_name = brain_name <NEW_LINE> self.brain_name = brain_name + ".brain" <NEW_LINE> self.brain_questions_name = brain_name + "_questions.brain" <NEW_LINE> self.brain = None <NEW_LINE> self.brain_questions = No... | Abstract class for a generative model for text | 6259908bad47b63b2c5a9468 |
class GetData: <NEW_LINE> <INDENT> cookies = None <NEW_LINE> re_call="18258148330" <NEW_LINE> re_pwd="wx123456" <NEW_LINE> re_memberId="1123267" | 反射类,利用反射传送cookies | 6259908b99fddb7c1ca63be8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.