code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class HandlerMetaClass(type): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> new_cls = type.__new__(cls, name, bases, attrs) <NEW_LINE> def already_registered(model, anon): <NEW_LINE> <INDENT> for k, (m, a) in typemapper.iteritems(): <NEW_LINE> <INDENT> if model == m and anon == a: <NEW_L...
Metaclass that keeps a registry of class -> handler mappings.
62598fd9c4546d3d9def7541
class InvalidJp2kError(RuntimeError): <NEW_LINE> <INDENT> pass
Raise this exception in case we cannot parse a valid JP2 file.
62598fd9956e5f7376df593c
class ST_LSTMCell(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_size, hidden_size, use_bias=True): <NEW_LINE> <INDENT> super(ST_LSTMCell, self).__init__() <NEW_LINE> self.input_size = input_size <NEW_LINE> self.hidden_size = hidden_size <NEW_LINE> self.use_bias = use_bias <NEW_LINE> self.weight_ih = nn.Param...
A basic LSTM cell.
62598fd9ad47b63b2c5a7dd1
class PIC(): <NEW_LINE> <INDENT> def __init__(self, args=None, sigma=0.2, nnn=5, alpha=0.001, distribute_singletons=True): <NEW_LINE> <INDENT> self.sigma = sigma <NEW_LINE> self.alpha = alpha <NEW_LINE> self.nnn = nnn <NEW_LINE> self.distribute_singletons = distribute_singletons <NEW_LINE> <DEDENT> def cluster(self, da...
Class to perform Power Iteration Clustering on a graph of nearest neighbors. Args: args: for consistency with k-means init sigma (float): bandwith of the Gaussian kernel (default 0.2) nnn (int): number of nearest neighbors (default 5) alpha (float): parameter in PIC (default 0.001) distribute_single...
62598fd93617ad0b5ee066c6
class AR(mva.MVA): <NEW_LINE> <INDENT> def __init__(self, features, categories, num_categories): <NEW_LINE> <INDENT> super(AR, self).__init__(features, categories, num_categories) <NEW_LINE> self.max_model_order = int(2.0 * numpy.sqrt(self.num_samples)) <NEW_LINE> <DEDENT> def calc_coef(self, i, j): <NEW_LINE> <INDENT>...
Auto-regressive model
62598fd9656771135c489bf0
class FloatOpt(Opt): <NEW_LINE> <INDENT> _convert_value = float <NEW_LINE> @staticmethod <NEW_LINE> def _validate_value(value): <NEW_LINE> <INDENT> if not isinstance(value, float): <NEW_LINE> <INDENT> raise ValueError("Value is not an float") <NEW_LINE> <DEDENT> <DEDENT> def _get_argparse_kwargs(self, group, **kwargs):...
Float opt values are converted to floats using the float() builtin.
62598fd9ad47b63b2c5a7dd2
class ReportDEC(models.Model): <NEW_LINE> <INDENT> report = models.ForeignKey(Report) <NEW_LINE> location = models.ForeignKey(Lieu) <NEW_LINE> death_code = models.ForeignKey(DeathCode) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.report.text
In this model will be stored DEC (Rapport de deces) reports
62598fd9a219f33f346c6d86
class FlightSchedule(BaseModel): <NEW_LINE> <INDENT> boarding_time: Optional[str] <NEW_LINE> departure_time: str <NEW_LINE> arrival_time: Optional[str]
https://developers.facebook.com/docs/messenger-platform/reference/templates/airline-itinerary#flight_schedule
62598fd9283ffb24f3cf3e02
class Event(db.Model): <NEW_LINE> <INDENT> id = sa.Column(UUIDType, primary_key=True, default=uuid.uuid4) <NEW_LINE> application = sa.Column(sa.String) <NEW_LINE> model = sa.Column(sa.String) <NEW_LINE> execution_timestamp = sa.Column(sa.DateTime) <NEW_LINE> site_id = sa.Column(sa.String) <NEW_LINE> building_id = sa.Co...
Event model class
62598fd97cff6e4e811b5faa
class Description(object): <NEW_LINE> <INDENT> def __init__(self, handle, short_title, title = None, markup_types=None, locale = "en-US", events = []): <NEW_LINE> <INDENT> self._handle = handle <NEW_LINE> self._short_title = short_title <NEW_LINE> self._title = title or short_title <NEW_LINE> self._markup_types = marku...
Instances of this class are used by portlets to inform the portal about their capabilities. See :meth:`~.description`.
62598fd9dc8b845886d53b3e
class Arcfour(_CryptographyCipher): <NEW_LINE> <INDENT> Name = 'arcfour' <NEW_LINE> KEY_SIZE = 16 <NEW_LINE> ALGORITHM = algorithms.ARC4
This is a terrible algorithm and you should not use it. Instead, use 'arcfour128' or 'arcfour256'.
62598fda956e5f7376df593e
class VehicleManufacturer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.builder = None <NEW_LINE> <DEDENT> def create(self): <NEW_LINE> <INDENT> assert not self.builder is None, "No defined builder" <NEW_LINE> self.builder.make_wheels() <NEW_LINE> self.builder.make_doors() <NEW_LINE> self.bu...
The director class, this will keep a concrete builder.
62598fdaab23a570cc2d502f
class ToteAutonomous(StatefulAutonomous): <NEW_LINE> <INDENT> MODE_NAME='Tote Pickup' <NEW_LINE> DEFAULT = False <NEW_LINE> tote_forklift = ToteForklift <NEW_LINE> drive = Drive <NEW_LINE> def initialize(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @timed_state(duration=.5, next_state='get_tote1', first=True) <N...
Gets two grey totes and drives back into autozone
62598fda099cdd3c636756a0
class SMAClassifier(BaseSMA): <NEW_LINE> <INDENT> def __init__(self, pom: ClassifierMixin, name: Optional[str]=None) -> None: <NEW_LINE> <INDENT> if not isinstance(pom, ClassifierMixin): <NEW_LINE> <INDENT> raise TypeError("set Classifier as pom.") <NEW_LINE> <DEDENT> super().__init__(pom, "classification", name)
Separate-Model Approach for Classification.
62598fda0fa83653e46f546d
class AllocationProvider(object): <NEW_LINE> <INDENT> def __init__(self, name, available): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.available = available <NEW_LINE> self.sub_requests = [] <NEW_LINE> self.grants = [] <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<AllocationProvider %s>'...
A node provider and its capacity.
62598fda7cff6e4e811b5fae
class Topic(models.Model): <NEW_LINE> <INDENT> text = models.CharField(max_length=200) <NEW_LINE> date_added = models.DateTimeField(auto_now_add=True) <NEW_LINE> owner = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.text
A topic the user is learning about
62598fda3617ad0b5ee066cc
class Exploit(exploits.Exploit): <NEW_LINE> <INDENT> __info__ = { 'name': 'S7-300/400 PLC Control', 'authors': [ 'wenzhe zhu <jtrkid[at]gmail.com>', ], 'description': 'Use S7comm command to start/stop plc.', 'references': [ ], 'devices': [ 'Siemens S7-300 and S7-400 programmable logic controllers (PLCs)', ], } <NEW_LIN...
Exploit implementation for siemens S7-300 and S7-400 PLCs Dos vulnerability.
62598fdac4546d3d9def7545
class TestModelAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('name', 'pic',) <NEW_LINE> list_filter = ('name',) <NEW_LINE> search_fields = ['name']
Admin View for TestModel
62598fdaadb09d7d5dc0aafe
class RecordFailure: <NEW_LINE> <INDENT> def __init__(self, exception, when="setup"): <NEW_LINE> <INDENT> self.when = when <NEW_LINE> self.start = time.time() <NEW_LINE> self.stop = time.time() <NEW_LINE> try: <NEW_LINE> <INDENT> raise exception <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> self.excinfo = E...
Mock pytest internal reporter to emulate CallInfo. Creates a class that can be safely passed into pytest_runtest_makereport to add failure report based on an arbitrary exception.
62598fdafbf16365ca794645
class SpreadsheetAuth(HTTPRequest): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.redirect_uri = os.environ["SPREADSHEET_REDIRECT_URI"] <NEW_LINE> self.client_id = os.environ["SPREADSHEET_CLIENT_ID"] <NEW_LINE> self.client_secret = os.environ["SPREADSHEET_CLIENT_SECRET"]...
Class that provides google auth interactions in spreadsheet scope.
62598fdac4546d3d9def7546
class PyWord2number(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://w2n.readthedocs.io" <NEW_LINE> pypi = "word2number/word2number-1.1.zip" <NEW_LINE> version('1.1', sha256='70e27a5d387f67b04c71fbb7621c05930b19bfd26efd6851e6e0f9969dcde7d0') <NEW_LINE> depends_on('py-setuptools', type='build')
This is a Python module to convert number words (eg. twenty one) to numeric digits (21). It works for positive numbers upto the range of 999,999,999,999 (i.e. billions).
62598fda283ffb24f3cf3e0a
class TTransportBase(object): <NEW_LINE> <INDENT> def is_open(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def open(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def _read(self, sz):...
Base class for Thrift transport layer.
62598fda26238365f5fad0ec
class ExprInfo(object): <NEW_LINE> <INDENT> def __init__(self, name, info): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.info = info <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.info.__getitem__(key) <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> try: <NE...
Container for the information dictionary attached to expressions
62598fdaadb09d7d5dc0ab02
class IPList(Interface): <NEW_LINE> <INDENT> content_syntax = RpkiSignedChecklist_2021.IPList <NEW_LINE> def __init__(self, ip_resources: IpResourcesInfo): <NEW_LINE> <INDENT> data = [{"addressFamily": AFI[network.version], "iPAddressOrRange": ("addressPrefix", net_to_bitstring(network))} for network in ip_resources if...
ASN.1 IPList type.
62598fdad8ef3951e32c8120
class Flatten(Operator): <NEW_LINE> <INDENT> def __init__(self, axis=1): <NEW_LINE> <INDENT> super(Flatten, self).__init__() <NEW_LINE> self.axis = axis <NEW_LINE> <DEDENT> def forward(self, x): <NEW_LINE> <INDENT> self.shape = list(x.shape()) <NEW_LINE> shape, axis = self.shape, self.axis <NEW_LINE> assert axis <= len...
Flattens the input tensor into a 2D matrix. If input tensor has shape `(d_0, d_1, ... d_n)` then the output will have shape `(d_0 X d_1 ... d_(axis-1), d_axis X d_(axis+1) ... X dn)`.
62598fda091ae356687051a6
class Raster(MaskSet): <NEW_LINE> <INDENT> @property <NEW_LINE> def masks(self): <NEW_LINE> <INDENT> rank = self.rank <NEW_LINE> length = (2**rank)**2 <NEW_LINE> if self.invert: <NEW_LINE> <INDENT> pixel = 0 <NEW_LINE> arr = array([[1 for x in range(0,length)] for y in range(0,length)]) <NEW_LINE> <DEDENT> else: <NEW_L...
raster masks
62598fdac4546d3d9def7548
class AlphaBetaAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> alpha = -sys.maxint <NEW_LINE> beta = +sys.maxint <NEW_LINE> return self.avalue(gameState, 0, 0, alpha, beta)[1] <NEW_LINE> util.raiseNotDefined() <NEW_LINE> <DEDENT> def avalue(self, gamestate, agentnum...
Your minimax agent with alpha-beta pruning (question 3)
62598fdaab23a570cc2d5033
class TestIsStepwiseMotion(unittest.TestCase): <NEW_LINE> <INDENT> def test_ascending(self): <NEW_LINE> <INDENT> melody = [5, 6, 7] <NEW_LINE> position = 1 <NEW_LINE> self.assertTrue(is_stepwise_motion(melody, position)) <NEW_LINE> <DEDENT> def test_descending(self): <NEW_LINE> <INDENT> melody = [7, 6, 5] <NEW_LINE> po...
Ensures that a note is correctly identified as being part of some step-wise movement in a single direction.
62598fdaad47b63b2c5a7dde
class DevConfig(Config): <NEW_LINE> <INDENT> SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://joan:kyle@localhost/alert_emergency' <NEW_LINE> DEBUG = True
Development configuration child class Args: Config: The parent configuration class with General configuration settings
62598fdafbf16365ca79464b
class AutoscalingPolicyCpuUtilization(messages.Message): <NEW_LINE> <INDENT> utilizationTarget = messages.FloatField(1)
CPU utilization policy. Fields: utilizationTarget: The target utilization that the Autoscaler should maintain. Must be a float value between (0, 1]. If not defined, the default is 0.8.
62598fda0fa83653e46f5475
class LeNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_shape, return_indices=False, return_sizes=False): <NEW_LINE> <INDENT> super(LeNet, self).__init__() <NEW_LINE> C, _, _ = input_shape <NEW_LINE> self.return_indices = return_indices <NEW_LINE> self.return_sizes = return_sizes <NEW_LINE> self.block1 = n...
Base Lenet(ish) network that compresses information and on which all variants are built upon.
62598fda956e5f7376df5943
class PlayDirective(BaseAudioDirective): <NEW_LINE> <INDENT> REPLACE_ALL = 'REPLACE_ALL' <NEW_LINE> ENQUEUE = 'ENQUEUE' <NEW_LINE> REPLACE_ENQUEUED = 'REPLACE_ENQUEUED' <NEW_LINE> def __init__(self, play_behavior=ENQUEUE): <NEW_LINE> <INDENT> super(PlayDirective, self).__init__(AudioDirective.PLAY) <NEW_LINE> self._pla...
This directive will enqueue an audio stream to play. There are three play behaviors; Replace all, replace enqueued, and enqueue. Replace all will stop the current playing audio and clear the audio queue and play the given audio stream. Replace enqueued will continue to play the current audio stream, but will replace t...
62598fdadc8b845886d53b4a
class AlertAttachmentMeta(object): <NEW_LINE> <INDENT> swagger_types = { 'name': 'str', 'id': 'str' } <NEW_LINE> attribute_map = { 'name': 'name', 'id': 'id' } <NEW_LINE> def __init__(self, name=None, id=None): <NEW_LINE> <INDENT> self._name = None <NEW_LINE> self._id = None <NEW_LINE> self.discriminator = None <NEW_LI...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fdafbf16365ca79464d
class CenterDialog() : <NEW_LINE> <INDENT> def center(self): <NEW_LINE> <INDENT> screen = QDesktopWidget().screenGeometry() <NEW_LINE> size = self.geometry() <NEW_LINE> self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)
Simple class to center a dialog, not to be created directly. Inherit from it and call self.center() to center a dialog
62598fda0fa83653e46f5477
class eucaconsole(sos.plugintools.PluginBase): <NEW_LINE> <INDENT> def checkenabled(self): <NEW_LINE> <INDENT> if self.isInstalled("eucalyptus-console"): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return False <NEW_LINE> <DEDENT> def setup(self): <NEW_LINE> <INDENT> self.addCopySpec("/etc/eucalyptus-console") ...
Eucalyptus Cloud - Console
62598fda091ae356687051aa
class ConstType(Const): <NEW_LINE> <INDENT> pass
---------------------- Format header ids --------------------- */ enum { BMP_ID = 0x4d42, TIFF_BIGEND_ID = 0x4d4d, /* MM - for 'motorola' */ TIFF_LITTLEEND_ID = 0x4949 /* II - for 'intel' */ }
62598fdaab23a570cc2d5035
class CoordinateFunctionCV(FunctionCV): <NEW_LINE> <INDENT> def __init__( self, name, f, cv_requires_lists=False, cv_wrap_numpy_array=False, cv_scalarize_numpy_singletons=False, **kwargs ): <NEW_LINE> <INDENT> super(FunctionCV, self).__init__( name, cv_callable=f, cv_time_reversible=True, cv_requires_lists=cv_requires_...
Turn any function into a `CollectiveVariable`. Attributes ---------- cv_callable
62598fdaadb09d7d5dc0ab08
class oAuthGenerator(): <NEW_LINE> <INDENT> def Auth(self,a,x,y,z): <NEW_LINE> <INDENT> oAuth="" <NEW_LINE> s = "java -jar "+a+"auth-header-1.3.jar -k "+x+" -s "+y+" -p "+z+" > oAuthKey.txt" <NEW_LINE> print(s) <NEW_LINE> os.system("java -jar "+a+"auth-header-1.3.jar -k "+x+" -s "+y+" -p "+z+" > oAuthKey.txt") <NEW_LIN...
Auth function is used to get the oAuth value. As of now using auth-header-1.3.jar which will be replaced oAuth generator
62598fdad8ef3951e32c8123
class EffettiResultsGridTable(pdcrel.dbglib.DbGridTable): <NEW_LINE> <INDENT> def GetValue(self, row, gridcol): <NEW_LINE> <INDENT> out = None <NEW_LINE> db = self.grid.db <NEW_LINE> if 0 <= row < self.data: <NEW_LINE> <INDENT> col = self.rsColumns[gridcol] <NEW_LINE> if db.GetFieldName(col) == 'anag_tipo': <NEW_LINE> ...
Ritorna il contenuto di ogni cella della griglia per il suo disegno.
62598fdaad47b63b2c5a7de3
class MessageDict(collections.OrderedDict): <NEW_LINE> <INDENT> def __init__(self, message, items=None): <NEW_LINE> <INDENT> assert message is None or isinstance(message, Message) <NEW_LINE> if items is None: <NEW_LINE> <INDENT> super(MessageDict, self).__init__() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> super(Mes...
A specialized dict that is used for JSON message payloads - Request.arguments, Response.body, and Event.body. For all members that normally throw KeyError when a requested key is missing, this dict raises InvalidMessageError instead. Thus, a message handler can skip checks for missing properties, and just work directl...
62598fda26238365f5fad0f4
class Config(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._config = {} <NEW_LINE> for (key, value) in kwargs.items(): <NEW_LINE> <INDENT> if key not in self.__dict__: <NEW_LINE> <INDENT> self._config[key] = value <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ConfigException(...
The Config class handles all configuration for pokemontools. Other classes and functions use a Config object to determine where expected files can be located.
62598fdaad47b63b2c5a7de4
class QryParkedOrderField(Base): <NEW_LINE> <INDENT> _fields_ = [ ('BrokerID', ctypes.c_char * 11), ('InvestorID', ctypes.c_char * 13), ('InstrumentID', ctypes.c_char * 31), ('ExchangeID', ctypes.c_char * 9), ('InvestUnitID', ctypes.c_char * 17), ] <NEW_LINE> def __init__(self, BrokerID='', InvestorID='', InstrumentID=...
查询预埋单
62598fda50812a4eaa620eab
class MessageBox(QtWidgets.QDialog): <NEW_LINE> <INDENT> def __init__(self, title: str, message: str, parent: QtWidgets.QWidget = None, *, link_url: str = None, link_title: str = None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.window().setWindowTitle(title) <NEW_LINE> button_box = QtWidgets.QDialogB...
The Message Box is an inheritance from QMessageBox for a simplistic Message Box whenever a user forgets to do something and the UI must send an error message :param title: The title to set for the MessageBox :param message: The message to display in the MessageBox :param parent: The parent widget for this MessageBox
62598fda0fa83653e46f547b
class Simulation: <NEW_LINE> <INDENT> pass
Responsibilities: - placing the Roomba - asking Roomba where it's moving - updating the room - iterating over turns - reporting data (current turn, percent complete) Collaborators: - Room - Roomba
62598fda26238365f5fad0f6
class VerifyForgot(APIView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> key_cipher = request.GET["ac"] <NEW_LINE> ab = request.GET["ab"] <NEW_LINE> user_account_info = UserAccountInfo.objects.get(forgot_link="https://smv.sia.co.in/api/account/v1/forgot_password_verify/?ab="...
To verify the forgot link and check whether to let the user reset the password based on token expiry time
62598fda8a349b6b436867d3
class Time(Tag): <NEW_LINE> <INDENT> def __init__(self, time): <NEW_LINE> <INDENT> super().__init__(time) <NEW_LINE> <DEDENT> def go_back(self): <NEW_LINE> <INDENT> return f"{tagtag}{self.value}"
Time special tag.
62598fdaab23a570cc2d5037
class DataBits: <NEW_LINE> <INDENT> (RW, ADDR, MODE) = (1, 2, 3)
Data bits in a data command.
62598fda099cdd3c636756a8
class UnknownMethodCallError(Error): <NEW_LINE> <INDENT> def __init__(self, unknown_method_name): <NEW_LINE> <INDENT> Error.__init__(self) <NEW_LINE> self._unknown_method_name = unknown_method_name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Method called is not a member of the object: %s" % ...
Raised if an unknown method is requested of the mock object.
62598fda091ae356687051b0
class ZippedHtmlExportWriter(ZippedExportWriter): <NEW_LINE> <INDENT> writer_class = HtmlFileWriter <NEW_LINE> table_file_extension = ".html"
Write each table to an HTML file in a zipfile
62598fda956e5f7376df5947
class BestLines(Lines): <NEW_LINE> <INDENT> @Query.typecheck <NEW_LINE> def __init__( self, event_ids: Union[List[int], int], market_ids: Union[List[int], int] ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> event_ids = utils.make_list(event_ids) <NEW_LINE> market_ids = utils.make_list(market_ids) <NEW_LINE> self....
Get the best lines offered by any sportsbook for a number of events and markets. For each event, participant and market combination, the best line offered by any of sportsbooks tracked by SBR is in the response. The date and time that the line was offered is also recorded. Both American and decimal odds are included. ...
62598fdac4546d3d9def754d
class Attribute(models.Model): <NEW_LINE> <INDENT> feature = models.ForeignKey(Feature) <NEW_LINE> field_name = models.CharField(max_length=255) <NEW_LINE> attr_type = models.CharField(max_length=20) <NEW_LINE> width = models.IntegerField(blank=True, null=True) <NEW_LINE> precision = models.IntegerField(blank=True, nul...
This model is for holding generic values that appear in the data files that are uploaded. This data is bound to a feature object (above), which is collected in a whole DataFile. This model is where most of the interesting data lives, but is stored generically, because it could really be anything...
62598fda656771135c489c06
class _ReassociationTraceNumber(X12LoopBridge): <NEW_LINE> <INDENT> trace_type = ElementAccess("TRN", 1, x12type=enum({ "1": "Current Transaction Trace Numbers"})) <NEW_LINE> check_or_eft_trace_number = ElementAccess("TRN", 2) <NEW_LINE> payer_id = ElementAccess("TRN", 3) <NEW_LINE> originating_company_supplemental_cod...
Uniquely identify this transaction set. Also aid in reassociating payments and remittances that have been separated.
62598fdaad47b63b2c5a7de8
class SimilarTemplateMessageMatcher: <NEW_LINE> <INDENT> def __init__(self, template, msg, lexerType=LEXER_TOKENS, whitespace=" \t\n\r"): <NEW_LINE> <INDENT> self.template = template <NEW_LINE> self.msg = msg <NEW_LINE> self.lexerType = lexerType <NEW_LINE> self.ws = whitespace <NEW_LINE> <DEDENT> def match(self): <NEW...
Return the fields in a template and the distance between this template an a given input message.
62598fda0fa83653e46f547f
class ScoreManager: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._scores = list() <NEW_LINE> <DEDENT> @property <NEW_LINE> def scores(self): <NEW_LINE> <INDENT> return [score.to_dict() for score in sorted(self._scores, reverse=True)] <NEW_LINE> <DEDENT> def add_score(self, score): <NEW_LINE> <INDENT...
Simple class to manage a collection of scores Attributes: scores (list): the list of scores managed by the instance
62598fdaa219f33f346c6d9d
class DiagnosticsProfile(Model): <NEW_LINE> <INDENT> _attribute_map = { 'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'}, } <NEW_LINE> def __init__(self, boot_diagnostics=None): <NEW_LINE> <INDENT> self.boot_diagnostics = boot_diagnostics
Describes a diagnostics profile. :param boot_diagnostics: Boot Diagnostics is a debugging feature which allows the user to view console output and/or a screenshot of the virtual machine from the hypervisor. :type boot_diagnostics: :class:`BootDiagnostics <azure.mgmt.compute.compute.v2016_04_30_preview.models.BootDi...
62598fdadc8b845886d53b54
class ItemViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Item.objects.all().order_by('-creation_date') <NEW_LINE> serializer_class = ItemSerializer
API endpoint that allows accounts to be viewed or edited.
62598fda656771135c489c08
class ElectraPreTrainedModel(PreTrainedModel): <NEW_LINE> <INDENT> config_class = ElectraConfig <NEW_LINE> load_tf_weights = load_tf_weights_in_electra <NEW_LINE> base_model_prefix = "electra" <NEW_LINE> _keys_to_ignore_on_load_missing = [r"position_ids"] <NEW_LINE> _keys_to_ignore_on_load_unexpected = [r"electra\.embe...
An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.
62598fda283ffb24f3cf3e1a
class DAERecommender(Recommender): <NEW_LINE> <INDENT> def __init__(self, conditions=None, **kwargs): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.verbose = kwargs.get('verbose', True) <NEW_LINE> self.model_params = kwargs <NEW_LINE> self.conditions = conditions <NEW_LINE> self.dae = None <NEW_LINE> <DEDENT> ...
Denoising Recommender ===================================== Arguments --------- n_input: Dimension of input to expect n_hidden: Dimension for hidden layers n_code: Code Dimension Keyword Arguments ----------------- n_epochs: Number of epochs to train batch_size: Batch size to use for training verbose: Print losses du...
62598fda099cdd3c636756aa
class UnicodeJSONRendererTests(TestCase): <NEW_LINE> <INDENT> def test_proper_encoding(self): <NEW_LINE> <INDENT> obj = {'countries': ['United Kingdom', 'France', 'España']} <NEW_LINE> renderer = UnicodeJSONRenderer() <NEW_LINE> content = renderer.render(obj, 'application/json') <NEW_LINE> self.assertEqual(content, '{"...
Tests specific for the Unicode JSON Renderer
62598fda50812a4eaa620eae
class ArchiveMenuItemSelectedChecker( z3c.menu.ready2go.checker.TrueSelectedChecker, grok.MultiAdapter): <NEW_LINE> <INDENT> grok.adapts(zope.interface.Interface, icemac.addressbook.browser.interfaces.IAddressBookLayer, zope.interface.Interface, icemac.addressbook.browser.menus.menu.MainMenu, ArchiveMenuItem) <NEW_LINE...
Selected checker for the archive menu item in the site menu.
62598fda9f28863672818b4a
class SegmentListDict(segmentlistdict): <NEW_LINE> <INDENT> pass
A `dict` of `SegmentLists <SegmentList>` This class implements a standard mapping interface, with additional features added to assist with the manipulation of a collection of `SegmentList` objects. In particular, methods for taking unions and intersections of the lists in the dictionary are available, as well as the a...
62598fda0fa83653e46f5483
class DataProcessor(object): <NEW_LINE> <INDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_dev_examples(self, data_dir): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_labels(self): <NEW_LINE> <INDENT> raise NotImplem...
Base class for data converters for sequence classification data sets.
62598fdaad47b63b2c5a7dee
class HtmlField(TextField): <NEW_LINE> <INDENT> def formfield(self, **kwargs): <NEW_LINE> <INDENT> formfield = super(HtmlField, self).formfield(**kwargs) <NEW_LINE> formfield.widget.attrs["class"] = "mceEditor" <NEW_LINE> return formfield
TextField that stores HTML.
62598fda9f28863672818b4b
class Personality(object): <NEW_LINE> <INDENT> def __init__(self, person, model, generator = random_personality_generator, facet_generator = random_facets): <NEW_LINE> <INDENT> self.person = person <NEW_LINE> self.interests = generator(model) <NEW_LINE> self.facets = facet_generator(self, model) <NEW_LINE> self.model =...
Personality class that defines the behavior of a personality
62598fda099cdd3c636756ac
class Widget(AbstractWidget): <NEW_LINE> <INDENT> widget_type = 'sorting' <NEW_LINE> widget_label = _('Sorting') <NEW_LINE> groups = (DefaultSchemata, LayoutSchemata) <NEW_LINE> index = ViewPageTemplateFile('widget.pt') <NEW_LINE> @property <NEW_LINE> def default(self): <NEW_LINE> <INDENT> default = self.data.get('defa...
Widget
62598fdaab23a570cc2d503c
class TagsFilter(django_filters.filters.CharFilter): <NEW_LINE> <INDENT> def filter(self, qs, value): <NEW_LINE> <INDENT> if not value: <NEW_LINE> <INDENT> return qs <NEW_LINE> <DEDENT> tags = (tag.strip().capitalize() for tag in value.split(',')) <NEW_LINE> qs = qs.filter(tags__name__in=tags).distinct() <NEW_LINE> ret...
Create a special M2M filter for the tags field from taggit module
62598fda9f28863672818b4c
class MoveGenerator(object): <NEW_LINE> <INDENT> def __init__(self, group=None): <NEW_LINE> <INDENT> super(MoveGenerator, self).__init__() <NEW_LINE> self.set_group(group) <NEW_LINE> <DEDENT> def _codify__(self, *args, **kwargs): <NEW_LINE> <INDENT> raise Exception(LOGGER.impl("'%s' method must be overloaded"%inspect.s...
It is the parent class of all moves generators. This class can't be instantiated but its sub-classes might be. :Parameters: #. group (None, Group): The group instance.
62598fdaad47b63b2c5a7df1
class _Options: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> parser = argparse.ArgumentParser( description="Plays a game of Watch Your Back! between two " "Player classes") <NEW_LINE> parser.add_argument('white_module', help="full name of module containing White Player class") <NEW_LINE> parser.add_argum...
Parse and contain command-line arguments. --- help message: --- usage: referee.py [-h] [-d [DELAY]] white_module black_module Plays a basic game of Watch Your Back! between two Player classes positional arguments: white_module full name of module containing White Player class black_module full ...
62598fda099cdd3c636756ae
class VirtualNetworkListUsageResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[VirtualNetworkUsage]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW...
Response for the virtual networks GetUsage API service call. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: VirtualNetwork usage stats. :vartype value: list[~azure.mgmt.network.v2020_07_01.models.VirtualNetworkUsage] :param next_link: The URL to get the next set o...
62598fdaad47b63b2c5a7df3
class DataProcessor(DataGrabber): <NEW_LINE> <INDENT> def __init__(self, table,column,order): <NEW_LINE> <INDENT> matrix = DataGrabber(table,column,order)
classdocs
62598fda099cdd3c636756af
class WTLS(ExtensionOnlyType_): <NEW_LINE> <INDENT> c_tag = 'WTLS' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = ExtensionOnlyType_.c_children.copy() <NEW_LINE> c_attributes = ExtensionOnlyType_.c_attributes.copy() <NEW_LINE> c_child_order = ExtensionOnlyType_.c_child_order[:] <NEW_LINE> c_cardinality = Ex...
The urn:oasis:names:tc:SAML:2.0:ac:classes:InternetProtocolPassword:WTLS element
62598fda656771135c489c14
class MIMEMessage(MIMEPart): <NEW_LINE> <INDENT> uid = Header('message-id', id=True) <NEW_LINE> message_id = uid <NEW_LINE> content_id = Header('content-id', id=True) <NEW_LINE> content_disposition = Header('content-disposition', attr='content_disposition') <NEW_LINE> content_transfer_encoding = Header('content-transfe...
Example: > message.message_id > message.subject > message.date > message.get_envelope() > message.get_body_content('html') > message.get_attachments()
62598fdaad47b63b2c5a7df6
class BicycleState(minisim.SerdeInterface): <NEW_LINE> <INDENT> def __init__(self, x, y, v, phi): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.v = v <NEW_LINE> self.phi = phi <NEW_LINE> <DEDENT> def serialize(self) -> np.ndarray: <NEW_LINE> <INDENT> return np.array([self.x, self.y, self.v, self....
Class describing the states of a simple bicycle model. Described in https://www.researchgate.net/publication/318810853 with an added state for the current steering angle (delta).
62598fdaab23a570cc2d503f
class MoveTimestamp(command.Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._src_dir = None <NEW_LINE> self._dst_dir = None <NEW_LINE> self.datefmt = constants.FILE_DATE_FORMAT <NEW_LINE> <DEDENT> @property <NEW_LINE> def src_dir(self): <NEW_LINE> <INDENT> return...
Moves/renames all files in a folder to a destination by adding a timestamp prefix.
62598fdbc4546d3d9def7555
class FileStream(object): <NEW_LINE> <INDENT> def close(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def write(self, data): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def read(self, size=-1): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def s...
File stream object stored in a FileStorage.
62598fdb26238365f5fad108
class StatLine(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, y: int, text: str): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.floor_font = COMIC_SANS <NEW_LINE> self.image = self.floor_font.render(text, True, BLACK) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.rect.top = y <NEW...
Text Sprite for displaying some text.
62598fdbadb09d7d5dc0ab1d
class Actor(BaseActor): <NEW_LINE> <INDENT> def __init__( self, actor_id, shell_class, shell_config, env_class, env_configs, traj_length, seed, system_loggers, batch_size=1, n_unrolls=None, use_parallel_envs=False, use_threaded_envs=False, discount_factor=None, **sess_config): <NEW_LINE> <INDENT> raise Exception('Depre...
Actor is responsible for the following. (1) Create a shell and batched environments. (2) Pushes experience out to exp_sender.
62598fdbad47b63b2c5a7dfa
class TestProxyHeadersMiddleware(base.BaseApiTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> CONF.set_override('public_endpoint', 'http://spam.ham/eggs', group='api') <NEW_LINE> self.proxy_headers = {"X-Forwarded-Proto": "https", "X-Forwarded-Host": "mycloud.com", "X-Forwarded-Prefix": "/ironic"} <NEW_L...
Provide a basic smoke test to ensure proxy headers middleware works.
62598fdb50812a4eaa620eb6
class Summary(): <NEW_LINE> <INDENT> def __init__(self, dict_keys_input_list): <NEW_LINE> <INDENT> self.total_files_checked = 1 <NEW_LINE> self.total_files_missing = 0 <NEW_LINE> self.main_product_files_checked = 1 <NEW_LINE> self.main_product_files_missing = 0 <NEW_LINE> self.missing_primary_input_error = 0 <NEW_LINE>...
Contains all the info that will be used by the summary at the end of the main total_files_checked - all files checked in the recursive funtion total_files_missing - number of files missing in the entire search main_product_files_checked - number of files checked of the initial product chec...
62598fdbad47b63b2c5a7dfc
class WebcamBuilder(object): <NEW_LINE> <INDENT> def buildWebcam(camConfig, debug=False): <NEW_LINE> <INDENT> camType = type(camConfig.name) <NEW_LINE> camType.debug = debug <NEW_LINE> cfgParser = configparser.RawConfigParser() <NEW_LINE> cfgParser.read(camConfig) <NEW_LINE> if (cfgParser.getboolean("methods", "pan_rel...
A factory/builder that can construct a new Class/Type dynamically that includes the appropriate methods for the camera type defined by a WebcamConfig.
62598fdbfbf16365ca794669
class Method: <NEW_LINE> <INDENT> required_attrs = () <NEW_LINE> def __init__(self, data, progress=None, loglevel=logging.INFO, logname="Log"): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.progress = progress <NEW_LINE> self.loglevel = loglevel <NEW_LINE> self.logname = logname <NEW_LINE> self._check_required_a...
Abstract base class for all cclib method classes. All the modules containing methods should be importable.
62598fdbc4546d3d9def7558
class ImageAPIView(CreateAPIView): <NEW_LINE> <INDENT> queryset = ArticleImage.objects.all() <NEW_LINE> serializer_class = ArticleImageModelSerializer
图片上传功能
62598fdb3617ad0b5ee066f2
@dataclass <NEW_LINE> class CommentThreadReplies(BaseModel): <NEW_LINE> <INDENT> comments: Optional[List[Comment]] = field(default=None, repr=False)
A class representing comment tread replies info. Refer: https://developers.google.com/youtube/v3/docs/commentThreads#replies
62598fdbfbf16365ca79466b
class rbrock: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def evaluate(cls, x): <NEW_LINE> <INDENT> assert(len(x)==2) <NEW_LINE> value = (100*(x[1] - x[0]**2)**2 + (1 - x[0])**2) <NEW_LINE> return(value) <NEW_LINE> <DEDENT> dimension = 2 <NEW_LINE> var_lower = np.array([-10, -10]) <NEW_LINE> var_upper = np.array([5, 10...
rbrock function of the GlobalLib test set.
62598fdb091ae356687051c8
class MissingDimensionsTest(TestCase): <NEW_LINE> <INDENT> def test_get_dimensions(self): <NEW_LINE> <INDENT> m = MediathreadFileFactory() <NEW_LINE> TahoeFileFactory(video=m.video) <NEW_LINE> CUITFLVFileFactory(video=m.video) <NEW_LINE> DimensionlessSourceFileFactory(video=m.video) <NEW_LINE> assert m.video.get_dimens...
test the behavior for a video that has a source file, but that we couldn't parse the dimensions out of for some reason
62598fdb656771135c489c1e
class PropertyIsGreaterThan(BinaryComparisonOpType): <NEW_LINE> <INDENT> def __init__(self, propertyname, literal, matchcase=True): <NEW_LINE> <INDENT> BinaryComparisonOpType.__init__(self, 'fes:PropertyIsGreaterThan', propertyname, literal, matchcase)
PropertyIsGreaterThan class
62598fdb283ffb24f3cf3e30
class ColumnarPicture(): <NEW_LINE> <INDENT> columns = [] <NEW_LINE> def __init__(self, picture, fill=[0, 0, 0]): <NEW_LINE> <INDENT> for index, color in enumerate(picture): <NEW_LINE> <INDENT> column_index = index % GRID_LENGTH <NEW_LINE> while len(self.columns) <= column_index: <NEW_LINE> <INDENT> self.columns.append...
turn a list of 64 pixel settings into a two dimensional array padded by two empty images on each side
62598fdb956e5f7376df5954
class DataFrameWeldLoc: <NEW_LINE> <INDENT> def __init__(self, df): <NEW_LINE> <INDENT> self.df = df <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> if isinstance(key, SeriesWeld): <NEW_LINE> <INDENT> index_expr = grizzly_impl.get_field(self.df.expr, 0) <NEW_LINE> if self.df.is_pivot: <NEW_LINE> <IN...
Label location based indexer for selection by label for dataframe objects. Attributes: df (TYPE): The DataFrame being indexed into.
62598fdbab23a570cc2d5045
class Sku(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, 'size': {'key': 'size', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, 'model': {'key': 'model', 'type': 'str'}, 'capacity': {'key': 'capacity', 'type': 'int'}, } <NEW_LI...
Sku for the resource. :param name: The sku name. :type name: str :param tier: The sku tier. :type tier: str :param size: The sku size. :type size: str :param family: The sku family. :type family: str :param model: The sku model. :type model: str :param capacity: The sku capacity. :type capacity: int
62598fdb091ae356687051cc
class BTool_Inters(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "btool.boolean_inters" <NEW_LINE> bl_label = "Brush Intersection" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.active_object is not None <NEW_LINE> <DEDENT> def execute(self, context): <NEW_LINE> <IN...
This operator add a intersect brush to a canvas
62598fdb099cdd3c636756b6
class _BooleanPrimitive(_Primitive): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("boolean") <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "mplane.model.prim_boolean" <NEW_LINE> <DEDENT> def parse(self, sval): <NEW_LINE> <INDENT> if sval is None or sval == VALUE_NONE...
Represents a real number (floating point). Uses a Python bool as the native representation. If necessary, use the prim_boolean instance of this class; in general, however, this is used internally by Element.
62598fdb26238365f5fad114
class TestTagMgrStats(TestDBBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> from pyramid.paster import get_app <NEW_LINE> from bookie.tests import BOOKIE_TEST_INI <NEW_LINE> app = get_app(BOOKIE_TEST_INI, 'bookie') <NEW_LINE> from webtest import TestApp <NEW_LINE> self.testapp = TestApp(app) <NEW_LINE> ...
Handle some TagMgr stats checks
62598fdbab23a570cc2d5046
class MISSING_DECIDUOUS(Treatment): <NEW_LINE> <INDENT> def __init__(self, num_teeth): <NEW_LINE> <INDENT> super(MISSING_DECIDUOUS, self).__init__(code=9324, instance_count=num_teeth)
Missing deciduous teeth, where "missing" means where a tooth has been extracted (between 0 and 12). ULA, ULB, URA, URB, LLA, LLB, LRA, LRB should be excluded from the count.
62598fdbad47b63b2c5a7e05
class AlphaVantage(object): <NEW_LINE> <INDENT> def __init__(self, api_key='YOUR_API_KEY'): <NEW_LINE> <INDENT> self.api_key = api_key <NEW_LINE> <DEDENT> def _construct_alpha_vantage_symbol_call(self, ticker): <NEW_LINE> <INDENT> return "%s/%s&symbol=%s&outputsize=full&apikey=%s" % ( ALPHA_VANTAGE_BASE_URL, ALPHA_VANT...
Encapsulates calls to the AlphaVantage API with a provided API key.
62598fdb099cdd3c636756b7
class WhitelistItem(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'str', 'gate': 'str', 'trigger_id': 'str' } <NEW_LINE> attribute_map = { 'id': 'id', 'gate': 'gate', 'trigger_id': 'trigger_id' } <NEW_LINE> def __init__(self, id=None, gate=None, trigger_id=None): <NEW_LINE> <INDENT> self._id = None <NEW_LINE> se...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fdb3617ad0b5ee066f9
class ComputeResourceReservationCreateAPI(SwaggerView): <NEW_LINE> <INDENT> parameters = [{ "name": "body", "in": "body", "schema": CreateComputeResourceReservationRequest, "required": True }] <NEW_LINE> responses = { CREATED: { 'description': 'Element containing information about the reserved ' 'resource.', 'schema': ...
Create Compute Resource Reservation operation. This operation allows requesting the reservation of virtualised compute resources as indicated by the consumer functional block.
62598fdbab23a570cc2d5047
class ATDFailureError(ATDError): <NEW_LINE> <INDENT> pass
Exception is raised when ATD box returns failure result to last request
62598fdb4c3428357761a861
class AuthResource(Resource): <NEW_LINE> <INDENT> def _get_url(self, endpoint: str) -> str: <NEW_LINE> <INDENT> return "{}/auth/api/v1/{}".format(self.base_url, endpoint) <NEW_LINE> <DEDENT> def _request(self, url: str, method: str, data: Optional[dict] = None) -> Any: <NEW_LINE> <INDENT> response = self._send_request(...
Handles resources under the `/auth` endpoints.
62598fdb099cdd3c636756b8
class tkFrame(Tkinter.Frame): <NEW_LINE> <INDENT> def __init__(self, master, canvas, width=500, height=500, bg='', **kw): <NEW_LINE> <INDENT> Tkinter.Frame.__init__(self, master, width=width, height = height, bg=bg, **kw) <NEW_LINE> if isinstance(canvas, pxdislin.Canvas): <NEW_LINE> <INDENT> self.canvas = canvas <NEW_L...
A Frame object modified for drawing disipyl Canvas objects. Comments: * Will also except a descendant of PlotObject and instantiate a disipyl Canvas object as needed.
62598fdbab23a570cc2d5048
class Imports(tables.IsDescription): <NEW_LINE> <INDENT> name = tables.StringCol(30, pos=1) <NEW_LINE> date = tables.StringCol(30, pos=2) <NEW_LINE> datfile = tables.StringCol(50, pos=3) <NEW_LINE> status = tables.StringCol(10, pos=4)
@brief HDF5 table definition for mascot import tracking table
62598fdb4c3428357761a865