code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class RegisterCallbackResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_CallbackID(self): <NEW_LINE> <INDENT> return self._output.get('CallbackID', None) <NEW_LINE> <DEDENT> def get_CallbackURL(self): <NEW_LINE> <INDENT> re...
A ResultSet with methods tailored to the values returned by the RegisterCallback Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
625990598e71fb1e983bd078
class GateDefinition(AbstractGate): <NEW_LINE> <INDENT> @property <NEW_LINE> def ideal_unitary(self): <NEW_LINE> <INDENT> return self._ideal_unitary <NEW_LINE> <DEDENT> def _ideal_unitary_pygsti(self, parms): <NEW_LINE> <INDENT> if parms: <NEW_LINE> <INDENT> return self._ideal_unitary(*parms) <NEW_LINE> <DEDENT> else: ...
Base: :class:`AbstractGate` Represents a gate that's implemented by a pulse sequence in a gate definition file.
62599059498bea3a75a590d3
@python_2_unicode_compatible <NEW_LINE> class CourseOrg(models.Model): <NEW_LINE> <INDENT> CATEGORY_CHOICES = ( ('pxjg', "培训机构"), ('gr', "个人"), ('gx', "高校") ) <NEW_LINE> name = models.CharField(max_length=50, verbose_name="机构名称") <NEW_LINE> desc = models.TextField(verbose_name="机构描述") <NEW_LINE> category = models.CharF...
课程机构Model
6259905901c39578d7f1420e
class ApiKeyListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ApiKey]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["ApiKey"]] = None, next_link: Optional[str] = None, **kwargs ): <NEW_LINE> <...
The result of a request to list API keys. :ivar value: The collection value. :vartype value: list[~app_configuration_management_client.models.ApiKey] :ivar next_link: The URI that can be used to request the next set of paged results. :vartype next_link: str
625990594a966d76dd5f04a0
class DefineSrvCommand(object): <NEW_LINE> <INDENT> def __init__(self, serv, name, alias=None): <NEW_LINE> <INDENT> self.serv = serv <NEW_LINE> self.name = name <NEW_LINE> if alias is None: <NEW_LINE> <INDENT> alias = [] <NEW_LINE> <DEDENT> self.alias = alias <NEW_LINE> if not self.name in serv.cmds: <NEW_LINE> <INDENT...
decorator that allows to "register" commands on-the-fly
625990598e7ae83300eea63c
class RevisionReplayer(object): <NEW_LINE> <INDENT> def __init__(self, document, initial_revision_id=1): <NEW_LINE> <INDENT> self.document = document <NEW_LINE> self.content = Content() <NEW_LINE> self.current_revision_id = 0 <NEW_LINE> self.to_revision(initial_revision_id) <NEW_LINE> <DEDENT> def to_revision(self, tar...
Document/content wrapper optimized for stepping forwards and backwards through revisions
6259905915baa72349463542
class IItemWithName(IItem): <NEW_LINE> <INDENT> pass
Item with name.
62599059379a373c97d9a5d3
class Sidedef(WADStruct): <NEW_LINE> <INDENT> _fields_ = [ ("off_x", ctypes.c_int16), ("off_y", ctypes.c_int16), ("tx_up", ctypes.c_char * 8), ("tx_low", ctypes.c_char * 8), ("tx_mid", ctypes.c_char * 8), ("sector", ctypes.c_uint16) ] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.tx_up = s...
Represents a map sidedef.
62599059462c4b4f79dbcfb4
class iterator: <NEW_LINE> <INDENT> def __init__(self, node): <NEW_LINE> <INDENT> self._nd = node <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Iterator[key=" + repr(self.key()) + ' value=' + repr(self.value()) + "]" <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self._nd ...
Encapsulation of a position in the map
625990591b99ca400229000f
class PatronStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.Auth = channel.unary_unary( '/Patron/Auth', request_serializer=Patron__pb2.AuthRequest.SerializeToString, response_deserializer=Patron__pb2.BooleanMessageReply.FromString, ) <NEW_LINE> self.ResetPassword = channel.unary_...
Missing associated documentation comment in .proto file.
6259905932920d7e50bc75f6
class SpearmanDistance(Distance): <NEW_LINE> <INDENT> def __init__(self, absolute): <NEW_LINE> <INDENT> self.absolute = absolute <NEW_LINE> <DEDENT> def __call__(self, e1, e2=None, axis=1): <NEW_LINE> <INDENT> x1 = _orange_to_numpy(e1) <NEW_LINE> x2 = _orange_to_numpy(e2) <NEW_LINE> if x2 is None: <NEW_LINE> <INDENT> x...
Generic Spearman's rank correlation coefficient.
625990590a50d4780f706896
class TestPortal(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def subprocess_run( cls, cmd, capture_output=None, check=None): <NEW_LINE> <INDENT> return subprocess.CompletedProcess(args='foo', returncode=0) <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> config = ({'SQLALCHEMY_DATABASE_URI':...
Unit tests for portal.
6259905999cbb53fe683248e
class User(Dateable, BASE): <NEW_LINE> <INDENT> __tablename__ = 'user' <NEW_LINE> login = Column(String, unique=True, nullable=False, info={'trim': True}) <NEW_LINE> firstname = Column(String) <NEW_LINE> lastname = Column(String) <NEW_LINE> email = Column(String) <NEW_LINE> password = Column('password', MyPassword) <NE...
User model
62599059d486a94d0ba2d577
class VirtualNetworkListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[VirtualNetwork]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(VirtualNetworkListResult, self).__init__(**kwa...
Response for the ListVirtualNetworks API service call. :param value: Gets a list of VirtualNetwork resources in a resource group. :type value: list[~azure.mgmt.network.v2018_07_01.models.VirtualNetwork] :param next_link: The URL to get the next set of results. :type next_link: str
62599059507cdc57c63a6354
class AbstractFieldReader(BaseReader): <NEW_LINE> <INDENT> def __init__(self, file_path, field_separator, result_order=11): <NEW_LINE> <INDENT> super(AbstractFieldReader, self).__init__(file_path, field_separator) <NEW_LINE> self.ordering = result_order <NEW_LINE> self.logger = logging.getLogger("AbstactFieldReader") <...
Read lines returning DOI, result_list, rank, confidence tuples. If the file is_gold_standard, confidence is None. If the file has_intrinsic_ranking or is_gold_standard, rank is None. Reports and raises ValueErrors if the rank or confidence is not as expected. Asserts the correct value range for rank and confidence.
625990590fa83653e46f6495
class EMreusedUS(bpy.types.PropertyGroup): <NEW_LINE> <INDENT> epoch: prop.StringProperty( name="epoch", description="Epoch", default="Untitled") <NEW_LINE> em_element: prop.StringProperty( name="em_element", description="", default="Empty")
Group of properties representing an item in the list
625990599c8ee82313040c62
class Movie(): <NEW_LINE> <INDENT> def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube): <NEW_LINE> <INDENT> self.title = movie_title <NEW_LINE> self.storyline = movie_storyline <NEW_LINE> self.poster_image_url = poster_image <NEW_LINE> self.trailer_youtube_url = trailer_youtube <NEW_LINE> <D...
This class provides a way to store movie related information. This class was adapted from the course "Full Stack Web Developer" by Alain Boisvert on Sunday 30 July 2017. Attributes: movie_title: Title of the movie. movie_storyline: Storyline of the movie. poster_image: Poster URL of the movie from the wik...
62599059f7d966606f749390
class Sender(tk.Frame): <NEW_LINE> <INDENT> def __init__(self,parent,root,user_name): <NEW_LINE> <INDENT> tk.Frame.__init__(self,parent) <NEW_LINE> self.root = root <NEW_LINE> self.parent = parent <NEW_LINE> self.user_name = user_name <NEW_LINE> self.title = tk.Label(self,text="Select Files ",relief='solid',fg='blue',b...
Send page --------- add or remove files to send
62599059d7e4931a7ef3d62f
class ISOCountryCode(SchemaNode): <NEW_LINE> <INDENT> schema_type = StringType <NEW_LINE> default = '' <NEW_LINE> missing = drop <NEW_LINE> validator = Regex(r'^[A-Z][A-Z]$|^$') <NEW_LINE> def deserialize(self, cstruct=null): <NEW_LINE> <INDENT> if cstruct == '': <NEW_LINE> <INDENT> return cstruct <NEW_LINE> <DEDENT> r...
An ISO 3166-1 alpha-2 country code (two uppercase ASCII letters). Example value: US
62599059a17c0f6771d5d679
class AnObject(BaseEntityMixin): <NEW_LINE> <INDENT> title = Column(Unicode(100), nullable=False) <NEW_LINE> headline = Column(UnicodeText, nullable=False) <NEW_LINE> description = Column(UnicodeText, nullable=True) <NEW_LINE> primary_key = Column(Unicode(256), nullable=False, unique=True) <NEW_LINE> url = Column(Unico...
Anything with text and meta. Note: At the time, I'm not enforcing any authorship norms. Those are to be defined on their respective ORM classes.
6259905956ac1b37e63037bf
class DebugStatsdClient(BaseStatsdClient): <NEW_LINE> <INDENT> def __init__( self, level: int = logging.INFO, logger: logging.Logger = logger, inner: Optional[BaseStatsdClient] = None, **kwargs: Any, ) -> None: <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.level = level <NEW_LINE> self.logger = logger ...
Verbose client for development or debugging purposes. All Statsd packets will be logged and optionally forwarded to a wrapped client.
6259905963b5f9789fe86722
class GalaxyApiAccess: <NEW_LINE> <INDENT> def __init__(self, galaxy_url, api_key): <NEW_LINE> <INDENT> self._base_url = galaxy_url <NEW_LINE> self._key = api_key <NEW_LINE> self._max_tries = 5 <NEW_LINE> <DEDENT> def _make_url(self, rel_url, params=None): <NEW_LINE> <INDENT> if not params: <NEW_LINE> <INDENT> params =...
Simple front end for accessing Galaxy's REST API.
625990593539df3088ecd84c
class LayerParametersDict(OrderedDict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._tensors = set() <NEW_LINE> super(LayerParametersDict, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> key = self._canonicalize_key(key) <N...
An OrderedDict where keys are Tensors or tuples of Tensors. Ensures that no Tensor is associated with two different keys.
625990594e4d5625663739b8
class Avion(OznakaINaziv, Kolekcija): <NEW_LINE> <INDENT> def __init__(self, ID, naziv, duzina, sirina, visina, raspon_krila, godiste, nosivost, relacija): <NEW_LINE> <INDENT> OznakaINaziv.__init__(self, ID, naziv) <NEW_LINE> Kolekcija.__init__(self, duzina, sirina, visina) <NEW_LINE> self.raspon_krila = raspon_krila <...
Pravi objekat Aviona. Mogu da se dodaju Prostori za robu. Avion opisuju ID, Naziv, Duzina, Sirina, Visina i Prostori za robu koje sadrzi
6259905901c39578d7f1420f
class APIDictWrapper(object): <NEW_LINE> <INDENT> _apidict = {} <NEW_LINE> def __init__(self, apidict): <NEW_LINE> <INDENT> self._apidict = apidict <NEW_LINE> <DEDENT> def __getattribute__(self, attr): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return object.__getattribute__(self, attr) <NEW_LINE> <DEDENT> except Att...
Simple wrapper for api dictionaries Some api calls return dictionaries. This class provides identical behavior as APIResourceWrapper, except that it will also behave as a dictionary, in addition to attribute accesses. Attribute access is the preferred method of access, to be consistent with api resource objects from...
62599059adb09d7d5dc0bb1b
class TestReporting(unittest.TestCase): <NEW_LINE> <INDENT> @patch('upload.result_upload.upload_result') <NEW_LINE> def test_process_folder(self, mock_upload): <NEW_LINE> <INDENT> report_config = self._report_config_example() <NEW_LINE> reporting.process_folder( 'test_runners/pytorch/unittest_files/results/basic', repo...
Tests for pytorch reporting module.
62599059be8e80087fbc0634
@base.vectorize <NEW_LINE> class movint(base.Instruction): <NEW_LINE> <INDENT> __slots__ = ["code"] <NEW_LINE> code = base.opcodes['MOVINT'] <NEW_LINE> arg_format = ['ciw','ci']
Assigns register $ci_i$ the value in the register $ci_j$.
62599059460517430c432b2a
class exp_polar(ExpBase): <NEW_LINE> <INDENT> is_polar = True <NEW_LINE> is_comparable = False <NEW_LINE> def _eval_Abs(self): <NEW_LINE> <INDENT> from sympy import expand_mul <NEW_LINE> return sqrt( expand_mul(self * self.conjugate()) ) <NEW_LINE> <DEDENT> def _eval_evalf(self, prec): <NEW_LINE> <INDENT> from sympy im...
Represent a 'polar number' (see g-function Sphinx documentation). ``exp_polar`` represents the function `Exp: \mathbb{C} \rightarrow \mathcal{S}`, sending the complex number `z = a + bi` to the polar number `r = exp(a), \theta = b`. It is one of the main functions to construct polar numbers. >>> from sympy import exp...
62599059d7e4931a7ef3d631
class IOException(Exception): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'msg', None, None, ), (2, TType.STRING, 'stack', None, None, ), (3, TType.STRING, 'clazz', None, None, ), ) <NEW_LINE> def __init__(self, msg=None, stack=None, clazz=None,): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> self.stack...
Generic I/O error Attributes: - msg: Error message. - stack: Textual representation of the call stack. - clazz: The Java class of the Exception (may be a subclass)
6259905963d6d428bbee3d60
@python_2_unicode_compatible <NEW_LINE> class Trigger(models.Model): <NEW_LINE> <INDENT> name = models.CharField(u'触发器名', max_length=16) <NEW_LINE> triggeritems = models.ManyToManyField(TriggerItem, verbose_name=u'触发器条目') <NEW_LINE> level_choices = ( ('info', u'消息'), ('debug', u'调试'), ('danger', u'危险'), ('disaster', u'...
触发器
6259905999cbb53fe6832491
class BaseValidator(object): <NEW_LINE> <INDENT> def _validate(self, filehandle, metadata): <NEW_LINE> <INDENT> raise NotImplementedError("_validate not implemented") <NEW_LINE> <DEDENT> def __call__(self, filehandle, metadata): <NEW_LINE> <INDENT> return self._validate(filehandle, metadata) <NEW_LINE> <DEDENT> def __r...
BaseValidator class for flask_transfer. Provides utility methods for combining validators together. Subclasses should implement `_validates`. Validators can signal failure in one of two ways: * Raise UploadError with a message * Return non-Truthy value. Raising UploadError is the preferred method, as it allow...
625990593eb6a72ae038bc11
class TalkSubmissionForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Talk <NEW_LINE> exclude = ('status', 'type') <NEW_LINE> field_args = { 'name': {'label': 'Title'}, 'description': { 'label': 'Description', 'description': ( 'If your talk is accepted this will be made public. It ' 'should b...
Form for editing :class:`~pygotham.models.Talk` instances.
62599059379a373c97d9a5d6
class CustomFormatter(logging.Formatter, object): <NEW_LINE> <INDENT> def format(self, record): <NEW_LINE> <INDENT> if record.levelno == LOG_LEVEL_TASK.level: <NEW_LINE> <INDENT> temp = '*' * (90 - len(record.msg) - 25) <NEW_LINE> self._fmt = "\n\n[%(asctime)s] %(levelname)s - [%(message)s] " + temp + "\n\n" <NEW_LINE>...
Custom formatter to handle different logging formats based on logging level Python 2.6 workaround - logging.Formatter class does not use new-style class and causes 'TypeError: super() argument 1 must be type, not classobj' so we use multiple inheritance to get around the problem.
62599059627d3e7fe0e0843f
class DecryptionError(Exception): <NEW_LINE> <INDENT> pass
Raised when a message could not be decrypted.
6259905907d97122c4218256
class StandardNormal(Distribution): <NEW_LINE> <INDENT> def __init__(self, shape, device='cpu'): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.device = device <NEW_LINE> self._shape = torch.Size(shape) <NEW_LINE> self._log_z = 0.5 * np.prod(shape) * np.log(2 * np.pi) <NEW_LINE> <DEDENT> def _log_prob(self, inp...
A multivariate Normal with zero mean and unit covariance.
62599059e76e3b2f99fd9fb1
class UserRegistration(Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.user_parser = reqparse.RequestParser() <NEW_LINE> self.user_parser.add_argument("firstname", type=str, required=True) <NEW_LINE> self.user_parser.add_argument("lastname", type=str, required=True) <NEW_LINE> self.user_pars...
Class for user registration
62599059004d5f362081fac6
class EscapeText(six.text_type, EscapeData): <NEW_LINE> <INDENT> __new__ = allow_lazy(six.text_type.__new__, six.text_type)
A unicode string object that should be HTML-escaped when output.
62599059baa26c4b54d50856
class TwoWordNonPSDProbe(Probe): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> print('TwoWordNonPSDProbe') <NEW_LINE> super(TwoWordNonPSDProbe, self).__init__() <NEW_LINE> self.args = args <NEW_LINE> self.probe_rank = args['probe']['maximum_rank'] <NEW_LINE> self.model_dim = args['model']['hidden_di...
Computes a bilinear function of difference vectors. For a batch of sentences, computes all n^2 pairs of scores for each sentence in the batch.
62599059dd821e528d6da459
class Account(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'account' <NEW_LINE> username = db.Column(db.String(30), primary_key=True) <NEW_LINE> contact_email = db.Column(db.String(100), nullable=False) <NEW_LINE> first_name = db.Column(db.String(100), nullable=False, default='') <NEW_LINE> last_name = db.Column(db.S...
Basic user account
62599059b5575c28eb7137a5
class Command(NoArgsCommand): <NEW_LINE> <INDENT> def handle_noargs(self, **options): <NEW_LINE> <INDENT> fixtures_dir = os.path.join(settings.PROJECT_ROOT, 'demo', 'fixtures') <NEW_LINE> fixture_file = os.path.join(fixtures_dir, 'demo.json') <NEW_LINE> image_src_dir = os.path.join(fixtures_dir, 'images') <NEW_LINE> im...
Import Wagtail fixtures
6259905901c39578d7f14210
class InteractionException(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message
An exception to be raised when an interaction with a web page fails Attributes ---------- message : str The message detailing why the exception was raised
6259905915baa72349463546
class BinaryTruePositives(keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, name='true_positives', **kwargs): <NEW_LINE> <INDENT> super(BinaryTruePositives, self).__init__(name=name, **kwargs) <NEW_LINE> self.true_positives = keras.backend.variable(value=0, dtype='int32') <NEW_LINE> <DEDENT> def reset_states(...
Stateful Metric to count the total true positives over all batches. Assumes predictions and targets of shape `(samples, 1)`. Arguments: threshold: Float, lower limit on prediction value that counts as a positive class prediction. name: String, name for the metric.
6259905910dbd63aa1c72153
class Simulator(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> parser = argparse.ArgumentParser(description='simulator') <NEW_LINE> parser.add_argument('conf', type=str, help='config file') <NEW_LINE> args = parser.parse_args() <NEW_LINE> config = args.conf <NEW_LINE> confmod = imp.load_source('conf','c...
Cross Entropy Method Stochastic Optimizer
62599059379a373c97d9a5d7
class ValidationCurves(): <NEW_LINE> <INDENT> def __init__(self, X, y, estimator, hyperparameter, metric, validation, pipeline=False, metric_name='metric', pipeline_step=-1): <NEW_LINE> <INDENT> self.X = X <NEW_LINE> self.y = y <NEW_LINE> self.estimator = estimator <NEW_LINE> self.hyperparameter = hyperparameter <NEW_L...
Assessment of the performace of machine learning models. parameters: X - Pandas dataframe. y - target. estimator - The machine learning algorithm chosen. hyperparameter - String with the name of the hyperparameter that will be evaluated. metric - Metric chosen for the assessment. It can be a string like: 'accurac...
62599059adb09d7d5dc0bb1d
class OneTimeTieredPricingOverride(object): <NEW_LINE> <INDENT> swagger_types = { 'quantity': 'float', 'tiers': 'list[ChargeTier]' } <NEW_LINE> attribute_map = { 'quantity': 'quantity', 'tiers': 'tiers' } <NEW_LINE> def __init__(self, quantity=None, tiers=None): <NEW_LINE> <INDENT> self._quantity = None <NEW_LINE> self...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599059be8e80087fbc0636
class CornersProblem(search.SearchProblem): <NEW_LINE> <INDENT> def __init__(self, startingGameState): <NEW_LINE> <INDENT> self.walls = startingGameState.getWalls() <NEW_LINE> self.startingPosition = startingGameState.getPacmanPosition() <NEW_LINE> top, right = self.walls.height-2, self.walls.width-2 <NEW_LINE> self.co...
This search problem finds paths through all four corners of a layout. You must select a suitable state space and successor function
62599059460517430c432b2b
class DefaultHandler(RateLimitHandler): <NEW_LINE> <INDENT> ca_lock = Lock() <NEW_LINE> cache = {} <NEW_LINE> cache_hit_callback = None <NEW_LINE> timeouts = {} <NEW_LINE> @staticmethod <NEW_LINE> def with_cache(function): <NEW_LINE> <INDENT> @wraps(function) <NEW_LINE> def wrapped(cls, _cache_key, _cache_ignore, _cach...
Extends the RateLimitHandler to add thread-safe caching support.
625990593617ad0b5ee076fd
class Asset(PrimaryKeyModel, Serializable): <NEW_LINE> <INDENT> physical_asset = models.ForeignKey('AssetPhysical', db_constraint=False, max_length=32, blank=True, null=True, db_column='c_asset_physical_id') <NEW_LINE> name = models.CharField(max_length=200, blank=True, null=True, db_column='c_name') <NEW_LINE> busines...
系统文件,文件的虚拟结构
62599059d99f1b3c44d06c53
class CreateOrder(CreateAPIView): <NEW_LINE> <INDENT> permission_classes = (Customer,) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._order_service = OrderService() <NEW_LINE> <DEDENT> def post(self, request): <NEW_LINE> <INDENT> serializer = OrderCreateSerializer(data = request.data) <NEW_LINE> if not serial...
Create an order
6259905932920d7e50bc75fa
class factory_callable(MetadataDictDirective): <NEW_LINE> <INDENT> key = FACTORY_CALLABLE_KEY <NEW_LINE> def factory(self, field_name, func): <NEW_LINE> <INDENT> return {field_name: func}
Directive used to define a callable returning a yafowil widget for a schema field.
625990590a50d4780f706898
class Xfsinfo(AutotoolsPackage, XorgPackage): <NEW_LINE> <INDENT> homepage = "http://cgit.freedesktop.org/xorg/app/xfsinfo" <NEW_LINE> xorg_mirror_path = "app/xfsinfo-1.0.5.tar.gz" <NEW_LINE> version('1.0.5', sha256='56a0492ed2cde272dc8f4cff4ba0970ccb900e51c10bb8ec62747483d095fd69') <NEW_LINE> depends_on('libfs') <NEW_...
xfsinfo is a utility for displaying information about an X font server. It is used to examine the capabilities of a server, the predefined values for various parameters used in communicating between clients and the server, and the font catalogues and alternate servers that are available.
6259905930dc7b76659a0d59
class NVTEnsemble(NVEEnsemble): <NEW_LINE> <INDENT> def __init__(self, dt, temp, thermostat=None, fixcom=False): <NEW_LINE> <INDENT> super(NVTEnsemble,self).__init__(dt=dt,temp=temp, fixcom=fixcom) <NEW_LINE> if thermostat is None: <NEW_LINE> <INDENT> self.thermostat = Thermostat() <NEW_LINE> <DEDENT> else: <NEW_LINE> ...
Ensemble object for constant temperature simulations. Has the relevant conserved quantity and normal mode propagator for the constant temperature ensemble. Contains a thermostat object containing the algorithms to keep the temperature constant. Attributes: thermostat: A thermostat object to keep the temperature co...
625990591f037a2d8b9e5345
class SqlComment(Base): <NEW_LINE> <INDENT> __tablename__ = 'comments' <NEW_LINE> id = sqla.Column(sqla.String, primary_key=True) <NEW_LINE> nid = sqla.Column(sqla.Integer) <NEW_LINE> comment_text = sqla.Column(sqla.String) <NEW_LINE> comment_signature = sqla.Column(sqla.String) <NEW_LINE> posting_date = sqla.Column(sq...
Object used to store a comment in a DB
625990598da39b475be0479a
class RegistroF210(Registro): <NEW_LINE> <INDENT> campos = [ CampoFixo(1, 'REG', 'F210'), CampoNumerico(2, 'VL_CUS_ORC', obrigatorio=True), CampoNumerico(3, 'VL_EXC', obrigatorio=True), CampoNumerico(4, 'VL_CUS_ORC_AJU', obrigatorio=True), CampoNumerico(5, 'VL_BC_CRED', obrigatorio=True), CampoNumerico(6, 'CST_PIS', ob...
Operações da Atividade Imobiliária – Custo Orçado da Unidade Imobiliária Vendida
6259905907f4c71912bb09ef
class LocalizedObjectAnnotation(proto.Message): <NEW_LINE> <INDENT> mid = proto.Field(proto.STRING, number=1,) <NEW_LINE> language_code = proto.Field(proto.STRING, number=2,) <NEW_LINE> name = proto.Field(proto.STRING, number=3,) <NEW_LINE> score = proto.Field(proto.FLOAT, number=4,) <NEW_LINE> bounding_poly = proto.Fi...
Set of detected objects with bounding boxes. Attributes: mid (str): Object ID that should align with EntityAnnotation mid. language_code (str): The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Unicode_...
62599059097d151d1a2c2620
class IntelPart(): <NEW_LINE> <INDENT> def __init__(self, family:str, device:str): <NEW_LINE> <INDENT> self.family = family <NEW_LINE> self.device = device <NEW_LINE> <DEDENT> def as_tuple(self): <NEW_LINE> <INDENT> return ( self.family, self.device, ) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> re...
Intel/Altera FPGA model name specification
62599059a8ecb033258727cc
class Number(float): <NEW_LINE> <INDENT> def __neg__(self): <NEW_LINE> <INDENT> n = float.__new__(self.__class__, -float(self)) <NEW_LINE> return n
A floating-point number without dimension.
625990594e4d5625663739bb
class Pad(Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> self.source = rtmidi.MidiIn() <NEW_LINE> self.score = 0.0 <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> if self.source.get_port_count() > 0: <NEW_LINE> <INDENT> self.source.open_port(1) <NEW_LINE> se...
docstring for Pad
62599059dd821e528d6da45a
class Controller(abc.ABC): <NEW_LINE> <INDENT> VIEW = None <NEW_LINE> def get(self, **kwargs): <NEW_LINE> <INDENT> return abort(404) <NEW_LINE> <DEDENT> def post(self, **kwargs): <NEW_LINE> <INDENT> return abort(404) <NEW_LINE> <DEDENT> def put(self, **kwargs): <NEW_LINE> <INDENT> return abort(404) <NEW_LINE> <DEDENT> ...
Controller base class
625990593539df3088ecd851
class GAKHcoin(Bitcoin): <NEW_LINE> <INDENT> name = 'gakhcoin' <NEW_LINE> symbols = ('GAKH', ) <NEW_LINE> nodes = ("46.166.168.155", ) <NEW_LINE> port = 7829
Class with all the necessary GAKHcoin network information based on https://github.com/gakh/GAKHcoin/blob/master/src/net.cpp (date of access: 02/15/2018)
625990598a43f66fc4bf3742
class VGG2L(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, idim: int, odim: int, pos_enc: torch.nn.Module = None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.vgg2l = torch.nn.Sequential( torch.nn.Conv2d(1, 64, 3, stride=1, padding=1), torch.nn.ReLU(), torch.nn.Conv2d(64, 64, 3, stride=1, padding=1...
VGG2L module for custom encoder. Args: idim: Dimension of inputs odim: Dimension of outputs pos_enc: Positional encoding class
625990597cff6e4e811b6ff8
class StackedAlternatingLstm(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_size: int, hidden_size: int, num_layers: int, recurrent_dropout_probability: float = 0.0, use_highway: bool = True, use_input_projection_bias: bool = True) -> None: <NEW_LINE> <INDENT> super(StackedAlternatingLstm, self).__init_...
A stacked LSTM with LSTM layers which alternate between going forwards over the sequence and going backwards. This implementation is based on the description in `Deep Semantic Role Labelling - What works and what's next <https://homes.cs.washington.edu/~luheng/files/acl2017_hllz.pdf>`_ . Parameters ---------- input_si...
62599059d53ae8145f919a16
class EmptyMaxMindFile: <NEW_LINE> <INDENT> def __init__(self, _): <NEW_LINE> <INDENT> utils.LOGGER.warning("Cannot find Maxmind database files") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def lookup(_): <NEW_LINE> <INDENT> return {}
Stub to replace MaxMind databases parsers. Used when a file is missing to emit a warning message and return empty results.
625990590fa83653e46f649b
class Xfd(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "http://cgit.freedesktop.org/xorg/app/xfd" <NEW_LINE> url = "https://www.x.org/archive/individual/app/xfd-1.1.2.tar.gz" <NEW_LINE> version('1.1.2', '12fe8f7c3e71352bf22124ad56d4ceaf') <NEW_LINE> depends_on('libxaw') <NEW_LINE> depends_on('fontconfig') <NE...
xfd - display all the characters in a font using either the X11 core protocol or libXft2.
62599059baa26c4b54d50859
class CheckboxTextboxDialog(CheckboxDialog): <NEW_LINE> <INDENT> def __init__(self, title, description, checkbox_text, checkbox_value, textbox_value, default_button, other_button): <NEW_LINE> <INDENT> super(CheckboxTextboxDialog, self).__init__(title, description, checkbox_text, checkbox_value, default_button, other_bu...
Like ``CheckboxDialog`` but also with a text area. Used for capturing bug report data.
62599059a79ad1619776b598
class KoruzaMonitor(registration.bases.NodeMonitoringRegistryItem): <NEW_LINE> <INDENT> serial_number = models.CharField(max_length=50, null=True) <NEW_LINE> mcu_connected = models.NullBooleanField() <NEW_LINE> motor_x = models.IntegerField(null=True) <NEW_LINE> motor_y = models.IntegerField(null=True) <NEW_LINE> accel...
KORUZA reported data.
62599059f7d966606f749393
class TestWasInit(unittest.TestCase): <NEW_LINE> <INDENT> def test_returns_int(self): <NEW_LINE> <INDENT> self.assertIs(type(SDL_WasInit(0)), int)
Tests SDL_WasInit()
6259905999cbb53fe6832495
class ResourceProviderOperation(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'is_data_action': {'readonly': True}, 'origin': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, 'is_data...
Supported operation of this resource provider. Variables are only populated by the server, and will be ignored when sending a request. :param name: Operation name, in format of {provider}/{resource}/{operation}. :type name: str :param display: Display metadata associated with the operation. :type display: ~azure.mgm...
62599059cb5e8a47e493cc61
@dataclass <NEW_LINE> class LearningRateDecay(Callback): <NEW_LINE> <INDENT> start: (int, list, tuple) <NEW_LINE> duration: int = 1 <NEW_LINE> factor: float = 0.1 <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> assert isinstance(self.start, (list, tuple, range, type(None))), "start must be a list or range or No...
Decay learning rate by a given factor spread on every batch for a given number of epochs. This callback is incompatible with a `LearningRateWarmUp` callback because learning rate is set from both callbacks at the beginning of each batch. start and duration are expressed in epochs here
6259905976e4537e8c3f0b42
class MinimalPackageSet(Model): <NEW_LINE> <INDENT> NAME = "minimal-package-set" <NEW_LINE> VENDOR = "source{d}" <NEW_LINE> DESCRIPTION = "Model that contains a set of libraries and their occurences in docker images." <NEW_LINE> LICENSE = "ODbL-1.0" <NEW_LINE> def construct(self, packages: pd.DataFrame, python_package_...
Simple co-occurence based model that finds minimal native package set needed to run a python package.
625990593cc13d1c6d466cf6
class Experiment: <NEW_LINE> <INDENT> def __init__(self, z, line, energy_eV, kratio=0.0, standard='', analyzed=True): <NEW_LINE> <INDENT> self._z = z <NEW_LINE> self._line = line <NEW_LINE> self._energy_eV = energy_eV <NEW_LINE> self._kratio = kratio <NEW_LINE> self._standard = standard <NEW_LINE> self._analyzed = anal...
Object to store experimental parameters and measurements. Once created an experiment object is immutable.
625990596e29344779b01c02
class NoDbTestRunner(DjangoTestSuiteRunner): <NEW_LINE> <INDENT> def setup_databases(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def teardown_databases(self, old_config, **kwargs): <NEW_LINE> <INDENT> pass
A test runner to test without memory database creation
62599059498bea3a75a590d7
class GraphOptions(object): <NEW_LINE> <INDENT> x_axis_data = None <NEW_LINE> y_axis_data = None <NEW_LINE> def __init__(self, x_axis_data, y_axis_data): <NEW_LINE> <INDENT> self.x_axis_data = x_axis_data <NEW_LINE> self.y_axis_data = y_axis_data <NEW_LINE> <DEDENT> @property <NEW_LINE> def x_axis_label(self): <NEW_LIN...
GraphOptions allow to set the value for the x and y axis
625990593539df3088ecd852
class CustomStructure(Structure): <NEW_LINE> <INDENT> _defaults_ = {} <NEW_LINE> _translation_ = {} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Structure.__init__(self) <NEW_LINE> self.__field_names = [ f for (f, t) in self._fields_] <NEW_LINE> self.update(self._defaults_) <NEW_LINE> <DEDENT> def update(self, di...
This class extends the functionality of the ctype's structure class by adding custom default values to the fields and a way of translating field types.
6259905910dbd63aa1c72155
class WorkerData(object): <NEW_LINE> <INDENT> def __init__(self, input, starttime=None, failure=""): <NEW_LINE> <INDENT> self.input = input <NEW_LINE> self.starttime = starttime or walltime() <NEW_LINE> self.failure = failure
Simple class which stores data about a running ``p_iter_fork`` worker. This just stores three attributes: - ``input``: the input value used by this worker - ``starttime``: the walltime when this worker started - ``failure``: an optional message indicating the kind of failure EXAMPLES:: sage: from sage.paralle...
6259905915baa72349463549
class Unit(object): <NEW_LINE> <INDENT> def __init__(self, crawler, parent, tags, level, typ, pattern, parent_tag_indices=None): <NEW_LINE> <INDENT> self.crawler = crawler <NEW_LINE> self.parent = parent <NEW_LINE> self.tags = tags <NEW_LINE> self.level = level <NEW_LINE> self.typ = typ <NEW_LINE> self.pattern = patter...
Unit is a set of elements (for example [p, p, div]) which is found to be repeated.
6259905999cbb53fe6832496
class ProblemReport(AgentMessage): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> handler_class = HANDLER_CLASS <NEW_LINE> message_type = PROBLEM_REPORT <NEW_LINE> schema_class = "ProblemReportSchema" <NEW_LINE> <DEDENT> def __init__( self, *, msg_catalog: str = None, locale: str = None, explain_ltxt: str = None, ...
Base class representing a generic problem report message.
62599059009cb60464d02aec
class RadioButton(Gtk.RadioButton): <NEW_LINE> <INDENT> def __init__(self, group, label): <NEW_LINE> <INDENT> Gtk.RadioButton.__init__(self, group, label)
A radio button
625990599c8ee82313040c66
class Git_API_handler(Git_handler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> my_data = json.loads(self.request.body) <NEW_LINE> current_path = my_data["current_path"] <NEW_LINE> showtoplevel = self.git.showtoplevel(current_path) <NEW_LINE> if(showtoplevel['code'] != 0): <NEW_LINE> <INDENT> self.finish(js...
A single class to give you 4 git commands combined: 1. git showtoplevel 2. git branch 3. git log 4. git status Class is used in the refresh method
625990594428ac0f6e659af3
class ConfirmationMessage(ProtocolMessage): <NEW_LINE> <INDENT> def __init__(self, confirmed_resources): <NEW_LINE> <INDENT> ProtocolMessage.__init__(self) <NEW_LINE> if type(confirmed_resources) is not list: <NEW_LINE> <INDENT> raise ValueError('confirmed_resources must be a list of str') <NEW_LINE> <DEDENT> for eleme...
Confirm subscriptions
62599059cb5e8a47e493cc62
class PerlEncodeLocale(PerlPackage): <NEW_LINE> <INDENT> homepage = "http://search.cpan.org/~gaas/Encode-Locale-1.05/lib/Encode/Locale.pm" <NEW_LINE> url = "http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/Encode-Locale-1.05.tar.gz" <NEW_LINE> version('1.05', sha256='176fa02771f542a4efb1dbc2a4c928e8f4391bf4078473b...
Determine the locale encoding
62599059004d5f362081fac9
class Task(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> category = models.ForeignKey(Category, on_delete=models.CASCADE) <NEW_LINE> details = models.TextField() <NEW_LINE> deadline = models.DateTimeField() <NEW_LINE> archive = models.BooleanField(default=False) <NEW_LINE> target...
A task that members of staff will be allocated These are usually much smaller than Activities and are deadline driven name a name for the task category see the Category model details a potentially large area of text giving more information deadline the time by which the task should be completed archi...
62599059e76e3b2f99fd9fb7
class MinimizerIndexer(object): <NEW_LINE> <INDENT> def __init__(self, targetString, w, k, t): <NEW_LINE> <INDENT> self.targetString = targetString <NEW_LINE> self.w = w <NEW_LINE> self.k = k <NEW_LINE> self.t = t <NEW_LINE> self.minimizerMap = {} <NEW_LINE> self.minmerOccurrences = {} <NEW_LINE> print('Value of t:', s...
Simple minimizer based substring-indexer. Please read: https://doi.org/10.1093/bioinformatics/bth408 Related to idea of min-hash index and other "sketch" methods.
62599059627d3e7fe0e08445
class CreatePostView(LoginRequiredMixin, CreateView): <NEW_LINE> <INDENT> template_name = 'posts/new.html' <NEW_LINE> form_class = PostForm <NEW_LINE> success_url = reverse_lazy('posts:feed') <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwargs) <NEW_LINE> con...
Create a new post
6259905956ac1b37e63037c3
class IFikaUser(Interface): <NEW_LINE> <INDENT> pass
Adapter to extend functionality of base fika users.
6259905976e4537e8c3f0b44
class AnimatedProgressBar(ProgressBar): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AnimatedProgressBar, self).__init__(*args, **kwargs) <NEW_LINE> self.stdout = kwargs.get('stdout', sys.stdout) <NEW_LINE> <DEDENT> def show_progress(self): <NEW_LINE> <INDENT> if hasattr(self.stdou...
Extends ProgressBar to allow you to use it straighforward on a script. Accepts an extra keyword argument named `stdout` (by default use sys.stdout) and may be any file-object to which send the progress status.
62599059435de62698e9d3bc
class TestDestinyDefinitionsDestinyObjectiveDefinition(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 testDestinyDefinitionsDestinyObjectiveDefinition(self): <NEW_LINE> <INDENT> pass
DestinyDefinitionsDestinyObjectiveDefinition unit test stubs
6259905923849d37ff85267e
class KNearestNeighbor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, X, y): <NEW_LINE> <INDENT> self.X_train = X <NEW_LINE> self.y_train = y <NEW_LINE> <DEDENT> def predict(self, X, k=1, num_loops=0): <NEW_LINE> <INDENT> if num_loops == 0: <NEW_LINE> <INDE...
a kNN classifier with L2 distance
6259905901c39578d7f14213
class AnnualFuelCost(BSElement): <NEW_LINE> <INDENT> element_type = "xs:decimal"
Annual cost of the resource ($)
62599059462c4b4f79dbcfbe
class StaticModule(DashboardModuleViewBase): <NEW_LINE> <INDENT> pass
Render a static template
62599059d6c5a102081e36d9
class BaseUnaryOp(CSTNode, ABC): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> whitespace_after: BaseParenthesizableWhitespace <NEW_LINE> def _visit_and_replace_children(self, visitor: CSTVisitorT) -> "BaseUnaryOp": <NEW_LINE> <INDENT> return self.__class__( whitespace_after=visit_required( self, "whitespace_after", se...
Any node that has a static value used in a :class:`UnaryOperation` expression.
625990592ae34c7f260ac6a0
class BasicTypeInfo(TypeInformation, ABC): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def STRING_TYPE_INFO(): <NEW_LINE> <INDENT> return WrapperTypeInfo(get_gateway().jvm .org.apache.flink.api.common.typeinfo.BasicTypeInfo.STRING_TYPE_INFO) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def BOOLEAN_TYPE_INFO(): <NEW_LI...
Type information for primitive types (int, long, double, byte, ...), String, BigInteger, and BigDecimal.
6259905956b00c62f0fb3e84
class menuimage(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, screen, spritetype="", imagename="", position = (), transparent = False): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.image = import_image(spritetype, imagename) <NEW_LINE> self.rect = self.image.get...
Class to display all menu images as sprites.
625990590a50d4780f70689b
class EntersXEnsemble(ExitsXEnsemble): <NEW_LINE> <INDENT> def _str(self): <NEW_LINE> <INDENT> domain = 'exists x[t], x[t+1] ' <NEW_LINE> result = 'such that x[t] not in {0} and x[t+1] in {0}'.format( self._volume) <NEW_LINE> return domain + result <NEW_LINE> <DEDENT> def __call__(self, trajectory, trusted=None, candid...
Represents an ensemble where two successive frames from the selected frames of the trajectory crossing from outside to inside the given volume.
62599059a17c0f6771d5d67e
class ElectricEngine(Engine): <NEW_LINE> <INDENT> pass
Electric engine.
62599059004d5f362081faca
class RetryableException(ElongException): <NEW_LINE> <INDENT> pass
可以重试的异常,如网络连接错误等
6259905956ac1b37e63037c4
class RichText(Object): <NEW_LINE> <INDENT> implements(IRichText, IFromUnicode) <NEW_LINE> default_mime_type = 'text/html' <NEW_LINE> output_mime_type = 'text/x-html-safe' <NEW_LINE> allowed_mime_types = None <NEW_LINE> max_length = None <NEW_LINE> def __init__(self, default_mime_type='text/html', output_mime_type='tex...
Text field that also stores MIME type
6259905991f36d47f223196d
class TestSignIn(FunctionalTestCase): <NEW_LINE> <INDENT> def test_happy_path(self): <NEW_LINE> <INDENT> self.browser.visit('/') <NEW_LINE> self.browser.click_link_by_partial_text('Sign In') <NEW_LINE> self.browser.fill_form( { 'name': 'Alyssa P. Hacker' }, form_id='sign-in-form', ) <NEW_LINE> self.browser.find_by_css(...
A student should be able to: - go to the home page - see (and click) a link for signing in - fill out the sign in form - see themselves as signed in
6259905932920d7e50bc7600
class TestPitch(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.new_user = User(username = "Adano") <NEW_LINE> self.new_blog = Blog(title = "blog", user = self.new_user) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> Blog.query.delete() <NEW_LINE> User.query.delete() <NEW_...
This is the class which we will use to do tests for the Pitch
6259905955399d3f05627ada
class Player: <NEW_LINE> <INDENT> def __init__(self, text, x, y, score): <NEW_LINE> <INDENT> self.turtle = turtle.Turtle() <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.text = text <NEW_LINE> self.score = score <NEW_LINE> self.num_clicks = 0 <NEW_LINE> self.turn = False <NEW_LINE> self.winner = False <NEW...
Used to create instances of player object. Has methods to calculate the beers drunk by each players and draws them on the screen
6259905901c39578d7f14214