code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Attack: <NEW_LINE> <INDENT> def __init__(self, value, element=None): <NEW_LINE> <INDENT> if element is None: <NEW_LINE> <INDENT> element = Element.physical if isinstance(value, int) else Element.summoner <NEW_LINE> <DEDENT> assert isinstance(element, Element) <NEW_LINE> assert isinstance(value, int) or (element =...
An enemy attack. It consists of an element and a value. The value is either the amount of damage or -- if element == Element.summoner -- the EnemyCategory of the summoned enemy. *element* defaults to physical or summoner attack, depending on *value*.
6259903d45492302aabfd700
class Quant(Model): <NEW_LINE> <INDENT> __tablename__ = 'storm_stock_quant' <NEW_LINE> __table_args__ = ( sa.UniqueConstraint('location_id', 'lot_id'), ) <NEW_LINE> id = sa.Column(sa.Integer, primary_key=True) <NEW_LINE> location_id = sa.Column(sa.Integer, sa.ForeignKey(Location.id), nullable=False) <NEW_LINE> lot_id =...
The amount of products belonging to a certain lot in a given location.
6259903db830903b9686ed8d
class KikIOSMessageEventData(events.EventData): <NEW_LINE> <INDENT> DATA_TYPE = 'ios:kik:messaging' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(KikIOSMessageEventData, self).__init__(data_type=self.DATA_TYPE) <NEW_LINE> self.body = None <NEW_LINE> self.displayname = None <NEW_LINE> self.message_status = No...
Kik message event data. Attributes: body (str): content of the message. message_status (str): message status, such as: read, unread, not sent, delivered, etc. message_type (str): message type, either Sent or Received. offset (str): identifier of the row, from which the event data was extracted. q...
6259903d5e10d32532ce4216
class CloudSqlHook(CloudSQLHook): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> warnings.warn(self.__doc__, DeprecationWarning, stacklevel=2) <NEW_LINE> super().__init__(*args, **kwargs)
This class is deprecated. Please use `airflow.providers.google.cloud.hooks.sql.CloudSQLHook`.
6259903d71ff763f4b5e89c4
class VictimViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Victim.objects.all() <NEW_LINE> serializer_class = VictimSerializer <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save(admitter=self.request.user)
This viewset automatically provides `list`, `create`, `retrieve`, `update` and `destroy` actions. Additionally we also provide an extra `highlight` action.
6259903d3eb6a72ae038b892
class OverrideSettings(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_crawler(cls, crawler): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> op_file = crawler.settings.attributes['FEED_URI'].value <NEW_LINE> if op_file and os.path.exists(op_file): <NEW_LINE> <INDENT> os.remove(op_file) <NEW_LINE> log.msg("D...
all key and value in the settings object below will be read and update to spider settings (settings.py) Here is example in config file : "settings": { "DOWNLOADER_MIDDLEWARES": { "scrapy_balloons.useragent.RandomUserAgentMiddleware":500 }, "DOWNLOAD_DELAY": 5 }
6259903d23e79379d538d727
class EmptyQueueException(Exception): <NEW_LINE> <INDENT> pass
Raised when trying to access element of empty Queue.
6259903d8c3a8732951f7780
class Part(UserRelation): <NEW_LINE> <INDENT> _connection = None <NEW_LINE> _context = None <NEW_LINE> _heading = None <NEW_LINE> _master = None <NEW_LINE> tier_regexp = r'(?P<master>' + '|'.join( [c.tier_regexp for c in (Manual, Lookup, Imported, Computed)] ) + r'){1,1}' + '__' + r'(?P<part>' + _base_regexp + ')' <NEW...
Inherit from this class if the table's values are details of an entry in another relation and if this table is populated by this relation. For example, the entries inheriting from dj.Part could be single entries of a matrix, while the parent table refers to the entire matrix. Part relations are implemented as classes i...
6259903d10dbd63aa1c71dfe
class class_setup_deformable_bones(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "bear.setup_deformable_bones" <NEW_LINE> bl_label = "Toggle Non-mecanim Deform" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return len(context.selected_objects) is not 0 <NEW_LINE> <DEDENT> def exe...
Toggle deform status for bones not required by mecanim
6259903de76e3b2f99fd9c34
class ClericalWordFeed(Feed): <NEW_LINE> <INDENT> title = ugettext_lazy("Geistliches Wort aus der Dreifaltigkeitskirchgemeinde") <NEW_LINE> description = ugettext_lazy("Geistliches Wort aus der Dreifaltigkeitskirchgemeinde") <NEW_LINE> feed_copyright = ugettext_lazy( "Copyright Ev.-Luth. Dreifaltigkeitskirchgemeinde Le...
Clerical word for services site.
6259903d21bff66bcd723e92
class LeakyRectify(object): <NEW_LINE> <INDENT> def __init__(self, leakiness=0.01): <NEW_LINE> <INDENT> self.leakiness = leakiness <NEW_LINE> <DEDENT> def __call__(self, x): <NEW_LINE> <INDENT> return tensor.nnet.relu(x, self.leakiness)
Leaky rectifier :math:`\varphi(x) = (x > 0)? x : \alpha \cdot x` The leaky rectifier was introduced in [1]_. Compared to the standard rectifier :func:`rectify`, it has a nonzero gradient for negative input, which often helps convergence. Parameters ---------- leakiness : float Slope for negative input, usually be...
6259903d63b5f9789fe86395
class Author(BaseModel): <NEW_LINE> <INDENT> id = PrimaryKeyField() <NEW_LINE> name = CharField(max_length=256) <NEW_LINE> biography = TextField() <NEW_LINE> age = SmallIntegerField() <NEW_LINE> @staticmethod <NEW_LINE> def add_author(name, biography, age): <NEW_LINE> <INDENT> if len(name) <= 256: <NEW_LINE> <INDENT> t...
Author model. id - primary key of author name - name of the author biograpy - a string of text about the author age - age of the author
6259903d8a349b6b4368746e
class NewTaskForm(QtGui.QWidget): <NEW_LINE> <INDENT> @property <NEW_LINE> def exit_code(self): <NEW_LINE> <INDENT> return self._exit_code <NEW_LINE> <DEDENT> @property <NEW_LINE> def hide_tk_title_bar(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def __init__(self, entity, step, user, parent): <NEW_LINE> ...
Form for requesting details needed to create a new Shotgun task
6259903d6fece00bbacccbd8
class NamedDistribution(object): <NEW_LINE> <INDENT> def __init__(self, name, distribution, required_gpus=None, required_tpu=False): <NEW_LINE> <INDENT> self._distribution = distribution <NEW_LINE> self._name = name <NEW_LINE> self._required_gpus = required_gpus <NEW_LINE> self._required_tpu = required_tpu <NEW_LINE> <...
Translates DistributionStrategy and its data into a good name.
6259903d15baa723494631ba
class LogSummary(models.Model): <NEW_LINE> <INDENT> checksum = models.CharField(max_length=32, primary_key=True) <NEW_LINE> level = models.PositiveIntegerField(choices=LEVEL_CHOICES, default=logbook.ERROR, blank=True, db_index=True) <NEW_LINE> source = models.CharField(max_length=128, blank=True, db_index=True) <NEW_LI...
A summary of the log messages
6259903d07d97122c4217ec7
class UniquenessMixin(object): <NEW_LINE> <INDENT> def _perform_unique_checks(self, unique_checks): <NEW_LINE> <INDENT> errors = {} <NEW_LINE> for model_class, unique_check in unique_checks: <NEW_LINE> <INDENT> lookup_kwargs = {} <NEW_LINE> for field_name in unique_check: <NEW_LINE> <INDENT> f = self._meta.get_field(fi...
Mixin overriding the methods checking value uniqueness. For models defining unique constraints this mixin should be inherited from. When iterable (list or set) fields are marked as unique it must be used. This is a copy of Django's implementation, save for the part marked by the comment.
6259903d50485f2cf55dc1ac
class BanditNArmedRandom(BanditEnv): <NEW_LINE> <INDENT> def __init__( self, nb_bandits: int = 10, nb_prices_per_bandit: int = 100, stdev: int = 1, seed: int = 42, ): <NEW_LINE> <INDENT> np.random.seed(seed) <NEW_LINE> reward_params = [] <NEW_LINE> for _i in range(nb_bandits): <NEW_LINE> <INDENT> mean = np.random.unifo...
N-armed bandit randomly initialized.
6259903dd10714528d69efa0
class RDMCPStorageObject(StorageObject): <NEW_LINE> <INDENT> def __init__(self, name, size=None, wwn=None, nullio=False): <NEW_LINE> <INDENT> if size is not None: <NEW_LINE> <INDENT> super(RDMCPStorageObject, self).__init__(name, 'create') <NEW_LINE> try: <NEW_LINE> <INDENT> self._configure(size, wwn, nullio) <NEW_LINE...
An interface to configFS storage objects for rd_mcp backstore.
6259903db830903b9686ed8e
class WideHelpFormatter(argparse.HelpFormatter): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs["max_help_position"] = 40 <NEW_LINE> super().__init__(*args, **kwargs)
Command-line help text formatter with wider help text.
6259903d23e79379d538d729
class Perceptron(LinearClassifier): <NEW_LINE> <INDENT> def findE_in(self, X, Y, do_transform=True): <NEW_LINE> <INDENT> errs = self.err(X, Y, do_transform) <NEW_LINE> self._badInds = np.where(errs)[0] <NEW_LINE> return np.mean(errs) <NEW_LINE> <DEDENT> def fit(self, X, Y, **conditions): <NEW_LINE> <INDENT> X = X if no...
The Perceptron Model (a binary classifier), uses PLA as the learning algorithm
6259903d379a373c97d9a252
class Stub(Service): <NEW_LINE> <INDENT> do_not_discover = True <NEW_LINE> def print_error(self, *errors): <NEW_LINE> <INDENT> for x in errors: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> report('error_handler for generic service', str(errors) ) <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> Service.stop(self...
Stub Service: start: brief description of service start-up here stop: brief description service shutdown here
6259903d3c8af77a43b68851
class _patch_dict(object): <NEW_LINE> <INDENT> def __init__(self, in_dict, values=(), clear=False, **kwargs): <NEW_LINE> <INDENT> self.in_dict = in_dict <NEW_LINE> self.values = dict(values) <NEW_LINE> self.values.update(kwargs) <NEW_LINE> self.clear = clear <NEW_LINE> self._original = None <NEW_LINE> <DEDENT> def __ca...
Patch a dictionary, or dictionary like object, and restore the dictionary to its original state after the test. `in_dict` can be a dictionary or a mapping like container. If it is a mapping then it must at least support getting, setting and deleting items plus iterating over keys. `in_dict` can also be a string speci...
6259903da79ad1619776b2a9
@classify("requests", "class") <NEW_LINE> class ResponseList(NotEmptyList, CommonAttributeList): <NEW_LINE> <INDENT> def set(self, resp): <NEW_LINE> <INDENT> self[:] = list_from(resp) <NEW_LINE> <DEDENT> @property <NEW_LINE> def single_item(self): <NEW_LINE> <INDENT> return only_item_of(self) <NEW_LINE> <DEDENT> def bu...
A list specialized for testing, w/ResponseInfo object items. To best understand this class, it is important to have a strong understanding of :py:class:`CommonAttributeList` and :py:class:`ResponseInfo`. The common workflow for ``ResponseList`` relies greatly on those other connected pieces. For example, you might ut...
6259903db5575c28eb7135de
class FixedFilterAction(FilterAction): <NEW_LINE> <INDENT> filter_type = 'fixed' <NEW_LINE> needs_preloading = True <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(FixedFilterAction, self).__init__(args, kwargs) <NEW_LINE> self.fixed_buttons = self.get_fixed_buttons() <NEW_LINE> self.filter_st...
A filter action with fixed buttons.
6259903d21bff66bcd723e94
class CAP_PieExportObject(Menu): <NEW_LINE> <INDENT> bl_idname = "pie.export_object" <NEW_LINE> bl_label = "Select Location" <NEW_LINE> def draw(self, context): <NEW_LINE> <INDENT> layout = self.layout <NEW_LINE> pie = layout.menu_pie() <NEW_LINE> obj = context.object.CAPObj <NEW_LINE> user_preferences = context.user_p...
Displays the export default options for objects.
6259903d94891a1f408ba00c
class ExpressRoutePortsLocation(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'address': {'readonly': True}, 'contact': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key...
Definition of the ExpressRoutePorts peering location resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param location: Resource location. :...
6259903d16aa5153ce401717
class Part(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.traces = [] <NEW_LINE> return <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> for trace in self.traces: <NEW_LINE> <INDENT> trace.close() <NEW_LINE> <DEDENT> return <NEW_LINE> <DEDENT> def applykerf(self, kerf): <NEW_LINE> <IN...
List of traces that make up a part.
6259903d50485f2cf55dc1ae
class Form(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.TextFragment <NEW_LINE> fields = ['lang', 'text'] <NEW_LINE> <DEDENT> def save(self, commit=True): <NEW_LINE> <INDENT> self.instance.type = "ann" <NEW_LINE> return super().save(commit)
Override form to set default type
6259903d26238365f5fadd82
class FixedBoundedFloatStrategy(SearchStrategy): <NEW_LINE> <INDENT> def __init__(self, lower_bound, upper_bound, width): <NEW_LINE> <INDENT> SearchStrategy.__init__(self) <NEW_LINE> assert isinstance(lower_bound, float) <NEW_LINE> assert isinstance(upper_bound, float) <NEW_LINE> assert 0 <= lower_bound < upper_bound <...
A strategy for floats distributed between two endpoints. The conditional distribution tries to produce values clustered closer to one of the ends.
6259903dd99f1b3c44d068d2
class TwoDimPolyN: <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> rstring = str(self.norder) <NEW_LINE> for key in self.twodkeys: <NEW_LINE> <INDENT> rstring += str(key) <NEW_LINE> <DEDENT> return rstring <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> if index > len(self.twodkeys)-1: ...
Object for a polynomial with 2D variance
6259903da4f1c619b294f79d
class ColorWidget(QtGui.QWidget): <NEW_LINE> <INDENT> colorChanged = QtCore.Signal(QtGui.QColor) <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(ColorWidget, self).__init__(parent) <NEW_LINE> self.setContentsMargins(0,0,0,0) <NEW_LINE> self._color = QtGui.QColor() <NEW_LINE> <DEDENT> def color(sel...
Base class for widgets manipulating colors.
6259903dec188e330fdf9ac5
class BaseClass(metaclass=MetaBase): <NEW_LINE> <INDENT> def __repr__(self) -> str: <NEW_LINE> <INDENT> def quote(item: tuple) -> tuple: <NEW_LINE> <INDENT> (key, value) = item <NEW_LINE> value = f"'{value}'" if isinstance(value, str) else value <NEW_LINE> return (key, value) <NEW_LINE> <DEDENT> values = ",".join("{}={...
Mercury BaseClass. This class is used as the main inheritance for all Mercury classes and provides default methods and properties across all the library.
6259903d3eb6a72ae038b896
class TimestamperInterface(object): <NEW_LINE> <INDENT> def time(self): <NEW_LINE> <INDENT> return time.time()
This is the only source for current time in the application. Override this for generating unix timestamp in different way.
6259903d287bf620b6272e17
class MishPulse(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def forward(self, x_input): <NEW_LINE> <INDENT> return fmishpulse(x_input)
Applies the mishpulse function element-wise: mishpulse(x) = -sign(x) * mish(-abs(x) + 0.6361099463262276) + step(x) Shape: - Input: (N, *) where * means, any number of additional dimensions - Output: (N, *), same shape as the input Examples: >>> m = MishPulse() >>> x_input = torch.randn(2) >...
6259903d507cdc57c63a5fc7
class TestInvitationTicket(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 testInvitationTicket(self): <NEW_LINE> <INDENT> model = TweakApi.models.invitation_ticket.InvitationTicket()
InvitationTicket unit test stubs
6259903d24f1403a926861e3
class Quote(): <NEW_LINE> <INDENT> def __init__(self, symbol): <NEW_LINE> <INDENT> self._symbol = symbol <NEW_LINE> self.prev_bid = 0 <NEW_LINE> self.prev_ask = 0 <NEW_LINE> self.prev_spread = 0 <NEW_LINE> self.bid = 0 <NEW_LINE> self.ask = 0 <NEW_LINE> self.bid_size = 0 <NEW_LINE> self.ask_size = 0 <NEW_LINE> self.spr...
We use Quote objects to represent the bid/ask spread. When we encounter a 'level change', a move of exactly 1 penny, we may attempt to make one trade. Whether or not the trade is successfully filled, we do not submit another trade until we see another level change. Note: Only moves of 1 penny are considered eligible b...
6259903d82261d6c527307da
class InsightsPage(Page): <NEW_LINE> <INDENT> def __init__(self, version, response, solution): <NEW_LINE> <INDENT> super(InsightsPage, self).__init__(version, response) <NEW_LINE> self._solution = solution <NEW_LINE> <DEDENT> def get_instance(self, payload): <NEW_LINE> <INDENT> return InsightsInstance(self._version, pa...
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
6259903d16aa5153ce401719
class IndexCommodBanner(BaseModel): <NEW_LINE> <INDENT> sku = models.ForeignKey( 'CommodSKU', on_delete=models.CASCADE, verbose_name='商品') <NEW_LINE> image = models.ImageField(upload_to='banner', verbose_name='图片') <NEW_LINE> index = models.SmallIntegerField(default=0, verbose_name='展示顺序') <NEW_LINE> class Meta: <NEW_L...
首页轮播商品展示模型类
6259903d96565a6dacd2d8a1
class UnaryOpNode(OpNode): <NEW_LINE> <INDENT> __slots__ = ('rhs',) <NEW_LINE> ops = { '-': (operator.neg, 3), '+': (operator.pos, 3), } <NEW_LINE> def __init__(self, tok): <NEW_LINE> <INDENT> op, self.rhs = tok[0] <NEW_LINE> super(UnaryOpNode, self).__init__(op) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDE...
An EvalNode for an operator that takes only a single operand.
6259903dd164cc61758221a3
class ExcelReader: <NEW_LINE> <INDENT> def __init__(self, xlsfile: BinaryIO): <NEW_LINE> <INDENT> book = load_workbook(xlsfile, read_only=True) <NEW_LINE> self.sheet = book.worksheets[0] <NEW_LINE> self.fieldnames = [n.value.strip() for n in self.sheet[1]] <NEW_LINE> self.line_num = 1 <NEW_LINE> self._rows = self.sheet...
Like csv.DictReader, but read MS Excel file.
6259903d8a43f66fc4bf33bc
class Polytope(cdd.CDDMatrix): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def fromcdd(m): <NEW_LINE> <INDENT> x = Polytope([]) <NEW_LINE> x._m = m._m <NEW_LINE> return x <NEW_LINE> <DEDENT> def contains(self, x): <NEW_LINE> <INDENT> if isinstance(x, Polytope): <NEW_LINE> <INDENT> return not cdd.pempty(cdd.pinters(sel...
A polytope. Mostly a convenience class
6259903d50485f2cf55dc1b0
class BaseBackend(object): <NEW_LINE> <INDENT> def track(self, period, id=None, bucket=None, old_id=None, old_bucket=None, date=None): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def collapse(self, period, date=None, max_periods=1, buckets=None, aggregate_buckets=None): <NEW_LINE> <INDENT> raise...
The base backend class. All backends implement these methods and accept these arguments, though some may also accept additional keyword arguments.
6259903d26238365f5fadd84
class CollectionsBkLogin(): <NEW_LINE> <INDENT> def __init__(self, client): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.get_all_user = ComponentAPI( client=self.client, method='GET', path='/api/c/compapi/bk_login/get_all_user/', description='获取所有用户信息', ) <NEW_LINE> self.get_batch_user = ComponentAPI( clien...
Collections of BK_LOGIN APIS
6259903d8da39b475be0441c
class FileHandler(MethodHandler): <NEW_LINE> <INDENT> def __init__(self, request, root): <NEW_LINE> <INDENT> self.root = root <NEW_LINE> super(FileHandler, self).__init__(request) <NEW_LINE> <DEDENT> def head(self): <NEW_LINE> <INDENT> return self.get(skip_body=True) <NEW_LINE> <DEDENT> def get(self, skip_body=False): ...
Serves static files out of some directory.
6259903dd99f1b3c44d068d4
class OperatorAPIStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.SetUserStatus = channel.unary_unary( '/api.OperatorAPI/SetUserStatus', request_serializer=proto__pb2.Report.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, )
Missing associated documentation comment in .proto file.
6259903dd6c5a102081e3353
class DualCamera(SensorInterface): <NEW_LINE> <INDENT> def __init__(self, racecar_name): <NEW_LINE> <INDENT> self.image_buffer_left = utils.DoubleBuffer() <NEW_LINE> self.image_buffer_right = utils.DoubleBuffer() <NEW_LINE> rospy.Subscriber('/{}/camera/zed/rgb/image_rect_color'.format(racecar_name), sensor_image, self....
This class handles the data for dual cameras
6259903dcad5886f8bdc5993
class Grammar(object): <NEW_LINE> <INDENT> __metaclass__ = GrammarBase <NEW_LINE> grammar = None <NEW_LINE> globals = None <NEW_LINE> def parse(self, source, ast, rule_name): <NEW_LINE> <INDENT> func_name = '%sRule' % rule_name <NEW_LINE> node.next_is(ast, ast) <NEW_LINE> dsl_parser.Parsing.oBaseParser.parsedStream(sou...
Base class for all grammars. This class turn any class A that inherit it into a grammar. Taking the description of the grammar in parameter it will add all what is what is needed for A to parse it.
6259903d07f4c71912bb0660
class Word(): <NEW_LINE> <INDENT> def __init__(self,w,b_links=None,f_links=None): <NEW_LINE> <INDENT> self.w = w <NEW_LINE> self.bkwrd_links = b_links if b_links else set([]) <NEW_LINE> self.frwrd_links = f_links if f_links else set([]) <NEW_LINE> <DEDENT> def getw(self): <NEW_LINE> <INDENT> return self.w <NEW_LINE> <D...
Word-Entity Attributes -- w : word itself bkwrd_links : words which have this word as their relational word. frwrd_links : words which are realtional to this word.
6259903d287bf620b6272e19
class UniqueClient(formencode.FancyValidator): <NEW_LINE> <INDENT> messages = { 'client_taken': 'Client already taken', } <NEW_LINE> def validate_python(self, value, state): <NEW_LINE> <INDENT> if state is not None and hasattr(state, 'session'): <NEW_LINE> <INDENT> clients =[] <NEW_LINE> cli = state.session.query(Clien...
Validate that the value is a unique client Name (i.e. the client does not already exist in the database). Requires an object to be passed in as ``state`` that contains a ``session`` attribute pointing to a SQLAlchemy Session object. The validator uses the Session object to access the database.
6259903d24f1403a926861e4
@dataclass <NEW_LINE> class LongformerMaskedLMOutput(ModelOutput): <NEW_LINE> <INDENT> loss: Optional[torch.FloatTensor] = None <NEW_LINE> logits: torch.FloatTensor = None <NEW_LINE> hidden_states: Optional[Tuple[torch.FloatTensor]] = None <NEW_LINE> attentions: Optional[Tuple[torch.FloatTensor]] = None <NEW_LINE> glob...
Base class for masked language models outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Masked language modeling (MLM) loss. logits (`torch.FloatTensor` of shape `(batch_size, sequence_length, config.vocab_size)`): Prediction scores of th...
6259903d8e05c05ec3f6f772
class mfaddoutsidefile(Package): <NEW_LINE> <INDENT> def __init__(self, model, name, extension, unitnumber): <NEW_LINE> <INDENT> Package.__init__( self, model, extension, name, unitnumber, allowDuplicates=True ) <NEW_LINE> self.parent.add_package(self) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return ...
Add a file for which you have a MODFLOW input file
6259903d16aa5153ce40171b
class APIStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.Listen = channel.unary_stream( '/proxy.API/Listen', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_proxy_dot_proxy__pb2.ListenRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_do...
Missing associated documentation comment in .proto file.
6259903d91af0d3eaad3b064
class CrmHome(APIView): <NEW_LINE> <INDENT> view_name = 'crm_home' <NEW_LINE> template_name = 'crm/index.html' <NEW_LINE> @method_decorator(login_required) <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> context = dict() <NEW_LINE> try: <NEW_LINE> <INDENT> print(1 / 0) <NEW_LINE> <DEDENT> except Exception as err...
后台首页
6259903d96565a6dacd2d8a2
class SACauchy(SimulatedAnnealingBase): <NEW_LINE> <INDENT> def __init__(self, func,lb,ub, x0, T_max=100, T_min=1e-7, L=300, max_stay_counter=150, **kwargs): <NEW_LINE> <INDENT> super().__init__(func,lb,ub, x0, T_max, T_min, L, max_stay_counter, **kwargs) <NEW_LINE> self.learn_rate = kwargs.get('m', 0.5) <NEW_LINE> <DE...
u ~ Uniform(-pi/2, pi/2, size=d) xc = learn_rate * T * tan(u) x_new = x_old + xc T_new = T0 / (1 + k)
6259903d76d4e153a661db8b
@register('role') <NEW_LINE> class RoleCheck(Check): <NEW_LINE> <INDENT> def __call__(self, target, creds, enforcer, current_rule=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> match = self.match % target <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> if 'roles' in creds:...
Check that there is a matching role in the ``creds`` dict.
6259903d15baa723494631c0
class VdtValueError(ValidateError): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> ValidateError.__init__(self, 'the value "%s" is unacceptable.' % (value,))
The value supplied was of the correct type, but was not an allowed value.
6259903d0a366e3fb87ddc14
class Conference(nb.Model): <NEW_LINE> <INDENT> name = ndb.StringProperty(required=True) <NEW_LINE> description = ndb.StringProperty() <NEW_LINE> organizerUserId = ndb.StringProperty() <NEW_LINE> topics = ndb.StringProperty(repeated = True) <NEW_LINE> city = ndb.StringProperty() <NEW_LINE> startDate = ndb.DateProperty(...
Conference Object
6259903db57a9660fecd2caa
class ListBands(Command): <NEW_LINE> <INDENT> command_name = 'list_posts' <NEW_LINE> option_list = ( Option('--title', '-t', dest='title'), ) <NEW_LINE> def run(self, title=None): <NEW_LINE> <INDENT> bands = Band.objects <NEW_LINE> if title: <NEW_LINE> <INDENT> bands = bands(title=title) <NEW_LINE> <DEDENT> for band in...
prints a list of bands
6259903d23849d37ff8522e9
class event_type(models.Model): <NEW_LINE> <INDENT> _name = 'event.type' <NEW_LINE> _description = 'Event Type' <NEW_LINE> name = fields.Char(string='Event Type', required=True) <NEW_LINE> default_reply_to = fields.Char(string='Default Reply-To', help="The email address of the organizer which is put in the 'Reply-To' o...
Event Type
6259903d71ff763f4b5e89cc
class EnvironmentBase(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_executable(self): <NEW_LINE> <INDENT> raise NotImplementedError()
Base class for all environments
6259903d8c3a8732951f7787
class _DesiredFunctionFound(BaseException): <NEW_LINE> <INDENT> pass
Exception to raise when expected function is found.
6259903d63f4b57ef008668c
class OnUpdateStatic(_OnUpdate): <NEW_LINE> <INDENT> update_type = 'static file' <NEW_LINE> def sync_pickup_file_in_ram(self, ctx): <NEW_LINE> <INDENT> self.server.static_config.read_file(ctx.file_path, ctx.file_name)
Updates a static resource in memory and file system.
6259903d8e05c05ec3f6f773
class Start: <NEW_LINE> <INDENT> def __get__(self, instance: Optional[CidLine], owner: Type[CidLine]) -> int: <NEW_LINE> <INDENT> return START_COLUMN.get(owner.__name__, 27)
The starting position for parsing a CID file line with a prefix.
6259903d94891a1f408ba00f
class BooleanValueField(Field): <NEW_LINE> <INDENT> widget = checkbox_button <NEW_LINE> def __init__(self, label=None, validators=None, **kwargs): <NEW_LINE> <INDENT> super(BooleanValueField, self).__init__(label, validators, **kwargs) <NEW_LINE> <DEDENT> def process_data(self, value): <NEW_LINE> <INDENT> self.data = b...
Represents an checkbox button
6259903d15baa723494631c2
class Solution: <NEW_LINE> <INDENT> def numDecodings(self, s): <NEW_LINE> <INDENT> if s[0] == '0': <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> n = len(s) <NEW_LINE> DP = [0] * n <NEW_LINE> DP[0] = 1 <NEW_LINE> for i in range(1, n): <NEW_LINE> <INDENT> if s[i] != '0': <NEW_LINE> <INDENT> DP[i] = DP[i-1] <NEW_LINE> ...
MY CODE VERSION Thought: Dynamic Programming template: State: DP[i] - number of ways to interpret a string at s[i] Transition: - DP[i] = DP[i-1] ----> s[i] 可以被翻译, s[i-1]+s[i] 不可以被翻译 - DP[i] = DP[i-2] ----> s[i] = 0, 但 s[i-1]+s[i] 在一起可以被翻译 - DP[i] = DP[i-1] + DP[i-2] ----> s[i] 可以被翻译, s[i-1]+...
6259903dd99f1b3c44d068d6
class ConvCnstrMODMaskDcpl_IterSM(ConvCnstrMODMaskDcplBase): <NEW_LINE> <INDENT> class Options(ConvCnstrMODMaskDcplBase.Options): <NEW_LINE> <INDENT> defaults = copy.deepcopy(ConvCnstrMODMaskDcplBase.Options.defaults) <NEW_LINE> def __init__(self, opt=None): <NEW_LINE> <INDENT> if opt is None: <NEW_LINE> <INDENT> opt =...
ADMM algorithm for Convolutional Constrained MOD with Mask Decoupling :cite:`heide-2015-fast` with the :math:`\mathbf{x}` step solved via iterated application of the Sherman-Morrison equation :cite:`wohlberg-2016-efficient`. | .. inheritance-diagram:: ConvCnstrMODMaskDcpl_IterSM :parts: 2 | Multi-channel signals...
6259903db57a9660fecd2cac
class AsyncBatchAnnotateImagesRequest(proto.Message): <NEW_LINE> <INDENT> requests = proto.RepeatedField( proto.MESSAGE, number=1, message="AnnotateImageRequest", ) <NEW_LINE> output_config = proto.Field(proto.MESSAGE, number=2, message="OutputConfig",) <NEW_LINE> parent = proto.Field(proto.STRING, number=4,)
Request for async image annotation for a list of images. Attributes: requests (Sequence[google.cloud.vision_v1.types.AnnotateImageRequest]): Required. Individual image annotation requests for this batch. output_config (google.cloud.vision_v1.types.OutputConfig): Required. The desired ou...
6259903db830903b9686ed92
class HashSchedulerTest(functional.FunctionalTest): <NEW_LINE> <INDENT> messages = 100 <NEW_LINE> def configure_tempesta(self): <NEW_LINE> <INDENT> functional.FunctionalTest.configure_tempesta(self) <NEW_LINE> for sg in self.tempesta.config.server_groups: <NEW_LINE> <INDENT> sg.sched = 'hash' <NEW_LINE> <DEDENT> <DEDEN...
Hash scheduler functional test, check that the same server connection is used for the same resource.
6259903d21a7993f00c6719f
class Sum(Aggregation): <NEW_LINE> <INDENT> def __init__(self, column_name): <NEW_LINE> <INDENT> self._column_name = column_name <NEW_LINE> <DEDENT> def get_aggregate_data_type(self, table): <NEW_LINE> <INDENT> return Number() <NEW_LINE> <DEDENT> def validate(self, table): <NEW_LINE> <INDENT> column = table.columns[sel...
Calculate the sum of a column containing :class:`.Number` data.
6259903da4f1c619b294f7a0
class RpMusicDefinitionsJson(_UniqueMcFileJsonMulti[ResourcePack]): <NEW_LINE> <INDENT> pack_path: ClassVar[str] = 'sounds/music_definitions.json' <NEW_LINE> def keys(self) -> Tuple[str, ...]: <NEW_LINE> <INDENT> result: List[str] = [] <NEW_LINE> if isinstance(self.json.data, dict): <NEW_LINE> <INDENT> for key in self....
music_definitions.json file.
6259903dd53ae8145f91968e
class Solution: <NEW_LINE> <INDENT> def fizzBuzz(self, n): <NEW_LINE> <INDENT> ret = [] <NEW_LINE> for i in range(1, n+1): <NEW_LINE> <INDENT> if i % 15 == 0: <NEW_LINE> <INDENT> ret.append("fizz buzz") <NEW_LINE> <DEDENT> elif i % 5 == 0: <NEW_LINE> <INDENT> ret.append("buzz") <NEW_LINE> <DEDENT> elif i % 3 == 0: <NEW...
@param n: An integer as description @return: A list of strings. For example, if n = 7, your code should return ["1", "2", "fizz", "4", "buzz", "fizz", "7"]
6259903d82261d6c527307dd
class ProgressFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, parent, labels, set_frame): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.set_frame = set_frame <NEW_LINE> self.parent = parent <NEW_LINE> self.buttons = [ Button( self, text=label, width=15, bg=REG_COLOR, activebackground=REG_COLOR, comm...
Mimic 'tabs' in a browser window control which edit window is showing
6259903d16aa5153ce401720
class DateTimeArg(DateArg): <NEW_LINE> <INDENT> def externalize(self, value: Optional[int]) -> str: <NEW_LINE> <INDENT> return formatTime(value)
Argument whose value is a date and a time.
6259903d50485f2cf55dc1b6
class Pyjo_Content_Single(Pyjo.Content.object, Pyjo.String.Mixin.object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Pyjo_Content_Single, self).__init__(**kwargs) <NEW_LINE> self.asset = notnone(kwargs.get('asset'), lambda: Pyjo.Asset.Memory.new(auto_upgrade=True)) <NEW_LINE> self.auto_...
:mod:`Pyjo.Content.Single` inherits all attributes and methods from :mod:`Pyjo.Content` and implements the following new ones.
6259903dd10714528d69efa5
class quasilinear_forward_euler(quasilinear_time_stepper): <NEW_LINE> <INDENT> def _step(self): <NEW_LINE> <INDENT> self.q = self.q + self.dt*self.A(self.t, self.q).dot(self.q)
The matrix A may be a function of time and state
6259903db57a9660fecd2cae
class Api: <NEW_LINE> <INDENT> def __init__(self, app=None, auth=None): <NEW_LINE> <INDENT> if app: <NEW_LINE> <INDENT> self.init_app(app, auth) <NEW_LINE> <DEDENT> <DEDENT> def init_app(self, app, auth=None): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> self.auth = auth <NEW_LINE> <DEDENT> def public(self, view): <NE...
Provides an abstraction from the rest API framework being used
6259903d07f4c71912bb0665
class change_dual_unit(models.TransientModel): <NEW_LINE> <INDENT> _name = 'change.dual.unit' <NEW_LINE> _description = 'Modification of the product dual unit' <NEW_LINE> _rec_name = 'product_id' <NEW_LINE> @api.model <NEW_LINE> def _dual_type_get(self): <NEW_LINE> <INDENT> return [ ('fixed', _('Fixed')), ('variable', ...
Wizard to change the product dual unit
6259903dec188e330fdf9acd
class Sys(object): <NEW_LINE> <INDENT> def Install(self): <NEW_LINE> <INDENT> print(' Running install.') <NEW_LINE> Utility.Utilities.MakeDir(HOME_BIN_DIR, 'pyhouse') <NEW_LINE> Utility.Utilities.MakeDir(CONFIG_DIR, 'pyhouse') <NEW_LINE> Utility.Utilities.MakeDir(LOG_DIR, 'pyhouse') <NEW_LINE> User._copy_bin_files()
This is a director that will run various installation sections.
6259903da79ad1619776b2b3
class TestGenderListResponse(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 testGenderListResponse(self): <NEW_LINE> <INDENT> model = kinow_client.models.gender_list_response.GenderListResponse()
GenderListResponse unit test stubs
6259903d379a373c97d9a25d
class SymbolNotFound(Exception): <NEW_LINE> <INDENT> pass
Raised when symbol cannot be found in table
6259903de76e3b2f99fd9c40
class Adaline(Perceptron): <NEW_LINE> <INDENT> def FitInternal(self, X, y): <NEW_LINE> <INDENT> nsamples = X.shape[0] <NEW_LINE> nfeatures = X.shape[1] <NEW_LINE> self.cost_ = [] <NEW_LINE> self.w_ = np.random.RandomState().normal(loc = 0.0, scale = 0.01, size = 1 + nfeatures) <NEW_LINE> self.PrintModel("initial random...
Adaline is a neural network which is like a perceptron with 2 differences both - The fitting is done wrt to the output of the activation function (real values), not the final (binary) classification values - In Adaline, changes to weights depends on all samples. That is w --sample1, sample2, ..., sample n--> w' --...
6259903d73bcbd0ca4bcb4be
class Drop(Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__('Drop') <NEW_LINE> self.requires(subsystems.elevator) <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> subsystems.elevator.down() <NEW_LINE> <DEDENT> def end(self): <NEW_LINE> <INDENT> subsystems.elevator.hold()
Drop command
6259903d82261d6c527307de
class Struct(common.SourceLocation): <NEW_LINE> <INDENT> def __init__(self, file_name, line, column): <NEW_LINE> <INDENT> self.name = None <NEW_LINE> self.description = None <NEW_LINE> self.strict = True <NEW_LINE> self.chained_types = [] <NEW_LINE> self.fields = [] <NEW_LINE> super(Struct, self).__init__(file_name, li...
IDL struct information. All fields are either required or have a non-None default.
6259903d004d5f362081f8fe
class Remote: <NEW_LINE> <INDENT> user = None <NEW_LINE> host = None <NEW_LINE> port = None <NEW_LINE> @typed <NEW_LINE> def __init__(self, user: str, host: str, port: numbers.Integral=22): <NEW_LINE> <INDENT> self.user = user <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> <DEDENT> def __eq__(self, ...
Remote node to SSH. :param user: the username to :program:`ssh` :type user: :class:`str` :param host: the host to access :type host: :class:`str` :param port: the port number to :program:`ssh`. the default is 22 which is the default :program:`ssh` port :type port: :class:`numbers.Integral`
6259903d63b5f9789fe863a1
class ListVpnGatewaysResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[VpnGateway]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ListVpnGatewaysResult, self).__init__(**kwargs) <NEW_...
Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink to get the next set of results. :param value: List of VpnGateways. :type value: list[~azure.mgmt.network.v2020_11_01.models.VpnGateway] :param next_link: URL to get the next set of operation list results if there are any. :...
6259903dd164cc61758221ab
class PolylineCommand(BaseCommand): <NEW_LINE> <INDENT> def __init__(self, document): <NEW_LINE> <INDENT> BaseCommand.__init__(self, document) <NEW_LINE> self.exception=[ExcPoint] <NEW_LINE> self.defaultValue=[None] <NEW_LINE> self.message=["Give Me A Point: "] <NEW_LINE> self.raiseStop=False <NEW_LINE> self.automaticA...
this class represents the polyline command
6259903d07f4c71912bb0667
class AverageNumberOfIndependentVoicesFeature(featuresModule.FeatureExtractor): <NEW_LINE> <INDENT> id = 'T2' <NEW_LINE> def __init__(self, dataOrStream=None, *arguments, **keywords): <NEW_LINE> <INDENT> super().__init__(dataOrStream=dataOrStream, *arguments, **keywords) <NEW_LINE> self.name = 'Average Number of Indepe...
Average number of different channels in which notes have sounded simultaneously. Rests are not included in this calculation. Here, Parts are treated as voices >>> s = corpus.parse('handel/rinaldo/lascia_chio_pianga') >>> fe = features.jSymbolic.AverageNumberOfIndependentVoicesFeature(s) >>> f = fe.extract() >>> f.vect...
6259903d21a7993f00c671a3
class RawModel: <NEW_LINE> <INDENT> _haar_detector = None <NEW_LINE> _hog_detector = None <NEW_LINE> _cnn_detector = None <NEW_LINE> _shape_predictor = None <NEW_LINE> _shape_predictor_small = None <NEW_LINE> @classmethod <NEW_LINE> def haar_detector(cls) -> cv2.CascadeClassifier: <NEW_LINE> <INDENT> if cls._haar_detec...
Raw Dlib and OpenCV detection models.
6259903d30c21e258be99a42
class DescribeL7HealthConfigResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.HealthConfig = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("HealthConfig") is not None: <NEW_LINE> <INDENT> self.HealthCon...
DescribeL7HealthConfig返回参数结构体
6259903d71ff763f4b5e89d2
class WidgetSettings(models.Model): <NEW_LINE> <INDENT> widgets_area = models.ForeignKey(WidgetsArea) <NEW_LINE> column = models.SmallIntegerField() <NEW_LINE> order = models.SmallIntegerField() <NEW_LINE> widget_class = models.CharField(max_length=30) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return "on wi...
Settings that specifies widget's position in selected area. The field 'widget_class' indicates Widget subclass defined in plugin.
6259903d8c3a8732951f778d
class Money: <NEW_LINE> <INDENT> def __init__(self, amount, currency): <NEW_LINE> <INDENT> self.amount = amount <NEW_LINE> self.currency = currency <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if self.currency.symbol: <NEW_LINE> <INDENT> return f"{self.currency.symbol}{self.amount:.{self.currency.digits}f...
Represents an amount of money. Requires an amount and a currency.
6259903d287bf620b6272e22
class DbLazy(DbProxy): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super(DbLazy, self).__init__(config) <NEW_LINE> self._backend = "lazydb" <NEW_LINE> self._db_name = self.config['storage_config'].get('cache_db_name') or 'cache_db_name' <NEW_LINE> self.db = Db(self._db_name) <NEW_LINE> self.set_...
Database proxy for LazyDB
6259903d1f5feb6acb163e29
class TensorInfo( tfx_namedtuple.namedtuple('TensorInfo', ['dtype', 'shape', 'temporary_asset_info'])): <NEW_LINE> <INDENT> def __new__( cls: Type['TensorInfo'], dtype: tf.dtypes.DType, shape: Sequence[Optional[int]], temporary_asset_info: Optional[TemporaryAssetInfo]) -> 'TensorInfo': <NEW_LINE> <INDENT> if not isinst...
A container for attributes of output tensors from analyzers. Fields: dtype: The TensorFlow dtype. shape: The shape of the tensor. temporary_asset_info: A named tuple containing information about the temporary asset file to write out while tracing the TF graph.
6259903d21bff66bcd723ea0
class Contracts(_ObjectWidgetBar): <NEW_LINE> <INDENT> pass
A model representing widget bar of the contract object
6259903d26068e7796d4db7d
class BreathDataGenerator(keras.utils.Sequence): <NEW_LINE> <INDENT> def __init__(self, directory, list_labels=['normal', 'deep', 'strong'], batch_size=32, dim=None, classes=None, shuffle=True): <NEW_LINE> <INDENT> self.directory = directory <NEW_LINE> self.list_labels = list_labels <NEW_LINE> self.dim = dim <NEW_LINE>...
Generates data for Keras
6259903ddc8b845886d547ec
class Map(collections.Mapping): <NEW_LINE> <INDENT> __slots__ = 'value', <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.value = dict(*args, **kwargs) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if not (isinstance(other, collections.Mapping) and len(self.value) == len(other...
As Python standard library doesn't provide immutable :class:`dict`, Nirum runtime itself need to define one.
6259903d15baa723494631c8
class SetLiveWatermarkStatusRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.WatermarkId = None <NEW_LINE> self.Status = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.WatermarkId = params.get("WatermarkId") <NEW_LINE> self.Status = params.get("...
SetLiveWatermarkStatus请求参数结构体
6259903d23e79379d538d736
class writeDouble_args(object): <NEW_LINE> <INDENT> def __init__(self, _v=None,): <NEW_LINE> <INDENT> self._v = _v <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: <NEW_LINE> <IND...
Attributes: - _v
6259903d10dbd63aa1c71e0e
class ArticleModelMethodTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> column = Column.objects.create(name='myColumn2') <NEW_LINE> tag = Tag.objects.create(name="myTag2") <NEW_LINE> self.article = Article.objects.create( title='my article', slug='my-article', column=column, tag=tag, summary='...
测试文章模型的方法
6259903d6e29344779b0188a
class VisualSemanticEmbedding(nn.Module): <NEW_LINE> <INDENT> def __init__(self, i_dim, t_dim, c_dim, margin=0.2, bow=False): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.i_dim = i_dim <NEW_LINE> self.t_dim = t_dim <NEW_LINE> self.c_dim = c_dim <NEW_LINE> self.bow = bow <NEW_LINE> self.margin = margin <NEW_LI...
The Visual Semantic embedding layer with ranking loss :meth:`torchutils.loss.contrastive_loss` Args: i_dim (int): dimension for image data t_dim (int): dimension for text data c_dim (int): dimension for embedding space margin (float, optional): margin for loss. Defaults to 0.2. bow (bool, optional)...
6259903d1f5feb6acb163e2b