code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ProductVariation(with_metaclass(ProductVariationMetaclass, Priced)): <NEW_LINE> <INDENT> product = models.ForeignKey("Product", related_name="variations") <NEW_LINE> default = models.BooleanField(_("Default"), default=False) <NEW_LINE> image = models.ForeignKey("ProductImage", verbose_name=_("Image"), null=True, ...
A combination of selected options from ``SHOP_OPTION_TYPE_CHOICES`` for a ``Product`` instance.
62598ee95fcc89381b2654a4
class Event(object): <NEW_LINE> <INDENT> openapi_types = { 'id': 'int', 'url': 'str' } <NEW_LINE> attribute_map = { 'id': 'id', 'url': 'url' } <NEW_LINE> def __init__(self, id=None, url=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> local_vars_configur...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598ee926068e7796d4b058
class PlayEntry: <NEW_LINE> <INDENT> def __init__(self, total_seconds_elapsed, team, team_score, opp_score, team_with_possession): <NEW_LINE> <INDENT> self.total_seconds_elapsed = total_seconds_elapsed <NEW_LINE> self.team = team <NEW_LINE> self.team_score = team_score <NEW_LINE> self.opp_score = opp_score <NEW_LINE> s...
Contains the time, team, team score, opponent score and possession.
62598ee93d592f4c4edb95f2
class StateBase(QExpr): <NEW_LINE> <INDENT> @property <NEW_LINE> def dual(self): <NEW_LINE> <INDENT> return self.dual_class._new_rawargs(self.hilbert_space, *self.args) <NEW_LINE> <DEDENT> @property <NEW_LINE> def dual_class(self): <NEW_LINE> <INDENT> raise NotImplementedError( 'dual_class must be implemented in a subc...
Abstract base class for general abstract states in quantum mechanics. All other state classes defined will need to inherit from this class. It carries the basic structure for all other states such as dual, _eval_dagger and label. This is an abstract base class and you should not instantiate it directly, instead use S...
62598ee97cff6e4e811b40ea
class Loggerator(object): <NEW_LINE> <INDENT> def __init__(self, name, color): <NEW_LINE> <INDENT> self.loggerator = logging.getLogger(name[0:15].center(16, '*')) <NEW_LINE> self.loggerator.setLevel(logging.DEBUG) <NEW_LINE> defaultHandler = logging.StreamHandler() <NEW_LINE> color = color if self._useColor() el...
Loggerator class is used to log information for a given component. Component name is given when Loggerator instance is created, and it will be reused. :type loggerator: logging instance :ivar loggerator: logging instance, which will be used to log messages.
62598ee9a8ecb0332586f8e6
class DxlResetPacket(DxlInstructionPacket): <NEW_LINE> <INDENT> def __new__(cls, id, mode): <NEW_LINE> <INDENT> return DxlInstructionPacket.__new__(cls, id, DxlInstruction.RESET, (mode, ))
This class is used to represent factory reset packet.
62598ee9442bda511e95ab5e
class UploadServiceTestCase(TestCase): <NEW_LINE> <INDENT> @patch.object(RemovalService, 'rm') <NEW_LINE> def test_upload_complete(self, mock_rm): <NEW_LINE> <INDENT> removal_service = RemovalService() <NEW_LINE> upload_service = UploadService(removal_service) <NEW_LINE> upload_service.upload_complete("filename") <NEW_...
Test object method: Patch object method. Example: from modulename import Classname @patch.object(Classname, 'funcname') def test(self, mock_funcname): self.assertTrue(mock_funcname.called)
62598ee9d7e4931a7ef3a79d
class Module(MixedModule): <NEW_LINE> <INDENT> interpleveldefs = { 'chain' : 'interp_itertools.W_Chain', 'combinations' : 'interp_itertools.W_Combinations', 'combinations_with_replacement' : 'interp_itertools.W_CombinationsWithReplacement', 'compress' : 'interp_itertools.W_Compress', 'count' : 'in...
Functional tools for creating and using iterators. Infinite iterators: count([n]) --> n, n+1, n+2, ... cycle(p) --> p0, p1, ... plast, p0, p1, ... repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times Iterators terminating on the shortest input sequence: ifilter(pred, seq) --> elements of seq where p...
62598ee9a8370b77170eeae0
class bm_mt_set_default_action_result: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'ouch', (InvalidTableOperation, InvalidTableOperation.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, ouch=None,): <NEW_LINE> <INDENT> self.ouch = ouch <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT>...
Attributes: - ouch
62598ee985dfad0860cbede6
@dataclasses.dataclass <NEW_LINE> class FrameWithManifest: <NEW_LINE> <INDENT> frameId: page.FrameId <NEW_LINE> manifestURL: str <NEW_LINE> status: int <NEW_LINE> @classmethod <NEW_LINE> def from_json(cls, json: dict) -> FrameWithManifest: <NEW_LINE> <INDENT> return cls(page.FrameId(json["frameId"]), json["manifestURL"...
Frame identifier - manifest URL pair. Attributes ---------- frameId: page.FrameId Frame identifier. manifestURL: str Manifest URL. status: int Application cache status.
62598ee971ff763f4b5e5e59
@python_2_unicode_compatible <NEW_LINE> class AccessList(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=30) <NEW_LINE> description = models.CharField(max_length=200) <NEW_LINE> entities = models.ManyToManyField(Entity, through='acl.AccessListMembership') <NEW_LINE> public = models.BooleanField(de...
A Django representation of an in-game Access List
62598ee90c0af96317c54a99
class AAC(FileType): <NEW_LINE> <INDENT> _mimes = ["audio/x-aac"] <NEW_LINE> def load(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> with open(filename, "rb") as h: <NEW_LINE> <INDENT> self.info = AACInfo(h) <NEW_LINE> <DEDENT> <DEDENT> @staticmethod <NEW_LINE> def score(filename, fileobj, hea...
Load ADTS or ADIF streams containing AAC. Tagging is not supported. Use the ID3/APEv2 classes directly instead.
62598ee9091ae35668703314
class JobPrePostDispatcher(EnabledExtensionManager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(JobPrePostDispatcher, self).__init__('avocado.plugins.job.prepost')
Calls extensions before Job execution Automatically adds all the extension with entry points registered under 'avocado.plugins.job.prepost'
62598ee97d847024c075aaca
class SourceVault(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, id: Optional[str] = None, **kwargs ): <NEW_LINE> <INDENT> super(SourceVault, self).__init__(**kwargs) <NEW_LINE> self.id = id
The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. :ivar id: Resource Id. :vartype id: str
62598ee90c0af96317c54a9a
class GridExtent(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(GridExtent, self).__init__() <NEW_LINE> self.maximum_latitude = None <NEW_LINE> self.maximum_longitude = None <NEW_LINE> self.minimum_latitude = None <NEW_LINE> self.minimum_longitude = None <NEW_LINE> self.units = None
A concrete class within the cim v1 type system. DataType for recording the geographic extent of a gridMosaic or gridTile.
62598ee9167d2b6e312b5696
class ChannelType(Dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> kw['required_fields'] = { 'uuid': Unicode(), 'tag': Tag(), 'name': Unicode(), 'description': Unicode(), 'endpoints': List(item_type=EndpointType()), } <NEW_LINE> super(ChannelType, self).__init__(*args, **kw) <NEW_LINE> <D...
Description of a channel. The following keys are required: * uuid: The channel key. * tag: A two-element list of the tag pool and tag name, e.g. `['apposit_sms', '*121#']`. * name: The channel name, often the same as the tag name, e.g. '*121#'. * description: The channel description, e.g. 'Apposit Sms: *121#'....
62598ee9e5267d203ee6a002
class TableApi(FlaskView): <NEW_LINE> <INDENT> route_base = '/api/table/' <NEW_LINE> tm = TableManager() <NEW_LINE> def get(self, table_id): <NEW_LINE> <INDENT> table_data = self.tm.get_table(table_id) <NEW_LINE> return jsonify(table_data) if table_data else jsonify({'found': False}) <NEW_LINE> <DEDENT> def post(self, ...
/api/table/create POST /api/table/<id> POST/GET
62598ee94f6381625f19883a
class MockKubernetesWatch: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.queue: Queue[str] = Queue() <NEW_LINE> <DEDENT> @asynccontextmanager <NEW_LINE> async def stream( self, api_call: Callable[..., Awaitable[Any]], *args: Any, **kwargs: Any, ) -> AsyncIterator[MockKubernetesStream]: <NEW_L...
Mock the watch API for Kubernetes. This is a very partial implementation of the watch API that allows a test to trigger new watch events via an asyncio Queue.
62598ee9e64d504609df873d
class ScopedDictField(TypedField): <NEW_LINE> <INDENT> def __init__(self, valuetype, *other_types, attr_name=None): <NEW_LINE> <INDENT> super().__init__(types.Dict[str, types.Dict[str, valuetype]], ScopedDict, *other_types, attr_name=attr_name) <NEW_LINE> <DEDENT> def __set__(self, obj, value): <NEW_LINE> <INDENT> valu...
Stores a ScopedDict with a specific type. It also handles implicit conversions from ordinary dicts.
62598ee966656f66f7d58add
class BytecodeCache(_BytecodeCache): <NEW_LINE> <INDENT> def __init__(self, cache_name): <NEW_LINE> <INDENT> self._cache_name = cache_name <NEW_LINE> <DEDENT> @cached_property <NEW_LINE> def backend(self): <NEW_LINE> <INDENT> return get_cache(self._cache_name) <NEW_LINE> <DEDENT> def load_bytecode(self, bucket): <NEW_L...
A bytecode cache for Jinja2 that uses Django's caching framework.
62598ee9796e427e5384ce95
class ServerFeatureUnavailableError(Exception): <NEW_LINE> <INDENT> pass
The server does not implement the requested feature. This can occur if e.g. a particular server is running a blob store but is not running an indexer, and a caller tries to use search features.
62598ee9fff4ab517ebcbed4
class testDASAnalytics(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> debug = 0 <NEW_LINE> self.db = 'test_analytics.db' <NEW_LINE> config = deepcopy(das_readconfig()) <NEW_LINE> dburi = config['mongodb']['dburi'] <NEW_LINE> logger = PrintManager('TestDASAnalytics', verbose=debu...
A test class for the DAS analyticsdb class
62598ee997e22403b38395ed
class RHDeleteContributionField(RHManageContributionFieldBase): <NEW_LINE> <INDENT> def _process(self): <NEW_LINE> <INDENT> db.session.delete(self.contrib_field) <NEW_LINE> db.session.flush() <NEW_LINE> self.event.log(EventLogRealm.management, EventLogKind.negative, 'Contributions', 'Deleted field: {}'.format(self.cont...
Dialog to delete a custom contribution field
62598ee94527f215b58e8604
class question_not_equal(relational_operator): <NEW_LINE> <INDENT> def __init__(self, sString='?/='): <NEW_LINE> <INDENT> relational_operator.__init__(self, '?/=')
unique_id = relational_operator : question_not_equal
62598ee92c8b7c6e89bd1ebd
class STAChannelAutoselect(registry_forms.FormDefaults): <NEW_LINE> <INDENT> def set_defaults(self, state, create): <NEW_LINE> <INDENT> for radio in state.filter_items('core.interfaces', klass=cgm_models.WifiRadioDeviceConfig): <NEW_LINE> <INDENT> all_vifs_sta = None <NEW_LINE> for vif in state.filter_items('core.inter...
Configures any radios containing VIFs in STA mode to have automatic channel selection.
62598ee97b25080760ed5b97
class InitIM(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = 'https://tyh.120yibao.com/yb/im/initIM.do' <NEW_LINE> self.token = Client.TOKEN <NEW_LINE> self.client = Client(url=self.url,method=Method.GET) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.client.res...
获取IM消息模板信息
62598ee95fc7496912d475f1
class ATZipCodeField(RegexField): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': _('Enter a zip code in the format XXXX.'), } <NEW_LINE> def __init__(self, max_length=None, min_length=None, *args, **kwargs): <NEW_LINE> <INDENT> super(ATZipCodeField, self).__init__(r'^[1-9]{1}\d{3}$', max_length, min_length, ...
A form field that validates its input is an Austrian postcode. Accepts 4 digits (first digit must be greater than 0).
62598ee91f037a2d8b9e2805
class BookStream(object): <NEW_LINE> <INDENT> def __init__(self, sheets=None, filename="memory", path=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.filename = filename <NEW_LINE> self.name_array = [] <NEW_LINE> if sheets: <NEW_LINE> <INDENT> self.load_from_sheets(sheets) <NEW_LINE> <DEDENT> else: <NEW_LIN...
Memory efficient book representation Comparing with :class:`pyexcel.Book`, the instace of this class uses :class:`pyexcel.generators.SheetStream` as its internal repesentation of sheet objects. Because `SheetStream` does not read data into memory, it is memory efficient.
62598ee9cc0a2c1114479701
class ExtraUserPreferences: <NEW_LINE> <INDENT> _prefix = 'extra_' <NEW_LINE> fields = {} <NEW_LINE> def __init__(self, user): <NEW_LINE> <INDENT> self.user = user <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def is_active(cls, user): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def load(self): <NEW_LINE> <INDENT...
Define additional user preferences. To use this class, subclass it and override `defaults`, `fields` and `save` to implement your custom logic.
62598ee95166f23b2e241ad5
class UMLSAuthentication: <NEW_LINE> <INDENT> _instance = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> raise RuntimeError("Call instance() instead") <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def instance(cls): <NEW_LINE> <INDENT> if not cls._instance: <NEW_LINE> <INDENT> cls._instance = cls.__new__(cls) <N...
Class for getting UMLS authentication tickets
62598ee9bd1bec0571e14449
class SystemData(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_by_type': {'key': 'createdByType', 'type': 'str'}, 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, 'last_...
Metadata pertaining to creation and last modification of the resource. :param created_by: The identity that created the resource. :type created_by: str :param created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :type created_by_typ...
62598ee956b00c62f0fb0fce
class WindowXMLDialog(WindowXML): <NEW_LINE> <INDENT> def __init__(self, xmlFilename: str, scriptPath: str, defaultSkin: str = "Default", defaultRes: str = "720p") -> None: <NEW_LINE> <INDENT> pass
**GUI xml window dialog** Creates a new xml file based window dialog class. :param xmlFilename: string - the name of the xml file to look for. :param scriptPath: string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg xbmcaddon.Addon().getAddonInfo('path')) :param defaultSki...
62598ee967a9b606de5446cc
class TensorboardCallback(Callback): <NEW_LINE> <INDENT> def __init__(self, path="tensorboard", log_interval=1000, reward_buffer_length=10000, episode_duration_buffer_length=10000): <NEW_LINE> <INDENT> self.log_interval = log_interval <NEW_LINE> self.iterations = 0 <NEW_LINE> self.running_data = {} <NEW_LINE> self.runn...
Provides logging in TensorBoard.
62598ee9097d151d1a2bf719
class PhoneCallDiscardReasonMissed(Object): <NEW_LINE> <INDENT> ID = 0x85e42301 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *args) -> "PhoneCallDiscardReasonMissed": <NEW_LINE> <INDENT> return PhoneCallDiscardReasonMissed() <NEW_LINE> <DEDENT...
Attributes: ID: ``0x85e42301`` No parameters required.
62598ee9627d3e7fe0e05587
class Meta: <NEW_LINE> <INDENT> model = Group <NEW_LINE> fields = ('name', 'parent', 'details')
Group Form
62598ee9fff4ab517ebcbed5
class IasPackage(APIView): <NEW_LINE> <INDENT> def post(self, requests, *args, **kwargs): <NEW_LINE> <INDENT> data = requests.data <NEW_LINE> serializer = IasPackageSerializers(data=data) <NEW_LINE> if not serializer.is_valid(): <NEW_LINE> <INDENT> logging.exception(serializer) <NEW_LINE> return Response({"87": "参数错误"}...
用于封装ias
62598ee97047854f4633dad2
class CompoundIndicator(ConfigurableIndicator): <NEW_LINE> <INDENT> def __init__(self, display_name, indicators): <NEW_LINE> <INDENT> super(CompoundIndicator, self).__init__(display_name) <NEW_LINE> self.indicators = indicators <NEW_LINE> <DEDENT> def get_columns(self): <NEW_LINE> <INDENT> return [c for ind in self.ind...
An indicator that wraps other indicators.
62598ee938b623060ffa7798
class OutputDataWriter(OutputDataReader): <NEW_LINE> <INDENT> METADATA = {"driver_name": None, "data_type": None, "mode": "w"} <NEW_LINE> def write(self, process_tile, data): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def prepare_path(self, tile): <NEW_LINE> <INDENT> makedirs(os.path.dirname(self...
Template class handling process output data. Parameters ---------- output_params : dictionary output parameters from Mapchete file Attributes ---------- pixelbuffer : integer buffer around output tiles pyramid : ``tilematrix.TilePyramid`` output ``TilePyramid`` crs : ``rasterio.crs.CRS`` object descri...
62598ee93539df3088eca9b0
class Mirror(): <NEW_LINE> <INDENT> geoNode = None <NEW_LINE> shapeNode = None <NEW_LINE> geo = None <NEW_LINE> def __init__(self, _geoNode, _shapeNode): <NEW_LINE> <INDENT> Mirror.geoNode = _geoNode <NEW_LINE> Mirror.shapeNode = _shapeNode <NEW_LINE> Mirror.geo = Mirror.geoNode.createNode('mirror') <NEW_LINE> <DEDENT>...
Mirror surface node
62598ee93317a56b869bd8e5
class DHT(Thermometer, Hygrometer, Device): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs)
DHT class
62598ee97cff6e4e811b40ec
class Rsquare(Rolling): <NEW_LINE> <INDENT> def __init__(self, feature, N): <NEW_LINE> <INDENT> super(Rsquare, self).__init__(feature, N, "rsquare") <NEW_LINE> <DEDENT> def _load_internal(self, instrument, start_index, end_index, freq): <NEW_LINE> <INDENT> _series = self.feature.load(instrument, start_index, end_index,...
Rolling R-value Square Parameters ---------- feature : Expression feature instance N : int rolling window size Returns ---------- Expression a feature instance with linear regression r-value square of given window
62598ee9d7e4931a7ef3a79f
class ProfilesSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> username = serializers.CharField(read_only=True) <NEW_LINE> bio = serializers.CharField(allow_blank=True, required=False) <NEW_LINE> image = serializers.ImageField(default=None) <NEW_LINE> followers_total = serializers.SerializerMethodField() <N...
Serialize user profile data
62598ee94e4d562566370b18
class Escena_Juego(Normal): <NEW_LINE> <INDENT> def iniciar(self): <NEW_LINE> <INDENT> pilas.fondos.Pasto() <NEW_LINE> VIDAS_INICIALES = 3 <NEW_LINE> self.vidas_J1 = pilas.actores.Puntaje(VIDAS_INICIALES, x=250, y=200, color=pilas.colores.blanco) <NEW_LINE> texto_J1 = pilas.actores.Texto("Verde:", x=200, y=200) <NEW_LI...
Escena principal del juego.
62598ee91f5feb6acb161350
class World(object): <NEW_LINE> <INDENT> def __init__(self, delta=1): <NEW_LINE> <INDENT> self._delta = delta <NEW_LINE> self._entities = list() <NEW_LINE> self._systems = list() <NEW_LINE> self._groups = dict() <NEW_LINE> <DEDENT> def add_entity(self, entity, second=False): <NEW_LINE> <INDENT> if not entity in self._e...
A World holds all entities, groups, and systems
62598ee97d847024c075aacc
class AdjacencyMatrix(Graph): <NEW_LINE> <INDENT> def __new__(cls, *vertices, **kwargs): <NEW_LINE> <INDENT> raise_if_backend_is_not_python( cls, kwargs.get('backend', Backend.PYTHON)) <NEW_LINE> obj = object.__new__(cls) <NEW_LINE> obj.vertices = [vertex.name for vertex in vertices] <NEW_LINE> for vertex in vertices: ...
Adjacency matrix implementation of graphs. See also ======== pydatastructs.graphs.graph.Graph
62598ee9baa26c4b54d4d9cd
class ML_Model(ML_ModelInterface): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data_set = None <NEW_LINE> self.frames = [] <NEW_LINE> self.variable_mapping: dict = {} <NEW_LINE> <DEDENT> def load_dataset(self, file_path: str, file_name: str, chunk_size: int, **columns): <NEW_LINE> <INDENT> try: <NE...
A concrete Model class built from the interface
62598ee98c0ade5d55dc2a01
class HostSources(BaseSources): <NEW_LINE> <INDENT> def __init__(self, context, files, canonical_suffix): <NEW_LINE> <INDENT> BaseSources.__init__(self, context, files, canonical_suffix)
Represents files to be compiled for the host during the build.
62598ee9e5267d203ee6a005
class LwF(SupervisedTemplate): <NEW_LINE> <INDENT> def __init__( self, model: Module, optimizer: Optimizer, criterion, alpha: Union[float, Sequence[float]], temperature: float, train_mb_size: int = 1, train_epochs: int = 1, eval_mb_size: int = None, device=None, plugins: Optional[List[SupervisedPlugin]] = None, evaluat...
Learning without Forgetting (LwF) strategy. See LwF plugin for details. This strategy does not use task identities.
62598ee923849d37ff84f7b5
class ShowIPsecPolicy(neutronv20.ShowCommand): <NEW_LINE> <INDENT> resource = 'ipsecpolicy' <NEW_LINE> log = logging.getLogger(__name__ + '.ShowIPsecPolicy')
Show information of a given ipsecpolicy.
62598ee95fdd1c0f98e5c6a0
class MultiJSONDecoder(json.JSONDecoder): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> json.JSONDecoder.__init__( self, object_hook=self.object_hook, *args, **kwargs) <NEW_LINE> <DEDENT> def object_hook(self, d): <NEW_LINE> <INDENT> if isinstance(d, dict): <NEW_LINE> <INDENT> if ('_type'...
A JSON decoder that can handle: * :obj:`numpy.ndarray` * :obj:`numpy.dtype`
62598ee9379a373c97d976f4
class TSBase(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> _snap.TSBase_swiginit(self,_snap.new_TSBase(*args)) <NEW_LINE> <DEDENT> __swig_dest...
Proxy of C++ TSBase class
62598ee97c178a314d78bb91
class Adam(Optimizer): <NEW_LINE> <INDENT> def __init__(self, graph, lr=1e-3, b1=0.9, b2=0.999, decay=0., e=1e-7): <NEW_LINE> <INDENT> super(Adam, self).__init__(graph) <NEW_LINE> self.lr = lr <NEW_LINE> self.b1 = b1 <NEW_LINE> self.b2 = b2 <NEW_LINE> self.e = e <NEW_LINE> self.decay = decay <NEW_LINE> self.W1, self.W2...
Nesterov momentum.
62598ee97b25080760ed5b99
@dataclass <NEW_LINE> class StaticHTMLBlueprintArgs(StaticBlueprintArgs): <NEW_LINE> <INDENT> _blueprint_type: str = BLUEPRINT_TYPE <NEW_LINE> _group: str = field( default="StaticBlueprint", metadata={ "help": ( "Tasks launched from static blueprints need a " "source html file to display to workers, as well as a csv " ...
Adds required options for StaticBlueprints. task_source points to the file intending to be deployed for this task data_csv has the data to be deployed for this task.
62598ee967a9b606de5446cd
class OrderedData(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data = {} <NEW_LINE> self._order = [] <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.data) <NEW_LINE> <DEDENT> def __contains__(self, key): <NEW_LINE> <INDENT> return key in self.data <NEW_LINE> <DEDE...
Ordered data.
62598ee94a966d76dd5ed5e3
class BackupService(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Get(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): <NEW_LINE> <INDENT> return grpc.experimental.unary_unary(request, target, '...
Missing associated documentation comment in .proto file.
62598ee9e1aae11d1e7cdbbf
class PyFlakesBuildFactory(TwistedBaseFactory): <NEW_LINE> <INDENT> def __init__(self, source, python="python"): <NEW_LINE> <INDENT> TwistedBaseFactory.__init__( self, source=source, python=python, uncleanWarnings=False, virtualenv=True, ) <NEW_LINE> self.addVirtualEnvStep( shell.ShellCommand, command=['pip', 'install'...
A build factory which just runs PyFlakes over the specified source.
62598ee991f36d47f2230223
class User: <NEW_LINE> <INDENT> credential_list = [] <NEW_LINE> def __init__(self,account_name,account_password): <NEW_LINE> <INDENT> self.account_name = account_name <NEW_LINE> self.account_password = account_password <NEW_LINE> <DEDENT> def save_credential(self): <NEW_LINE> <INDENT> User.credential_list.append(self) ...
A class that generates new instaces of passwords
62598ee91b99ca400228e88d
class UserForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('用户名', validators=[DataRequired()]) <NEW_LINE> password = StringField('密码', validators=[DataRequired()]) <NEW_LINE> password2 = StringField('确认密码', validators=[DataRequired(), EqualTo('password', '密码不一致')]) <NEW_LINE> submit = SubmitField('提交') <NEW_...
登录注册表单验证
62598ee992d797404e387efa
class Tagged(DB.Model): <NEW_LINE> <INDENT> tagged_id = DB.Column(DB.Integer, primary_key=True) <NEW_LINE> typename = DB.Column(DB.String(79)) <NEW_LINE> tag_objects = DB.relationship(Tag, secondary=Tag_Associations, collection_class=amc('key')) <NEW_LINE> tags = association_proxy('tag_objects', 'value') <NEW_LINE> __m...
Base model/table for all objects which can have tags. Nearly everything in OSM can have associated tags[0]. Most importantly, elements, i.e. nodes, ways and/or relations, have nothing in common with changesets, except having tags. Therefore being tagged is the only commonality which can be factored out into a class th...
62598ee98e7ae83300ee778f
class DummyRoute(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name
Trick for supporting request.matched_route in case of DummyRequest()
62598ee901c39578d7f114a9
class ComponentConfig: <NEW_LINE> <INDENT> __slots__ = ( 'realm', 'extra', 'keyring', 'controller' ) <NEW_LINE> def __init__(self, realm=None, extra=None, keyring=None, controller=None): <NEW_LINE> <INDENT> assert(realm is None or isinstance(realm, string_types)) <NEW_LINE> self.realm = realm <NEW_LINE> self.extra = ex...
WAMP application component configuration. An instance of this class is provided to the constructor of :class:`autobahn.wamp.protocol.ApplicationSession`.
62598ee9d7e4931a7ef3a7a1
class Dynamic(object): <NEW_LINE> <INDENT> def __init__(self, stream, elffile, stringtable, position): <NEW_LINE> <INDENT> self._stream = stream <NEW_LINE> self._elffile = elffile <NEW_LINE> self._elfstructs = elffile.structs <NEW_LINE> self._num_tags = -1 <NEW_LINE> self._offset = position <NEW_LINE> self._tagsize = s...
Shared functionality between dynamic sections and segments.
62598ee9a8ecb0332586f8ea
class Pants: <NEW_LINE> <INDENT> def __init__(self, color, waist_size, length, price): <NEW_LINE> <INDENT> self.color = color <NEW_LINE> self.waist_size = waist_size <NEW_LINE> self.length = length <NEW_LINE> self.price = price <NEW_LINE> <DEDENT> def change_price(self, new_price): <NEW_LINE> <INDENT> self.price = new_...
The Pants class represents an article of clothing sold in a store
62598ee90c0af96317c54a9d
class Development(Config): <NEW_LINE> <INDENT> DEBUG = True
Development config class
62598ee93317a56b869bd8e6
class AccessError(AccessResponse): <NEW_LINE> <INDENT> def __init__(self, error_code, developer_message, user_message): <NEW_LINE> <INDENT> super(AccessError, self).__init__(False, error_code, developer_message, user_message)
Class that holds information about the error in the case of an access denial in has_access. Contains the error code, user and developer messages. Subclasses represent specific errors.
62598ee971ff763f4b5e5e5d
class SheetManager(object): <NEW_LINE> <INDENT> sheet_id = None <NEW_LINE> service = None <NEW_LINE> last_sheet = None <NEW_LINE> needs_update = False <NEW_LINE> SCOPES = 'https://www.googleapis.com/auth/spreadsheets' <NEW_LINE> CLIENT_SECRET_FILE = 'client_secret.json' <NEW_LINE> APPLICATION_NAME = 'Google Sheets API ...
This class will manage reading and writing to a google doc sheet
62598ee91f5feb6acb161352
class AddFormSchema(group_base.BaseAddFormSchema): <NEW_LINE> <INDENT> title = schema.TextLine(title=_(u"Title")) <NEW_LINE> description = schema.Text( title=_(u"Description"), required=False ) <NEW_LINE> start = schema.Datetime( title=_pae( u'label_event_start', default=u'Event Starts' ), description=_pae( u'help_even...
Add form
62598ee9091ae35668703318
class cm(CssUnit): <NEW_LINE> <INDENT> _UNIT = "cm"
The cm unit.
62598ee957b8e32f52507485
class Form(object): <NEW_LINE> <INDENT> def __init__(self, interaction, protocol, form_dict=None, **kwargs): <NEW_LINE> <INDENT> self._interaction = interaction <NEW_LINE> self._protocol = protocol <NEW_LINE> self._form_dict = form_dict if form_dict else FormDict(**kwargs) <NEW_LINE> <DEDENT> def __getattr__(self, name...
Communication metadata where a service can be accessed by a client application.
62598ee95fdd1c0f98e5c6a2
class Solution(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def last_digit_01(self, n1, n2): <NEW_LINE> <INDENT> if n2 == 0: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> hashtab = { 0: [0, ], 1: [1, ], 2: [2, 4, 8, 6], 3: [3, 9, 7, 1], 4: [4, 6], 5: [5, ], 6: [6, ], 7: [7,...
https://www.codewars.com/kata/5511b2f550906349a70004e1 Define a function def last_digit(n1, n2): return that takes in two numbers a and b and returns the last decimal digit of a^b. Note that a and b may be very large! For example, the last decimal digit of 9^7 is 9, since 9^7 = 4782969. The last decimal digit of (...
62598ee999fddb7c1ca62185
class ZombieCure(Zombie): <NEW_LINE> <INDENT> def __init__(self, text, params): <NEW_LINE> <INDENT> match = re.match( '@@(.+?)@@ was struck by a (.+?) from @@(.+?)@@, curing ([0-9]+) million infected.', text ) <NEW_LINE> if not match: <NEW_LINE> <INDENT> raise _ParseError <NEW_LINE> <DEDENT> super().__init__(match, tex...
A nation curing another nation during Z-Day.
62598ee955399d3f05624c35
class EuclideanMetricSystem(System): <NEW_LINE> <INDENT> def __init__(self, neg_log_dens, metric=None, grad_neg_log_dens=None): <NEW_LINE> <INDENT> super().__init__(neg_log_dens, grad_neg_log_dens) <NEW_LINE> if metric is None: <NEW_LINE> <INDENT> self.metric = matrices.IdentityMatrix() <NEW_LINE> <DEDENT> elif isinsta...
Hamiltonian system with a Euclidean metric on the position space. Here Euclidean metric is defined to mean a metric with a fixed positive definite matrix representation \(M\). The momentum variables are taken to be independent of the position variables and with a zero-mean Gaussian marginal distribution with covarianc...
62598ee9dd821e528d6d7645
class ExposureHasTimeEvent(Validator): <NEW_LINE> <INDENT> def get_error(self): <NEW_LINE> <INDENT> if (self.calc.rc.vulnerability_input("occupants") is not None and not self.calc.rc.exposure_model.has_time_event( self.calc.rc.time_event)): <NEW_LINE> <INDENT> return ("Some assets are missing an " "occupancy with perio...
If fatalities are considered check that the exposure has the proper time_event
62598ee94428ac0f6e656c53
class EditComment(BaseHandler): <NEW_LINE> <INDENT> def get(self, comment_id): <NEW_LINE> <INDENT> if self.user: <NEW_LINE> <INDENT> key = db.Key.from_path('Comment', int(comment_id)) <NEW_LINE> comment = db.get(key) <NEW_LINE> if not comment: <NEW_LINE> <INDENT> return self.error(404) <NEW_LINE> <DEDENT> if self.user....
The handler for editing comments on posts.
62598ee9a79ad1619776871d
class Button: <NEW_LINE> <INDENT> def __init__(self, x, y, text, color, action): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.text = text <NEW_LINE> self.w = x+len(text)/2 <NEW_LINE> self.h = y+1 <NEW_LINE> self.color = [color[0], color[0], color[1]] <NEW_LINE> self.action = action <NEW_LINE> <D...
A button widget.
62598ee9851cf427c66b69d2
class BankAdminSession(abc_assessment_sessions.BankAdminSession, osid_sessions.OsidSession): <NEW_LINE> <INDENT> def __init__(self, provider_session, authz_session, proxy=None): <NEW_LINE> <INDENT> osid_sessions.OsidSession.__init__(self, provider_session, authz_session, proxy) <NEW_LINE> self._qualifier_id = Id('asses...
Adapts underlying BankAdminSession methodswith authorization checks.
62598ee9fff4ab517ebcbed8
class TestFullRun(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.temp_path = mkdtemp(prefix='pelicantests.') <NEW_LINE> self.temp_cache = mkdtemp(prefix='pelican_cache.') <NEW_LINE> os.chdir(TEST_DATA_DIR) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> rmtree(self.temp_pa...
Test running Pelican with the Plugin
62598ee95fdd1c0f98e5c6a3
class GwWebDocPattern(GwWebPattern): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(GwWebDocPattern, self).__init__(*args, **kwargs) <NEW_LINE> if not hasattr(self.app.web, "WebDocApplication"): <NEW_LINE> <INDENT> self.app.web.doc = WebDocApplication(self.app) <NEW_LINE> <DEDENT> se...
Creates documentation objects of definable routes
62598ee90a50d4780f703aa7
class BasisVector(object): <NEW_LINE> <INDENT> pass
A basis vector arises from the inner product of a BasisFunction with a FunctionalBasis. Two BasisVectors can only be added if they arose from the identical FunctionalBasis
62598ee963b5f9789fe8385e
class Engine: <NEW_LINE> <INDENT> pass
Sudoku Game Engine
62598ee93cc13d1c6d463e71
class AbstractGroup(models.Model): <NEW_LINE> <INDENT> uuid = models.CharField(max_length=36, unique=True) <NEW_LINE> org = models.ForeignKey(Org, verbose_name=_("Organization"), related_name="%(class)ss") <NEW_LINE> name = models.CharField(verbose_name=_("Name"), max_length=128, blank=True, help_text=_("The name of th...
Corresponds to a RapidPro contact group
62598ee92c8b7c6e89bd1ec2
class MRCState(StateModule): <NEW_LINE> <INDENT> def get_internal_state(self, cand_kb, last_turn): <NEW_LINE> <INDENT> agent_act, user_value = last_turn <NEW_LINE> agent_act_id = AgentActs.slot_to_id(agent_act) <NEW_LINE> turn_slot_cls = torch.zeros(AgentActs.slot_size()) <NEW_LINE> turn_slot_cls[agent_act_id] = 1 <NEW...
MRC State Module
62598ee94a966d76dd5ed5e5
class Peripheral(): <NEW_LINE> <INDENT> def __init__(self, name=None, registers=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> if registers == None: <NEW_LINE> <INDENT> registers = [] <NEW_LINE> <DEDENT> self.registers = registers <NEW_LINE> <DEDENT> def addRegister(self, register): <NEW_LINE> <INDENT> self.reg...
Peripheral Represents the names and masks of the peripherals control and data registers and methods for smart comparison.
62598ee991f36d47f2230224
class FnordmetricUdp(FnordmetricTcp): <NEW_LINE> <INDENT> def __init__(self, host="localhost", port=2323): <NEW_LINE> <INDENT> self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) <NEW_LINE> self._socket.connect((host, port))
Works with Fnordmetric through udp
62598ee95166f23b2e241ad9
class WM_OT_properties_edit(Operator): <NEW_LINE> <INDENT> bl_idname = "wm.properties_edit" <NEW_LINE> bl_label = "Edit Property" <NEW_LINE> bl_options = {'REGISTER'} <NEW_LINE> data_path = rna_path <NEW_LINE> property = rna_property <NEW_LINE> value = rna_value <NEW_LINE> min = rna_min <NEW_LINE> max = rna_max <NEW_LI...
Internal use (edit a property data_path)
62598ee9e76e3b2f99fd7138
class FailedValidationError(Exception): <NEW_LINE> <INDENT> pass
Target input has failed one or more validations
62598ee945492302aabfabaf
class DiscreteStateTransition(tf.keras.Model): <NEW_LINE> <INDENT> def __init__(self, transition_network, num_categories): <NEW_LINE> <INDENT> super(DiscreteStateTransition, self).__init__() <NEW_LINE> self.dense_net = transition_network <NEW_LINE> self.num_categ = num_categories <NEW_LINE> <DEDENT> def call(self, inpu...
Discrete state transition p(s[t] | s[t-1], x[t-1]).
62598ee93539df3088eca9b3
class SessionType(messages.Enum): <NEW_LINE> <INDENT> NOT_SPECIFIED = 1 <NEW_LINE> Workshop = 2 <NEW_LINE> Lecture = 3 <NEW_LINE> Keynote = 4 <NEW_LINE> Motivational = 5 <NEW_LINE> INVALID = 6
SessionType -- session type enumeration value
62598ee96e29344779afed36
class SelectionModelTests(TestCase): <NEW_LINE> <INDENT> fixtures = ['test_selection',] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> for model in MODELS: <NEW_LINE> <INDENT> for obj in model.objects.all(): <NEW_LINE> <INDENT> obj.dele...
Tests the model attributes of Selection objects contained in the reagents app.
62598ee9925a0f43d25e6731
class Calendar(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError
*** not implemented Holds information regarding holidays, trade days, etc. depending on market/country. Every TimeZone object holds a Calendar object.
62598ee9442bda511e95ab64
class QADataCollectionWorld(World): <NEW_LINE> <INDENT> collector_agent_id = 'QA Collector' <NEW_LINE> def __init__(self, opt, task, agent): <NEW_LINE> <INDENT> self.task = task <NEW_LINE> self.agent = agent <NEW_LINE> self.episodeDone = False <NEW_LINE> self.turn_index = -1 <NEW_LINE> <DEDENT> def parley(self): <NEW_L...
World for recording a person's question and answer given a context. Assumes the context is a random context from a given task, e.g. from SQuAD, CBT, etc.
62598ee93317a56b869bd8e7
class Enemy(GameSprites): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("./images/enemy1.png") <NEW_LINE> self.speed = random.randint(1, 3) <NEW_LINE> self.rect.y = -self.rect.height <NEW_LINE> self.rect.x = random.randint(0, SCREEN_RECT.width - self.rect.width) <NEW_LINE> <DEDENT> def up...
创建敌机类
62598ee985dfad0860cbede9
class ScheduleTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.builder_run = False <NEW_LINE> def builder(schedule): <NEW_LINE> <INDENT> self.builder_run = True <NEW_LINE> return timezone.now() <NEW_LINE> <DEDENT> self.start = timezone.now() <NEW_LINE> self.range = timedelta(days=1) <NEW_L...
Tests that the :class:`Schedule` class behaves itself in the general case, using a stub builder.
62598ee97d847024c075aad0
class holicow: <NEW_LINE> <INDENT> __slots__ = 'field', 'max_number', 'max_id', 'max_color', 'cow_paint_list' <NEW_LINE> def __init__(self, file_name): <NEW_LINE> <INDENT> self.field = Graph(file_name) <NEW_LINE> self.max_number = 0 <NEW_LINE> self.max_id = 0 <NEW_LINE> self.max_color = '' <NEW_LINE> self.cow_paint_li...
drives the exploding paint balls simulation :slot: field (Graph): graph that holds the graph representation of the input file :slot: max_number (int): holds the max number of cows colored so far :slot: max_id (int): holds the id of the paintball that triggered the most cow color used to print correct cow color...
62598ee957b8e32f52507486
class _SearchScholarIterator(object): <NEW_LINE> <INDENT> def __init__(self, nav, url: str): <NEW_LINE> <INDENT> self._url = url <NEW_LINE> self._nav = nav <NEW_LINE> self._load_url(url) <NEW_LINE> <DEDENT> def _load_url(self, url: str): <NEW_LINE> <INDENT> self._soup = self._nav._get_soup(url) <NEW_LINE> self._pos = 0...
Iterator that returns Publication objects from the search page I have removed all logging from here for simplicity. -V
62598ee9a8370b77170eeae6
class Logger(object): <NEW_LINE> <INDENT> def __init__(self, debug=0, mode=0, log_file=None, level=logging.INFO): <NEW_LINE> <INDENT> if debug and mode and not log_file: <NEW_LINE> <INDENT> raise ValueError('logFile CANNOT be None if debug = 1 and mode = 1') <NEW_LINE> <DEDENT> self.debug = debug <NEW_LINE> self.mode =...
A thread safe class for logging
62598ee9167d2b6e312b569c
class TestPack(unittest.TestCase): <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> print(f"{self.test_init}") <NEW_LINE> pack = Pack(1) <NEW_LINE> self.assertEqual(len(pack), 52) <NEW_LINE> pack = Pack(4) <NEW_LINE> self.assertEqual(len(pack), 4*52)
Tests for Pack
62598ee9090684286d592a62
class Thread(qtc.QThread): <NEW_LINE> <INDENT> def __init__(self, target, args=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.args = [] if args is None else args <NEW_LINE> self.target = target <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> self.target(*self.args)
construct a QThread using a similar API to the threading module
62598ee9498bea3a75a56234
class AddUserViewRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(AddUserViewRequest, self).__init__( '/regions/{regionId}/userview/addUserView', 'POST', header, version) <NEW_LINE> self.parameters = parameters
添加主域名的自定义解析线路
62598ee923849d37ff84f7b9
@dataclass <NEW_LINE> class TurnConfiguration: <NEW_LINE> <INDENT> domain: str = None <NEW_LINE> uris: list[str] = field(default_factory=list) <NEW_LINE> shared_secret: str = None <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> if self.domain and not self.uris: <NEW_LINE> <INDENT> self.uris = [ f'{typ}:{self.do...
Data class to hold TURN server configuration. domain is the string representing the domain name with which Coturn has been configured. This is necessary to associate the correct TLS certificate with Coturn communication. STUN/TURN URIs are generated using this. shared_secret is a string that must be used by a server ...
62598ee9ac7a0e7691f70c1b