code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class IEEESolrExport(IEEETask): <NEW_LINE> <INDENT> date = ClosestDateParameter(default=datetime.date.today()) <NEW_LINE> def requires(self): <NEW_LINE> <INDENT> return IEEEIntermediateSchema(date=self.date) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> output = shellout("""span-tag -c '{{"DE-15": {{"any": {{}...
Export to a SOLR compatible format.
62598ef5a8370b77170eec67
class YoloLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, anchor_mask=[], num_classes=0, anchors=[], num_anchors=1, stride=32, model_out=False): <NEW_LINE> <INDENT> super(YoloLayer, self).__init__() <NEW_LINE> self.anchor_mask = anchor_mask <NEW_LINE> self.num_classes = num_classes <NEW_LINE> self.anchors = an...
Yolo layer model_out: while inference,is post-processing inside or outside the model true:outside
62598ef58a349b6b43684ac4
class TestExpectations(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.expectations = [] <NEW_LINE> self.SetExpectations() <NEW_LINE> <DEDENT> def SetExpectations(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Fail(self, url_pattern, conditions=None, bug=None): <NEW_LINE> <INDENT> sel...
A class which defines the expectations for a page set test execution
62598ef599fddb7c1ca62245
class TestRunCommand(object): <NEW_LINE> <INDENT> def test_example(self, mocker): <NEW_LINE> <INDENT> mock = mocker.spy(util.subprocess, 'Popen') <NEW_LINE> util.run_command(args=['ls', '-l']) <NEW_LINE> mock.assert_called_once_with( ['ls', '-l'], stdout=util.DEVNULL, stderr=subprocess.PIPE) <NEW_LINE> <DEDENT> def tes...
Tests for the run_command function.
62598ef5cc0a2c1114479884
class WinEVTXFormatterTest(test_lib.EventFormatterTestCase): <NEW_LINE> <INDENT> def testInitialization(self): <NEW_LINE> <INDENT> event_formatter = winevtx.WinEVTXFormatter() <NEW_LINE> self.assertNotEqual(event_formatter, None) <NEW_LINE> <DEDENT> def testGetFormatStringAttributeNames(self): <NEW_LINE> <INDENT> event...
Tests for the Windows XML EventLog (EVTX) record event formatter.
62598ef58a43f66fc4bf09f8
class BadArgumentsError(Exception): <NEW_LINE> <INDENT> def __init__(self, callable, suggestion=""): <NEW_LINE> <INDENT> self.message = "{0} was called using incompatible arguments. {1}".format( callable, suggestion ) <NEW_LINE> super().__init__(self.message)
Raised when a function or method has been called with incompatible arguments. This can be used by developers to prevent bad usage of their functions or classes by other developers.
62598ef523849d37ff84f940
class MyDataset: <NEW_LINE> <INDENT> def __init__(self,dirImgPath,dataNum): <NEW_LINE> <INDENT> print("tagName >",end="") <NEW_LINE> tagName = input() <NEW_LINE> self.MyMakeDataSplit(dirImgPath,dataNum,tagName) <NEW_LINE> pass <NEW_LINE> <DEDENT> def MyMakeDataSplit(self,dirPath,dataNum,tagName): <NEW_LINE> <INDENT> di...
Please turn on the camera. And download Cascade Classifier. dirImgPath = "path/" tagName = "tagName" dataNum = 1000
62598ef560cbc95b06362bb9
class UserCustomQuotaArg(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_user_value', '_quota_gb_value', ] <NEW_LINE> _has_required_fields = True <NEW_LINE> def __init__(self, user=None, quota_gb=None): <NEW_LINE> <INDENT> self._user_value = bb.NOT_SET <NEW_LINE> self._quota_gb_value = bb.NOT_SET <NEW_LINE> if user is ...
User and their required custom quota in GB (1 TB = 1024 GB).
62598ef560cbc95b06362bba
class BadRepositoryURI(PublisherError): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return _("'%s' is not a valid URI.") % self.data
Used to indicate that a repository URI is not syntactically valid.
62598ef5adb09d7d5dc08e42
class ClusterUser: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def checkUser(user, strict=True): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> UserUtil.check_user_exist(user) <NEW_LINE> <DEDENT> except Exception as excep: <NEW_LINE> <INDENT> raise Excepti...
user utility for cluster
62598ef52c8b7c6e89bd2049
class ModelVisualizer(Visualizer): <NEW_LINE> <INDENT> def fit(self, X, y=None, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def predict(self, X): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def poof(self, model=None): <NEW_LINE> <INDENT> raise NotImplementedError( "Please specify how to render the model vi...
A model visualization accepts as input an unfitted Scikit-Learn estimator(s) and enables the user to visualize the performance of models across a range of hyperparameter values (e.g. using VisualGridsearch and ValidationCurve).
62598ef57d847024c075ac52
class RegisterForm(FlaskForm): <NEW_LINE> <INDENT> name = StringField( label="账号", validators=[ DataRequired("账号不能为空") ], description="账号", render_kw={ "class": "form-control", "placeholder": "请输入账号" } ) <NEW_LINE> password = PasswordField( label="密码", validators=[ DataRequired("密码不能为空") ], description="密码", render_kw=...
注册表单:账号、密码、确认密码、验证码、注册按钮
62598ef57c178a314d78bd1c
class Softplus: <NEW_LINE> <INDENT> def __init__(self, x): <NEW_LINE> <INDENT> components.append(self) <NEW_LINE> self.x = x <NEW_LINE> self.grad = None if x.grad is None else DT(0) <NEW_LINE> <DEDENT> def forward(self): <NEW_LINE> <INDENT> self.value = np.log(1. + np.exp(self.x.value)) <NEW_LINE> <DEDENT> def backward...
Class Name: Softplus Class Usage: compute the elementwise Softplus activation. Class Functions: forward: compute activation y_{i} for all i. backward: compute the derivative w.r.t input vector/matrix x
62598ef5236d856c2adc885a
class GosuTemplateLexer(Lexer): <NEW_LINE> <INDENT> name = 'Gosu Template' <NEW_LINE> aliases = ['gst'] <NEW_LINE> filenames = ['*.gst'] <NEW_LINE> mimetypes = ['text/x-gosu-template'] <NEW_LINE> lexer = GosuLexer() <NEW_LINE> def get_tokens_unprocessed(self, text): <NEW_LINE> <INDENT> stack = ['templateText'] <NEW_LIN...
For Gosu templates. *New in Pygments 1.5.*
62598ef5aad79263cf42d092
class StyleAdapter(logging.LoggerAdapter): <NEW_LINE> <INDENT> def __init__(self, logger, extra=None): <NEW_LINE> <INDENT> super(StyleAdapter, self).__init__(logger, extra or {}) <NEW_LINE> <DEDENT> def log(self, level, msg, *args, **kwargs): <NEW_LINE> <INDENT> if self.isEnabledFor(level): <NEW_LINE> <INDENT> msg, kwa...
"Use .format {} style logging rather than %.
62598ef5adb09d7d5dc08e43
class PutRecordsRequestParams(RequestParams): <NEW_LINE> <INDENT> __slots__ = '_record_list' <NEW_LINE> action = 'pub' <NEW_LINE> def __init__(self, record_list): <NEW_LINE> <INDENT> self._record_list = record_list <NEW_LINE> <DEDENT> @property <NEW_LINE> def record_list(self): <NEW_LINE> <INDENT> return self._record_l...
Request params of put records api
62598ef5009cb60464cffdd4
class SelectInvalidAction(pyblish.api.Action): <NEW_LINE> <INDENT> label = "Select invalid" <NEW_LINE> on = "failed" <NEW_LINE> icon = "search" <NEW_LINE> def process(self, context, plugin): <NEW_LINE> <INDENT> from maya import cmds <NEW_LINE> errored_instances = _get_errored_instances_from_context(context) <NEW_LINE> ...
Select invalid nodes in Maya when plug-in failed. To retrieve the invalid nodes this assumes a static `get_invalid()` method is available on the plugin.
62598ef58a43f66fc4bf09fa
class Pipeline(object): <NEW_LINE> <INDENT> def __init__(self, source=None): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self.generator() <NEW_LINE> <DEDENT> def generator(self): <NEW_LINE> <INDENT> while self.has_next(): <NEW_LINE> <INDENT> try: <NEW_LINE...
Common pipeline class fo all pipeline tasks.
62598ef55fdd1c0f98e5c829
class CombinationSuspend(Suspend): <NEW_LINE> <INDENT> def __init__(self, children): <NEW_LINE> <INDENT> self.children = children <NEW_LINE> <DEDENT> def cancel(self): <NEW_LINE> <INDENT> for c in self.children: <NEW_LINE> <INDENT> c.cancel()
CombinationSuspend(children) -> new instance A CombinationSuspend composes multiple nested suspends This class provides a standartized attribute for holding the "children" this suspend composes and an implementation of the cancel() method; apply() is kept abstract.
62598ef521bff66bcd7214db
class Section: <NEW_LINE> <INDENT> def __init__(self, section, contains=None): <NEW_LINE> <INDENT> self.section = section <NEW_LINE> self.str = [block() for block in self.section] <NEW_LINE> self.constants = [x for x in self.section if not x.variable] <NEW_LINE> self.constants_str = [constant() for constant in self.con...
A class for storing lists of `Blocks`. Doing it this way allows to group `Blocks` depending on their attributes.
62598ef5f9cc0f698b1c4712
class GattoolConnection(Connection): <NEW_LINE> <INDENT> def __init__(self, controller='hci0'): <NEW_LINE> <INDENT> Connection.__init__(self) <NEW_LINE> self.backend = lambda: pygatt.GATTToolBackend(hci_device=controller) <NEW_LINE> self._conn_hnd = None <NEW_LINE> <DEDENT> def connect(self, hub_mac=None, hub_name=None...
Used for connecting to :type _conn_hnd: pygatt.backends.bgapi.device.BGAPIBLEDevice
62598ef58a349b6b43684ac7
class MealLocation(models.Model, OrmExtensions): <NEW_LINE> <INDENT> _name = 'meal.location' <NEW_LINE> _description = 'The location where a meal will be served' <NEW_LINE> _inherit = ['descriptor.mixin', 'image.mixin'] <NEW_LINE> _sql_constraints = [ ('meal_location_key_unique', 'unique (key)', 'The name of this recor...
A dining location Note: create multi
62598ef53317a56b869bd9a8
class CurrentWorkItemsValues(value.ValuesMixin): <NEW_LINE> <INDENT> @property <NEW_LINE> def values(self): <NEW_LINE> <INDENT> intids = zope.component.getUtility(IIntIds, context=self.context) <NEW_LINE> oid = intids.queryId(self.context) <NEW_LINE> if oid: <NEW_LINE> <INDENT> query = SearchQuery(AnyOf('workflow-relev...
Adapter to get table values.
62598ef526068e7796d4b1e1
@python_2_unicode_compatible <NEW_LINE> class ArticleRevision(BaseRevisionMixin, models.Model): <NEW_LINE> <INDENT> article = models.ForeignKey('Article', on_delete=models.CASCADE, verbose_name=_('article')) <NEW_LINE> content = models.TextField(blank=True, verbose_name=_('article contents')) <NEW_LINE> title = models....
This is where main revision data is stored. To make it easier to copy, do NEVER create m2m relationships.
62598ef55fcc89381b26556b
class InputExample(object): <NEW_LINE> <INDENT> def __init__(self, guid, text_a, text_b=None, label=None): <NEW_LINE> <INDENT> self.guid = guid <NEW_LINE> self.text_a = text_a <NEW_LINE> self.text_b = text_b <NEW_LINE> self.label = label
A single training/test example for simple sequence classification.
62598ef5dc8b845886d51e4a
class Tags(Resource): <NEW_LINE> <INDENT> def create(self, label_id): <NEW_LINE> <INDENT> data = { 'type': 'tagit', 'rate_count': 0, 'rate_range': 'day', 'limit_count': 0, 'limit_range': 'day', 'schedule': [], 'enabled': True, 'args': { 'sn': label_id, 'tag_sn': label_id } } <NEW_LINE> return self._post( request=ApiAct...
A class for dealing with tags Tags have one or more labels.
62598ef5fff4ab517ebcc05d
class List(Raw): <NEW_LINE> <INDENT> def __init__(self, cls_or_instance, **kwargs): <NEW_LINE> <INDENT> super(List, self).__init__(**kwargs) <NEW_LINE> if isinstance(cls_or_instance, type): <NEW_LINE> <INDENT> if not issubclass(cls_or_instance, FieldABC): <NEW_LINE> <INDENT> raise MarshallingError("The type of the list...
A list field. Example: :: numbers = fields.List(fields.Float) :param cls_or_instance: A field class or instance.
62598ef54527f215b58e8787
class TrainDatasetDataLoader: <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.bs = args.batch_size * args.D_iters + args.eval_size <NEW_LINE> if 'rsgan' in args.g_loss_mode: <NEW_LINE> <INDENT> self.bs += args.batch_size <NEW_LINE> <DEDENT> if 'fitness' in args.g_loss_...
Wrapper class of Dataset class that performs multi-threaded data loading
62598ef57047854f4633dc4e
@SimilarityFunction.register("dot_product") <NEW_LINE> class DotProductSimilarity(SimilarityFunction): <NEW_LINE> <INDENT> def __init__(self, scale_output: bool = False) -> None: <NEW_LINE> <INDENT> super(DotProductSimilarity, self).__init__() <NEW_LINE> self._scale_output = scale_output <NEW_LINE> <DEDENT> @overrides ...
This similarity function simply computes the dot product between each pair of vectors, with an optional scaling to reduce the variance of the output elements. Parameters ---------- scale_output : ``bool``, optional If ``True``, we will scale the output by ``math.sqrt(tensor.size(-1))``, to reduce the variance ...
62598ef571ff763f4b5e5fe6
class NullAction (Action): <NEW_LINE> <INDENT> def __init__ (self, manager, prop_set): <NEW_LINE> <INDENT> Action.__init__ (self, manager, [], None, prop_set) <NEW_LINE> <DEDENT> def actualize (self): <NEW_LINE> <INDENT> if not self.actualized_: <NEW_LINE> <INDENT> self.actualized_ = True <NEW_LINE> for i in self.targe...
Action class which does nothing --- it produces the targets with specific properties out of nowhere. It's needed to distinguish virtual targets with different properties that are known to exist, and have no actions which create them.
62598ef57b180e01f3e48489
class RadauQuadratureLineRule(QuadratureRule): <NEW_LINE> <INDENT> def __init__(self, ref_el, m, right=True): <NEW_LINE> <INDENT> assert m >= 1 <NEW_LINE> N = m - 1 <NEW_LINE> x = -numpy.cos(2 * numpy.pi * numpy.linspace(0, N, m) / (2 * N + 1)) <NEW_LINE> P = numpy.zeros((N + 1, N + 2)) <NEW_LINE> xold = 2 <NEW_LINE> f...
Produce the Gauss--Radau quadrature rules on the interval using an adaptation of Winkel's Matlab code. The quadrature rule uses m points for a degree of precision of 2m-1.
62598ef592d797404e387fbf
class DecodeLayers(nn.Module): <NEW_LINE> <INDENT> def __init__(self,size,self_attn,src_attn,feed_forward,dropout): <NEW_LINE> <INDENT> super(DecodeLayers, self).__init__() <NEW_LINE> self.size = size <NEW_LINE> self.self_attn = self_attn <NEW_LINE> self.src_attn = src_attn <NEW_LINE> self.feed_forward = feed_forward <...
Decode is made of self-attn,src-attn and feed-forward
62598ef51f5feb6acb1614da
class AzureFirewallApplicationRuleProtocol(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'port': {'maximum': 64000, 'minimum': 0}, } <NEW_LINE> _attribute_map = { 'protocol_type': {'key': 'protocolType', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, } <NEW_LINE> def __init__( self, **kwargs...
Properties of the application rule protocol. :param protocol_type: Protocol type. Possible values include: "Http", "Https". :type protocol_type: str or ~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRuleProtocolType :param port: Port number for the protocol, cannot be greater than 64000. This field is...
62598ef5ec188e330fdf712f
class Aida(Package): <NEW_LINE> <INDENT> homepage = "http://aida.freehep.org/" <NEW_LINE> url = "ftp://ftp.slac.stanford.edu/software/freehep/AIDA/v3.2.1/aida-3.2.1.tar.gz" <NEW_LINE> version('3.2.1', sha256='c51da83e99c0985a7ef3e8bc5a60c3ae61f3ca603b61100c2438b4cdadd5bb2e') <NEW_LINE> def install(self, spec, pref...
Abstract Interfaces for Data Analysis
62598ef5a8370b77170eec6a
class TestCookieSessions(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> from django.contrib.auth.models import User <NEW_LINE> user = User.objects.create_user('testuser', 'test@example.com', 'secret') <NEW_LINE> user.is_staff = True <NEW_LINE> user.save() <NEW_LINE> <DEDENT> def testLogin(self): <N...
Unit tests for cookiesessions
62598ef599cbb53fe682f735
class Binomial(LikelihoodFunction): <NEW_LINE> <INDENT> def __init__(self,link=None): <NEW_LINE> <INDENT> self._analytical = link_functions.Probit <NEW_LINE> if not link: <NEW_LINE> <INDENT> link = self._analytical <NEW_LINE> <DEDENT> super(Binomial, self).__init__(link) <NEW_LINE> <DEDENT> def _distribution(self,gp,ob...
Probit likelihood Y is expected to take values in {-1,1} ----- $$ L(x) = \Phi (Y_i*f_i) $$
62598ef58da39b475be01a36
class Result(IntEnum): <NEW_LINE> <INDENT> OKEY = 0 <NEW_LINE> BAD_COMMAND = 1 <NEW_LINE> RESOURCE_NOT_FOUND = 2 <NEW_LINE> ACCESS_DENIED = 5 <NEW_LINE> NOT_READY = 21 <NEW_LINE> TIMEOUT = 258 <NEW_LINE> INTERNAL_SERVER_ERROR = 500
Server response codes.
62598ef563b5f9789fe839e4
class AnnealingSchedule: <NEW_LINE> <INDENT> def __init__(self, start=1.0, end=0.1, decay_steps=500, decay_type="linear"): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> self.decay_steps = decay_steps <NEW_LINE> self.annealed_value = np.linspace(start, end, decay_steps) <NEW_LINE> self.deca...
Scheduling the gradually decreasing value, e.g., epsilon or beta params
62598ef51b99ca400228e952
class Choice(models.Model): <NEW_LINE> <INDENT> question = models.ForeignKey('Question', on_delete=models.CASCADE) <NEW_LINE> text = models.TextField() <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return f'{self.question}'
Model defnition for Choice.
62598ef5796e427e5384d020
class MetaAttribute(BaseModel): <NEW_LINE> <INDENT> attribute_type_id: CURIE <NEW_LINE> attribute_source: Optional[str] <NEW_LINE> original_attribute_names: Optional[HashableSequence[str]] <NEW_LINE> constraint_use: Optional[bool] = False <NEW_LINE> constraint_name: Optional[str]
MetaAttribute.
62598ef53317a56b869bd9a9
class InvenioOAuth2ServerREST(object): <NEW_LINE> <INDENT> def __init__(self, app=None, **kwargs): <NEW_LINE> <INDENT> if app: <NEW_LINE> <INDENT> self.init_app(app, **kwargs) <NEW_LINE> <DEDENT> <DEDENT> def init_app(self, app, **kwargs): <NEW_LINE> <INDENT> self.init_config(app) <NEW_LINE> allowed_urlencode_chars = a...
Invenio-OAuth2Server REST extension.
62598ef5bf627c535bcafcf9
class PCA(object): <NEW_LINE> <INDENT> def __init__(self, k=3, svdmethod='direct'): <NEW_LINE> <INDENT> self.k = k <NEW_LINE> self.svdmethod = svdmethod <NEW_LINE> <DEDENT> def fit(self, data): <NEW_LINE> <INDENT> if type(data) is not RowMatrix: <NEW_LINE> <INDENT> data = RowMatrix(data) <NEW_LINE> <DEDENT> data.center...
Perform principal components analysis using the singular value decomposition Parameters ---------- k : int Number of principal components to estimate svdmethod : str, optional, default = "direct" Which method to use for performing the SVD Attributes ---------- `comps` : array, shape (k, ncols) The k prin...
62598ef599fddb7c1ca62247
class IngressClassSpec(_kuber_definitions.Definition): <NEW_LINE> <INDENT> def __init__( self, controller: str = None, parameters: "TypedLocalObjectReference" = None, ): <NEW_LINE> <INDENT> super(IngressClassSpec, self).__init__( api_version="networking/v1", kind="IngressClassSpec" ) <NEW_LINE> self._properties = { "co...
IngressClassSpec provides information about the class of an Ingress.
62598ef576e4537e8c3ede3f
class QueuedRunner(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.q = q = Queue(maxsize=100) <NEW_LINE> self.sample_channel = getattr(settings, 'SENTRY_TAGSTORE_MULTI_SAMPLING', 1.0) <NEW_LINE> def worker(): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> (func, args, kwargs) = q.get() <N...
Secondary backend runner that puts method calls on a bounded queue and drops them when the queue is full. A separate (non-main) thread works the queue.
62598ef532920d7e50bc48b4
class SystemInfoWidget(PanelWidget): <NEW_LINE> <INDENT> fps = NumericProperty() <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> global_w, global_h = Window.size <NEW_LINE> width, height = int(global_w * 0.115), int(global_h * 0.08) <NEW_LINE> kwargs['pos'] = (global_w - width - 15, global_h - height - 15)...
Build-in widget showing system info. The fields are: FPS Current frames per second speed (for GUI). SPS Current steps per second speed (for simulation). Speed How many steps are skipped each frame. Time Global timestep counter.
62598ef566673b3332c2ec34
class ContentItemRelation(GenericRelation): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(ContentItemRelation, self).__init__(to=ContentItem, object_id_field='parent_id', content_type_field='parent_type', **kwargs) <NEW_LINE> <DEDENT> def bulk_related_objects(self, objs, using=DEFAULT_DB_A...
A :class:`~django.contrib.contenttypes.generic.GenericRelation` which can be applied to a parent model that is expected to be referenced by the :class:`~fluent_contents.models.ContentItem` classes. For example: .. code-block:: python class Page(models.Model): contentitem_set = ContentItemRelation() Addin...
62598ef59c8ee8231303f59f
class BBinnyHeap(object): <NEW_LINE> <INDENT> def __init__(self, iterable=None): <NEW_LINE> <INDENT> self.list_heap = [] <NEW_LINE> self.size = 0 <NEW_LINE> if iterable: <NEW_LINE> <INDENT> for val in iterable: <NEW_LINE> <INDENT> self.push(val) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def _perc_up(self, val): <NEW_LINE> ...
The Binary Heap Class. __init__([iterable]): takes an optional iterable object when instantiating the class. _perc_ip(val): Send the value up the heap as it is pushed in. push(val): Append a value to the end of the list, increase list size, push the index that is equal to size, up the list. _perc_down(val): Send a val...
62598ef592d797404e387fc0
class CapsConv(object): <NEW_LINE> <INDENT> def __init__(self, num_units, with_routing=True): <NEW_LINE> <INDENT> self.num_units = num_units <NEW_LINE> self.with_routing = with_routing <NEW_LINE> <DEDENT> def __call__(self, input, num_outputs, kernel_size=None, stride=None): <NEW_LINE> <INDENT> self.num_outputs = num_o...
Capsule layer. Args: input: A 4-D tensor. num_units: integer, the length of the output vector of a capsule. with_routing: boolean, this capsule is routing with the lower-level layer capsule. num_outputs: the number of capsule in this layer. Returns: A 4-D tensor.
62598ef5f548e778e5969e15
class InstancesListResponse(_messages.Message): <NEW_LINE> <INDENT> items = _messages.MessageField('DatabaseInstance', 1, repeated=True) <NEW_LINE> kind = _messages.StringField(2, default=u'sql#instancesList') <NEW_LINE> nextPageToken = _messages.StringField(3)
Database instances list response. Fields: items: List of database instance resources. kind: This is always sql#instancesList. nextPageToken: The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
62598ef61f5feb6acb1614dc
class CommonOptions: <NEW_LINE> <INDENT> def __init__(self, define_common_options, suffix_precedence): <NEW_LINE> <INDENT> self.define_common_options = define_common_options <NEW_LINE> self.suffix_precedence = suffix_precedence <NEW_LINE> self.common_options = dict() <NEW_LINE> self.append_options = set() <NEW_LINE> se...
Support class to allow specifying common options directly after the top-level command. Normally options can only be specified on the parser defining them, which means that generally speaking *all* options go after all sub-commands. This is annoying for common options in scripts, e.g. --remote-path or logging options. ...
62598ef62c8b7c6e89bd204d
class LinearEstimator(estimator.Estimator): <NEW_LINE> <INDENT> def __init__(self, head, feature_columns, model_dir=None, optimizer='Ftrl', config=None, partitioner=None, sparse_combiner='sum'): <NEW_LINE> <INDENT> def _model_fn(features, labels, mode, config): <NEW_LINE> <INDENT> return linear_lib._linear_model_fn( fe...
An estimator for TensorFlow linear models with user-specified head. Example: ```python categorical_column_a = categorical_column_with_hash_bucket(...) categorical_column_b = categorical_column_with_hash_bucket(...) categorical_feature_a_x_categorical_feature_b = crossed_column(...) # Estimator using the default opt...
62598ef68da39b475be01a38
class FIR(BaseFilter): <NEW_LINE> <INDENT> symmetry = Symmetry.T(xmltagname='Symmetry') <NEW_LINE> numerator_coefficient_list = List.T( NumeratorCoefficient.T(xmltagname='NumeratorCoefficient'))
Response: FIR filter. Corresponds to SEED blockette 61. FIR filters are also commonly documented using the Coefficients element.
62598ef6a8370b77170eec6c
class Battery(): <NEW_LINE> <INDENT> def __init__(self, battery_size=70): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size) + 'kwh battery.') <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDEN...
将子类电动车特有的属性单独归为一类
62598ef6796e427e5384d022
class DescribeCallInMetricsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Timestamp = None <NEW_LINE> self.TotalMetrics = None <NEW_LINE> self.NumberMetrics = None <NEW_LINE> self.SkillGroupMetrics = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(se...
DescribeCallInMetrics返回参数结构体
62598ef601c39578d7f1162c
class WindDirection(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'winddirections' <NEW_LINE> id = Column(Integer, autoincrement=True, primary_key=True) <NEW_LINE> values = Column(ARRAY(Float), nullable=False) <NEW_LINE> times = Column(ARRAY(DateTime), nullable=False) <NEW_LINE> date = Column(Date, nullable=False) <NE...
Wind direction storage.
62598ef65fc7496912d476b7
class ncf_gen(rv_continuous): <NEW_LINE> <INDENT> def _rvs(self, dfn, dfd, nc): <NEW_LINE> <INDENT> return self._random_state.noncentral_f(dfn, dfd, nc, self._size) <NEW_LINE> <DEDENT> def _pdf_skip(self, x, dfn, dfd, nc): <NEW_LINE> <INDENT> n1, n2 = dfn, dfd <NEW_LINE> term = -nc/2+nc*n1*x/(2*(n2+n1*x)) + gamln(n1/2....
A non-central F distribution continuous random variable. %(before_notes)s Notes ----- The probability density function for `ncf` is:: ncf.pdf(x, df1, df2, nc) = exp(nc/2 + nc*df1*x/(2*(df1*x+df2))) * df1**(df1/2) * df2**(df2/2) * x**(df1/2-1) * (df2+df1*x)**(-(df1+df2)/2) * ...
62598ef68a43f66fc4bf09fe
class ExportBruteAttacksRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Filters = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Filters") is not None: <NEW_LINE> <INDENT> self.Filters = [] <NEW_LINE> for item in params.get("Filters")...
ExportBruteAttacks请求参数结构体
62598ef621bff66bcd7214df
class TestPredictionStockPrice(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.goog_data = pd.read_csv('Google.csv', sep=',') <NEW_LINE> self.amzn_data = pd.read_csv('Amazon.csv', sep=',') <NEW_LINE> self.mic_data = pd.read_csv('Microsoft.csv', sep=',') <NEW_LINE> <DEDENT> def test_dat...
Unit tests data availability
62598ef64428ac0f6e656dd6
class IntegerGenrator(object): <NEW_LINE> <INDENT> def __init__(self, dataConf): <NEW_LINE> <INDENT> self.dataConf=dataConf <NEW_LINE> <DEDENT> def getRandom(self,count=0): <NEW_LINE> <INDENT> if self.dataConf.pattern == 'Random_normal': <NEW_LINE> <INDENT> if self.dataConf.step is None: <NEW_LINE> <INDENT> return rand...
classdocs
62598ef63d592f4c4edb9776
@Declarations.register(Declarations.Model) <NEW_LINE> class Attachment: <NEW_LINE> <INDENT> pass
Name space for the attachment models
62598ef6097d151d1a2bf8ac
class Tag(object): <NEW_LINE> <INDENT> def __init__(self, tagClass, tagFormat, tagId): <NEW_LINE> <INDENT> if tagId < 0: <NEW_LINE> <INDENT> raise error.PyAsn1Error('Negative tag ID (%s) not allowed' % tagId) <NEW_LINE> <DEDENT> self.__tagClass = tagClass <NEW_LINE> self.__tagFormat = tagFormat <NEW_LINE> self.__tagId ...
Create ASN.1 tag Represents ASN.1 tag that can be attached to a ASN.1 type to make types distinguishable from each other. *Tag* objects are immutable and duck-type Python :class:`tuple` objects holding three integer components of a tag. Parameters ---------- tagClass: :py:class:`int` Tag *class* value tagFormat...
62598ef699fddb7c1ca62248
class IdleDetector(Component): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__idle_timer = None <NEW_LINE> self.__is_idle = False <NEW_LINE> Component.__init__(self) <NEW_LINE> <DEDENT> def __go_idle(self): <NEW_LINE> <INDENT> self.__is_idle = True <NEW_LINE> self.__idle_timer = None <NEW_LINE> logg...
Component responsible for putting the application into idle mode for saving battery.
62598ef660cbc95b06362bbf
class SteamAccount(Entity): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return "SteamAccount(account_id = {})".format(self['id32']) <NEW_LINE> <DEDENT> def __bool__(self): <NEW_LINE> <INDENT> return self['id32'] != None <NEW_LINE> <DEDENT> def __init__(self, account_id): <NEW_LINE> <INDENT> if account_i...
Wrapper to implicitly store steam32 and steam64 account IDs Attributes ---------- id32 : int 32-bit Steam ID id64 : int 64-bit Steam ID
62598ef6d486a94d0ba2a852
class AnnotatedSentence(): <NEW_LINE> <INDENT> def __init__(self, annotated_words): <NEW_LINE> <INDENT> self.words = annotated_words <NEW_LINE> <DEDENT> def at(self, index): <NEW_LINE> <INDENT> if index >= len(self.words) or index < 0: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return self.words[index] <NEW_LI...
Container for annotated words.
62598ef632920d7e50bc48b7
class SFTPUploader: <NEW_LINE> <INDENT> def __init__(self, host: str, port: int, username: str, password: str): <NEW_LINE> <INDENT> transport = paramiko.Transport((host, port)) <NEW_LINE> transport.connect( username=username, password=password, ) <NEW_LINE> self._sftp_client = paramiko.SFTPClient.from_transport(transpo...
Class for uploading new file to server via SFTP connection.
62598ef67c178a314d78bd21
class ReleaseCommand(Command): <NEW_LINE> <INDENT> user_options = [('sign', 's', 'GPG-sign the Git tag and release files')] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> self.sign = False <NEW_LINE> <DEDENT> def finalize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def run(self): <NEW_LINE...
Tag and push a new release.
62598ef692d797404e387fc1
class EditUserInfo(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["user_id", "message", "entities"] <NEW_LINE> ID = 0x66b91b70 <NEW_LINE> QUALNAME = "functions.help.EditUserInfo" <NEW_LINE> def __init__(self, *, user_id: "raw.base.InputUser", message: str, entities: List["raw.base.MessageEntity"]) -> None: <NEW...
Telegram API method. Details: - Layer: ``122`` - ID: ``0x66b91b70`` Parameters: user_id: :obj:`InputUser <pyrogram.raw.base.InputUser>` message: ``str`` entities: List of :obj:`MessageEntity <pyrogram.raw.base.MessageEntity>` Returns: :obj:`help.UserInfo <pyrogram.raw.base.help.UserInfo>`
62598ef656ac1b37e6300a77
class ShowLogfile(object): <NEW_LINE> <INDENT> def __init__(self, iface): <NEW_LINE> <INDENT> self.iface = iface <NEW_LINE> self.icon_path = ":/plugins/ThreeDiToolbox/icons/icon_logfile.png" <NEW_LINE> self.menu_text = "Show logfile" <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> title = "Show logfile" <NEW_LIN...
Show link to the logfile.
62598ef667a9b606de544859
class IoK8sApiCoreV1PersistentVolume(object): <NEW_LINE> <INDENT> swagger_types = { 'api_version': 'str', 'kind': 'str', 'metadata': 'IoK8sApimachineryPkgApisMetaV1ObjectMeta', 'spec': 'IoK8sApiCoreV1PersistentVolumeSpec', 'status': 'IoK8sApiCoreV1PersistentVolumeStatus' } <NEW_LINE> attribute_map = { 'api_version': 'a...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ef63539df3088ecab37
class TestRootCommanad(): <NEW_LINE> <INDENT> def mock_usage(self, cmd): <NEW_LINE> <INDENT> usage = PropertyMock() <NEW_LINE> type(cmd).usage = usage <NEW_LINE> return usage <NEW_LINE> <DEDENT> def test_root_usage(self, root): <NEW_LINE> <INDENT> doc = root.usage <NEW_LINE> assert "success Command that returns 0." in...
Tests the root command.
62598ef62c8b7c6e89bd204f
class IncrementalTaskScheduler: <NEW_LINE> <INDENT> def __init__(self, tasks, success_threshold=2): <NEW_LINE> <INDENT> self.tasks = tasks <NEW_LINE> self.task_ptr = 0 <NEW_LINE> self.reward_count = 0 <NEW_LINE> self.success_threshold = success_threshold <NEW_LINE> <DEDENT> def get_next_task(self): <NEW_LINE> <INDENT> ...
Switches to the next task type sequentially After the current task was successfully learned N times
62598ef6f548e778e5969e17
class WeatherEntity(Entity): <NEW_LINE> <INDENT> @property <NEW_LINE> def temperature(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @property <NEW_LINE> def temperature_unit(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @property <NEW_LINE> def pressure(self): <...
ABC for a weather data.
62598ef663b5f9789fe839e9
class EntityID( object ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.siteID = 0 <NEW_LINE> self.applicationID = 0 <NEW_LINE> self.entityID = 0 <NEW_LINE> <DEDENT> def serialize(self, outputStream): <NEW_LINE> <INDENT> outputStream.write_unsigned_short(self.siteID); <NEW_LINE> outputStream.write_un...
more laconically named EntityIdentifier
62598ef64c34283577618b70
class LogisticRegressionSummary(JavaCallable): <NEW_LINE> <INDENT> @property <NEW_LINE> @since("2.0.0") <NEW_LINE> def predictions(self): <NEW_LINE> <INDENT> return self._call_java("predictions") <NEW_LINE> <DEDENT> @property <NEW_LINE> @since("2.0.0") <NEW_LINE> def probabilityCol(self): <NEW_LINE> <INDENT> return sel...
Abstraction for Logistic Regression Results for a given model. .. versionadded:: 2.0.0
62598ef6a8370b77170eec6e
class CalDAVResource(DAVResource, LoggingMixIn): <NEW_LINE> <INDENT> def davComplianceClasses(self): <NEW_LINE> <INDENT> return ( tuple(super(CalDAVResource, self).davComplianceClasses()) + config.CalDAVComplianceClasses ) <NEW_LINE> <DEDENT> supportedCalendarComponentSet = caldavxml.SupportedCalendarComponentSet( *[ca...
CalDAV resource.
62598ef65fc7496912d476b8
class W10(VOTableSpecWarning): <NEW_LINE> <INDENT> message = "Unknown tag '%s'. Ignoring" <NEW_LINE> default_args = ('x',)
The parser has encountered an element that does not exist in the specification, or appears in an invalid context. Check the file against the VOTable schema (with a tool such as `xmllint <http://xmlsoft.org/xmllint.html>`__. If the file validates against the schema, and you still receive this warning, this may indicat...
62598ef68a43f66fc4bf0a00
@python_2_unicode_compatible <NEW_LINE> class Project(AbstractArticle): <NEW_LINE> <INDENT> description = models.TextField(null=True) <NEW_LINE> tags = models.ManyToManyField(Tag, related_name="projects", blank=True) <NEW_LINE> thumbnail_image = ThumbnailerImageField(upload_to=readable_name_to_path('images'), null=True...
Post for blogging.
62598ef62c8b7c6e89bd2050
class MetaSearchPlugin(object): <NEW_LINE> <INDENT> def __init__(self, iface): <NEW_LINE> <INDENT> self.iface = iface <NEW_LINE> self.context = StaticContext() <NEW_LINE> self.action_run = None <NEW_LINE> self.action_help = None <NEW_LINE> self.dialog = None <NEW_LINE> self.web_menu = '&MetaSearch' <NEW_LINE> <DEDENT> ...
base plugin
62598ef67d43ff2487426840
class SmoothnessToughWebGLAdCases(_Smoothness): <NEW_LINE> <INDENT> page_set = page_sets.SyntheticToughWebglAdCasesPageSet <NEW_LINE> @classmethod <NEW_LINE> def Name(cls): <NEW_LINE> <INDENT> return 'smoothness.tough_webgl_ad_cases' <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def ShouldDisable(cls, possible_browser): ...
Measures rendering statistics while scrolling advertisements.
62598ef64a966d76dd5ed765
class JugadorConecta4(juegos_cuadricula.JugadorNegamax): <NEW_LINE> <INDENT> def __init__(self, tiempo_espera=10): <NEW_LINE> <INDENT> juegos_cuadricula.JugadorNegamax.__init__(self, d_max=1) <NEW_LINE> self.tiempo = tiempo_espera <NEW_LINE> self.maxima_d = 20 <NEW_LINE> <DEDENT> def ordena(self, juego, estado, jugadas...
Un jugador Negamax ajustado a el juego conecta 4, solamente hay que modificar dos métodos (o uno solo si no estamos preocupados por el tiempo de búsqueda: ordena y utilidad.
62598ef699fddb7c1ca62249
class TestExternalLinks(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.f = File(self.mktemp(), 'w') <NEW_LINE> self.ename = self.mktemp() <NEW_LINE> self.ef = File(self.ename, 'w') <NEW_LINE> self.ef.create_group('external') <NEW_LINE> self.ef.close() <NEW_LINE> <DEDENT> def tearDown(self): <N...
Feature: Create and manage external links
62598ef63617ad0b5ee049b2
class ProductProductPurchase(orm.Model): <NEW_LINE> <INDENT> _inherit = 'product.product' <NEW_LINE> _columns = { 'first_supplier_id': fields.many2one('res.partner', 'First supplier'), 'default_supplier_code': fields.char('Codice forn. default', size=40), 'default_supplier': fields.char('Fornitore default', size=64), }
Add extra field in product (used in form and report)
62598ef6091ae356687034a4
class Payee(ndb.Model): <NEW_LINE> <INDENT> name = ndb.StringProperty(indexed=True) <NEW_LINE> category = ndb.StringProperty(indexed=True) <NEW_LINE> def string(self): <NEW_LINE> <INDENT> return ",".join([self.name,self.category]) <NEW_LINE> <DEDENT> def load(self,params): <NEW_LINE> <INDENT> self.name = params...
A main model for representing a payee.
62598ef644b2445a339b5db3
class DellaPorta(Cipher): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.keys = { 'A': 0, 'B': 0, 'C': 1, 'D': 1, 'E': 2, 'F': 2, 'G': 3, 'H': 3, 'I': 4, 'J': 4, 'K': 5, 'L': 5, 'M': 6, 'N': 6, 'O': 7, 'P': 7, 'Q': 8, 'R': 8, 'S': 9, 'T': 9, 'U': 10, 'V': 10, 'W': 11, 'X': 11, 'Y': 12, 'Z': 12 } <NEW_...
Cifra criptografica de Giambattista della Porta
62598ef6aad79263cf42d09a
class SamplingEnable(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "sampling-enable" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.counters1 = "" <NEW_LINE> for keys, value in kwargs.items(): <NEW_LINE> <INDENT> setattr(self,keys, val...
This class does not support CRUD Operations please use parent. :param counters1: {"enum": ["all", "packets-sent", "bytes-sent", "nat44-records-sent", "nat44-records-sent-failure", "nat64-records-sent", "nat64-records-sent-failure", "dslite-records-sent", "dslite-records-sent-failure", "session-event-nat44-records-sent...
62598ef6ec188e330fdf7134
class DeleteTrafficMirrorResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TaskId = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TaskId = params.get("TaskId") <NEW_LINE> self.RequestId = params.get("RequestId")
DeleteTrafficMirror返回参数结构体
62598ef6adb09d7d5dc08e4b
class Helper(object): <NEW_LINE> <INDENT> def send_confirmation_code(self, to_number, code): <NEW_LINE> <INDENT> verification_code = code <NEW_LINE> to_number = "{}{}".format("+91", to_number) <NEW_LINE> self.send_sms(to_number, verification_code) <NEW_LINE> <DEDENT> def generate_code(self): <NEW_LINE> <INDENT> return ...
Helper Class
62598ef6283ffb24f3cf2135
class AddProductTest(BaseTestCase): <NEW_LINE> <INDENT> def test_add_product(self): <NEW_LINE> <INDENT> ap = AddProduct(self.driver) <NEW_LINE> ap.click_product_menu() <NEW_LINE> before_add = ap.total_strip() <NEW_LINE> ap.add() <NEW_LINE> ap.input_name() <NEW_LINE> ap.input_sort_number() <NEW_LINE> ap.select_brand() <...
新增商品
62598ef68a43f66fc4bf0a02
class NetworkMetadataProxyHandler(object): <NEW_LINE> <INDENT> def __init__(self, network_id=None, router_id=None): <NEW_LINE> <INDENT> self.network_id = network_id <NEW_LINE> self.router_id = router_id <NEW_LINE> if network_id is None and router_id is None: <NEW_LINE> <INDENT> msg = _('network_id and router_id are Non...
Proxy AF_INET metadata request through Unix Domain socket. The Unix domain socket allows the proxy access resource that are not accessible within the isolated tenant context.
62598ef616aa5153ce3fed8f
class TextAudioCollate(object): <NEW_LINE> <INDENT> def __init__(self, n_frames_per_step=1): <NEW_LINE> <INDENT> self.n_frames_per_step = n_frames_per_step <NEW_LINE> <DEDENT> def __call__(self, batch): <NEW_LINE> <INDENT> input_lengths, ids_sorted_decreasing = torch.sort( torch.LongTensor([len(x[0]) for x in batch]), ...
Another way to implement collate_fn passed to DataLoader. Use class but not function because this is easier to pass some parameters.
62598ef64428ac0f6e656dda
class ListWorkspacesEnums: <NEW_LINE> <INDENT> class Sort(str, Enum): <NEW_LINE> <INDENT> NAME = 'name' <NEW_LINE> UPDATED = 'updated'
Enums for list_workspaces parameters.
62598ef623849d37ff84f94a
class AmmoFileReader(object): <NEW_LINE> <INDENT> def __init__(self, filename, **kwargs): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.log = logging.getLogger(__name__) <NEW_LINE> self.log.info("Loading ammo from '%s'" % filename) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> def read_chun...
Read missiles from ammo file
62598ef657b8e32f5250754a
class Node(object): <NEW_LINE> <INDENT> not_inherited = ['parent', 'nodes', 'name', 'full_name', 'format_name', 'dot_name', 'prefix_name', 'offset', 'address', 'entries', 'ref', 'index', 'number', 'group', 'is_bitfield', 'is_register', 'is_group', 'is_sequence'] <NEW_LINE> is_bitfield = False <NEW_LINE> is_register = F...
Root object of BitField, Register, Group and Sequence.
62598ef626068e7796d4b1e9
class DESExecutableNotFound(Exception): <NEW_LINE> <INDENT> pass
Exception raised if DES executable is not found on the specified path.
62598ef6d268445f26638fd6
class CommentForm(forms.ModelForm): <NEW_LINE> <INDENT> def clean_content(self): <NEW_LINE> <INDENT> content = self.cleaned_data.get('content') <NEW_LINE> if not content: <NEW_LINE> <INDENT> raise forms.ValidationError('Comment to short') <NEW_LINE> <DEDENT> return parser.parse(content) <NEW_LINE> <DEDENT> def save(sel...
Creating/updating comment form
62598ef660cbc95b06362bc3
class ShdslIdentity(IanaInterfaceTypeIdentity): <NEW_LINE> <INDENT> _prefix = 'ianaift' <NEW_LINE> _revision = '2014-05-08' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> IanaInterfaceTypeIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.ietf....
Multirate HDSL2.
62598ef6fff4ab517ebcc064
class Solutions(object): <NEW_LINE> <INDENT> def search(self, nums, target): <NEW_LINE> <INDENT> vals = collections.Counter(nums) <NEW_LINE> return vals[target]
调库
62598ef6091ae356687034a6
class PrivateIngredientApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.user = get_user_model().objects.create_user( 'test@gmail.com', 'password123' ) <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_ingredie...
Test the private ingredients API
62598ef6167d2b6e312b5828
class UnicodeAwareMimeEncapsulator(MimeEncapsulatorSection): <NEW_LINE> <INDENT> classProvides(ISectionBlueprint) <NEW_LINE> implements(ISection) <NEW_LINE> def __iter__(self): <NEW_LINE> <INDENT> for item in self.previous: <NEW_LINE> <INDENT> key, match = self.datakey(*item.keys()) <NEW_LINE> if not key: <NEW_LINE> <I...
Make the default plone.app.transmogrifier.mimeencapsulator work with unicode fields.
62598ef6be383301e025206c
class MD5Field(BaseField, JsonHashMixin): <NEW_LINE> <INDENT> hash_length = 32 <NEW_LINE> def validate(self, value): <NEW_LINE> <INDENT> if len(value) != MD5Field.hash_length: <NEW_LINE> <INDENT> raise ShieldException('MD5 value is wrong length', self.field_name, value) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> int(...
A field that validates input as resembling an MD5 hash.
62598ef64f88993c371ef931