code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class InputHandlerEvent(object): <NEW_LINE> <INDENT> deserialized_types = { 'name': 'str', 'input_events': 'list[ask_sdk_model.services.game_engine.input_event.InputEvent]' } <NEW_LINE> attribute_map = { 'name': 'name', 'input_events': 'inputEvents' } <NEW_LINE> def __init__(self, name=None, input_events=None): <NEW_LI... | :param name: The name of the event as you defined it in your GameEngine.StartInputHandler directive.
:type name: (optional) str
:param input_events: A chronologically ordered report of the raw Button Events that contributed to this Input Handler Event.
:type input_events: (optional) list[ask_sdk_model.services.game_eng... | 62598fbe7047854f4633f5c5 |
class SSD1351(DisplaySPI): <NEW_LINE> <INDENT> _COLUMN_SET = _SETCOLUMN <NEW_LINE> _PAGE_SET = _SETROW <NEW_LINE> _RAM_WRITE = _WRITERAM <NEW_LINE> _RAM_READ = _READRAM <NEW_LINE> _INIT = ( (_COMMANDLOCK, b"\x12"), (_COMMANDLOCK, b"\xb1"), (_DISPLAYOFF, b""), (_DISPLAYENHANCE, b"\xa4\x00\x00"), (_CLOCKDIV, b"\xf0"), (_... | A simple driver for the SSD1351-based displays.
>>> import busio
>>> import digitalio
>>> import board
>>> from adafruit_rgb_display import color565
>>> import adafruit_rgb_display.ssd1351 as ssd1351
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> display = ssd1351.SSD1351(spi, cs=digitalio.... | 62598fbee5267d203ee6baf1 |
class BreslowFlemingHarringtonFitter(object): <NEW_LINE> <INDENT> def __init__(self, alpha=0.95): <NEW_LINE> <INDENT> self.alpha = alpha <NEW_LINE> <DEDENT> def fit(self, durations, event_observed=None, timeline=None, entry=None, label='BFH-estimate', alpha=None): <NEW_LINE> <INDENT> naf = NelsonAalenFitter(self.alpha)... | Class for fitting the Breslow-Fleming-Harrington estimate for the survival function. This estimator
is a biased estimator of the survival function but is more stable when the popualtion is small and
there are too few early truncation times, it may happen that is the number of patients at risk and
the number of death... | 62598fbe7d43ff24874274fd |
class FilterQueue(object): <NEW_LINE> <INDENT> def __init__(self, bloomd_client=None, crawler_name=None, capacity=1e8, prob=1e-5): <NEW_LINE> <INDENT> if bloomd_client is None: <NEW_LINE> <INDENT> raise FilterError("bloomd_client cannot be None") <NEW_LINE> <DEDENT> if crawler_name is None: <NEW_LINE> <INDENT> raise Fi... | We use this class to define interface to check where url is
crawled or not. We use bloomd server on backend currently. | 62598fbe60cbc95b0636452f |
class NoSuchDriverError(BaseError): <NEW_LINE> <INDENT> pass | Drastic Base Exception. | 62598fbe56ac1b37e63023e0 |
class Visitor(ast.NodeVisitor): <NEW_LINE> <INDENT> def __init__(self, lines): <NEW_LINE> <INDENT> self.parent = self.top = ModuleDecl('', 0) <NEW_LINE> self.lines = lines <NEW_LINE> self.last_lineno = 1 <NEW_LINE> self.closing_decls = [] <NEW_LINE> <DEDENT> def visitdecl(self, node, cls): <NEW_LINE> <INDENT> decl = cl... | Create a Decl tree from a Python abstract syntax tree. | 62598fbe4428ac0f6e658715 |
class Armor(Item): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Chestplate() -> Armor: <NEW_LINE> <INDENT> return Armor("Chestplate", 5) <NEW_LINE> <DEDENT> def __init__(self, name: str, defense: int) -> None: <NEW_LINE> <INDENT> super().__init__(name) <NEW_LINE> self.defense = defense | Represents an armor item. | 62598fbefff4ab517ebcd9d7 |
class InvalidPaginationToken(Route53ClientError): <NEW_LINE> <INDENT> code = 400 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> message = ( "Route 53 can't get the next page of query logging configurations " "because the specified value for NextToken is invalid." ) <NEW_LINE> super().__init__("InvalidPaginationToke... | Bad NextToken specified when listing query logging configs. | 62598fbecc40096d6161a2d2 |
class MapRelativeVectorSpaceToRelativeNumberField(NumberFieldIsomorphism): <NEW_LINE> <INDENT> def __init__(self, V, K): <NEW_LINE> <INDENT> NumberFieldIsomorphism.__init__(self, Hom(V, K)) <NEW_LINE> <DEDENT> def _call_(self, v): <NEW_LINE> <INDENT> K = self.codomain() <NEW_LINE> B = K.base_field().absolute_field('a')... | EXAMPLES::
sage: L.<b> = NumberField(x^4 + 3*x^2 + 1)
sage: K = L.relativize(L.subfields(2)[0][1], 'a'); K
Number Field in a with defining polynomial x^2 - b0*x + 1 over its base field
sage: V, fr, to = K.relative_vector_space()
sage: V
Vector space of dimension 2 over Number Field in b0 with d... | 62598fbedc8b845886d537ad |
class SimpleVirus(object): <NEW_LINE> <INDENT> def __init__(self, maxBirthProb, clearProb): <NEW_LINE> <INDENT> self.maxBirthProb = maxBirthProb <NEW_LINE> self.clearProb = clearProb <NEW_LINE> <DEDENT> def getMaxBirthProb(self): <NEW_LINE> <INDENT> return self.maxBirthProb <NEW_LINE> <DEDENT> def getClearProb(self): <... | Representation of a simple virus (does not model drug effects/resistance). | 62598fbecc0a2c111447b200 |
class SoundFile: <NEW_LINE> <INDENT> def __init__(self, filepath, volume=1): <NEW_LINE> <INDENT> self.filepath = filepath <NEW_LINE> self.volume = volume <NEW_LINE> <DEDENT> async def play(self, client, channel): <NEW_LINE> <INDENT> voice = await client.join_voice_channel(channel) <NEW_LINE> player = voice.create_ffmpe... | A class representing a sound file | 62598fbe167d2b6e312b7169 |
class ValueEstimator(): <NEW_LINE> <INDENT> def __init__(self, learning_rate=0.1, scope="value_estimator"): <NEW_LINE> <INDENT> with tf.variable_scope(scope): <NEW_LINE> <INDENT> self.state = tf.placeholder(tf.int32, [], "state") <NEW_LINE> self.target = tf.placeholder(dtype=tf.float32, name="target") <NEW_LINE> state_... | Value Function approximator. | 62598fbe97e22403b383b0fc |
class DdosProtectionPlan(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, 'resource_guid': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'virtual_networks': {'readonly': True}, }... | A DDoS protection plan in a resource group.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Resource location.
:type location: st... | 62598fbeadb09d7d5dc0a771 |
class zAttr(Attr): <NEW_LINE> <INDENT> ENTRY_ = const.zENTRY_ <NEW_LINE> ENTRY_DATA_ = const.zENTRY_DATA_ <NEW_LINE> SCOPE = const.VARIABLE_SCOPE <NEW_LINE> ENTRY_EXISTENCE_ = const.zENTRY_EXISTENCE_ <NEW_LINE> ATTR_NUMENTRIES_ = const.ATTR_NUMzENTRIES_ <NEW_LINE> ATTR_MAXENTRY_ = const.ATTR_MAXzENTRY_ <NEW_LINE> ENTRY... | zAttribute for zVariables within a CDF.
.. warning::
Because zAttributes are shared across all variables in a CDF,
directly manipulating them may have unexpected consequences.
It is safest to operate on zEntries via :class:`zAttrList`.
.. note::
When accessing a zAttr, pyCDF exposes only the zEntry co... | 62598fbe66656f66f7d5a5e7 |
class BatchTuner(Tuner): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.count = -1 <NEW_LINE> self.values = [] <NEW_LINE> <DEDENT> def is_valid(self, search_space): <NEW_LINE> <INDENT> if not len(search_space) == 1: <NEW_LINE> <INDENT> raise RuntimeError('BatchTuner only supprt one combined-paramreter... | BatchTuner is tuner will running all the configure that user want to run batchly.
The search space only be accepted like:
{
'combine_params': { '_type': 'choice',
'_value': '[{...}, {...}, {...}]',
}
} | 62598fbe56ac1b37e63023e2 |
class CueSheetTrack(object): <NEW_LINE> <INDENT> def __init__(self, track_number, start_offset, isrc='', type_=0, pre_emphasis=False): <NEW_LINE> <INDENT> self.track_number = track_number <NEW_LINE> self.start_offset = start_offset <NEW_LINE> self.isrc = isrc <NEW_LINE> self.type = type_ <NEW_LINE> self.pre_emphasis = ... | CueSheetTrack()
A track in a cuesheet.
For CD-DA, track_numbers must be 1-99, or 170 for the
lead-out. Track_numbers must be unique within a cue sheet. There
must be atleast one index in every track except the lead-out track
which must have none.
Attributes:
track_number (`int`): track number
start_offset (`... | 62598fbe99fddb7c1ca62ee6 |
@python_2_unicode_compatible <NEW_LINE> class Submit(models.Model): <NEW_LINE> <INDENT> receiver = models.ForeignKey(SubmitReceiver) <NEW_LINE> user = models.ForeignKey(django_settings.AUTH_USER_MODEL) <NEW_LINE> time = models.DateTimeField(auto_now_add=True) <NEW_LINE> filename = models.CharField(max_length=128, blank... | Submit holds information about user-submitted data. | 62598fbe21bff66bcd722e5e |
class Contact_info(models.Model): <NEW_LINE> <INDENT> address = models.CharField(verbose_name='地址', max_length=30) <NEW_LINE> phone_regex = RegexValidator(regex=r'^\+?1?\d{9,15}$', message="号码格式不正确") <NEW_LINE> phone_number = models.CharField('手机号码', max_length=20, validators=[phone_regex], blank=True) <NEW_LINE> custo... | 联系方式 | 62598fbe377c676e912f6e6c |
class LDIFDeltaModificationMissingEndDashError(ldifprotocol.LDIFParseError): <NEW_LINE> <INDENT> pass | LDIF delta modification has no ending dash. | 62598fbebf627c535bcb169a |
class LatencyAwareRequestSimulator(object): <NEW_LINE> <INDENT> def __init__( self, worker_desc, load_balancer, latency_fn, number_of_requests, request_per_s): <NEW_LINE> <INDENT> self.worker_desc = worker_desc <NEW_LINE> self.load_balancer = load_balancer <NEW_LINE> self.latency_fn = latency_fn <NEW_LINE> self.number_... | Simulates a M/G/k process common in request processing (computing)
:param worker_desc: A list of ints of capacities to construct workers with
:param local_balancer: A function which takes the current request number
the list of workers and the request time and returns the index of the
worker to send the next re... | 62598fbe76e4537e8c3ef79b |
class AbstractGameUnit(metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, name=''): <NEW_LINE> <INDENT> self.max_hp = 0 <NEW_LINE> self.health_meter = 0 <NEW_LINE> self.name = name <NEW_LINE> self.enemy = None <NEW_LINE> self.unit_type = None <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def info(self): <NEW_L... | An Abstract base class for creating various game characters | 62598fbe4f6381625f1995bc |
class SmartFormatBaseException(Exception): <NEW_LINE> <INDENT> pass | Base for every SmartFormat template tag exceptions. | 62598fbe283ffb24f3cf3a78 |
class IfNode(Node): <NEW_LINE> <INDENT> def __init__(self, predicate): <NEW_LINE> <INDENT> self.predicate = predicate <NEW_LINE> self.child = None <NEW_LINE> <DEDENT> def set_child(self, child): <NEW_LINE> <INDENT> self.child = child <NEW_LINE> <DEDENT> def evaluate(self, context): <NEW_LINE> <INDENT> if eval(self.pred... | Renders content if predicate | 62598fbe5fdd1c0f98e5e187 |
class ParseOFX(IPlugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.is_activated = False <NEW_LINE> <DEDENT> def build_journal(self, ofx_file, config): <NEW_LINE> <INDENT> tree = OFXTree() <NEW_LINE> tree.parse(ofx_file) <NEW_LINE> ofx_obj = tree.convert() <NEW_LINE> stop_words = config.get('stop_... | OFX file parsing. | 62598fbe2c8b7c6e89bd39b6 |
class SystemDCache(object): <NEW_LINE> <INDENT> _cache = None <NEW_LINE> @staticmethod <NEW_LINE> def get(): <NEW_LINE> <INDENT> if SystemDCache._cache is None: <NEW_LINE> <INDENT> SystemDCache._cache = [] <NEW_LINE> out = check_run_cmd("systemctl", "list-units", "-q", "--full", "--type=service", "--system", "--no-page... | Global cache to list SystemD units named ssh tunnel | 62598fbeaad79263cf42e9cb |
class Course(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'courses' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> course_name = db.Column(db.Unicode(32),unique=True,index=True) <NEW_LINE> course_credit = db.Column(db.Integer) <NEW_LINE> course_college = db.Column(db.Unicode(32)) | 课程表,存储所有课程信息 | 62598fbe4527f215b58ea0c4 |
class EventList(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._evtlist = list() <NEW_LINE> <DEDENT> def append(self, object): <NEW_LINE> <INDENT> self._evtlist.append(object) <NEW_LINE> <DEDENT> def getEventListToRawData(self): <NEW_LINE> <INDENT> out = [] <NEW_LINE> for day in self._evtlist: <NEW... | イベントリストを格納するリストオブジェクト | 62598fbea8370b77170f05d6 |
class HTTPException(DiscodoException): <NEW_LINE> <INDENT> def __init__(self, status: int, data=None) -> None: <NEW_LINE> <INDENT> if not data: <NEW_LINE> <INDENT> data = {} <NEW_LINE> <DEDENT> self.status = data.get("status", status) <NEW_LINE> self.description = data.get( "description", responses.get(status, "Unknown... | Exception that is thrown when HTTP operation failed.
:var int status: HTTP status code
:var str description: Description of the HTTP status code
:var str message: Server message with this request | 62598fbe5fc7496912d48376 |
class PrivateDnsZoneConfig(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'record_sets': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'... | PrivateDnsZoneConfig resource.
Variables are only populated by the server, and will be ignored when sending a request.
:param name: Name of the resource that is unique within a resource group. This name can be used
to access the resource.
:type name: str
:ivar id: The id of the privateDnsZoneConfig.
:vartype id: str... | 62598fbef9cc0f698b1c53ca |
class SupportedRuntimePlatform(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> JAVA = "Java" <NEW_LINE> _NET_CORE = ".NET Core" | The platform of this runtime version (possible values: "Java" or ".NET").
| 62598fbe99fddb7c1ca62ee7 |
class Mailwrapper(Gmail): <NEW_LINE> <INDENT> def __init__(self, gm): <NEW_LINE> <INDENT> self.attachments = gm.attachments <NEW_LINE> self.body = gm.body <NEW_LINE> self.to = gm.to <NEW_LINE> self.cc = gm.cc <NEW_LINE> self.flags = gm.flags <NEW_LINE> self.headers = gm.headers <NEW_LINE> self.message_id = gm.message_i... | Wrapper per selezionare i soli campi d'interesse dalle mail e salvarle in
un file json | 62598fbedc8b845886d537b1 |
class AtRule(object): <NEW_LINE> <INDENT> def __init__(self, at_keyword, head, body, line, column): <NEW_LINE> <INDENT> self.at_keyword = at_keyword <NEW_LINE> self.head = TokenList(head) <NEW_LINE> self.body = TokenList(body) if body is not None else body <NEW_LINE> self.line = line <NEW_LINE> self.column = column <NE... | An unparsed at-rule.
.. attribute:: at_keyword
The normalized (lower-case) at-keyword as a string. Eg: ``'@page'``
.. attribute:: head
The part of the at-rule between the at-keyword and the ``{``
marking the body, or the ``;`` marking the end of an at-rule without
a body. A :class:`~.token_data.Tok... | 62598fbe7c178a314d78d696 |
class ShowHighlight(Mbase_subcmd.DebuggerSubcommand): <NEW_LINE> <INDENT> short_help = 'Show if we use terminal highlight' <NEW_LINE> def run(self, args): <NEW_LINE> <INDENT> val = self.settings['highlight'] <NEW_LINE> if 'plain' == val: <NEW_LINE> <INDENT> mess = 'output set to not use terminal escape sequences' <NEW_... | **show highlight**
Show whether we use terminal highlighting.
See also:
--------
`set highlight` | 62598fbe63d6d428bbee29a8 |
class MockedUser: <NEW_LINE> <INDENT> def __init__(self, username): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.top_artists = [] | mocks query_user reponse | 62598fbe7047854f4633f5cb |
class Transformations(object): <NEW_LINE> <INDENT> def mean_at_zero(self, arr): <NEW_LINE> <INDENT> return np.array([i - np.mean(a) for i in arr]) <NEW_LINE> <DEDENT> def norm_to_min_zero(self, arr): <NEW_LINE> <INDENT> return np.array([i / max(a) for i in arr]) <NEW_LINE> <DEDENT> def norm_to_absolute_min_zero(self, a... | since these transformations are all related, we'll nest them all under a feature norm class | 62598fbe0fa83653e46f50db |
class AsciiToImage(object): <NEW_LINE> <INDENT> def __init__(self, **kw): <NEW_LINE> <INDENT> self._font = kw.get('font', pkg_resources.resource_filename( 'mediagoblin.media_types.ascii', os.path.join('fonts', 'Inconsolata.otf'))) <NEW_LINE> self._font_size = kw.get('font_size', 11) <NEW_LINE> self._if = ImageFont.true... | Converter of ASCII art into image files, preserving whitespace
kwargs:
- font: Path to font file
default: fonts/Inconsolata.otf
- font_size: Font size, ``int``
default: 11 | 62598fbe26068e7796d4cb53 |
class Meta2Rebuild(SingleServiceCommandMixin, XcuteRdirCommand): <NEW_LINE> <INDENT> JOB_CLASS = Meta2RebuildJob <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(Meta2Rebuild, self).get_parser(prog_name) <NEW_LINE> SingleServiceCommandMixin.patch_parser(self, parser) <NEW_LINE> parser.add_... | [BETA] Rebuild bases that were on the specified service. | 62598fbe099cdd3c636754de |
@admin.register(models.FBARegion) <NEW_LINE> class FBARegionAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> fields = [ "name", "default_country", "postage_price", "max_weight", "max_size", "fulfillment_unit", "currency", "auto_close", "warehouse_required", ] <NEW_LINE> list_display = [ "name", "default_country", "postage_... | Model admin for the FBARegion model. | 62598fbeaad79263cf42e9cc |
class ParserNode: <NEW_LINE> <INDENT> def __init__(self, grammar, begin, prior, visual): <NEW_LINE> <INDENT> self.grammar = grammar <NEW_LINE> self.begin = begin <NEW_LINE> self.prior = prior <NEW_LINE> self.visual = visual <NEW_LINE> <DEDENT> def debug_log(self, out, indent, data): <NEW_LINE> <INDENT> out( "%sParserNo... | A parser node represents a span of grammar. i.e. from this point to that
point is HTML. Another parser node would represent the next segment, of
grammar (maybe JavaScript, CSS, comment, or quoted string for example. | 62598fbe796e427e5384e98d |
class WindowState: <NEW_LINE> <INDENT> def __init__(self, window_state): <NEW_LINE> <INDENT> self.x = window_state[3] <NEW_LINE> alerts_data = window_state[1] <NEW_LINE> if alerts_data is not None: <NEW_LINE> <INDENT> alerts = alerts_data[1] <NEW_LINE> self.alerts = [ Alert(alert_data) for alert_data in alerts ] <NEW_L... | Represents the window.STATE variable in the Google Alerts page.
This variable is a Javascript array containing all information regarding
every alert, information about the logged in user account and some other
information as well. | 62598fbe7cff6e4e811b5c1a |
class RsaModel(ModelBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(RsaModel, self).__init__() <NEW_LINE> self.model_param = RsaParam() <NEW_LINE> <DEDENT> def fit(self, data_inst): <NEW_LINE> <INDENT> LOGGER.info("RsaModel start fit...") <NEW_LINE> LOGGER.debug("data_inst={}, count={}".format(... | encrypt data using RSA
Parameters
----------
RsaParam : object, self-define id_process parameters,
define in federatedml.param.rsa_param | 62598fbed7e4931a7ef3c28b |
class BatchProcessingCommand(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument('fields', nargs='+', help="A sequence of " "model-field name pairs in the form 'Model.field'") <NEW_LINE> <DEDENT> def precondition_check(self, options, model, field): <NEW_LINE> <INDE... | A ``BatchProcessingCommand`` provides utilities for manipulating a sequence
of fields, which would be useful for cleaning or exporting data. | 62598fbeff9c53063f51a846 |
class Test: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def test_func(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def next_test_func(self): <NEW_LINE> <INDENT> pass | class doc string | 62598fbe3317a56b869be64b |
class Operator(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def display(cls): <NEW_LINE> <INDENT> game.set_board('lower') <NEW_LINE> game.grid.draw_board() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def spawn(cls): <NEW_LINE> <INDENT> game.set_board('upper') <NEW_LINE> game.grid.draw_board() <NEW_LINE> <DEDENT... | Handles receiving, parsing, and triaging incoming signals | 62598fbee1aae11d1e7ce921 |
class permutation_dict(dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._phook_setitem_ = lambda key, val: val <NEW_LINE> self._phook_getitem_ = lambda key, val: val <NEW_LINE> <DEDENT> def __setitem__(self, arg, val): <NEW_LINE> <INDE... | A modification of dict.
Tuple keys are considered equal, if the first can be obtained by permuting the second.
For example (1, 3, 2, 0) == (0, 1, 2, 3)
Also, hooks for __getitem__ and __setitem__ are provided. | 62598fbecc40096d6161a2d5 |
class CharacterStatistics(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> damage = models.IntegerField() <NEW_LINE> icon = models.CharField(max_length=255) <NEW_LINE> rarity = models.CharField(max_length=20) | To be changed | 62598fbe5166f23b2e2435d7 |
class UNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_classes, num_filters=32, pretrained=True): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.resnet = resnet50(pretrained=pretrained) <NEW_LINE> self.enc0 = nn.Sequential(self.resnet.conv1, self.resnet.bn1, self.resnet.relu, self.resnet.maxpool) <NE... | The "U-Net" architecture for semantic segmentation, adapted by changing the encoder to a ResNet feature extractor.
Also known as AlbuNet due to its inventor Alexander Buslaev. | 62598fbea8370b77170f05d9 |
class TaskStatus(object): <NEW_LINE> <INDENT> NONE = SimpleString("None") <NEW_LINE> READY = SimpleString("Ready") <NEW_LINE> QUEUE = SimpleString("Queue") <NEW_LINE> RUNNING = SimpleString("Running") <NEW_LINE> STOPPING = SimpleString("Stopping") <NEW_LINE> STOPPED = SimpleString("Stopped") <NEW_LINE> INVALID = Simple... | add in version 0.1.19 | 62598fbedc8b845886d537b3 |
class Int(SimpleSpace): <NEW_LINE> <INDENT> def __init__(self, lower, upper, default=None): <NEW_LINE> <INDENT> self.lower = lower <NEW_LINE> self.upper = upper <NEW_LINE> self._default = default <NEW_LINE> <DEDENT> def get_hp(self, name): <NEW_LINE> <INDENT> return CSH.UniformIntegerHyperparameter(name=name, lower=sel... | Search space for numeric hyperparameter that takes integer values.
Parameters
----------
lower : int
The lower bound of the search space (minimum possible value of hyperparameter)
upper : int
The upper bound of the search space (maximum possible value of hyperparameter)
default : int (optional)
Default val... | 62598fbe4a966d76dd5ef0cc |
class IdentityCache(Cache): <NEW_LINE> <INDENT> def __init__(self, django_session): <NEW_LINE> <INDENT> self._db = DjangoSessionCacheAdapter(django_session, '_identities') <NEW_LINE> self._sync = True <NEW_LINE> <DEDENT> def get(self, name_id, entity_id, *args, **kwargs): <NEW_LINE> <INDENT> info = super(IdentityCache,... | Handles information about the users that have been succesfully
logged in.
This information is useful because when the user logs out we must
know where does he come from in order to notify such IdP/AA.
The current implementation stores this information in the Django session. | 62598fbe71ff763f4b5e7974 |
class ExecutorDriverThread(ExceptionalThread): <NEW_LINE> <INDENT> def __init__(self, driver): <NEW_LINE> <INDENT> self._driver = driver <NEW_LINE> super(ExecutorDriverThread, self).__init__() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> self._driver.run() | Start the executor and wait until it is stopped.
This is decoupled from the main thread, because only the main thread can receive signals
and we would miss those when blocking in the driver run method. | 62598fbe63b5f9789fe8536a |
class MiningJob: <NEW_LINE> <INDENT> def __init__(self, previous_block: Block, pending_txs: List[Transaction]): <NEW_LINE> <INDENT> self.previous_block = previous_block <NEW_LINE> self.pending_txs = pending_txs <NEW_LINE> data = { 'txs': [dataclasses.asdict(_) for _ in self.pending_txs], } <NEW_LINE> self.block = Block... | CPU挖矿的一个工作 | 62598fbe0fa83653e46f50de |
class OperationNameNode(Node): <NEW_LINE> <INDENT> def __init__(self, ident): <NEW_LINE> <INDENT> self.ident = ident | A Node which represents the name of an operation in the AST. | 62598fbe50812a4eaa620ce7 |
class TeachingUsePropertyCode(models.Model): <NEW_LINE> <INDENT> code = models.CharField(primary_key=True, max_length=2, verbose_name=u"代码") <NEW_LINE> name = models.CharField(unique=True, max_length=32, verbose_name=u"名称") <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name | 教学使用性质 | 62598fbe44b2445a339b6a73 |
class LocationComparator: <NEW_LINE> <INDENT> def __init__(self, posting_location, candidate_locations): <NEW_LINE> <INDENT> self.api_key = "AIzaSyDbkAJndXb-HX6cj4LYYaB8Nm98DmI3D7Y" <NEW_LINE> self.posting_location = posting_location <NEW_LINE> self.candidate_locations = [] <NEW_LINE> self.max_distance = 100000 <NEW_LI... | This class uses the google maps api to compare the different locations offered by the user against the location
specified for the posting by the employer | 62598fbed486a94d0ba2c1ca |
class CannotRedefineSnipIDError(SnippetError): <NEW_LINE> <INDENT> def __init__(self, snippet): <NEW_LINE> <INDENT> msg = ('Attempted to overwrite snip_id {} for snippet {} ' '(has this snippet already been committed?)' ).format(snippet.snip_id, str(snippet)) <NEW_LINE> super(CannotRedefineSnipIDError, self).__init__(s... | Attempted to redefine snip_id in committed snippet | 62598fbe3346ee7daa337745 |
class MathBlock(Block): <NEW_LINE> <INDENT> def __init__(self, parent, idevice): <NEW_LINE> <INDENT> Block.__init__(self, parent, idevice) <NEW_LINE> self.contentElement = MathElement(idevice.content) <NEW_LINE> self.contentElement.height = 250 <NEW_LINE> <DEDENT> def process(self, request): <NEW_LINE> <INDENT> Block.p... | MathBlock can render and process MathIdevices as XHTML | 62598fbe21bff66bcd722e64 |
class Thing(Response): <NEW_LINE> <INDENT> _validation = { '_type': {'required': True}, 'id': {'readonly': True}, 'web_search_url': {'readonly': True}, 'name': {'readonly': True}, 'url': {'readonly': True}, 'image': {'readonly': True}, 'description': {'readonly': True}, 'bing_id': {'readonly': True}, } <NEW_LINE> _attr... | Thing.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: CreativeWork, Intangible
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param _type: Required. Constant f... | 62598fbebe7bc26dc9251f59 |
class TestOWLUnaryPropertyAxiom(TestCase): <NEW_LINE> <INDENT> pass | OWLUnaryPropertyAxiom test cases | 62598fbed268445f26639c81 |
class XNORGate(Block): <NEW_LINE> <INDENT> def __init__(self,system,numInput,sizeInput): <NEW_LINE> <INDENT> self.numInput = numInput <NEW_LINE> self.name = "XNOR_GATE" <NEW_LINE> self.sizeInput = sizeInput <NEW_LINE> input_vector = [sizeInput]*self.numInput <NEW_LINE> output_vector = [sizeInput] <NEW_LINE> super().__i... | XNOR Gate
PORTS SPECIFICATIONS | 62598fbe4527f215b58ea0c8 |
class JobRepository(JobRepositoryInterface): <NEW_LINE> <INDENT> def find(self, uuid: 'UUID') -> Job: <NEW_LINE> <INDENT> return self._find({'uuid': uuid}) <NEW_LINE> <DEDENT> def create(self, **kwargs) -> Job: <NEW_LINE> <INDENT> return Job.objects.create(**kwargs) <NEW_LINE> <DEDENT> def get_or_create(self, **kwargs)... | Implementation of the interface that define operations over the database. | 62598fbe091ae35668704e1f |
class Light: <NEW_LINE> <INDENT> def __init__(self, device, index): <NEW_LINE> <INDENT> self.device = device <NEW_LINE> self.index = index <NEW_LINE> <DEDENT> @property <NEW_LINE> def state(self): <NEW_LINE> <INDENT> return self.raw.get(ATTR_LIGHT_STATE) == 1 <NEW_LINE> <DEDENT> @property <NEW_LINE> def dimmer(self): <... | Represent a light control.
https://github.com/IPSO-Alliance/pub/blob/master/docs/IPSO-Smart-Objects.pdf | 62598fbe9f28863672818978 |
class AgeInsight(DemographicInsight): <NEW_LINE> <INDENT> def __init__(self, percentage=None, age=None, **kwargs): <NEW_LINE> <INDENT> super(AgeInsight, self).__init__(percentage=percentage, **kwargs) <NEW_LINE> self.age = age | AgeInsight. | 62598fbe3d592f4c4edbb0b9 |
class _TSeenSecondary(typing.NamedTuple): <NEW_LINE> <INDENT> schema_name: str <NEW_LINE> property_name: str | Records information about the secondary that has been seen. | 62598fbe7047854f4633f5cf |
class VirusTotalWhoisDialog(QDialog, Ui_VirusTotalWhoisDialog): <NEW_LINE> <INDENT> def __init__(self, domain, whois, parent=None): <NEW_LINE> <INDENT> super(VirusTotalWhoisDialog, self).__init__(parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.headerLabel.setText( self.tr("<b>Whois information for domain {0}</b>"... | Class implementing a dialog to show the 'whois' information. | 62598fbeec188e330fdf8a8d |
class DataProject(Base): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def cast(arg): <NEW_LINE> <INDENT> return DataProject() <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return str() <NEW_LINE> <DEDENT> @name.setter <NEW_L... | Represents the master branch project within a hub. | 62598fbe55399d3f05626711 |
class GRUCell(RNNCellBase): <NEW_LINE> <INDENT> def __init__(self, input_size: int, hidden_size: int, bias: bool = True): <NEW_LINE> <INDENT> super().__init__(input_size, hidden_size, bias, num_chunks=3) <NEW_LINE> <DEDENT> def construct(self, inputs, hx): <NEW_LINE> <INDENT> return gru_cell(inputs, hx, self.weight_ih,... | A GRU(Gated Recurrent Unit) cell.
.. math::
\begin{array}{ll}
r = \sigma(W_{ir} x + b_{ir} + W_{hr} h + b_{hr}) \\
z = \sigma(W_{iz} x + b_{iz} + W_{hz} h + b_{hz}) \\
n = \tanh(W_{in} x + b_{in} + r * (W_{hn} h + b_{hn})) \\
h' = (1 - z) * n + z * h
\end{array}
Here :math:`\sigma` is the sig... | 62598fbe5fdd1c0f98e5e18d |
class PredPreyEnv(se.SpatialEnv): <NEW_LINE> <INDENT> repop = True <NEW_LINE> def __init__(self, name, length, height, preact=True, postact=True, model_nm="predprey_model"): <NEW_LINE> <INDENT> super().__init__(name, length, height, preact, postact, model_nm=model_nm) <NEW_LINE> self.agents.set_num_zombies(self.props.g... | This class creates an environment for predators
to chase and eat prey | 62598fbe7d43ff2487427502 |
class RebootTest(base_test.BaseTestClass): <NEW_LINE> <INDENT> def setUpClass(self): <NEW_LINE> <INDENT> self.dut = self.android_devices[0] <NEW_LINE> <DEDENT> def testReboot(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.dut.reboot() <NEW_LINE> self.dut.waitForBootCompletion() <NEW_LINE> <DEDENT> except util... | Tests if device survives reboot.
Attributes:
dut: AndroidDevice, the device under test as config | 62598fbea8370b77170f05dc |
@python_2_unicode_compatible <NEW_LINE> class SurveyForm(TimeStampedModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=255, db_index=True, unique=True) <NEW_LINE> form = models.TextField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> app_label = 'survey' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDE... | Model to define a Survey Form that contains the HTML form data
that is presented to the end user. A SurveyForm is not tied to
a particular run of a course, to allow for sharing of Surveys
across courses
.. no_pii: | 62598fbed7e4931a7ef3c290 |
class Session(object): <NEW_LINE> <INDENT> session_re = re.compile( r'^(?P<protocol>https?)://(?P<host>([a-z0-9-_])+(\.[a-z0-9-_]+){0,})(:(?P<port>\d{1,5}))?$' ) <NEW_LINE> def __init__(self, protocol, host, port=None): <NEW_LINE> <INDENT> self.protocol = protocol <NEW_LINE> self.host = host <NEW_LINE> if port is None:... | Elasticsearch session
| 62598fbe99fddb7c1ca62eea |
class Interface: <NEW_LINE> <INDENT> def __init__(self, game): <NEW_LINE> <INDENT> self.game = game <NEW_LINE> pg.init() <NEW_LINE> self.window = pg.display.set_mode((640, 600)) <NEW_LINE> self.window.fill((230, 230, 230)) <NEW_LINE> pg.display.set_caption("MacGseyver Escape") <NEW_LINE> self.sprites = { FLOOR: pg.imag... | Control the view of the game using pygame | 62598fbe5fdd1c0f98e5e18e |
@ComponentFactory(FACTORY_REQUIRES_BEST) <NEW_LINE> @RequiresBest('service', IEchoService) <NEW_LINE> class RequiresBestComponentFactory(TestComponentFactory): <NEW_LINE> <INDENT> @Bind <NEW_LINE> def bind(self, svc, svc_ref): <NEW_LINE> <INDENT> self.states.append(IPopoEvent.BOUND) <NEW_LINE> <DEDENT> @Unbind <NEW_LIN... | Component factory with a RequiresBest requirement | 62598fbe4527f215b58ea0ca |
class SuiteEntryUpdateModel(Model): <NEW_LINE> <INDENT> _attribute_map = { 'child_suite_id': {'key': 'childSuiteId', 'type': 'int'}, 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, 'test_case_id': {'key': 'testCaseId', 'type': 'int'} } <NEW_LINE> def __init__(self, child_suite_id=None, sequence_number=None... | SuiteEntryUpdateModel.
:param child_suite_id: Id of child suite in a suite
:type child_suite_id: int
:param sequence_number: Updated sequence number for the test case or child suite in the suite
:type sequence_number: int
:param test_case_id: Id of a test case in a suite
:type test_case_id: int | 62598fbe091ae35668704e21 |
class NumpyToTensor(object): <NEW_LINE> <INDENT> def __call__(self, img): <NEW_LINE> <INDENT> x = torch.from_numpy(img) <NEW_LINE> return x | Converts numpy array to PyTorch tensor. | 62598fbe442bda511e95c65b |
class ResolutionEmailView(generic.DetailView): <NEW_LINE> <INDENT> model = ResolutionEmail | View to get the details of one resolution email | 62598fbe66673b3332c305cf |
@override_settings(EMAIL_BACKEND="anymail.backends.mailgun.EmailBackend") <NEW_LINE> class MailgunBackendImproperlyConfiguredTests(SimpleTestCase, AnymailTestMixin): <NEW_LINE> <INDENT> def test_missing_api_key(self): <NEW_LINE> <INDENT> with self.assertRaises(ImproperlyConfigured) as cm: <NEW_LINE> <INDENT> mail.send_... | Test ESP backend without required settings in place | 62598fbe71ff763f4b5e7978 |
class MessageContactModel(S3Model): <NEW_LINE> <INDENT> names = ("msg_contact", ) <NEW_LINE> def model(self): <NEW_LINE> <INDENT> T = current.T <NEW_LINE> tablename = "msg_contact" <NEW_LINE> self.define_table(tablename, self.super_link("message_id", "msg_message"), self.msg_channel_id(), s3_datetime(default = "now"), ... | Contact Form | 62598fbeec188e330fdf8a90 |
class AzureAsyncOperationResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'error': {'key': 'error', 'type': 'Error'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(AzureAsyncOperationResult, self).__init__(**kwargs) <NEW_LINE... | The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response bod... | 62598fbe7b180e01f3e4914e |
class ExtendedQLabel(QtGui.QLabel): <NEW_LINE> <INDENT> zoom = Signal(QtGui.QWheelEvent, name="zoom") <NEW_LINE> pan = Signal(QtGui.QMoveEvent, name="pan") <NEW_LINE> DELTA2 = 100 <NEW_LINE> def __init__(self, parent): <NEW_LINE> <INDENT> QtGui.QLabel.__init__(self, parent) <NEW_LINE> self.old_pos = None <NEW_LINE> <DE... | Extenstion for Qlabel with pan and zoom function used to display images
| 62598fbe55399d3f05626713 |
class TradeList(object): <NEW_LINE> <INDENT> def __init__(self, trades: list=None): <NEW_LINE> <INDENT> self.trades = trades or [] <NEW_LINE> <DEDENT> def add_trade(self, trade: Trade): <NEW_LINE> <INDENT> self.trades.append(trade) <NEW_LINE> <DEDENT> def get_trades_in_interval(self) -> list: <NEW_LINE> <INDENT> interv... | Contains a list of trade transactions, along with helper methods
to process the transaction list | 62598fbe656771135c48986c |
class GitNameNotFound(ContinuousIntegrationException): <NEW_LINE> <INDENT> pass | Describes a missing Git Name. | 62598fbe956e5f7376df577d |
class Condition: <NEW_LINE> <INDENT> META_DATA_HEADER = "\t".join(["isTs", "is1stLast", "prevCol", "del.t", "condName"]) + "\n" <NEW_LINE> def __init__(self, condition_name, gene_mapping): <NEW_LINE> <INDENT> self.name = condition_name <NEW_LINE> self.gene_mapping = pd.Series(gene_mapping, name=condition_name) <NEW_LIN... | A condition maps gene names to numbers which often represent expression levels.
Parameters
----------
condition_name: str
A unique name identifying the condition.
gene_mapping: pd.Series
A pandas Series holding the gene to number mapping or an object that
can be converted to a pandas Series. | 62598fbe7cff6e4e811b5c20 |
class ParallelDevice(object): <NEW_LINE> <INDENT> def __init__(self, components): <NEW_LINE> <INDENT> global _next_device_number, _next_device_number_lock <NEW_LINE> self.components = tuple(components) <NEW_LINE> ctx = context.context() <NEW_LINE> with _next_device_number_lock: <NEW_LINE> <INDENT> self.name = "{}/devic... | A device which executes operations in parallel. | 62598fbead47b63b2c5a7a53 |
class _ClippingPlaneRemoveAll(CommandManager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(_ClippingPlaneRemoveAll, self).__init__() <NEW_LINE> self.resources = { "Pixmap": "fem-clipping-plane-remove-all", "MenuText": QtCore.QT_TRANSLATE_NOOP( "FEM_ClippingPlaneRemoveAll", "Remove all clipping pla... | The FEM_ClippingPlaneemoveAll command definition | 62598fbe796e427e5384e993 |
class UPCCodeGenerator(CCodeGenerator): <NEW_LINE> <INDENT> pass | A BRAID-style code generator for UPC. | 62598fbe57b8e32f5250821c |
class TestAddressResource(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 testAddressResource(self): <NEW_LINE> <INDENT> pass | AddressResource unit test stubs | 62598fbe7d847024c075c5bb |
class CustomUser(AbstractBaseUser): <NEW_LINE> <INDENT> name = models.CharField(_('name'), max_length=254, blank=True, default="") <NEW_LINE> email = models.EmailField(_('email address'), max_length=254, unique=True) <NEW_LINE> date_of_birth = models.DateField(blank=True, null=True) <NEW_LINE> is_staff = models.Boolean... | A custom user class that basically mirrors Django's `AbstractUser` class | 62598fbe5166f23b2e2435dd |
class ExactMarginalLogLikelihood(MarginalLogLikelihood): <NEW_LINE> <INDENT> def __init__(self, likelihood, model): <NEW_LINE> <INDENT> if not isinstance(likelihood, _GaussianLikelihoodBase): <NEW_LINE> <INDENT> raise RuntimeError("Likelihood must be Gaussian for exact inference") <NEW_LINE> <DEDENT> super(ExactMargina... | The exact marginal log likelihood (MLL) for an exact Gaussian process with a
Gaussian likelihood.
.. note::
This module will not work with anything other than a :obj:`~gpytorch.likelihoods.GaussianLikelihood`
and a :obj:`~gpytorch.models.ExactGP`. It also cannot be used in conjunction with
stochastic optim... | 62598fbebe7bc26dc9251f5b |
class EchoClient(protocol.Protocol): <NEW_LINE> <INDENT> def connectionMade(self): <NEW_LINE> <INDENT> self.transport.write(b"hello alex!") <NEW_LINE> <DEDENT> def dataReceived(self, data): <NEW_LINE> <INDENT> print("Server said:", data.decode()) <NEW_LINE> self.transport.loseConnection() <NEW_LINE> <DEDENT> def connec... | Once connected, send a message, then print the result. | 62598fbefff4ab517ebcd9e3 |
class UnscentedTransform(object): <NEW_LINE> <INDENT> _sum = functools.partial(np.sum, axis=0) <NEW_LINE> def __init__(self, function): <NEW_LINE> <INDENT> assert isinstance(function, collections.Callable) <NEW_LINE> self._function = function <NEW_LINE> <DEDENT> def __call__(self, mean, covariance, *args, **kwargs): <N... | Implementation of the Unscented Transform of Julier and Uhlmann.
The unscented transform propagates mean and covariance information
through a non-linear function. An instance of this class is callable
to apply the function to a vector of mean values and a covariance
matrix, returning an output mean vector and covarian... | 62598fbea8370b77170f05df |
class MigrateMaterialsView(LoggedInFacultyMixin, AjaxRequiredMixin, JSONResponseMixin, View): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> course = get_object_or_404(Course, id=kwargs.pop('course_id', None)) <NEW_LINE> faculty = [user.id for user in course.faculty.all()] <NEW_LINE> f... | An ajax-only request to retrieve course information & materials
from the perspective of the course faculty members.
Returns:
* Projects authored by faculty
* Assets collected or annotated by faculty
Example:
/api/course/ | 62598fbe1f5feb6acb162e1e |
class GANModule(nn.Module): <NEW_LINE> <INDENT> def __init__(self, generator:nn.Module=None, critic:nn.Module=None, gen_mode:bool=False): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.gen_mode = gen_mode <NEW_LINE> if generator: self.generator,self.critic = generator,critic <NEW_LINE> <DEDENT> def forward(self... | Wrapper around a `generator` and a `critic` to create a GAN. | 62598fbe3d592f4c4edbb0bd |
class Customer(): <NEW_LINE> <INDENT> def __init__(self, name, level, issue_type, issue): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.level = level <NEW_LINE> self.issue_type = issue_type <NEW_LINE> self.issue = issue <NEW_LINE> self.patience = randint(1, 100) <NEW_LINE> for i in range(0, 5): <NEW_LINE> <INDEN... | Defines the customer object | 62598fbe71ff763f4b5e797a |
class ViCommandDefBase(object): <NEW_LINE> <INDENT> _serializable = ['_inp',] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.command = '<unset>' <NEW_LINE> self.input_parser = None <NEW_LINE> self._inp = '' <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.__dict__[key] <NEW_LINE>... | Base class for all Vim commands. | 62598fbe60cbc95b0636453b |
class HostState(BASE, StateMixin): <NEW_LINE> <INDENT> __tablename__ = 'host_state' <NEW_LINE> id = Column( Integer, ForeignKey('host.id', onupdate='CASCADE', ondelete='CASCADE'), primary_key=True ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return 'HostState[%s state %s percentage %s]' % ( self.id, self.state, ... | Host state table. | 62598fbe55399d3f05626715 |
class OptActionQuiet(ActionExt): <NEW_LINE> <INDENT> def __init__(self, option_strings, dest, nargs=None, **kwargs): <NEW_LINE> <INDENT> super(OptActionQuiet, self).__init__( option_strings, dest, nargs, **kwargs) <NEW_LINE> <DEDENT> def call(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> nam... | Suppress output
--quiet | 62598fbe656771135c48986e |
class RepoReprTests(RepoTests): <NEW_LINE> <INDENT> def test_repr_works_correctly(self): <NEW_LINE> <INDENT> repo = Repo('/path/to/existing/repository') <NEW_LINE> repo_repr = repr(repo) <NEW_LINE> self.assertIsInstance(repo_repr, str) <NEW_LINE> self.assertEqual(eval(repo_repr), repo) | Tests for Repo.__repr__(). | 62598fbe5fdd1c0f98e5e191 |
class Postnet(torch.nn.Module): <NEW_LINE> <INDENT> def __init__( self, idim: int, odim: int, n_layers: int = 5, n_chans: int = 512, n_filts: int = 5, dropout_rate: float = 0.5, use_batch_norm: bool = True, ): <NEW_LINE> <INDENT> super(Postnet, self).__init__() <NEW_LINE> self.postnet = torch.nn.ModuleList() <NEW_LINE>... | Postnet module for Spectrogram prediction network.
This is a module of Postnet in Spectrogram prediction network,
which described in `Natural TTS Synthesis by
Conditioning WaveNet on Mel Spectrogram Predictions`_.
The Postnet predicts refines the predicted
Mel-filterbank of the decoder,
which helps to compensate the de... | 62598fbe4f6381625f1995c1 |
class CIFARDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, x, y, normal_class): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = (y != normal_class).astype(float) <NEW_LINE> self.transform = transforms.Compose([ transforms.ToTensor(), transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]... | load synthetic time series data | 62598fbe4428ac0f6e658723 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.