code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TestBase(testtools.TestCase): <NEW_LINE> <INDENT> def _remove_swift_env_vars(self): <NEW_LINE> <INDENT> self._environ_vars = {} <NEW_LINE> keys = list(os.environ.keys()) <NEW_LINE> for k in keys: <NEW_LINE> <INDENT> if (k in ('ST_KEY', 'ST_USER', 'ST_AUTH') or k.startswith('OS_')): <NEW_LINE> <INDENT> self._envir...
Provide some common methods to subclasses
62598f8416aa5153ce3fffa0
class HeaderParser(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def generate_tempate(file_name=None): <NEW_LINE> <INDENT> if file_name is None: <NEW_LINE> <INDENT> os.environ['PATH'] += os.pathsep + '/usr/bin' <NEW_LINE> here = os.path.abspath(os.path.dirname(__file__)) <NEW_LINE> file_name = os.path.join(here, '..'...
Parser for C header file Parses to json format
62598f84be383301e025329a
class NewsItemNode(template.Node): <NEW_LINE> <INDENT> def __init__(self, varname, limit=None, author=None, category_slug=None, filters=None): <NEW_LINE> <INDENT> self.varname = varname <NEW_LINE> self.limit = limit <NEW_LINE> self.filters = filters <NEW_LINE> self.author = author <NEW_LINE> self.category = category_sl...
Returns a QuerySet of published NewsItems based on the lookup parameters.
62598f84d10714528d69d970
class GetFullChannel(Object): <NEW_LINE> <INDENT> ID = 0x08736a09 <NEW_LINE> def __init__(self, channel): <NEW_LINE> <INDENT> self.channel = channel <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *args) -> "GetFullChannel": <NEW_LINE> <INDENT> channel = Object.read(b) <NEW_LINE> return GetFullChannel...
Attributes: ID: ``0x08736a09`` Args: channel: Either :obj:`InputChannelEmpty <pyrogram.api.types.InputChannelEmpty>` or :obj:`InputChannel <pyrogram.api.types.InputChannel>` Raises: :obj:`Error <pyrogram.Error>` Returns: :obj:`messages.ChatFull <pyrogram.api.types.messages.ChatFull>`
62598f8423e79379d538bf9a
class HistoryTranslationsModel(HistoryBaseModel, CommonModel): <NEW_LINE> <INDENT> id = models.UUIDField( primary_key=True, default=uuid.uuid4, editable=False ) <NEW_LINE> history = models.ManyToManyField( UserModel, related_name='translations_users_histories' ) <NEW_LINE> favorite = models.ManyToManyField( UserModel, ...
History translations model.
62598f84711fe17d825e0189
class ISoerRDF2Surf(Interface): <NEW_LINE> <INDENT> pass
Read a rdf and verify that the feed is correct before content is updated in Plone.
62598f8496565a6dacd2ccc8
class Filter(BaseSchemaItem): <NEW_LINE> <INDENT> def __init__(self, schema, attributes): <NEW_LINE> <INDENT> super(Filter, self).__init__(schema, attributes) <NEW_LINE> self._type_code = [16,] <NEW_LINE> self._strip_attribute('RDB$FUNCTION_NAME') <NEW_LINE> self._strip_attribute('RDB$MODULE_NAME') <NEW_LINE> self._str...
Represents userdefined BLOB filter. Supported SQL actions: - BLOB filter: `declare`, `drop`, `comment` - System UDF: `none`
62598f84596a897236127713
class meshRouting (object): <NEW_LINE> <INDENT> routing = 'custom' <NEW_LINE> @classmethod <NEW_LINE> def customMeshRouting(self, sta, wlan, stationList, **params): <NEW_LINE> <INDENT> associate = False <NEW_LINE> controlMeshMac = [] <NEW_LINE> command = '' <NEW_LINE> for ref_sta in stationList: <NEW_LINE> <INDENT> if ...
Mesh Routing
62598f84b830903b9686e1c2
class TestDestinyDefinitionsDestinyItemActionRequiredItemDefinition(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 testDestinyDefinitionsDestinyItemActionRequiredItemDefinition(self): <NEW_LINE> <...
DestinyDefinitionsDestinyItemActionRequiredItemDefinition unit test stubs
62598f8430c21e258be982ab
class nakagami_gen(rv_continuous): <NEW_LINE> <INDENT> def _pdf(self, x, nu): <NEW_LINE> <INDENT> return 2*nu**nu/gam(nu)*(x**(2*nu-1.0))*exp(-nu*x*x) <NEW_LINE> <DEDENT> def _cdf(self, x, nu): <NEW_LINE> <INDENT> return special.gammainc(nu, nu*x*x) <NEW_LINE> <DEDENT> def _ppf(self, q, nu): <NEW_LINE> <INDENT> return ...
A Nakagami continuous random variable. %(before_notes)s Notes ----- The probability density function for `nakagami` is:: nakagami.pdf(x, nu) = 2 * nu**nu / gamma(nu) * x**(2*nu-1) * exp(-nu*x**2) for ``x > 0``, ``nu > 0``. %(example)s
62598f8494891a1f408b943f
class SynapseService(service.Service): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> <DEDENT> def startService(self): <NEW_LINE> <INDENT> hs = setup(self.config) <NEW_LINE> change_resource_limit(hs.config.soft_file_limit) <NEW_LINE> if hs.config.gc_thresholds: <NEW_...
A twisted Service class that will start synapse. Used to run synapse via twistd and a .tac.
62598f847c178a314d78cf4d
class CommunityChest(Square): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(Square.Name.COMMUNITY_CHEST) <NEW_LINE> <DEDENT> def landed_on(self, game, player): <NEW_LINE> <INDENT> game.state.board.community_chest_deck.take_card(game, player)
Represents one of the Community Chest squares.
62598f84379a373c97d98ab3
class BuyBelow10ShortAbove10(Moonshot): <NEW_LINE> <INDENT> COMMISSION_CLASS = TestCommission <NEW_LINE> def prices_to_signals(self, prices): <NEW_LINE> <INDENT> long_signals = prices.loc["Close"] <= 10 <NEW_LINE> short_signals = prices.loc["Close"] > 10 <NEW_LINE> signals = long_signals.astype(int).where(long_signals,...
A basic test strategy that buys below 10 and shorts above 10.
62598f8429b78933be269e2b
class Module(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=40) <NEW_LINE> description = models.TextField(blank=False) <NEW_LINE> sort_order = models.IntegerField(null=True) <NEW_LINE> created_at = models.DateTimeField(auto_now=True) <NEW_LINE> updated_at = models.DateTimeField(auto_now_add=True)...
Modules of each course
62598f84004d5f362081ed4b
class ShowConsumer(show.ShowOne): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + '.ShowConsumer') <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(ShowConsumer, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'consumer', metavar='<consumer>', help='Name or ID of consume...
Show consumer command
62598f840383005118f6d19d
class Constant(ConstOpMixin): <NEW_LINE> <INDENT> def __init__(self, typ, constant): <NEW_LINE> <INDENT> assert not isinstance(typ, types.VoidType) <NEW_LINE> self.type = typ <NEW_LINE> self.constant = constant <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '{0} {1}'.format(self.type, self.get_refere...
Constant values
62598f841f5feb6acb1626d4
class SelectMunicipioWidget(Widget): <NEW_LINE> <INDENT> def render(self, name, value, attrs=None): <NEW_LINE> <INDENT> if value is None: value = '' <NEW_LINE> attrs = attrs or {} <NEW_LINE> if attrs: <NEW_LINE> <INDENT> self.attrs.update(attrs) <NEW_LINE> <DEDENT> output = [] <NEW_LINE> uf_val = '' <NEW_LINE> uf_choic...
Widget to render a <select> with the UFs (Brazillian states) and a <select> with the actual Municipio depending on the state selected
62598f8421a7993f00c65a14
class ReferenceImage(proto.Message): <NEW_LINE> <INDENT> name = proto.Field(proto.STRING, number=1,) <NEW_LINE> uri = proto.Field(proto.STRING, number=2,) <NEW_LINE> bounding_polys = proto.RepeatedField( proto.MESSAGE, number=3, message=geometry.BoundingPoly, )
A ``ReferenceImage`` represents a product image and its associated metadata, such as bounding boxes. Attributes: name (str): The resource name of the reference image. Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. This field is i...
62598f84c432627299fa2a71
class PublisherSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> name = serializers.CharField( validators=[UniqueValidator(queryset=Publisher.objects.all())] ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Publisher <NEW_LINE> fields = ('id', 'name') <NEW_LINE> <DEDENT> def create(self, validated_data):...
Publisher Serializer
62598f8423e79379d538bf9c
class Cryptographic(BaseProvider): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.__words = Text('en')._data.get('words', {}) <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> name = 'cryptographic' <NEW_LINE> <DEDENT> def uuid(se...
Class that provides cryptographic data.
62598f84d4950a0f3b110b86
class PutItemResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
A ResultSet with methods tailored to the values returned by the PutItem Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62598f84bde94217f37073b7
class aaGrouping(object): <NEW_LINE> <INDENT> def __init__(self,groups,title='',description=''): <NEW_LINE> <INDENT> self.groups=groups <NEW_LINE> self.labelDict={} <NEW_LINE> self.colorDict={} <NEW_LINE> for g in groups: <NEW_LINE> <INDENT> self.colorDict.update({aa:g.color for aa in g.aas}) <NEW_LINE> self.labelDict....
Builds lookup dicts of color and label assignments from the set of colorGroups
62598f849b70327d1c57e840
class SendISMSMessageResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "Message": fields.Str(required=True, load_from="Message"), "ReqUuid": fields.Str(required=True, load_from="ReqUuid"), "TaskId": fields.Str(required=True, load_from="TaskId"), }
SendISMSMessage - 发送视频短信
62598f843eb6a72ae038a0d8
class UserRegisterApi(MethodView): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> data = request.get_json() <NEW_LINE> if data is None: <NEW_LINE> <INDENT> return api_abort(400, '无效的数据') <NEW_LINE> <DEDENT> username = data.get('username') <NEW_LINE> password = data.get('password') <NEW_LINE> class_ = data.get(...
用于用户注册的api
62598f8423e79379d538bf9d
class OsFile: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def getOSInitFile(): <NEW_LINE> <INDENT> distname, _, _ = LinuxDistro.linux_distribution() <NEW_LINE> system_dir = "/usr/lib/systemd/system/" <NEW_LINE> system_file = "/usr/lib/systemd/system/gs-OS-set.service" <NEW_LINE> init_file_suse = "/etc/init.d/boot.loca...
operation with os file
62598f843eb6a72ae038a0d9
class Monitorfloat(ACS__POA.Monitorfloat, GenericMonitor): <NEW_LINE> <INDENT> def __init__(self, scheduler, timeoutID): <NEW_LINE> <INDENT> GenericMonitor.__init__(self, scheduler, timeoutID) <NEW_LINE> return
Properties can be derived from Monitordouble only if their IDL derives from ACS::Monitordouble.
62598f84d7e4931a7ef3bb3e
class CassandraConnection(object): <NEW_LINE> <INDENT> NATIVE_PROTOCOL_VERSION = 3 <NEW_LINE> CONNECTION_TIMEOUT_SEC = CONF.agent_call_high_timeout <NEW_LINE> RECONNECT_DELAY_SEC = 3 <NEW_LINE> def __init__(self, contact_points, user): <NEW_LINE> <INDENT> self.__user = user <NEW_LINE> self._cluster = Cluster( contact_p...
A wrapper to manage a Cassandra connection.
62598f847b25080760ed6f49
class raichu(Cluster): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Cluster.__init__(self) <NEW_LINE> self.workerNodeClass = DMTFSMASHCLPIpmiWorkerNode <NEW_LINE> self.masterNodeClass = DMTFSMASHCLPIpmiMasterNode
this class represents the raichu cluster
62598f84e64d504609df9102
class PistonOAuth2(object): <NEW_LINE> <INDENT> def __init__(self, scope=None, json=False): <NEW_LINE> <INDENT> self.enable_json = json <NEW_LINE> Auth = Authenticator if not json else JSONAuthenticator <NEW_LINE> self.authenticator = Auth(scope=scope) if scope else Auth() <NEW_LINE> <DEDENT> def is_authenticated(self,...
OAuth2 authentication.
62598f84a4f1c619b294e090
class CloudbuildProjectsBuildsCancelRequest(_messages.Message): <NEW_LINE> <INDENT> id = _messages.StringField(1, required=True) <NEW_LINE> projectId = _messages.StringField(2, required=True)
A CloudbuildProjectsBuildsCancelRequest object. Fields: id: The ID of the build. projectId: The ID of the project.
62598f840383005118f6d19f
class FuzzyTerm(MultiTerm): <NEW_LINE> <INDENT> __inittypes__ = dict(fieldname=str, text=unicode, boost=float, minsimilarity=float, prefixlength=int) <NEW_LINE> def __init__(self, fieldname, text, boost=1.0, minsimilarity=0.5, prefixlength=1): <NEW_LINE> <INDENT> if not text: <NEW_LINE> <INDENT> raise QueryError("Fuzzy...
Matches documents containing words similar to the given term.
62598f8410dbd63aa1c70657
class PlinkStats(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.f_a = None <NEW_LINE> self.f_u = None <NEW_LINE> self.chisq = None <NEW_LINE> self.or_val = None <NEW_LINE> self.p_val = None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.__repr__() <NEW_LINE> <DEDENT> d...
PLINK Statistics
62598f8450485f2cf55daa17
class ValDictMeta(type): <NEW_LINE> <INDENT> pass
A placeholder for :class:`ValDict` metaclass.
62598f84d10714528d69d974
class CoursesMainPage(DidelEntity, list): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CoursesMainPage, self).__init__() <NEW_LINE> self.path = '/' <NEW_LINE> <DEDENT> def populate(self, soup, *args, **kw): <NEW_LINE> <INDENT> for ref in soup.select("dt a"): <NEW_LINE> <INDENT> href = ref.get("href...
DidEL's student homepage
62598f8430c21e258be982ae
class MsgError(__Error): <NEW_LINE> <INDENT> pass
Ошибка сообщения
62598f84b5575c28eb712a19
class ThreadedRequestHandler(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def __init__(self, url, method): <NEW_LINE> <INDENT> self._url = url <NEW_LINE> self.method = method <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> n = self.__class__.__name__ <NEW_LINE> return f'<{n} at 0x{id(self):x}>' <NEW_LINE> <D...
Base class for all request classes
62598f8415baa72349461a23
class Asset(OpenvasObject): <NEW_LINE> <INDENT> name = field.Text(editable=False).required() <NEW_LINE> type = field.Text(editable=False).required() <NEW_LINE> comment = field.Text() <NEW_LINE> user_tags = field.Object(Tag) <NEW_LINE> in_use = field.Text(editable=False) <NEW_LINE> writable = field.Text(editable=False) ...
Assets are added by scans generally and are tracked as a host and/or os
62598f848e71fb1e983bb55f
class Meta: <NEW_LINE> <INDENT> verbose_name = _("Instructor/Administrator")
The name of this section within the admin site
62598f84fbf16365ca793b4f
class Message(models.Model): <NEW_LINE> <INDENT> id = models.IntegerField(primary_key=True) <NEW_LINE> reply_id = models.IntegerField() <NEW_LINE> reply_name = models.CharField(max_length=200) <NEW_LINE> passport_id = models.IntegerField() <NEW_LINE> article_id = models.IntegerField() <NEW_LINE> article_title = models....
docstring for Me
62598f8415baa72349461a24
class _DihedralTerm(object): <NEW_LINE> <INDENT> def __init__(self, idivf=1, pk=None, phase=None, periodicity=None, dihedraltype=None, scee=1.2, scnb=2.0, dihtype='normal'): <NEW_LINE> <INDENT> self.idivf = int(idivf) <NEW_LINE> if not dihtype in ('normal', 'improper'): <NEW_LINE> <INDENT> raise ValueError('dihtype mus...
A single term in a (potentially multiterm) dihedral
62598f847b25080760ed6f4b
class ListLogger(object): <NEW_LINE> <INDENT> def __init__(self, list): <NEW_LINE> <INDENT> self.list=list <NEW_LINE> <DEDENT> def write(self,data): <NEW_LINE> <INDENT> if len(data)<=1: return <NEW_LINE> if data[-1] in ['\r','\n']: data=data[0:-1] <NEW_LINE> Qt.QListWidgetItem(data,self.list) <NEW_LINE> <DEDENT> def fl...
Stream python logger output to a QtListView. Parameters ---------- list : listview A listview for output.
62598f843eb6a72ae038a0db
class FPGALinkData(AbstractLinkData): <NEW_LINE> <INDENT> __slots__ = ( "_fpga_link_id", "_fpga_id" ) <NEW_LINE> def __init__(self, fpga_link_id, fpga_id, connected_chip_x, connected_chip_y, connected_link, board_address): <NEW_LINE> <INDENT> AbstractLinkData.__init__( self, connected_chip_x, connected_chip_y, connecte...
Data object for FPGA links
62598f840fa83653e46f4994
class CustomField(models.Model): <NEW_LINE> <INDENT> workflow_id = models.IntegerField('工作流id') <NEW_LINE> field_type_id = models.IntegerField('类型', help_text='5.字符串,10.整形,15.浮点型,20.布尔,25.日期,30.日期时间,35.单选框,40.多选框,45.下拉列表,50.多选下拉列表,55.文本域,60.用户名, 70.多选的用户名, 80.附件(只保存路径,多个使用逗号隔开)') <NEW_LINE> field_key = models.CharField...
自定义字段, 设定某个工作流有哪些自定义字段
62598f8450485f2cf55daa18
class ADAttributeAttr(AttrConfig): <NEW_LINE> <INDENT> def __init__(self, attributes, *args, **kwargs): <NEW_LINE> <INDENT> super(ADAttributeAttr, self).__init__(*args, **kwargs) <NEW_LINE> self.attributes = _prepare_constants(attributes, const.ADAttribute)
Config for attributes fetched from the AD attribute table in Cerebrum. Certain attributes could be stored in the AD attribute table in Cerebrum, if there are nowhere else to put the data. This table should not be used that often, since most of the data Cerebrum should know about is put in other, more proper places. So...
62598f84d6c5a102081e1bef
class worker_celery(object): <NEW_LINE> <INDENT> def run_worker(self, workflow_name, data, **kwargs): <NEW_LINE> <INDENT> return CeleryResult(celery_run.delay(workflow_name, data, **kwargs)) <NEW_LINE> <DEDENT> def restart_worker(self, wid, **kwargs): <NEW_LINE> <INDENT> return CeleryResult(celery_restart.delay(wid, **...
Used by :py:class:`.api.WorkerBackend` to call the worker functions.
62598f8421a7993f00c65a18
class QuestionList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Questions.objects.all() <NEW_LINE> serializer_class = QuestionSerializer <NEW_LINE> paginate_by = 10 <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Questions.objects.all().order_by('number')
List all questions, or create a new question.
62598f841f5feb6acb1626d8
class DynamicsEntityDataset(Dataset): <NEW_LINE> <INDENT> _validation = { 'linked_service_name': {'required': True}, 'type': {'required': True}, } <NEW_LINE> _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, 'description': {'key': 'description', 'type': 'str'}, 'structure': {'key': 'structure...
The Dynamics entity dataset. :param additional_properties: Unmatched properties from the message are deserialized this collection :type additional_properties: dict[str, object] :param description: Dataset description. :type description: str :param structure: Columns that define the structure of the dataset. Type: ar...
62598f84498bea3a75a575ca
class ResourceMixin: <NEW_LINE> <INDENT> def head(self, HttpRequest, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> '''Ресурс''' <NEW_LINE> @convertToJSON <NEW_LINE> def get(self, HttpRequest, **kwargs): <NEW_LINE> <INDENT> stream = self.get_exported_resource(HttpRequest, kwargs) <NEW_LINE> return stream <NEW_...
Заголовок ресурса
62598f8482261d6c5272fc27
class Log(Entity): <NEW_LINE> <INDENT> __slots__ = [ 'job_id', 'body', 'type', ]
:ivar int job_id: Jod ID. :ivar str body: Log body. :ivar str type:
62598f8426068e7796d4c402
class Subsystem(ProcSubsystem): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super().__init__(name, 'athome.lib.hbmqttrunner')
Subprocess subsystem
62598f84d53ae8145f917f35
class CategorizedDictionary(Category): <NEW_LINE> <INDENT> def __init__(self,data=None): <NEW_LINE> <INDENT> if data == None: <NEW_LINE> <INDENT> data = {} <NEW_LINE> <DEDENT> self.data = data <NEW_LINE> self.locked_keys = {} <NEW_LINE> super(CategorizedDictionary,self).__init__(self) <NEW_LINE> <DEDENT> def copy(self,...
Auto-complete compatible dictionary wrapper where keys can be grouped into categories. Keys can be documented using the named argument info during creation. Useful for storing settings. Members / Initializer Parameters: -------------------------------- data: Dictionary containing key/value pairs Example: -------- >>>...
62598f8407d97122c421674a
class CyclusPath(ZeroArgAction): <NEW_LINE> <INDENT> def __call__(self, parser, ns, values, option_string=None): <NEW_LINE> <INDENT> cp = Env().cyclus_path <NEW_LINE> s = os.pathsep.join(cp) <NEW_LINE> print(s)
Prints the Cyclus Path
62598f849b70327d1c57e844
class SubmitV2View(BaseSubmitView): <NEW_LINE> <INDENT> metric_path = "v2.geosubmit" <NEW_LINE> route = "/v2/geosubmit" <NEW_LINE> schema = SUBMIT_V2_SCHEMA
Submit version 2 view for `/v2/geosubmit`.
62598f846aa9bd52df0d4982
class AlbertEmbeddings(Layer): <NEW_LINE> <INDENT> def __init__(self, config, **kwargs): <NEW_LINE> <INDENT> super(AlbertEmbeddings, self).__init__(**kwargs) <NEW_LINE> self.vocab_size = config.vocab_size <NEW_LINE> self.embedding_size = config.embedding_size <NEW_LINE> self.initializer_range = config.initializer_range...
Construct the embeddings from word, position and token_type embeddings.
62598f8423e79379d538bfa1
class BaseDrmaaManager(ExternalBaseManager): <NEW_LINE> <INDENT> def __init__(self, name, app, **kwds): <NEW_LINE> <INDENT> super(BaseDrmaaManager, self).__init__(name, app, **kwds) <NEW_LINE> self.native_specification = kwds.get('native_specification', None) <NEW_LINE> drmaa_session_factory_class = kwds.get('drmaa_ses...
Base class for Pulsar managers using DRMAA.
62598f848e05c05ec3f6eb9b
class tradeinfo_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'json', None, None, ), ) <NEW_LINE> def __init__(self, json=None,): <NEW_LINE> <INDENT> self.json = json <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and i...
Attributes: - json
62598f84507cdc57c63a4833
class Meta: <NEW_LINE> <INDENT> verbose_name = _(u"logged message") <NEW_LINE> verbose_name = _(u"logged messages") <NEW_LINE> ordering = ['-date', 'direction'] <NEW_LINE> permissions = ( ("can_view", _(u"Can view")), ("can_respond", _(u"Can respond")), )
Django Meta class to set the translatable verbose_names and to create permissions. The can_view permission is used by rapidsms to determine whether a user can see the tab. can_respond determines if a user can respond to a message from the log view.
62598f84a17c0f6771d5bce9
class TuringMachineFrame(tk.Frame): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> register(self, 'TuringMachineFrame') <NEW_LINE> tk.Frame.__init__(self, top) <NEW_LINE> from TuringCore import TuringMachine <NEW_LINE> self.turingmachine = TuringMachine(self) <NEW_LINE> self.turingmachine.pack()
a frame that exposes what is inside turing machine
62598f848e71fb1e983bb561
class STRIPMixin(AbstainPredictorMixin): <NEW_LINE> <INDENT> def __init__( self, predict_fn: Callable[[np.ndarray], np.ndarray], num_samples: int = 20, false_acceptance_rate: float = 0.01, **kwargs ) -> None: <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.predict_fn = predict_fn <NEW_LINE> self.num_samp...
Implementation of STRIP: A Defence Against Trojan Attacks on Deep Neural Networks (Gao et. al. 2020) | Paper link: https://arxiv.org/abs/1902.06531
62598f84d7e4931a7ef3bb42
class ArithmeticLookup(BaseLookup): <NEW_LINE> <INDENT> OPERATORS = { '/': operator.truediv, '//': operator.floordiv, '*': operator.mul, '+': operator.add, '-': operator.sub, '%': operator.mod, '^': operator.pow } <NEW_LINE> def config(self, oper_name, operand, reverse=False): <NEW_LINE> <INDENT> if oper_name not in se...
Perform an arithmetic operation on two operands and return the value. <arith:operator_str,operand,reverse> Example: To return the quotient of 12 with the current node do <arith://,12,reverse=True> Note that / will use true division while // will use floordiv.
62598f8473bcbd0ca4bc9cf8
class MaiPotrait(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, Start_X, Start_Y): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image, self.rect = load_image('MaiPotrait.png', 'Mai') <NEW_LINE> self.image.set_colorkey((255,255,255)) <NEW_LINE> self.Current_X_position = Start_X ...
generates a health bar
62598f8473bcbd0ca4bc9cf9
class GeocoderResult(collections.Iterator): <NEW_LINE> <INDENT> attribute_mapping = { "state": "administrative_area_level_1", "province": "administrative_area_level_1", "city": "locality", "county": "administrative_area_level_2", } <NEW_LINE> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> sel...
A geocoder resultset to iterate through address results. Exemple: results = Geocoder.geocode('paris, us') for result in results: print(result.formatted_address, result.location) Provide shortcut to ease field retrieval, looking at 'types' in each 'address_components'. Example: result.country result.postal...
62598f8407f4c71912baeeeb
class sieve_of_eratosthenes_optimized(object): <NEW_LINE> <INDENT> def __init__(self, max_n): <NEW_LINE> <INDENT> self.max_n = max_n <NEW_LINE> self.sieve = [True] * (self.max_n // 2 + 1) <NEW_LINE> self.sieve[0] = False <NEW_LINE> self.sieve[1] = True <NEW_LINE> <DEDENT> def calculate(self): <NEW_LINE> <INDENT> limit ...
Prime sieve.
62598f8410dbd63aa1c7065b
class Integer(GraphProperty): <NEW_LINE> <INDENT> data_type = "Integer" <NEW_LINE> validator = long_validator <NEW_LINE> def to_python(self, value): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return int(value) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> return long_(value...
Integer Data property type
62598f8423849d37ff850b65
class ElementPermissions(object): <NEW_LINE> <INDENT> def __init__(self, ID, private=False): <NEW_LINE> <INDENT> self.ID = ID <NEW_LINE> self.is_private = private <NEW_LINE> self.read = Permissions() <NEW_LINE> self.write = Permissions() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def deserialize(doc): <NEW_LINE> <IND...
Model common permissions for block and hive.
62598f8463d6d428bbee2260
class Parser: <NEW_LINE> <INDENT> urls = list() <NEW_LINE> def __init__(self, token): <NEW_LINE> <INDENT> self.token = token <NEW_LINE> <DEDENT> def get_interests(self, urls): <NEW_LINE> <INDENT> sources = self.get_sources(urls) <NEW_LINE> interests = self.get_entities_by_sources(sources) <NEW_LINE> return interests <N...
Superclass for interest parsers.
62598f8450485f2cf55daa1b
class FlowContainer(ui.View): <NEW_LINE> <INDENT> def __init__(self, background_color=(0.9, 0.9, .9), border_color=(.5, .5, .5), border_width=1, corner_radius=5, frame=(0,0,200,200), flex='WH', padding=5, subviews=None, name=None ): <NEW_LINE> <INDENT> self.background_color=background_color <NEW_LINE> self.border_color...
a subclass of View that automatically flows subviews in the order they were added. and reflows upon resize. also, set a few sane defaults, and expose some of the commonly midified params in thr constructor
62598f840a366e3fb87dc475
class GroupProfile(ModelBase): <NEW_LINE> <INDENT> slug = models.SlugField(unique=True, editable=False, blank=False, null=False, max_length=80) <NEW_LINE> group = models.ForeignKey(Group, related_name='profile') <NEW_LINE> leaders = models.ManyToManyField(User) <NEW_LINE> information = models.TextField(help_text=u'Use ...
Profile model for groups.
62598f84a4f1c619b294e095
class TSTData(object): <NEW_LINE> <INDENT> def __init__(self, X, Y, label=None): <NEW_LINE> <INDENT> self.X = X <NEW_LINE> self.Y = Y <NEW_LINE> self.label = label <NEW_LINE> nx, dx = X.shape <NEW_LINE> ny, dy = Y.shape <NEW_LINE> if dx != dy: <NEW_LINE> <INDENT> raise ValueError('Dimension sizes of the two datasets mu...
Class representing data for two-sample test
62598f8426068e7796d4c404
class RemapNamespaceTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.runtime = mock.MagicMock(Runtime) <NEW_LINE> self.field_data = KvsFieldData(kvs=DictKeyValueStore()) <NEW_LINE> self.scope_ids = ScopeIds('Bob', 'stubxblock', '123', 'import') <NEW_LINE> self.xblock = StubXBlock(self.runti...
Test that remapping the namespace from import to the actual course location.
62598f84711fe17d825e0191
class ResourceTest(ForsetiTestCase): <NEW_LINE> <INDENT> def test_get_resource_types_exist(self): <NEW_LINE> <INDENT> self.assertEqual(ResourceType.ORGANIZATION, ResourceType.verify('organization')) <NEW_LINE> self.assertEqual(ResourceType.FOLDER, ResourceType.verify('folder')) <NEW_LINE> self.assertEqual(ResourceType....
Test Resource.
62598f8415baa72349461a27
class DateEmpty(BadRequest): <NEW_LINE> <INDENT> ID = "DATE_EMPTY" <NEW_LINE> MESSAGE = __doc__
The date argument is empty
62598f84596a89723612771b
@register(Test) <NEW_LINE> class TestAdmin(BaseAdmin): <NEW_LINE> <INDENT> inlines = [QuestionInline, ConclusionInline, ] <NEW_LINE> search_fields = ['title'] <NEW_LINE> date_hierarchy = 'create_at' <NEW_LINE> list_filter = ['star', ] <NEW_LINE> list_display = ('title', 'summary', 'num', 'star', 'create_at') <NEW_LINE>...
图书管理
62598f84009cb60464d00fd5
class LogParser(AbstractExtParser): <NEW_LINE> <INDENT> exts = ("log", "txt") <NEW_LINE> @staticmethod <NEW_LINE> def convertTeletype(t): <NEW_LINE> <INDENT> for (code, style) in TTY2HTML: <NEW_LINE> <INDENT> t = t.replace(code, style) <NEW_LINE> <DEDENT> return "<span>{}</span>".format(t) <NEW_LINE> <DEDENT> @Slot() <...
Used for log files that may contain terminal color code characters.
62598f8476d4e153a661c6bc
class SanicHelper: <NEW_LINE> <INDENT> port = 8080 <NEW_LINE> loop = None <NEW_LINE> def __init__(self, loop=None, port=None): <NEW_LINE> <INDENT> self.loop = loop <NEW_LINE> self.port = port <NEW_LINE> <DEDENT> async def handle(self, request, name): <NEW_LINE> <INDENT> text = 'Sanic server running on {0} port. Hello, ...
Helper class that do all sanic start stop manipulation
62598f8473bcbd0ca4bc9cfa
class Model1(Model): <NEW_LINE> <INDENT> def construct(self): <NEW_LINE> <INDENT> self.model = m = mo.ConcreteModel() <NEW_LINE> m.data = self.model_data <NEW_LINE> m.idxs = mo.Set(initialize=m.data['idxs']) <NEW_LINE> m.t = mo.Var(m.idxs, within=mo.NonNegativeReals, bounds=(0, ineq.MAX_THEIL)) <NEW_LINE> m.position = ...
Minimize L2-norm under position and constrainted relative difference and Theil sum. Comprised of | |pos| | |diff_hi|
62598f8407d97122c421674d
class Submission(models.Model): <NEW_LINE> <INDENT> requester_id = models.CharField(max_length=CHARFIELD_LEN_SMALL) <NEW_LINE> lms_callback_url = models.CharField(max_length=255, db_index=True) <NEW_LINE> queue_name = models.CharField(max_length=CHARFIELD_LEN_SMALL, db_index=True) <NEW_LINE> xqueue_header ...
Representation of submission request, including metadata information
62598f84a4f1c619b294e096
class Command(MenuItem): <NEW_LINE> <INDENT> def __init__(self, title, command, *args): <NEW_LINE> <INDENT> MenuItem.__init__(self, title, None) <NEW_LINE> self._command = command <NEW_LINE> self._args = args <NEW_LINE> <DEDENT> def invoke_command(self): <NEW_LINE> <INDENT> if self._command is not None: <NEW_LINE> <IND...
A single menu item which executes a callback when selected
62598f844e696a045264db56
class Electric(Field): <NEW_LINE> <INDENT> _cpp_class_name = "PotentialExternalElectricField" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> params = TypeParameter( 'E', 'particle_types', TypeParameterDict((float, float, float), len_keys=1)) <NEW_LINE> self._add_typeparam(params)
Electric field. `Electric` specifies that an external force should be added to every particle in the simulation that results from an electric field. The external potential :math:`V(\vec{r})` is implemented using the following formula: .. math:: V(\vec{r}) = - q_i \vec{E} \cdot \vec{r} where :math:`q_i` is the ...
62598f84e76e3b2f99fd84df
class FeedbackCreateViewTestCase(ViewTestMixin, TestCase): <NEW_LINE> <INDENT> longMessage = True <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.user = UserFactory() <NEW_LINE> <DEDENT> def get_view_name(self): <NEW_LINE> <INDENT> return 'feedback_form' <NEW_LINE> <DEDENT> def test_view(self): <NEW_LINE> <INDENT>...
Tests for the ``FeedbackCreateView`` generic view.
62598f8416aa5153ce3fffaa
class Init: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def args(cls, subparsers): <NEW_LINE> <INDENT> sub = subparsers.add_parser("init", help=Init.__doc__) <NEW_LINE> sub.add_argument("--force", "-f", action="store_true", help="recreate all tables") <NEW_LINE> sub.set_defaults(func=cls.run) <NEW_LINE> <DEDENT> @class...
Initializes the database.
62598f8473bcbd0ca4bc9cfb
class RunPipelineRequest(_messages.Message): <NEW_LINE> <INDENT> @encoding.MapUnrecognizedFields('additionalProperties') <NEW_LINE> class LabelsValue(_messages.Message): <NEW_LINE> <INDENT> class AdditionalProperty(_messages.Message): <NEW_LINE> <INDENT> key = _messages.StringField(1) <NEW_LINE> value = _messages.Strin...
The arguments to the `RunPipeline` method. The requesting user must have the `iam.serviceAccounts.actAs` permission for the Cloud Genomics service account or the request will fail. Messages: LabelsValue: User-defined labels to associate with the returned operation. These labels are not propagated to any Google C...
62598f8421bff66bcd722714
class FormattedHeadFile(FormattedLayerFile): <NEW_LINE> <INDENT> def __init__( self, filename, text="head", precision="single", verbose=False, **kwargs, ): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> super().__init__(filename, precision, verbose, kwargs) <NEW_LINE> return <NEW_LINE> <DEDENT> def _get_text_header(se...
FormattedHeadFile Class. Parameters ---------- filename : string Name of the formatted head file text : string Name of the text string in the formatted head file. Default is 'head' precision : string 'single' or 'double'. Default is 'single'. verbose : bool Write information to the screen. Default i...
62598f8410dbd63aa1c7065d
class IWorkspaceFolderNameFromTitle(INameFromTitle): <NEW_LINE> <INDENT> pass
Behavior interface.
62598f84d53ae8145f917f38
class MethodHandleCpInfo(KaitaiStruct): <NEW_LINE> <INDENT> class ReferenceKindEnum(Enum): <NEW_LINE> <INDENT> get_field = 1 <NEW_LINE> get_static = 2 <NEW_LINE> put_field = 3 <NEW_LINE> put_static = 4 <NEW_LINE> invoke_virtual = 5 <NEW_LINE> invoke_static = 6 <NEW_LINE> invoke_special = 7 <NEW_LINE> new_invoke_special...
.. seealso:: Source - https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.8
62598f8430c21e258be982b4
class UserSecuredWizardClass(WizardClass): <NEW_LINE> <INDENT> def security_hash(self, request, form): <NEW_LINE> <INDENT> return "123"
Wizard with a custum security_hash method
62598f8466656f66f7d59e9f
class ApiPortalCustomDomainResource(ProxyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type':...
Custom domain of the API portal. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource Id for the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str :ivar syst...
62598f84442bda511e95bf05
@benchmark.Enabled('chromeos') <NEW_LINE> class PageCyclerMoz(_PageCycler): <NEW_LINE> <INDENT> page_set = page_sets.MozPageSet <NEW_LINE> @classmethod <NEW_LINE> def Name(cls): <NEW_LINE> <INDENT> return 'page_cycler.moz'
Page load for mozilla's original page set. Recorded in December 2000.
62598f84498bea3a75a575ce
class GroupCoordinatorResponse(Response): <NEW_LINE> <INDENT> def __init__(self, buff): <NEW_LINE> <INDENT> fmt = 'hiSi' <NEW_LINE> response = struct_helpers.unpack_from(fmt, buff, 0) <NEW_LINE> error_code = response[0] <NEW_LINE> if error_code != 0: <NEW_LINE> <INDENT> self.raise_error(error_code, response) <NEW_LINE>...
A group coordinator response Specification:: GroupCoordinatorResponse => ErrorCode CoordinatorId CoordinatorHost CoordinatorPort ErrorCode => int16 CoordinatorId => int32 CoordinatorHost => string CoordinatorPort => int32
62598f8426068e7796d4c406
class PkiGsNameUtilsTest(GsNameUtilsTest): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> os.environ['QGIS_AUTH_DB_DIR_PATH'] = AUTH_TESTDATA <NEW_LINE> cls.authm = QgsAuthManager.instance() <NEW_LINE> msg = 'Failed to verify master password in auth db' <NEW_LINE> assert cls.authm....
Adapt tests to be used in PKI context
62598f84d4950a0f3b110b8a
class ValueChunk(Chunk): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> Chunk.__init__(self) <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def render(self, context): <NEW_LINE> <INDENT> logger.debug("value: context %s typeof %s", context, type(context)) <NEW_LINE> value = str(context.get(self.va...
Не является напрямую токеном, его заголовки не описаны в синтаксисе шаблонной системы. Однако используется в рендеринге цепочек как объект, определяющий переменную, значение которой зависит от контекста и будет извлечено из текущего объекта Context
62598f845f7d997b871f912d
class ModelGenerationError(OMError): <NEW_LINE> <INDENT> pass
Error when generating a new model.
62598f84097d151d1a2c0acf
class Adenine(Molecule): <NEW_LINE> <INDENT> def __init__( self, strand: int = -1, chain: int = -1, position: np.array = np.zeros(3), rotation: np.array = np.zeros(3), index: int = 0, ): <NEW_LINE> <INDENT> super().__init__( "Adenine", "ellipse", ADENINE_SIZE, strand=strand, chain=chain, position=position, rotation=rot...
Adenine molecule :param strand: strand ID :param chain: Chain ID :param position: position array (3-vector) :param rotation: rotation array (euler angles) :param index: base pait index
62598f8496565a6dacd2cccd
class Movie(models.Model): <NEW_LINE> <INDENT> title = models.CharField(verbose_name="Название", max_length=100) <NEW_LINE> tagline = models.CharField(verbose_name="Слоган", max_length=100, default="") <NEW_LINE> description = models.TextField(verbose_name="Описание") <NEW_LINE> poster = models.ImageField(verbose_name=...
Фильмы
62598f8438b623060ffa8b41
class KeywordDetector: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> keyword = Config.triggerword.picovoice.word <NEW_LINE> if keyword not in pvporcupine.KEYWORDS: <NEW_LINE> <INDENT> raise ConfigValidationError(f"available keywords are {pvporcupine.KEYWORDS}") <NEW_LINE> <DEDENT> self._detector =...
Keyword detector.
62598f8424f1403a92685603
class IntAexp(AST): <NEW_LINE> <INDENT> def __init__(self, i): <NEW_LINE> <INDENT> super().__init__(CLASS, "int_aexp") <NEW_LINE> self.i = i
Integer arithmetic expression class for AST. interpret - runtime function for Evaluator (just return i). Example: 54
62598f846fece00bbaccb433
class ControllerData(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.errorMsg = "" <NEW_LINE> self.statusMsg = "" <NEW_LINE> self.path = None <NEW_LINE> self.bibtexFilepath = None <NEW_LINE> self.importFormat = None <NEW_LINE> self.exportFormat = None <NEW_LINE> self.searchQuery = None <NEW_LI...
It encapsulates the state of the controller. The data that can be used by the controller and statechart.
62598f8430c21e258be982b5
@context.configure(name="dummy_context", order=750) <NEW_LINE> class DummyContext(context.Context): <NEW_LINE> <INDENT> CONFIG_SCHEMA = { "type": "object", "$schema": consts.JSON_SCHEMA, "properties": { "fail_setup": {"type": "boolean"}, "fail_cleanup": {"type": "boolean"} }, } <NEW_LINE> def setup(self): <NEW_LINE> <I...
Dummy context.
62598f8476d4e153a661c6be
class Duration(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'durations' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(255), nullable=False) <NEW_LINE> duration = db.Column(db.Integer, nullable=False) <NEW_LINE> inactive = db.Column(db.Boolean, default=False) <NEW_LINE> ...
Talk duration.
62598f84fbf16365ca793b55
@register <NEW_LINE> class ContinuedEvent(BaseSchema): <NEW_LINE> <INDENT> __props__ = { "seq": { "type": "integer", "description": "Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request." }, "type": { "type": "string", "enum": [ "event" ] }, "even...
The event indicates that the execution of the debuggee has continued. Please note: a debug adapter is not expected to send this event in response to a request that implies that execution continues, e.g. 'launch' or 'continue'. It is only necessary to send a 'continued' event if there was no previous request that impl...
62598f8473bcbd0ca4bc9cfc