code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Card: <NEW_LINE> <INDENT> def __init__(self, scale=1.0): <NEW_LINE> <INDENT> self.spr = None <NEW_LINE> self.index = None <NEW_LINE> self._scale = scale <NEW_LINE> <DEDENT> def create(self, string, attributes=None, sprites=None, file_path=None): <NEW_LINE> <INDENT> if attributes is None: <NEW_LINE> <INDENT> if se... | Individual cards | 62598fc9bf627c535bcb1808 |
class StarterFlag(object): <NEW_LINE> <INDENT> pattern = "STARTER_FLAG.{timestamp}" <NEW_LINE> def __init__(self, filename=None): <NEW_LINE> <INDENT> if filename: <NEW_LINE> <INDENT> self.read(filename) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.filename = None <NEW_LINE> self.timestamp = None <NEW_LINE> self.d... | Flag files indicating analysis start
| 62598fc9cc40096d6161a387 |
class SequenceField(BaseField): <NEW_LINE> <INDENT> _lazy = (operator.__getitem__, operator.__contains__, ) <NEW_LINE> def contains(self, operand): <NEW_LINE> <INDENT> return self.create_copy(operator.__contains__, operand) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return 'len' | Class used for sequences fields creations. It can be used to create:
strings
arrays
dictionaries | 62598fc9ff9c53063f51a9ac |
class GoodsInfo(SqlModel): <NEW_LINE> <INDENT> __tablename__ = "goods_info" <NEW_LINE> __connection_name__ = "default" <NEW_LINE> id = Column('id',Integer,primary_key=True,autoincrement=True,nullable=False) <NEW_LINE> code = Column('code',Integer,nullable=False,unique=True,index=True) <NEW_LINE> avatar_id = Column('ava... | 商品信息 | 62598fc94428ac0f6e658886 |
class TestAdjustPIP(object): <NEW_LINE> <INDENT> def test_unpack(self): <NEW_LINE> <INDENT> controller = Controller(address='unix:abstract=abcde') <NEW_LINE> controller.establish_connection = Mock(return_value=None) <NEW_LINE> controller.connection = MockConnection(True) <NEW_LINE> with pytest.raises(ConnectionReturnEr... | Test the adjust_pip method | 62598fc94c3428357761a61d |
class JSONFieldAnonymizer(FieldAnonymizer): <NEW_LINE> <INDENT> empty_values = [None, ''] <NEW_LINE> def get_numeric_encryption_key(self, encryption_key: str, value: Union[int, float] = None) -> int: <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> return numerize_key(encryption_key) <NEW_LINE> <DEDENT> return... | Anonymization for JSONField. | 62598fc963b5f9789fe854d5 |
class ApplicationGatewayFirewallRuleGroup(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'rule_group_name': {'required': True}, 'rules': {'required': True}, } <NEW_LINE> _attribute_map = { 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'},... | A web application firewall rule group.
All required parameters must be populated in order to send to Azure.
:param rule_group_name: Required. The name of the web application firewall rule group.
:type rule_group_name: str
:param description: The description of the web application firewall rule group.
:type descriptio... | 62598fc99f28863672818a2c |
class Not(Boolean): <NEW_LINE> <INDENT> def __init__(self, condition): <NEW_LINE> <INDENT> if not isinstance(condition, Boolean): <NEW_LINE> <INDENT> raise SpecSyntaxError() <NEW_LINE> <DEDENT> self.condition = condition <NEW_LINE> <DEDENT> def eval(self, values): <NEW_LINE> <INDENT> return not self.condition.eval(valu... | NOT operator | 62598fc9bf627c535bcb180a |
class Score(ndb.Model): <NEW_LINE> <INDENT> user = ndb.KeyProperty(required=True, kind='User') <NEW_LINE> opponent = ndb.KeyProperty(required=True, kind='User') <NEW_LINE> date = ndb.DateProperty(required=True) <NEW_LINE> board_state = ndb.StringProperty(required=True) <NEW_LINE> result = msgprop.EnumProperty(Result, r... | Score object | 62598fc98a349b6b436865a0 |
class Matrix(Effect): <NEW_LINE> <INDENT> def __init__(self, screen, **kwargs): <NEW_LINE> <INDENT> super(Matrix, self).__init__(screen, **kwargs) <NEW_LINE> self._chars = [] <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self._chars = [_Trail(self._screen, x) for x in range(self._screen.width)] <NEW_LINE> <D... | Matrix-like falling green letters. | 62598fc9adb09d7d5dc0a8db |
class RobertaForSequenceClassification(BertPreTrainedModel): <NEW_LINE> <INDENT> config_class = RobertaConfig <NEW_LINE> pretrained_model_archive_map = ROBERTA_PRETRAINED_MODEL_ARCHIVE_MAP <NEW_LINE> base_model_prefix = "roberta" <NEW_LINE> def __init__(self, config): <NEW_LINE> <INDENT> super(RobertaForSequenceClassif... | **labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``:
Labels for computing the sequence classification/regression loss.
Indices should be in ``[0, ..., config.num_labels]``.
If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss),
If ``confi... | 62598fc9851cf427c66b8615 |
class getSquareMemberRelations_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (GetSquareMemberRelationsResponse, GetSquareMemberRelationsResponse.thrift_spec), None, ), (1, TType.STRUCT, 'e', (SquareException, SquareException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, succe... | Attributes:
- success
- e | 62598fc93617ad0b5ee064a9 |
class rule_006(proposed_rule.Rule): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> proposed_rule.Rule.__init__(self, 'context_ref', '006') | This rule checks the semicolon is on the same line as the context selected name.
.. NOTE:: This rule has not been implemented yet.
**Violation**
.. code-block:: vhdl
context c1
;
context
c1
;
**Fix**
.. code-block:: vhdl
context c1;
context
c1; | 62598fc94c3428357761a61f |
class GuildEmbed(DiscordObject): <NEW_LINE> <INDENT> def __init__(self, enabled=False, channel_id=0): <NEW_LINE> <INDENT> self.enabled = enabled <NEW_LINE> self.channel_id = channel_id | Represents a guild embed
.. versionadded:: 0.2.0
Attributes:
enabled (:obj:`bool`): if the embed is enabled
channel_id (:obj:`int`): the embed channel id | 62598fc955399d3f0562687b |
class Uniform(Distribution): <NEW_LINE> <INDENT> def __init__(self, a=0.0, b=1.0): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> self.b = b <NEW_LINE> params = { "loc" : a, "scale" : b - a } <NEW_LINE> if a > b: <NEW_LINE> <INDENT> raise Exception("b cannot be less than a") <NEW_LINE> <DEDENT> super().__init__(params, stat... | Defines a probability space for a uniform distribution.
Attributes:
a (float): lower bound for possible values
b (float): upper bound for possible values | 62598fc9fbf16365ca79441b |
class Device(models.Model): <NEW_LINE> <INDENT> __model_label__ = "device" <NEW_LINE> device = models.CharField( 'Device', max_length=200, null=True, blank=True) <NEW_LINE> pcsRow_fk = models.ForeignKey('PcsRow') <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return "%s: %s" % (self.device, self.pcsRow_fk) | The ICD 10 PCS bodypart models. | 62598fc9ad47b63b2c5a7bbc |
class ConstExpr(Expr): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.val = asm.ConstWord(val) <NEW_LINE> <DEDENT> def emit_with_dest(self, context): <NEW_LINE> <INDENT> return ('', asm.DataLoc(asm.LocType.CONST, self.val)) <NEW_LINE> <DEDENT> def is_always_true(self): <NEW_LINE> <INDENT> return ... | Expression that has a constant value | 62598fc94527f215b58ea232 |
class CreateFloatingIP(neutronV20.CreateCommand): <NEW_LINE> <INDENT> resource = 'floatingip' <NEW_LINE> def add_known_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( 'floating_network_id', metavar='FLOATING_NETWORK', help=_('Network name or ID to allocate floating IP from.')) <NEW_LINE> parser.add_ar... | Create a floating IP for a given tenant. | 62598fc9be7bc26dc925200c |
class DataLogger(object): <NEW_LINE> <INDENT> CONFIG_FILENAME = os.path.join( rospkg.RosPack().get_path('assistance_arbitrator'), 'config/datalogger.yaml' ) <NEW_LINE> DATA_DIRECTORY = os.path.join(rospkg.RosPack().get_path('assistance_arbitrator'), 'data') <NEW_LINE> ROSBAG_CMD = [ 'rosbag', 'record', '--duration=10m'... | Logs data specified by the YAML file | 62598fc9adb09d7d5dc0a8dd |
@dataclass <NEW_LINE> class Annotation: <NEW_LINE> <INDENT> filename: str <NEW_LINE> label_index: int <NEW_LINE> label_enum: str <NEW_LINE> label_display: str <NEW_LINE> bbox: BBox <NEW_LINE> color: Color=BLACK <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return self.as_dict() <NEW_LINE> <DEDENT> def as_dict(self... | Annotation data object
| 62598fc9851cf427c66b8617 |
class ShadowUsersManager(manager.Manager): <NEW_LINE> <INDENT> driver_namespace = 'keystone.identity.shadow_users' <NEW_LINE> _provides_api = 'shadow_users_api' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> shadow_driver = CONF.shadow_users.driver <NEW_LINE> super(ShadowUsersManager, self).__init__(shadow_driver) | Default pivot point for the Shadow Users backend. | 62598fc9f9cc0f698b1c5484 |
class TestStatus: <NEW_LINE> <INDENT> def __init__(self, test_manager, returncode, stdout, stderr, directory, inputs, input_filenames): <NEW_LINE> <INDENT> self.test_manager = test_manager <NEW_LINE> self.returncode = returncode <NEW_LINE> self.stdout = stdout <NEW_LINE> self.stderr = stderr <NEW_LINE> self.directory =... | A struct for holding run status of a test case. | 62598fc97b180e01f3e49202 |
class Decisions(PmmlBinding): <NEW_LINE> <INDENT> def toPFA(self, options, context): <NEW_LINE> <INDENT> raise NotImplementedError | Represents a <Decisions> tag and provides methods to convert to PFA. | 62598fc95fcc89381b2662ff |
@register <NEW_LINE> class Request(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": [ "request" ] }, "command":... | A client or debug adapter initiated request.
Note: automatically generated code. Do not edit manually. | 62598fc923849d37ff851417 |
class Keypads(Elements): <NEW_LINE> <INDENT> def __init__(self, elk): <NEW_LINE> <INDENT> super().__init__(elk, Keypad, Max.KEYPADS.value) <NEW_LINE> elk.add_handler("IC", self._ic_handler) <NEW_LINE> elk.add_handler("KA", self._ka_handler) <NEW_LINE> elk.add_handler("KC", self._kc_handler) <NEW_LINE> elk.add_handler("... | Handling for multiple areas | 62598fc95fdd1c0f98e5e2f1 |
class JenkinsChangeQueueObject(JenkinsObject): <NEW_LINE> <INDENT> QUEUE_JOB_SUFFIX = '_change-queue' <NEW_LINE> TESTER_JOB_SUFFIX = '_change-queue-tester' <NEW_LINE> def queue_job_name(self, queue_name=None): <NEW_LINE> <INDENT> if queue_name is None: <NEW_LINE> <INDENT> queue_name = self.get_queue_name() <NEW_LINE> <... | Utility base class to objects that represent the change queue in Jenkins
| 62598fc9ff9c53063f51a9b2 |
class CreateRoleInputSet(InputSet): <NEW_LINE> <INDENT> def set_Role(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Role', value) <NEW_LINE> <DEDENT> def set_ApplicationID(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'ApplicationID', value) <NEW_LINE> <DEDENT> def set_RESTAPIKey(self, value... | An InputSet with methods appropriate for specifying the inputs to the CreateRole
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598fc9d8ef3951e32c800e |
class EmailBackend(ModelBackend): <NEW_LINE> <INDENT> def authenticate(self, email=None, password=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = self.user_class.objects.get(email=email) <NEW_LINE> <DEDENT> except self.user_class.DoesNotExist: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if user.check... | Authenticate user against email,password credentials
The user class might be :
- django.contrib.auth.models.User (default)
- a custom User class inheriting from django.contrib.auth.models.User
A custom User class is declared through CUSTOM_USER_MODEL setting :
CUSTOM_USER_MODEL = 'yourapp.YourCustomUser' | 62598fc93617ad0b5ee064ad |
class TAction(ActionFlowable): <NEW_LINE> <INDENT> def __init__(self, bgs=[],F=[],f=None): <NEW_LINE> <INDENT> Flowable.__init__(self) <NEW_LINE> self.bgs = bgs <NEW_LINE> self.F = F <NEW_LINE> self.f = f <NEW_LINE> <DEDENT> def apply(self,doc,T=T): <NEW_LINE> <INDENT> T.frames = self.F <NEW_LINE> frame._frameBGs = sel... | a special Action flowable that sets stuff on the doc template T | 62598fc9091ae35668704f8f |
class HistDataProp(Data1DProp): <NEW_LINE> <INDENT> NAME = "HistData" <NEW_LINE> WIDGET_NAMES = [*Data1DProp.WIDGET_NAMES, 'hist_color_box'] <NEW_LINE> def hist_color_box(self): <NEW_LINE> <INDENT> hist_color_box = GW.ColorBox() <NEW_LINE> hist_color_box.setToolTip("Color to be used for this histogram") <NEW_LINE> self... | Provides the definition of the :class:`~HistDataProp` plot property.
This property contains boxes for setting the label; X-axis data and color
for an individual histogram. | 62598fc94a966d76dd5ef23c |
class PostView(TemplateView): <NEW_LINE> <INDENT> template_name = 'blog/post.html' <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> context = self.get_context_data(**kwargs) <NEW_LINE> blog_id = kwargs.get('id', None) <NEW_LINE> try: <NEW_LINE> <INDENT> post = Post.objects.get(id=blog_id) <NEW_LI... | Просмотр поста | 62598fc9656771135c4899d6 |
class Flatten(Layer): <NEW_LINE> <INDENT> def __init__(self, include_batch_dim=False, **kwargs): <NEW_LINE> <INDENT> super(Flatten, self).__init__(**kwargs) <NEW_LINE> self.include_batch_dim = include_batch_dim <NEW_LINE> <DEDENT> def output_shape(self, input_shape): <NEW_LINE> <INDENT> batch_size, input_shape = input_... | Flatten the input tensor into 1D. Behaves like numpy.reshape().
- input_shape: nD, `(nb_samples, x, y, ...)`
- output_shape: 2D, `(nb_samples, Prod(x,y,...))` | 62598fc9377c676e912f6f29 |
class Point: <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "({x}, {y})".format(x = self.x, y = self.y) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Time({x}, {y})".format(x = sel... | Klasa reprezentująca punkty na płaszczyźnie. | 62598fc960cbc95b063646a4 |
class Port(object): <NEW_LINE> <INDENT> def __init__(self, name, remote_id, *args, **kwargs): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.remote_id = remote_id <NEW_LINE> self.others_list = args <NEW_LINE> self.others_dict = kwargs <NEW_LINE> self.hosts = {} | A minimal data object for containing port information.
This is made as a class in order to make it easier to extend upon it. | 62598fc9167d2b6e312b72de |
class IUndislikeEvent(IObjectEvent): <NEW_LINE> <INDENT> pass | Interface for the Undislike event | 62598fc9be7bc26dc925200e |
class InvalidFileFormat(OSError): <NEW_LINE> <INDENT> pass | A Invalid File Format Error occurred | 62598fc93346ee7daa3377fb |
class BigquerydatatransferProjectsDataSourcesCheckValidCredsRequest(_messages.Message): <NEW_LINE> <INDENT> checkValidCredsRequest = _messages.MessageField('CheckValidCredsRequest', 1) <NEW_LINE> name = _messages.StringField(2, required=True) | A BigquerydatatransferProjectsDataSourcesCheckValidCredsRequest object.
Fields:
checkValidCredsRequest: A CheckValidCredsRequest resource to be passed as
the request body.
name: The data source in the form:
`projects/{project_id}/dataSources/{data_source_id}` | 62598fc97cff6e4e811b5d8f |
class BikeShop(): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.inventory = () <NEW_LINE> self.profit = 0 <NEW_LINE> <DEDENT> def sell_bike(self, inventory_index, retail_margin): <NEW_LINE> <INDENT> del self.inventory_index[inventory_index] <NEW_LINE> self.profit += ... | the shop class | 62598fc9d486a94d0ba2c33a |
class GQAQuestionType(TypedDict): <NEW_LINE> <INDENT> structural: Optional[str] <NEW_LINE> semantic: Optional[str] <NEW_LINE> detailed: Optional[str] | Class wrapper for GQA question types.
Attributes:
-----------
`structural`: Question structural type, e.g. query (open), verify (yes/no).
`semantic`: Question subject's type, e.g. 'attribute' for questions about
color or material.
`detailed`: Question complete type specification, out of 20+ subtypes,
e.g. twoSame.
... | 62598fc9ec188e330fdf8bfe |
class sortedProductReiterable(object) : <NEW_LINE> <INDENT> def __init__(self, reiterable, repeat) : <NEW_LINE> <INDENT> self.repeat = repeat <NEW_LINE> self.reiterable = reiterable <NEW_LINE> <DEDENT> def reiter(self, status) : <NEW_LINE> <INDENT> return sortedProductReiterator(self, status) <NEW_LINE> <DEDENT> def in... | this class produces "canonical representatives" for all the (unsorted) multisets of a given Reiterable.
It produces all sequences (i1,...,ik) of reiterator values with i1 <= i2 <= ... <= i3. | 62598fc94527f215b58ea237 |
class mLine(LineAny, Mutable): <NEW_LINE> <INDENT> __slots__ = () | A mutable Line | 62598fc9be7bc26dc925200f |
class RootDocumentCategoryList(ListView): <NEW_LINE> <INDENT> context_object_name = 'root_categories' <NEW_LINE> template_name = 'documents/root_categories.html' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return DocumentCategory.objects.filter(parent=None).prefetch_related( 'children', 'documents', 'childre... | Shows a listing of all root :class:`~.models.DocumentCategory`.
They are passed in with the ``root_categories`` context variable.
The default template is ``documents/root_categories.html``. | 62598fc9099cdd3c63675596 |
class LoginView(FormView): <NEW_LINE> <INDENT> template_name = "users/login.html" <NEW_LINE> form_class = BaseLoginForm <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> login(self.request, form.get_user()) <NEW_LINE> self.request.session.cycle_key() <NEW_LINE> return super(LoginView, self).form_valid(form) | Login method for the users | 62598fc97c178a314d78d809 |
class PoissonNLLLoss(_Loss): <NEW_LINE> <INDENT> def __init__(self, log_input=True, full=False, size_average=True, eps=1e-8, reduce=True): <NEW_LINE> <INDENT> super(PoissonNLLLoss, self).__init__(size_average, reduce) <NEW_LINE> self.log_input = log_input <NEW_LINE> self.full = full <NEW_LINE> self.eps = eps <NEW_LINE>... | Negative log likelihood loss with Poisson distribution of target.
The loss can be described as:
.. math::
\text{target} \sim \mathrm{Poisson}(\text{input})
\text{loss}(\text{input}, \text{target}) = \text{input} - \text{target} * \log(\text{input})
+ \log(\text{target!})
The ... | 62598fc9ad47b63b2c5a7bc4 |
class NameServerView(base_view.BaseView): <NEW_LINE> <INDENT> _resource_name = 'nameserver' <NEW_LINE> _collection_name = 'nameservers' <NEW_LINE> def _get_base_href(self, parents=None): <NEW_LINE> <INDENT> assert len(parents) == 1 <NEW_LINE> href = "%s/v2/zones/%s/nameservers" % (self.base_uri, parents[0]) <NEW_LINE> ... | Model a NameServer API response as a python dictionary | 62598fc9283ffb24f3cf3bef |
@Chat.register('update') <NEW_LINE> class ChatUpdate(BaseAPIEndpoint): <NEW_LINE> <INDENT> endpoint = 'chat.update' <NEW_LINE> required_args = { 'channel', 'text', 'ts', } <NEW_LINE> optional_args = { 'as_user', 'attachments', 'link_names', 'parse', } <NEW_LINE> options = { 'include_token': True, } <NEW_LINE> scopes = ... | This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.
.. code-block:: json
{
"ok": true,
"channel": "C024BE91L",
"ts": "1401383885.000061",
"text": "Updated Text"
}
The respon... | 62598fc97b180e01f3e49205 |
class Player(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.image = pygame.Surface([10, 10]) <NEW_LINE> self.image.fill(WHITE) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.rect.y = y <NEW_LINE> self.rect.x = x <NEW_LINE> self.s... | This class represents the bar at the bottom that the player
controls. | 62598fc9a219f33f346c6b73 |
class ContentTypeFilter(SimpleListFilter): <NEW_LINE> <INDENT> title = _('Content Type') <NEW_LINE> parameter_name = 'ctype' <NEW_LINE> def lookups(self, request, model_admin): <NEW_LINE> <INDENT> lookup_list = [ (None, _('Site')), ] <NEW_LINE> others = model_admin.model.objects.exclude(content_type=site_ctype()) ... | Filter on related content type, defaulting to sites.Site instead of
'all'. Assumes a foreignkey to contenttypes.ContentType called
content_type exists on the model. | 62598fc94527f215b58ea23a |
class ExceptionProblemReporterNoExpiration(transitfeed.ProblemReporter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> accumulator = transitfeed.ExceptionProblemAccumulator(raise_warnings=True) <NEW_LINE> transitfeed.ProblemReporter.__init__(self, accumulator) <NEW_LINE> <DEDENT> def expiration_date(self,... | Ignores feed expiration problems.
Use TestFailureProblemReporter in new code because it fails more cleanly, is
easier to extend and does more thorough checking. | 62598fc9bf627c535bcb1814 |
class Link(Kmlable): <NEW_LINE> <INDENT> def __init__(self, href=" ", refreshmode=None, refreshinterval=None, viewrefreshmode=None, viewrefreshtime=None, viewboundscale=None, viewformat=None, httpquery=None): <NEW_LINE> <INDENT> super(Link, self).__init__() <NEW_LINE> self._kml["href"] = href <NEW_LINE> self._kml["refr... | Defines an image associated with an Icon style or overlay.
Keyword Arguments:
href (string) -- target url (default None)
refreshmode (string) -- one of [RefreshMode] constants (default None)
refreshinterval (float) -- time between refreshes (default None)
viewrefreshmode (string) -- one of [ViewRefresh... | 62598fc960cbc95b063646a8 |
class NestedTransaction(Transaction): <NEW_LINE> <INDENT> __slots__ = ("_savepoint",) <NEW_LINE> def __init__(self, connection, parent): <NEW_LINE> <INDENT> super().__init__(connection, parent) <NEW_LINE> self._savepoint = None <NEW_LINE> <DEDENT> async def _do_rollback(self): <NEW_LINE> <INDENT> assert self._savepoint... | Represent a 'nested', or SAVEPOINT transaction.
A new NestedTransaction object may be procured
using the SAConnection.begin_nested() method.
The interface is the same as that of Transaction class. | 62598fc93346ee7daa3377fd |
class AttributeTreatmentEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, AttributeTreatment): <NEW_LINE> <INDENT> rep = dict() <NEW_LINE> rep['treatment_type'] = 'attribute_treatment' <NEW_LINE> rep['attribute'] = AttributeEncoder().default(obj.attribute) <NE... | A JSONEncoder for the {AttributeTreatment} class. | 62598fc9d8ef3951e32c8011 |
class TestLDAPUserAttributeRead(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 testLDAPUserAttributeRead(self): <NEW_LINE> <INDENT> model = swagger_client.models.ldap_user_attribute_read.LDAPUserA... | LDAPUserAttributeRead unit test stubs | 62598fc950812a4eaa620d9a |
class ValidatorMixin(object): <NEW_LINE> <INDENT> def validate(self, data, use_defaults=True): <NEW_LINE> <INDENT> for error in self.iter_errors(data, use_defaults=use_defaults): <NEW_LINE> <INDENT> raise error <NEW_LINE> <DEDENT> <DEDENT> def iter_errors(self, data, path=None, use_defaults=True): <NEW_LINE> <INDENT> f... | Mixin for implementing XML Schema validators. A derived class must implement the
methods `iter_decode` and `iter_encode`. | 62598fc94a966d76dd5ef242 |
class SymbolARRAYDECL(Symbol): <NEW_LINE> <INDENT> def __init__(self, symbol): <NEW_LINE> <INDENT> Symbol.__init__(self, symbol._mangled, 'ARRAYDECL') <NEW_LINE> self._type = symbol._type <NEW_LINE> self.size = symbol.total_size <NEW_LINE> self.entry = symbol <NEW_LINE> self.bounds = symbol.bounds | Defines an Array declaration
| 62598fc9656771135c4899dc |
class UpdateRequestMessage(UpdateMessage): <NEW_LINE> <INDENT> @property <NEW_LINE> def summary(self) -> str: <NEW_LINE> <INDENT> status = self.topic.split('.')[-1] <NEW_LINE> if status in ('unpush', 'obsolete', 'revoke'): <NEW_LINE> <INDENT> status = status + (status[-1] == 'e' and 'd' or 'ed') <NEW_LINE> return f"{se... | Sent when an update's request is changed. | 62598fc95fcc89381b266303 |
class Gemv(Op): <NEW_LINE> <INDENT> def __init__(self, inplace): <NEW_LINE> <INDENT> self.inplace = inplace <NEW_LINE> if inplace: <NEW_LINE> <INDENT> self.destroy_map = {0: [0]} <NEW_LINE> <DEDENT> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return type(self) == type(other) and self.inplace == other.inplace ... | expression is beta * y + alpha * A x
A is matrix
x, y are vectors
alpha, beta are scalars
output is a vector that can be inplace on y | 62598fc9dc8b845886d53928 |
class Tag(base_model.BaseModel): <NEW_LINE> <INDENT> name = ndb.StringProperty(required=True) <NEW_LINE> hidden = ndb.BooleanProperty(required=True) <NEW_LINE> protect = ndb.BooleanProperty(required=True) <NEW_LINE> color = ndb.StringProperty(choices=_TAG_COLORS, required=True) <NEW_LINE> description = ndb.StringProper... | Datastore model representing a tag.
Attributes:
name: str, a unique name for the tag.
hidden: bool, whether a tag is hidden in the frontend UI.
protect: bool, whether a tag is protected from user manipulation.
color: str, the UI color of the tag in human-readable format.
description: Optional[str], a descrip... | 62598fc9099cdd3c63675598 |
class AppengineAppsModulesListRequest(_messages.Message): <NEW_LINE> <INDENT> name = _messages.StringField(1, required=True) <NEW_LINE> pageSize = _messages.IntegerField(2, variant=_messages.Variant.INT32) <NEW_LINE> pageToken = _messages.StringField(3) | A AppengineAppsModulesListRequest object.
Fields:
name: A string attribute.
pageSize: A integer attribute.
pageToken: A string attribute. | 62598fc95fdd1c0f98e5e2f9 |
class LocalHost: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.deviceid = "localhost" <NEW_LINE> <DEDENT> def shell_cmd(self, cmd="", timeout=15): <NEW_LINE> <INDENT> return shell_command(cmd, timeout) <NEW_LINE> <DEDENT> def check_process(self, process_name): <NEW_LINE> <INDENT> exit_code, ret = she... | Implementation for transfer data
between Host and Tizen PC | 62598fc93346ee7daa3377fe |
class Options: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self._config() <NEW_LINE> self.parse(sys.argv) <NEW_LINE> <DEDENT> def get_columns(self) -> str: <NEW_LINE> <INDENT> return self._columns <NEW_LINE> <DEDENT> def get_hosts(self) -> List[str]: <NEW_LINE> <INDENT> return self._hosts <NEW_L... | Options class | 62598fc950812a4eaa620d9b |
class Comment(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(to=User, on_delete=models.CASCADE, to_field='user', related_name='comments', verbose_name='用户') <NEW_LINE> topic_id = models.ForeignKey( to=Topic, on_delete=models.CASCADE, related_name='comments', verbose_name='话题') <NEW_LINE> reply_obj = models... | 评论模型
| 62598fc963b5f9789fe854e3 |
class Solution1: <NEW_LINE> <INDENT> def sortedArrayToBST(self, nums: List[int]) -> TreeNode: <NEW_LINE> <INDENT> if not nums: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def helper(nums,left,right): <NEW_LINE> <INDENT> if left > right: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> mid = (left + right) //... | Time complexity : O(n)
Space complexity : O(n) | 62598fc9ec188e330fdf8c04 |
class battleSetupTest(unittest.TestCase): <NEW_LINE> <INDENT> def testRandomBattle(self): <NEW_LINE> <INDENT> from battle_engine import _battleSetup <NEW_LINE> from monsters.monster import Monster <NEW_LINE> import constants <NEW_LINE> player = MagicMock() <NEW_LINE> space = MagicMock() <NEW_LINE> player.getLocation = ... | Tests _battleSetup helper function in battle_engine.py. | 62598fc9dc8b845886d5392a |
class CoverageReport(Command): <NEW_LINE> <INDENT> description = 'report results of coverage analysis' <NEW_LINE> user_options = [] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def finalize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <IN... | Report results of coverage analysis. | 62598fc93d592f4c4edbb221 |
class WikiVersion(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=128, blank=False) <NEW_LINE> author = models.ForeignKey(User, blank=False) <NEW_LINE> date = models.DateTimeField(auto_now_add=True) <NEW_LINE> text = models.TextField() <NEW_LINE> comments = models.ManyToManyField(Comment, blank=Tr... | Versión de un artículo de documentación. El
funcionamiento es igual que es de las versiones
en los Titles. | 62598fc9be7bc26dc9252012 |
class Out: <NEW_LINE> <INDENT> def __init__(self, stream=sys.stdout, indent=0): <NEW_LINE> <INDENT> self._stream = stream <NEW_LINE> self._indent = indent <NEW_LINE> <DEDENT> def __call__(self, s): <NEW_LINE> <INDENT> self._stream.write('%s%s\n' % (' ' * 4 * self._indent, s)) <NEW_LINE> <DEDENT> def indent(self): <NEW_... | Indents text and writes it to a file.
Useful for generated code. | 62598fc926068e7796d4cccb |
class ExperimentIntroduction(Page): <NEW_LINE> <INDENT> pass | Page introducing the entire experiment.
Assumes this is the first test. | 62598fc9283ffb24f3cf3bf4 |
class Js(models.Model): <NEW_LINE> <INDENT> XN = models.CharField('学年', max_length=18) <NEW_LINE> XQ = models.CharField('学期', max_length=40) <NEW_LINE> JSBH = models.CharField('教室编号', max_length=10) <NEW_LINE> XQJ = models.CharField('星期几', max_length=40) <NEW_LINE> SJD = models.IntegerField('时间点', help_text='1表示第1节课开始,... | 教学场地/教师课程表 | 62598fc9d8ef3951e32c8013 |
class Touch(PythonBatchCommandBase): <NEW_LINE> <INDENT> def __init__(self, path: os.PathLike, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.path = path <NEW_LINE> <DEDENT> def repr_own_args(self, all_args: List[str]) -> None: <NEW_LINE> <INDENT> all_args.append(self.unnamed__init__p... | Create an empty file if it does not already exist or update modification time to now if file exist | 62598fc9656771135c4899e0 |
class MusicServiceItem(MetadataDictBase): <NEW_LINE> <INDENT> _valid_fields = {} <NEW_LINE> _types = {} <NEW_LINE> def __init__(self, item_id, desc, resources, uri, metadata_dict, music_service=None): <NEW_LINE> <INDENT> _LOG.debug('%s.__init__ with item_id=%s, desc=%s, resources=%s, ' 'uri=%s, metadata_dict=..., music... | A base class for all music service items | 62598fc9fbf16365ca794429 |
class FloatRange(click.types.FloatParamType): <NEW_LINE> <INDENT> name = 'float range' <NEW_LINE> def __init__(self, min=None, max=None, clamp=False): <NEW_LINE> <INDENT> self.min = min <NEW_LINE> self.max = max <NEW_LINE> self.clamp = clamp <NEW_LINE> <DEDENT> def convert(self, value, param, ctx): <NEW_LINE> <INDENT> ... | A parameter that works similar to :data:`click.FLOAT` but restricts
the value to fit into a range. The default behavior is to fail if the
value falls outside the range, but it can also be silently clamped
between the two edges. | 62598fc9d486a94d0ba2c342 |
class Array(DeclNode): <NEW_LINE> <INDENT> def __init__(self, n, child): <NEW_LINE> <INDENT> self.n = n <NEW_LINE> self.child = child <NEW_LINE> super().__init__() | Represents an array of a type.
n (int) - size of the array | 62598fc9ab23a570cc2d4f26 |
@attributes( [ Attribute(name="type", default_value=STAR), Attribute(name="subtype", default_value=STAR), Attribute(name="parameters", default_factory=dict), Attribute(name="quality", default_value=1.0), ], apply_with_cmp=False, ) <NEW_LINE> class MediaRange(object): <NEW_LINE> <INDENT> def __eq__(self, other): <NEW_LI... | A media range.
Open ranges (e.g. ``text/*`` or ``*/*``\ ) are represented by
:attr:`type` and / or :attr:`subtype` being ``None``\ . | 62598fc9ec188e330fdf8c06 |
class FirePoint(pyggel.particle.BehaviorPoint): <NEW_LINE> <INDENT> def __init__(self, emitter): <NEW_LINE> <INDENT> pyggel.particle.BehaviorPoint.__init__(self, emitter) <NEW_LINE> self.particle_lifespan = 20 <NEW_LINE> self.point_size = 10 <NEW_LINE> self.max_particles = 105 <NEW_LINE> <DEDENT> def get_dimensions(sel... | This behavior uses the point particles... | 62598fc9167d2b6e312b72e8 |
class UpdateMageCharacter(BaseUpdateCharacterView): <NEW_LINE> <INDENT> template_name = 'characters/create_mage.html' <NEW_LINE> form_class = CreateMageForm <NEW_LINE> model = MageCharacter <NEW_LINE> success_url = 'characters:list' <NEW_LINE> inlines = [MageMeritInline, MageSpecialtyInline, RoteInline] <NEW_LINE> def ... | Update a MageCharacter. | 62598fc9dc8b845886d5392c |
class StaticMethod(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> <DEDENT> def __get__(self, obj, cls): <NEW_LINE> <INDENT> return self.func | A re-implementation of staticmethod because in python2 you can't have custom attributes on staticmethod.
Useless in python3 | 62598fc926068e7796d4cccd |
class Momentum(object): <NEW_LINE> <INDENT> def __init__(self, learning_rate=0.01, momentum_coeff=0.9): <NEW_LINE> <INDENT> self.learning_rate = learning_rate <NEW_LINE> self.momentum_coeff = momentum_coeff <NEW_LINE> self.velocities = {} <NEW_LINE> <DEDENT> def receive(self, x): <NEW_LINE> <INDENT> values = compute.co... | Stochastic gradient descent with momentum. | 62598fc9f9cc0f698b1c548b |
class NSNitroNserrNormalVsNoneListenpol(NSNitroLbErrors): <NEW_LINE> <INDENT> pass | Nitro error code 1355
The vserver already has None Listen Policy | 62598fc9ff9c53063f51a9be |
class PurchasePlanAutoGenerated(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, 'publisher': {'required': True}, 'product': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'publisher': {'key': 'publisher', 'type': 'str'}, 'product'... | Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
All required parameters must be populated in order to send to Azure.
:ivar name: Required. The plan ID.
:vartype name: str
:ivar publisher: Required. The publisher ID.
:vartype publisher: str
:ivar product: Required. Specifies t... | 62598fc963b5f9789fe854e7 |
class TestDeclarativeCommandExtension: <NEW_LINE> <INDENT> @pytest.fixture <NEW_LINE> def config_file(self, tmpdir): <NEW_LINE> <INDENT> config_file = pathlib.Path(str(tmpdir)) / "config.ini" <NEW_LINE> config_file.write_text("[repobee]") <NEW_LINE> return config_file <NEW_LINE> <DEDENT> def test_add_required_option_to... | Test creating command extensions to existing commands. | 62598fc9656771135c4899e2 |
class NotFoundError(HoardException): <NEW_LINE> <INDENT> pass | The related entity could not be found.
:param args[0]: the identity provided by the caller.
:param args[1]: the type of related entity. | 62598fc9283ffb24f3cf3bf7 |
class intSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.vals = [] <NEW_LINE> <DEDENT> def insert(self, e): <NEW_LINE> <INDENT> if not e in self.vals: <NEW_LINE> <INDENT> self.vals.append(e) <NEW_LINE> <DEDENT> <DEDENT> def member(self, e): <NEW_LINE> <INDENT> return e in self.vals <NEW_LI... | An intSet is a set of integers
The value is represented by a list of ints, self.vals.
Each int in the set occurs in self.vals exactly once. | 62598fc997e22403b383b277 |
class PairedDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, datasets, n_elements, max_iters, same=True, pair_based_transforms=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.datasets = datasets <NEW_LINE> self.n_datasets = len(self.datasets) <NEW_LINE> self.n_data = [len(dataset) for dataset in s... | Make pairs of data from dataset
When 'same=True',
a pair contains data from same datasets,
and the choice of datasets for each pair is random.
e.g. [[ds1_3, ds1_2], [ds3_1, ds3_2], [ds2_1, ds2_2], ...]
When 'same=False',
a pair contains data from different datasets,
if 'n_elements' <= # of ... | 62598fc9ec188e330fdf8c08 |
class BaseModel: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.db = init_connection() <NEW_LINE> <DEDENT> def get_email(self, email): <NEW_LINE> <INDENT> query = """SELECT email FROM app_users WHERE email=%s""" <NEW_LINE> cursor = self.db.cursor() <NEW_LINE> cursor.execute(query, (email,)) <NEW_LINE>... | Base model to initiate db | 62598fc93d592f4c4edbb225 |
class TestResult: <NEW_LINE> <INDENT> def __init__(self, status=None, duration=None, tv_ip=None, tv_mac=None): <NEW_LINE> <INDENT> if status is None: <NEW_LINE> <INDENT> self._status = TEST_STATUS.blocked <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._status = TEST_STATUS(status) <NEW_LINE> <DEDENT> self.duration ... | Controller for generating detailed test run results | 62598fc9a8370b77170f074d |
class SizeUnitType (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'SizeUnitType') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('MapsPlatformDescriptor.xsd', 145, 2) <NEW_LINE> _Documentation = None | An atomic simple type. | 62598fc9be7bc26dc9252014 |
class List(core_models.TimeStampedModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=80) <NEW_LINE> user = models.ForeignKey( "users.User", related_name="lists", on_delete=models.CASCADE ) <NEW_LINE> rooms = models.ManyToManyField("rooms.Room", related_name="lists", blank=True) <NEW_LINE> def __str__(self):... | List Model Definition | 62598fc98a349b6b436865b2 |
class BaseTypeDriver(api.TypeDriver): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.physnet_mtus = utils.parse_mappings( cfg.CONF.ml2.physical_network_mtus ) <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> self.physnet_mtus = [] <NEW_LINE> <DEDENT> <DEDENT> def get_... | BaseTypeDriver for functions common to Segment and flat. | 62598fc9cc40096d6161a391 |
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('email', 'password', 'name') <NEW_LINE> extra_kwargs = {'password': {'write_only': True, 'min_length': 5}} <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE>... | Serializer for the users object | 62598fc9f9cc0f698b1c548c |
class Microphone: <NEW_LINE> <INDENT> def __init__(self, usb_port, coord): <NEW_LINE> <INDENT> self.usb_port = usb_port <NEW_LINE> self.coord = coord <NEW_LINE> self.angle = coord.get_angle() <NEW_LINE> self.serial = '' <NEW_LINE> self.buffer = [] <NEW_LINE> self.dt = 0 <NEW_LINE> <DEDENT> def set_buffer(self, test_lis... | Contains a buffer that has all the 64 byte info. The buffer will read off
all the data that the arduino recorded. | 62598fc94a966d76dd5ef24a |
class Tigertail(object): <NEW_LINE> <INDENT> USB_VID = 0x18d1 <NEW_LINE> USB_PID = 0x5027 <NEW_LINE> READ_EP_OFFSET = 0x81 <NEW_LINE> WRITE_EP_OFFSET = 0x1 <NEW_LINE> def __init__(self, serial): <NEW_LINE> <INDENT> devices = usb.core.find(idVendor=self.USB_VID, idProduct=self.USB_PID, find_all=True) <NEW_LINE> if not d... | Class representing a Google Tigertail device.
Args:
serial: A string that's the serial number of the Tigertail device. | 62598fc9fbf16365ca79442d |
class JsonRetrieveMixin(RetrieveModelMixin): <NEW_LINE> <INDENT> def retrieve(self, request, *args, **kwargs): <NEW_LINE> <INDENT> response = super(JsonRetrieveMixin, self).retrieve(request, *args, **kwargs) <NEW_LINE> logger.debug('JsonRetrieveMixin:retrieve:' + str(type(response.data))) <NEW_LINE> return make_respons... | Retrieve a model instance.
override retrieve method
return whth error_code:success | 62598fc97c178a314d78d813 |
class MonitoringInvalidValueTypeError(MonitoringError): <NEW_LINE> <INDENT> def __init__(self, metric, value): <NEW_LINE> <INDENT> self.metric = metric <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Metric "%s" was given invalid value "%s" (%s).' % ( self.metric, self.v... | Raised when sending a metric value is not a valid type. | 62598fc9dc8b845886d53930 |
class SubscriptionPlotting(object): <NEW_LINE> <INDENT> openapi_types = { 'enabled': 'bool', 'theme': 'str' } <NEW_LINE> attribute_map = { 'enabled': 'enabled', 'theme': 'theme' } <NEW_LINE> def __init__(self, enabled=None, theme=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is N... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598fc98a349b6b436865b4 |
@pytest.mark.usefixtures <NEW_LINE> class TestSpiderFootThreadPool(unittest.TestCase): <NEW_LINE> <INDENT> def test_threadPool(self): <NEW_LINE> <INDENT> threads = 10 <NEW_LINE> def callback(x, *args, **kwargs): <NEW_LINE> <INDENT> return (x, args, list(kwargs.items())[0]) <NEW_LINE> <DEDENT> iterable = ["a", "b", "c"]... | Test SpiderFoot | 62598fc95fdd1c0f98e5e301 |
class TestPillarSharingBreadcrumb(BaseBreadcrumbTestCase, SharingBaseTestCase): <NEW_LINE> <INDENT> pillar_type = 'product' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(TestPillarSharingBreadcrumb, self).setUp() <NEW_LINE> login_person(self.driver) <NEW_LINE> <DEDENT> def test_sharing_breadcrumb(self): <NEW_LI... | Test breadcrumbs for the sharing views. | 62598fc9283ffb24f3cf3bfa |
class f_gen(rv_continuous): <NEW_LINE> <INDENT> def _rvs(self, dfn, dfd): <NEW_LINE> <INDENT> return self._random_state.f(dfn, dfd, self._size) <NEW_LINE> <DEDENT> def _pdf(self, x, dfn, dfd): <NEW_LINE> <INDENT> return np.exp(self._logpdf(x, dfn, dfd)) <NEW_LINE> <DEDENT> def _logpdf(self, x, dfn, dfd): <NEW_LINE> <IN... | An F continuous random variable.
%(before_notes)s
Notes
-----
The probability density function for `f` is:
.. math::
f(x, df_1, df_2) = \frac{df_2^{df_2/2} df_1^{df_1/2} x^{df_1 / 2-1}}
{(df_2+df_1 x)^{(df_1+df_2)/2}
B(df_1/2, df_2/2)}
for :math:`x > 0`.... | 62598fc9f9cc0f698b1c548d |
class Messages(list): <NEW_LINE> <INDENT> def __init__(self, msg_list=None, max_history=None): <NEW_LINE> <INDENT> if msg_list: <NEW_LINE> <INDENT> super(Messages, self).__init__(msg_list) <NEW_LINE> <DEDENT> self.max_history = max_history <NEW_LINE> <DEDENT> def append(self, msg): <NEW_LINE> <INDENT> if isinstance(sel... | 多条消息的合集,可用于记录或搜索 | 62598fc971ff763f4b5e7af5 |
class ContrackAccuracy(tf.keras.metrics.Mean): <NEW_LINE> <INDENT> def __init__(self, section_name, dtype=None): <NEW_LINE> <INDENT> self.encodings = Env.get().encodings <NEW_LINE> self.section_name = section_name <NEW_LINE> super(ContrackAccuracy, self).__init__( name=f'{section_name}/accuracy', dtype=dtype) <NEW_LINE... | Computes zero-one accuracy on a given slice of the result vector. | 62598fc9377c676e912f6f31 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.