code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class MAVLink_battery_status_message(MAVLink_message): <NEW_LINE> <INDENT> def __init__(self, accu_id, voltage_cell_1, voltage_cell_2, voltage_cell_3, voltage_cell_4, voltage_cell_5, voltage_cell_6, current_battery, current_consumed, energy_consumed, battery_remaining): <NEW_LINE> <INDENT> MAVLink_message.__init__(self... | Transmitte battery informations for a accu pack. | 62598fb13539df3088ecc308 |
class PrivateGeneralTypeSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = PrivateGeneralType <NEW_LINE> fields = ('id', 'active', 'value', 'hour', 'terms',) <NEW_LINE> read_only_fields = ('id',) | Serializer to represent the Private general type classes model | 62598fb1fff4ab517ebcd83b |
class PerViewThrottling(BaseThrottle): <NEW_LINE> <INDENT> def get_cache_key(self): <NEW_LINE> <INDENT> return 'throttle_view_%s' % self.view.__class__.__name__ | Limits the rate of API calls that may be used on a given view.
The class name of the view is used as a unique identifier to
throttle against. | 62598fb14527f215b58e9f2b |
class Conv1x1Branch(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels): <NEW_LINE> <INDENT> super(Conv1x1Branch, self).__init__() <NEW_LINE> self.conv = incept_conv1x1( in_channels=in_channels, out_channels=out_channels) <NEW_LINE> <DEDENT> def forward(self, x): <NEW_LINE> <INDENT> x = self.c... | InceptionV3 specific convolutional 1x1 branch block.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels. | 62598fb17d43ff248742742d |
class InputReadersTest(module_testutil.ModuleInterfaceTest, googletest.TestCase): <NEW_LINE> <INDENT> MODULE = input_readers | Test input_readers module interface. | 62598fb1a05bb46b3848a8c2 |
class Call(BaseMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = u'telephony_call' <NEW_LINE> call_uuid = db.Column(db.String(100)) <NEW_LINE> start_time = db.Column(db.DateTime) <NEW_LINE> end_time = db.Column(db.DateTime) <NEW_LINE> from_phonenumber_id = db.Column(db.ForeignKey('telephony_phonenumber.id')) <NEW_L... | An incoming or outgoing call from the telephony system.
Defined here for easy readability by the web server, but should not be written to in this process. | 62598fb166673b3332c30422 |
class FluidSynthPlayer(Player): <NEW_LINE> <INDENT> def __init__(self, config, section, main_loop): <NEW_LINE> <INDENT> self._encoding = locale.getpreferredencoding(False) <NEW_LINE> self._subprocess = None <NEW_LINE> self._supervisor = None <NEW_LINE> super().__init__(config, section, main_loop) <NEW_LINE> self._comma... | FluidSynt MIDI player.
Sends MIDI notes to a FluidSynth process. | 62598fb130dc7b766599f8a3 |
@parser(Specs.docker_info) <NEW_LINE> class DockerInfo(Parser): <NEW_LINE> <INDENT> def parse_content(self, content): <NEW_LINE> <INDENT> self.data = {} <NEW_LINE> if len(content) >= 10: <NEW_LINE> <INDENT> for line in content: <NEW_LINE> <INDENT> if ":" in line: <NEW_LINE> <INDENT> key, value = line.strip().split(":",... | Represents the output of the ``/usr/bin/docker info`` command.
The resulting output of the command is essentially key/value pairs. | 62598fb15fcc89381b266177 |
class InlineForm(LayoutObject): <NEW_LINE> <INDENT> template = 'trionyx/forms/inlineform.html' <NEW_LINE> def __init__(self, form_name, template=None): <NEW_LINE> <INDENT> self.form_name = form_name <NEW_LINE> if template: <NEW_LINE> <INDENT> self.template = template <NEW_LINE> <DEDENT> <DEDENT> def render(self, form, ... | Layout renderer for inline forms | 62598fb1cc40096d6161a204 |
class TaskLogicVocabularyFactory(object): <NEW_LINE> <INDENT> provides_interface = None <NEW_LINE> def __call__(self, context): <NEW_LINE> <INDENT> gsm = getGlobalSiteManager() <NEW_LINE> scheduled_interfaces = context.get_scheduled_interfaces() <NEW_LINE> terms = [] <NEW_LINE> for scheduled_interface in scheduled_inte... | Base class for vocabulary factories listing adapters providing
some ITaskLogic (sub)interface and adapting a task container
content type. | 62598fb191f36d47f2230ed2 |
@with_slots <NEW_LINE> class EvenlyDiscretizedMFD(BaseMFD): <NEW_LINE> <INDENT> MODIFICATIONS = set() <NEW_LINE> __slots__ = 'min_mag bin_width occurrence_rates'.split() <NEW_LINE> def __init__(self, min_mag, bin_width, occurrence_rates): <NEW_LINE> <INDENT> self.min_mag = min_mag <NEW_LINE> self.bin_width = bin_width ... | Evenly discretized MFD is defined as a precalculated histogram.
:param min_mag:
Positive float value representing the middle point of the first
bin in the histogram.
:param bin_width:
A positive float value -- the width of a single histogram bin.
:param occurrence_rates:
The list of non-negative float ... | 62598fb1442bda511e95c4ae |
class Locacao(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def validar(cls): <NEW_LINE> <INDENT> return {} | Classe de negocio responsavel pelos dados da locacao. | 62598fb1379a373c97d9906b |
class IntegerToolParameter(TextToolParameter): <NEW_LINE> <INDENT> dict_collection_visible_keys = ToolParameter.dict_collection_visible_keys + ['min', 'max'] <NEW_LINE> def __init__(self, tool, input_source): <NEW_LINE> <INDENT> input_source = ensure_input_source(input_source) <NEW_LINE> TextToolParameter.__init__(self... | Parameter that takes an integer value.
>>> from galaxy.util.bunch import Bunch
>>> trans = Bunch(app=None, history=Bunch(), workflow_building_mode=True)
>>> p = IntegerToolParameter(None, XML('<param name="_name" type="integer" value="10" />'))
>>> print(p.name)
_name
>>> sorted(p.to_dict(trans).items())
[('area', Fal... | 62598fb1f548e778e596b5fa |
class TMAClassifier(BaseTMA): <NEW_LINE> <INDENT> def __init__(self, pom_treat: ClassifierMixin, pom_control: ClassifierMixin, name: Optional[str]=None) -> None: <NEW_LINE> <INDENT> if not isinstance(pom_treat, ClassifierMixin): <NEW_LINE> <INDENT> raise TypeError("set Classifier as pom_treat.") <NEW_LINE> <DEDENT> if ... | Two-Model Approach for Classification. | 62598fb1aad79263cf42e829 |
class StochasticEncoderLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, size, self_attn, feed_forward, dropout_rate, death_rate=0.0, normalize_before=True, concat_after=False): <NEW_LINE> <INDENT> super(StochasticEncoderLayer, self).__init__() <NEW_LINE> self.self_attn = self_attn <NEW_LINE> self.feed_forward =... | Encoder layer module.
:param int size: input dim
:param espnet.nets.pytorch_backend.transformer.attention.MultiHeadedAttention self_attn: self attention module
:param espnet.nets.pytorch_backend.transformer.positionwise_feed_forward.PositionwiseFeedForward feed_forward:
feed forward module
:param float dropout_rat... | 62598fb15166f23b2e243430 |
class TableSelectMultiple(forms.widgets.SelectMultiple): <NEW_LINE> <INDENT> def __init__(self, item_attrs, grouper, *args, **kwargs): <NEW_LINE> <INDENT> super(TableSelectMultiple, self).__init__(*args, **kwargs) <NEW_LINE> self.item_attrs = item_attrs <NEW_LINE> if grouper is None: <NEW_LINE> <INDENT> self.grouper = ... | Provides selection of items via checkboxes, with a table row
being rendered for each item, the first cell in which contains the
checkbox.
When providing choices for this field, give the item as the second
item in all choice tuples. For example, where you might have
previously used::
field.choices = [(item.id, ite... | 62598fb1a219f33f346c686c |
class Visitor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._travelled = set() <NEW_LINE> <DEDENT> def travel(self, src, dst): <NEW_LINE> <INDENT> src_path = src.path if src else '' <NEW_LINE> edge = src_path + ',' + dst.path <NEW_LINE> if edge in self._travelled: <NEW_LINE> <INDENT> return ... | Base class for visitors used to traverse the dependency graph. | 62598fb1283ffb24f3cf38e3 |
class Test_strS(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> Base._Base__nb_objects = 0 <NEW_LINE> <DEDENT> def test_str1S(self): <NEW_LINE> <INDENT> s1 = Square(2) <NEW_LINE> st = "[Square] (1) 0/0 - 2" <NEW_LINE> strP = str(s1) <NEW_LINE> self.assertEqual(st, strP) <NEW_LINE> with patc... | Class for unittest of __str__ method | 62598fb1a8370b77170f0432 |
class Error(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> Exception.__init__(self, message) <NEW_LINE> self.message = message | Used to catch parser.error. | 62598fb17d847024c075c418 |
class ProxyInputSource(InputSource): <NEW_LINE> <INDENT> def __init__(self, input): <NEW_LINE> <INDENT> assert isinstance(input, InputSource), input <NEW_LINE> self._input = input <NEW_LINE> <DEDENT> def _get_input_tensors(self): <NEW_LINE> <INDENT> return self._input.get_input_tensors() <NEW_LINE> <DEDENT> def _setup(... | An InputSource which proxy every method to ``self._input``. | 62598fb1e5267d203ee6b95f |
class KMtronicSwitch(CoordinatorEntity, SwitchEntity): <NEW_LINE> <INDENT> def __init__(self, coordinator, relay, reverse, config_entry_id): <NEW_LINE> <INDENT> super().__init__(coordinator) <NEW_LINE> self._relay = relay <NEW_LINE> self._config_entry_id = config_entry_id <NEW_LINE> self._reverse = reverse <NEW_LINE> <... | KMtronic Switch Entity. | 62598fb12c8b7c6e89bd381c |
class OperationExtendedInfo(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'object_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'object_type': {'key': 'objectType', 'type': 'str'}, } <NEW_LINE> _subtype_map = { 'object_type': {'OperationJobExtendedInfo': 'OperationJobExtendedInfo'} } <NE... | Operation Extended Info.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: OperationJobExtendedInfo.
All required parameters must be populated in order to send to Azure.
:param object_type: Required. This property will be used as the discriminator for deciding the
specific... | 62598fb1a8370b77170f0433 |
class Tile(BaseTile, AttrToggles): <NEW_LINE> <INDENT> ship = blank = is_hit = revealed = False <NEW_LINE> hidden = True <NEW_LINE> attribute_toggles = [("hidden", "revealed")] <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return blank if self.hidden else self.char <NEW_LINE> <DEDENT> def h... | Tile that may be a ship or blank space (water). | 62598fb1d486a94d0ba2c027 |
class Dialect(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> ordering = ['signlanguage', 'name'] <NEW_LINE> <DEDENT> signlanguage = models.ForeignKey(SignLanguage) <NEW_LINE> name = models.CharField(max_length=20) <NEW_LINE> description = models.TextField() <NEW_LINE> def __str__(self): <NEW_LINE> <... | A dialect name - a regional dialect of a given Language | 62598fb1d486a94d0ba2c026 |
class UpdateExpressionDeleteAction(UpdateExpressionClause): <NEW_LINE> <INDENT> pass | DeleteAction => Path Value | 62598fb1a17c0f6771d5c28c |
class SubmissionList_NoHTML5Iframe_IntegrationTests(NoHTML5SeleniumTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(SubmissionList_NoHTML5Iframe_IntegrationTests, self).setUp() <NEW_LINE> self.exhibition = Exhibition.objects.create(title='New Exhibition', description='goes here', author=self.st... | Tests the artwork rendering in a browser that does not support HTML5 iframe srcdoc/sandbox | 62598fb130bbd722464699a4 |
class BertIndex2Text(BaseRecorderInterface): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(self.__class__,self).__init__() <NEW_LINE> from transformers import PreTrainedTokenizerFast <NEW_LINE> self.tokenizer = PreTrainedTokenizerFast() <NEW_LINE> <DEDENT> def forward(self, x : torch.Tensor ) -> str... | [summary]
:param BaseRecorderInterface: [description]
:type BaseRecorderInterface: [type] | 62598fb1bd1bec0571e150ee |
@factory_config(IAlchemyEngineUtility) <NEW_LINE> class PersistentAlchemyEngineUtility(Persistent, AlchemyEngineUtility, Contained): <NEW_LINE> <INDENT> pass | Persistent implementation of SQLAlchemy engine utility | 62598fb18e7ae83300ee90fa |
class PeriodicTaskAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> form = PeriodicTaskForm <NEW_LINE> model = PeriodicTask <NEW_LINE> celery_app = current_app <NEW_LINE> list_display = ('__str__', 'enabled') <NEW_LINE> actions = ('enable_tasks', 'disable_tasks', 'run_tasks') <NEW_LINE> fieldsets = ( (None, { 'fields': ('na... | Admin-interface for periodic tasks. | 62598fb185dfad0860cbfa9f |
class VipPermRelation(models.Model): <NEW_LINE> <INDENT> vip_id = models.IntegerField() <NEW_LINE> perm_id = models.IntegerField() | 会员-权限 关系表
会员套餐 1
会员身份标识
超级喜欢
会员套餐 2
会员身份标识
反悔功能
无限喜欢次数
会员套餐 3
会员身份标识
超级喜欢
反悔功能
任意更改定位
无限喜欢次数 | 62598fb13317a56b869be577 |
class FrozenDict(dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.update(*args, **kwargs) <NEW_LINE> <DEDENT> def __setitem__(self, key, val): <NEW_LINE> <INDENT> if key in self: <NEW_LINE> <INDENT> raise Exception("Cannot overwrite existent key: %s" % str(key)) <NEW_LINE> <DEDEN... | A dictionary that does not permit to redefine its keys | 62598fb17d43ff248742742e |
class Embeddings(torch.nn.Module, Generic[DT]): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if not hasattr(self, "name"): <NEW_LINE> <INDENT> self.name: str = "unnamed_embedding" <NEW_LINE> <DEDENT> if not hasattr(self, "static_embeddings"): <NEW_LINE> <INDENT> self.static_embeddings = False <NEW_LINE> ... | Abstract base class for all embeddings. Every new type of embedding must implement these methods. | 62598fb1fff4ab517ebcd83e |
class ProcessIOWriter(ProcessIOBase): <NEW_LINE> <INDENT> def __init__(self, args, file, mode, encoding=None, errors=None, newline=None): <NEW_LINE> <INDENT> raise NotImplementedError() | Writable file-like object that wraps an external process. | 62598fb101c39578d7f12dd7 |
class CategoryViewset(mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = GoodsCategory.objects.filter(category_type=1) <NEW_LINE> serializer_class = CategorySerializer | list:
商品分类列表数据
retrieve:
获取商品分类详情 | 62598fb17047854f4633f433 |
class Set(_Sequence[S]): <NEW_LINE> <INDENT> def validate(self, value: S) -> None: <NEW_LINE> <INDENT> super().validate(value) <NEW_LINE> cast_value = typing.cast(typing.Sequence, value) <NEW_LINE> if utils.has_duplicates(cast_value): <NEW_LINE> <INDENT> raise exceptions.InvalidArgumentValueError("Value '{value}' {for_... | A set hyper-parameter which samples without replacement multiple times another hyper-parameter or hyper-parameters configuration.
This is useful when a primitive is interested in more than one value of a hyper-parameter or hyper-parameters configuration.
Values are represented as tuples of unique elements. The order ... | 62598fb156ac1b37e6302243 |
class LectureAuthenticationForm(AuthenticationForm): <NEW_LINE> <INDENT> username = forms.EmailField(label=_("Email"), max_length=254) <NEW_LINE> error_messages = { 'invalid_login': _("Please enter a correct %(username)s and password. " "Note that both fields may be case-sensitive."), 'inactive': _("This account is ina... | Base class for authenticating users. Extend this to get a form that accepts
username/password logins. | 62598fb199cbb53fe6830f32 |
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 1200 <NEW_LINE> self.screen_height = 800 <NEW_LINE> self.bg_color = (230, 230, 230) | A class that stores all settings. | 62598fb199fddb7c1ca62e16 |
class BaseModel(object): <NEW_LINE> <INDENT> def override_values(self, **kwargs): <NEW_LINE> <INDENT> for attr_name, attr_value in kwargs.items(): <NEW_LINE> <INDENT> if hasattr(self, attr_name): <NEW_LINE> <INDENT> setattr(self, attr_name, attr_value) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def obj_to_json(self): <NEW_L... | Base class for models.
To allow simple (de)serialization we will use __dict__ to create | 62598fb130bbd722464699a5 |
class HelloViewSet(viewsets.ViewSet): <NEW_LINE> <INDENT> serializer_class = serializer.HelloSerializer <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> a_viewset = [ 'Uses actions (list,create,retrieve,update,partial_update) ', 'Automatically maps to URLS using Routers', 'Provides more fuctionality with less co... | Test API ViewSet | 62598fb167a9b606de546027 |
class BeginEnvironment(Command): <NEW_LINE> <INDENT> is_abstract = True <NEW_LINE> endmacro = EndEnvironment <NEW_LINE> @classmethod <NEW_LINE> def invoke(cls, job, tokens, *, invoke_macro=False): <NEW_LINE> <INDENT> if invoke_macro: <NEW_LINE> <INDENT> return super(BeginEnvironment, cls).invoke(job, tokens) <NEW_LINE>... | Base command that defines the beginning of an environment | 62598fb1be8e80087fbbf0bf |
class ConsoleLogger(Logger): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def _log(self): <NEW_LINE> <INDENT> print(self._buffer, end='') | logs to wherever print() goes | 62598fb1f548e778e596b5fd |
class DescribeAddressTemplatesResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.AddressTemplateSet = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("Total... | DescribeAddressTemplates response structure.
| 62598fb160cbc95b063643aa |
class ArchiveCreationError(Exception): <NEW_LINE> <INDENT> pass | Raised when an archive fails during creation | 62598fb14428ac0f6e658580 |
class LivingSocialSpider(BaseSpider): <NEW_LINE> <INDENT> name = "livingsocial" <NEW_LINE> allowed_domains = ['livingsocial.com'] | Spider for regularly updated livingsocial.com site, San Francisco Page | 62598fb1cc0a2c111447b06c |
class Actor(Greenlet): <NEW_LINE> <INDENT> def __init__(self, name, out, socket, context): <NEW_LINE> <INDENT> Greenlet.__init__(self) <NEW_LINE> self.name=name <NEW_LINE> self.out=out <NEW_LINE> self.counter=0 <NEW_LINE> self.context=context <NEW_LINE> self.inbox=self.context.socket(zmq.SUB) <NEW_LINE> self.inbox.conn... | Context is created inside class | 62598fb17d43ff248742742f |
class TrackedRepository(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField(primary_key=True, default=uuid4, editable=False) <NEW_LINE> user = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> repo_name = models.TextField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> app_label = 'flowie' <NEW_LINE> defau... | Tracked Repository model | 62598fb1fff4ab517ebcd840 |
class conj(reex.connective): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "{0:s} & {1:s}".format(self.arg1._strP(), self.arg2._strP()) <NEW_LINE> <DEDENT> def _strP(self): <NEW_LINE> <INDENT> return "({0:s} & {1:s})".format(self.arg1._strP(), self.arg2._strP()) | FAdo regexp class that represents the conjunction operation. | 62598fb138b623060ffa90f6 |
class FilterNotValidException(CmisException): <NEW_LINE> <INDENT> pass | FilterNotValidException | 62598fb1f548e778e596b5fe |
class UWBNetworkCommand: <NEW_LINE> <INDENT> def __init__(self, destination_group=0, type=0, length=0, data=0): <NEW_LINE> <INDENT> self.destination_group = CiholasSerialNumber(destination_group) <NEW_LINE> self.type = type <NEW_LINE> self.length = length <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> def __str__(self... | UWB Network Command Class Definition | 62598fb16e29344779b006b6 |
class TSVOL(PoundSeparatedCommand): <NEW_LINE> <INDENT> pass | tone classes volume. | 62598fb1167d2b6e312b6fcc |
class DomPerf(test.Test): <NEW_LINE> <INDENT> test = _DomPerfMeasurement <NEW_LINE> enabled = not sys.platform.startswith('linux') <NEW_LINE> def CreatePageSet(self, options): <NEW_LINE> <INDENT> dom_perf_dir = os.path.join(util.GetChromiumSrcDir(), 'data', 'dom_perf') <NEW_LINE> base_page = 'file://run.html?reportInJS... | A suite of JavaScript benchmarks for exercising the browser's DOM.
The final score is computed as the geometric mean of the individual results.
Scores are not comparable across benchmark suite versions and higher scores
means better performance: Bigger is better! | 62598fb1851cf427c66b8316 |
class IndexView(HTTPMethodView): <NEW_LINE> <INDENT> decorators = [] <NEW_LINE> async def get(self, req): <NEW_LINE> <INDENT> return text('Hello world!') | This is the class that responds for requests for: / | 62598fb126068e7796d4c9b0 |
class VSEQF_PT_QuickTagsPanel(bpy.types.Panel): <NEW_LINE> <INDENT> bl_label = "Quick Tags" <NEW_LINE> bl_space_type = 'SEQUENCE_EDITOR' <NEW_LINE> bl_region_type = 'UI' <NEW_LINE> bl_category = "Strip" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> prefs = vseqf.get_prefs() <NEW_LINE> i... | Panel for displaying, removing and adding tags | 62598fb1a79ad1619776a0c3 |
class ClusterSet(object): <NEW_LINE> <INDENT> def __init__(self, pointType): <NEW_LINE> <INDENT> self.members = [] <NEW_LINE> <DEDENT> def add(self, c): <NEW_LINE> <INDENT> if c in self.members: <NEW_LINE> <INDENT> raise ValueError <NEW_LINE> <DEDENT> self.members.append(c) <NEW_LINE> <DEDENT> def remove(self, c): <NEW... | A ClusterSet is defined as a list of clusters | 62598fb18da39b475be03241 |
class EnterNexellFastbootAction(DeployAction): <NEW_LINE> <INDENT> def __init__(self,parameters, key1, key2, key3): <NEW_LINE> <INDENT> super(EnterNexellFastbootAction, self).__init__() <NEW_LINE> self.name = "enter_nexell_fastboot_action" <NEW_LINE> self.description = "enter fastboot bootloader" <NEW_LINE> self.summar... | Enters fastboot bootloader. | 62598fb1d486a94d0ba2c02a |
@total_ordering <NEW_LINE> class Elem: <NEW_LINE> <INDENT> def __init__(self, metric_value, father_id, graph): <NEW_LINE> <INDENT> self.father_id = father_id <NEW_LINE> self.graph = graph <NEW_LINE> self.metric_value = metric_value <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.metric_valu... | Elements to be sorted according to metric value. | 62598fb130bbd722464699a6 |
class Texture1D(Texture): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Texture.__init__(self, gl.GL_TEXTURE_1D) <NEW_LINE> self.shape = self._check_shape(self.shape, 1) <NEW_LINE> self._cpu_format = Texture._cpu_formats[self.shape[-1]] <NEW_LINE> self._gpu_format = Texture._gpu_formats[self.shape[-1]] <N... | 1D Texture | 62598fb155399d3f0562657b |
@dataclass <NEW_LINE> class Tick(object): <NEW_LINE> <INDENT> Time: int = 0 <NEW_LINE> Open: float = 0 <NEW_LINE> Close: float = 0 <NEW_LINE> High: float = 0 <NEW_LINE> Low: float = 0 <NEW_LINE> Volume: float = 0 <NEW_LINE> OpenTime: int = 0 <NEW_LINE> CloseTime: int = 0 <NEW_LINE> def is_valid(self): <NEW_LINE> <INDEN... | Candlestick/Tick data | 62598fb156b00c62f0fb2911 |
class CachedList(ndb.Model): <NEW_LINE> <INDENT> list_data = ndb.JsonProperty(repeated=True) <NEW_LINE> is_processing = ndb.BooleanProperty() <NEW_LINE> valid_through = ndb.DateTimeProperty() | The CachedList model, represents a list cached as a ndb entity. | 62598fb14f6381625f1994ed |
class DnsManagementClientConfiguration(AzureConfiguration): <NEW_LINE> <INDENT> def __init__( self, credentials, subscription_id, base_url=None): <NEW_LINE> <INDENT> if credentials is None: <NEW_LINE> <INDENT> raise ValueError("Parameter 'credentials' must not be None.") <NEW_LINE> <DEDENT> if subscription_id is None: ... | Configuration for DnsManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id... | 62598fb18e7ae83300ee90fe |
class ApigwPath(object): <NEW_LINE> <INDENT> def __init__(self, event: Dict): <NEW_LINE> <INDENT> self.version = event.get("version") <NEW_LINE> self.apigw_stage = _get_apigw_stage(event) <NEW_LINE> self.path = _get_request_path(event) <NEW_LINE> self.api_prefix = proxy_pattern.sub("", event.get("resource", "")).rstrip... | Parse path of API Call. | 62598fb157b8e32f52508149 |
class ConservativeSourceTerm(ConservativeTracerTerm): <NEW_LINE> <INDENT> def residual(self, solution, solution_old, fields, fields_old, bnd_conditions=None): <NEW_LINE> <INDENT> f = 0 <NEW_LINE> source = fields_old.get('source') <NEW_LINE> if source is not None: <NEW_LINE> <INDENT> H = self.depth.get_total_depth(field... | Generic source term
The weak form reads
.. math::
F_s = \int_\Omega \sigma \phi dx
where :math:`\sigma` is a user defined scalar :class:`Function`. | 62598fb13346ee7daa337675 |
class NodesCommand(RootCommand): <NEW_LINE> <INDENT> name = 'nodes' <NEW_LINE> help = 'Tortuga nodes API' <NEW_LINE> sub_commands = [ ListCommand(), GetCommand(), UpdateCommand(), NodeStatusCommand(), ] | This is a command for interacting with WS API endpoints. | 62598fb1b7558d5895463686 |
class CreateOpenBankOrderPaymentResult(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ChannelOrderId = None <NEW_LINE> self.ThirdPayOrderId = None <NEW_LINE> self.RedirectInfo = None <NEW_LINE> self.OutOrderId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDEN... | 云企付-支付下单返回响应
| 62598fb1d7e4931a7ef3c0f0 |
class DemoBatchSystem(GenericBatchSystem): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_mnemonic(): <NEW_LINE> <INDENT> return "demo" <NEW_LINE> <DEDENT> def __init__(self, scheduler_output_filenames, config, options): <NEW_LINE> <INDENT> self.scheduler_output_filenames = scheduler_output_filenames <NEW_LINE> s... | This is an example implementation of how a batch system is "read" and what is expected of it
by qtop in order to run. | 62598fb1baa26c4b54d4f311 |
class IntegerArgument(AbstractArgument): <NEW_LINE> <INDENT> def _parse_one(self, arg): <NEW_LINE> <INDENT> return int(arg) | An argument that captures integers. | 62598fb1d58c6744b42dc306 |
class Typed(): <NEW_LINE> <INDENT> def __init__(self, name, expected_type, mutable=True): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.expected_type = expected_type <NEW_LINE> self.mutable = mutable <NEW_LINE> <DEDENT> def __get__(self, instance, cls): <NEW_LINE> <INDENT> if instance is None: <NEW_LINE> <INDENT... | Descriptor class used for a type assertion decorator used to type-check specified attributes
Parameters
----------
name: str
name of attribute
expected_type: type object
type associated with attribute
mutable: boolean
attribute if mutable if set to True and Immutable otherwise | 62598fb160cbc95b063643ac |
class DeleteVPNBindGroupToLocalSite(CommandResource): <NEW_LINE> <INDENT> resource = 'vpnbindgrouptolocalsites' <NEW_LINE> @staticmethod <NEW_LINE> def add_known_arguments(parser): <NEW_LINE> <INDENT> parser.add_argument( 'id', metavar='VPNBINDGROUPTOLOCALSITE', help="ID or Name of VPNBindGroupToLocalSite to delete\n\n... | Delete a given VPNBindGroupToLocalSite | 62598fb13317a56b869be579 |
class DiffXDOMReader(object): <NEW_LINE> <INDENT> reader_cls = DiffXReader <NEW_LINE> def __init__(self, diffx_cls): <NEW_LINE> <INDENT> self.diffx_cls = diffx_cls <NEW_LINE> <DEDENT> def parse(self, stream): <NEW_LINE> <INDENT> with stream: <NEW_LINE> <INDENT> reader = self.reader_cls(stream) <NEW_LINE> diffx = self.d... | A reader for parsing a DiffX file into DOM objects.
This will construct a :py:class:`~pydiffx.dom.objects.DiffX` from an input
byte stream, such as a file, HTTP response, or memory-backed stream.
Often, you won't use this directly. Instead, you'll call
:py:meth:`DiffXFile.from_stream() <pydiffx.dom.objects.DiffX.from... | 62598fb14428ac0f6e658582 |
class Album: <NEW_LINE> <INDENT> def __init__(self, name, year, artist=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.year = year <NEW_LINE> if artist is None: <NEW_LINE> <INDENT> self.artist = Artist("Various Artists") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.artist = artist <NEW_LINE> <DEDENT> ... | Class to represent a Album, using it's track list
Attributes:
album name (str): The name of the album
year (int): The year of the album
artist: (Artist): The artist responsible for the album. If not specified will default to "Various Artists"
tracks (List(Songs)): A list of songs on the album
Methods... | 62598fb1236d856c2adc946c |
@implementer(IMessage) <NEW_LINE> class Message(Container): <NEW_LINE> <INDENT> pass | Archive Simple Message Item
| 62598fb17d43ff2487427430 |
class StateProcessor(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> with tf.variable_scope("state_processor"): <NEW_LINE> <INDENT> self.input_state = tf.placeholder(shape=[observation_space_size], dtype=tf.float32) <NEW_LINE> self.output = self.input_state <NEW_LINE> <DEDENT> <DEDENT> def process(self, ... | Processes the input state for use with the network | 62598fb18e7ae83300ee90ff |
class Word(gym.spaces.MultiDiscrete): <NEW_LINE> <INDENT> def __init__(self, max_length, vocab): <NEW_LINE> <INDENT> if len(vocab) != len(set(vocab)): <NEW_LINE> <INDENT> raise VocabularyHasDuplicateTokens() <NEW_LINE> <DEDENT> self.max_length = max_length <NEW_LINE> self.PAD = "<PAD>" <NEW_LINE> self.UNK = "<UNK>" <NE... | Word observation/action space
This space consists of a series of `gym.spaces.Discrete` objects all with
the same parameters. Each `gym.spaces.Discrete` can take integer values
between 0 and `len(self.vocab)`.
Notes
-----
The following special tokens will be prepended (if needed) to the vocabulary:
<PAD> : Padding
<UN... | 62598fb138b623060ffa90f8 |
class OutputFilterDatabase(LazyDatabase): <NEW_LINE> <INDENT> def initialize(self): <NEW_LINE> <INDENT> from spira.yevon import filters <NEW_LINE> f = filters.ToggledCompositeFilter(filters=[]) <NEW_LINE> f += filters.PortCellFilter(name='cell_ports') <NEW_LINE> f += filters.PortPolygonEdgeFilter(name='edge_ports') <NE... | Define the filters that will be used when creating a spira.PCell object. | 62598fb11b99ca400228f55e |
class ActiveUserView(View): <NEW_LINE> <INDENT> def get(self, request, active_code): <NEW_LINE> <INDENT> all_records = EmailVerifyRecord.objects.filter(code=active_code) <NEW_LINE> if all_records: <NEW_LINE> <INDENT> for record in all_records: <NEW_LINE> <INDENT> email = record.email <NEW_LINE> user = UserProfile.objec... | 用户激活 | 62598fb1fff4ab517ebcd842 |
class ErrorResponse(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'error': {'key': 'error', 'type': 'ErrorDetails'}, } <NEW_LINE> def __init__( self, *, error: Optional["ErrorDetails"] = None, **kwargs ): <NEW_LINE> <INDENT> super(ErrorResponse, self).__init__(**kwargs) <NEW_LINE> self.error = err... | The error object.
:param error: The error details object.
:type error: ~azure.mgmt.network.v2020_03_01.models.ErrorDetails | 62598fb1442bda511e95c4b4 |
class AdminLoginForm(AdminAuthenticationForm): <NEW_LINE> <INDENT> error_messages = { "invalid_login": _("Please enter the correct %(username)s and password " "for your account. Note that both fields are " "case-sensitive") } <NEW_LINE> def confirm_login_allowed(self, user): <NEW_LINE> <INDENT> if not user.is_active: <... | Provides a login form for the admin UI
This removes the requirement for the user to have the `is_staff`
attribute set to True. We use the admin UI for all users so this
check and flag is redundant in this app. | 62598fb1be383301e0253856 |
class Pbit_Conversion(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.pbit_check = Pbit.pbit_conversion_check.Pbit_Conversion_check() <NEW_LINE> <DEDENT> def convert_decimal(self,value): <NEW_LINE> <INDENT> Negative_counter = 0 <NEW_LINE> value = str(value) <NEW_LINE> if value[0] is "-": <NEW_LINE> ... | 変換系の関数を集めたモジュール | 62598fb16e29344779b006b8 |
class BatchTextRequest(object): <NEW_LINE> <INDENT> openapi_types = { 'text': 'str', 'id': 'str' } <NEW_LINE> attribute_map = { 'text': 'text', 'id': 'id' } <NEW_LINE> def __init__(self, text=None, id=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> loca... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598fb1aad79263cf42e82f |
class TokenAuthView(APIView): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> token = request.data['token'] <NEW_LINE> userName = request.data['userName'] <NEW_LINE> decodeToken = jwt.decode(token, SECRET_KEY, JWT_ALGORITHM) <NEW_LINE> AuthUserName = User.objects.get(email=decodeToken['user_email']).na... | POST /api/token/auth | 62598fb166656f66f7d5a44c |
class OpenedheaterDw0: <NEW_LINE> <INDENT> energy = 'internel' <NEW_LINE> devtype = "FWH-OPEN-DW0" <NEW_LINE> def __init__(self, dictDev): <NEW_LINE> <INDENT> self.name = dictDev['name'] <NEW_LINE> self.iPort = Port(dictDev['iPort']) <NEW_LINE> self.iPort_fw = Port(dictDev['iPort_fw']) <NEW_LINE> self.oPort_fw = Port(d... | so and sm | 62598fb1090684286d59370b |
class Blog(models.Model): <NEW_LINE> <INDENT> caption = models.CharField(max_length=50) <NEW_LINE> author = models.ForeignKey(Author) <NEW_LINE> tags = models.ManyToManyField(Tag, blank=True) <NEW_LINE> content = models.TextField() <NEW_LINE> publish_time = models.DateTimeField(auto_now_add=True) <NEW_LINE> update_time... | docstring for Blogs | 62598fb121bff66bcd722cc4 |
class MlpPolicy(FeedForwardPolicy): <NEW_LINE> <INDENT> def __init__(self, sess, ob_space, ac_space, n_env, n_steps, n_batch, reuse=False, obs_phs=None, dueling=True, **_kwargs): <NEW_LINE> <INDENT> super(MlpPolicy, self).__init__(sess, ob_space, ac_space, n_env, n_steps, n_batch, reuse, feature_extraction="mlp", obs_p... | Policy object that implements DQN policy, using a MLP (2 layers of 64)
:param sess: (TensorFlow session) The current TensorFlow session
:param ob_space: (Gym Space) The observation space of the environment
:param ac_space: (Gym Space) The action space of the environment
:param n_env: (int) The number of environments t... | 62598fb18da39b475be03243 |
class WaterCost(BSElement): <NEW_LINE> <INDENT> element_type = "xs:decimal" | Annual cost of water. ($) | 62598fb14527f215b58e9f31 |
class Section(unittest.TestCase): <NEW_LINE> <INDENT> def test_level6(self): <NEW_LINE> <INDENT> s = wtp.Section('====== == ======\n') <NEW_LINE> self.assertEqual(6, s.level) <NEW_LINE> self.assertEqual(' == ', s.title) <NEW_LINE> <DEDENT> def test_nolevel7(self): <NEW_LINE> <INDENT> s = wtp.Section('======= h6 =======... | Test the Section class. | 62598fb1a17c0f6771d5c292 |
class CheckResultNotice(Event): <NEW_LINE> <INDENT> def __init__(self, player_id, side): <NEW_LINE> <INDENT> self.player_id = player_id <NEW_LINE> self.side = side | Special Notice for Sheriff, results of night check | 62598fb167a9b606de54602b |
class ParametricConcurrent(nn.Sequential): <NEW_LINE> <INDENT> def __init__(self, axis=1): <NEW_LINE> <INDENT> super(ParametricConcurrent, self).__init__() <NEW_LINE> self.axis = axis <NEW_LINE> <DEDENT> def forward(self, x, **kwargs): <NEW_LINE> <INDENT> out = [] <NEW_LINE> for module in self._modules.values(): <NEW_L... | A container for concatenation of modules with parameters.
Parameters:
----------
axis : int, default 1
The axis on which to concatenate the outputs. | 62598fb171ff763f4b5e77cf |
class ChoiceOfMovementError(GameError): <NEW_LINE> <INDENT> pass | コマの移動が適切でない時のエラー | 62598fb14428ac0f6e658583 |
class Noun: <NEW_LINE> <INDENT> def __init__(self, noun, article): <NEW_LINE> <INDENT> self.noun = noun <NEW_LINE> self.article = article | Represents a noun with its respective article. | 62598fb14f6381625f1994ee |
class BusinessMonthBegin(CacheableOffset, DateOffset): <NEW_LINE> <INDENT> def apply(self, other): <NEW_LINE> <INDENT> n = self.n <NEW_LINE> wkday, _ = tslib.monthrange(other.year, other.month) <NEW_LINE> first = _get_firstbday(wkday) <NEW_LINE> if other.day > first and n <= 0: <NEW_LINE> <INDENT> n += 1 <NEW_LINE> <DE... | DateOffset of one business month at beginning | 62598fb157b8e32f5250814a |
class RMSProp(LearningRule): <NEW_LINE> <INDENT> def __init__(self, decay=0.9, max_scaling=1e5, max_colm_norm=False, max_norm=15.0): <NEW_LINE> <INDENT> assert 0. <= decay < 1., 'decay must be: 0. <= decay < 1' <NEW_LINE> assert max_scaling > 0., 'max_scaling must be > 0.' <NEW_LINE> self.decay = sharedX_value(decay, n... | Implements the RMSProp learning rule as described in [1].
The RMSProp rule was described in [1]. The idea is similar to the
AdaDelta,
which consists of dividing the learning rate for a weight by a running
average of the magintudes of recent graidients of that weight.
Parameters:
decay: float
Decay constant... | 62598fb191f36d47f2230ed6 |
class Adjunto(models.Model): <NEW_LINE> <INDENT> nombre = models.CharField(max_length=100, null=True) <NEW_LINE> descripcion = models.TextField() <NEW_LINE> binario = models.BinaryField(null=True, blank=True) <NEW_LINE> content_type = models.CharField(null=True, editable=False, max_length=50) <NEW_LINE> fechaCreacion =... | Modelo que repsenta a un archivo
@cvar binario: Campo de tipo binario que almacena el archivo adjunto
@cvar id_trabajo: clave foranea a un trabajo en el cual se cargo el archivo
@cvar nombre: un campo de texto con el nombre que representa el archivo | 62598fb144b2445a339b69a0 |
class DescribeRestoreJobController(object): <NEW_LINE> <INDENT> @probe.Probe(__name__) <NEW_LINE> def process_request(self, req, project_id, table_name, restore_job_id): <NEW_LINE> <INDENT> utils.check_project_id(req.context, project_id) <NEW_LINE> req.context.tenant = project_id <NEW_LINE> validation.validate_table_na... | Describes a restore job. | 62598fb1cc0a2c111447b070 |
class BinNodeList(osid_objects.OsidList): <NEW_LINE> <INDENT> def get_next_bin_node(self): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> next_bin_node = property(fget=get_next_bin_node) <NEW_LINE> def get_next_bin_nodes(self, n): <NEW_LINE> <INDENT> return | Like all ``OsidLists,`` ``BinNodeList`` provides a means for accessing ``BinNode`` elements sequentially either one at a time or many at a time.
Examples: while (bnl.hasNext()) { BinNode node =
bnl.getNextBinNode(); }
or
while (bnl.hasNext()) {
BinNode[] nodes = bnl.getNextBinNodes(bnl.available());
} | 62598fb17d43ff2487427431 |
class Video(models.Model): <NEW_LINE> <INDENT> id=models.AutoField(primary_key=True) <NEW_LINE> Catalog = models.ForeignKey('Catalog', on_delete=models.PROTECT, null=True, verbose_name="目录项") <NEW_LINE> over_time = models.CharField(max_length=128,verbose_name="完成最短用时") <NEW_LINE> video = models.FileField(upload_to='upl... | 视频表 | 62598fb163b5f9789fe851c7 |
class LogParabolaSpectralModel(SpectralModel): <NEW_LINE> <INDENT> tag = ["LogParabolaSpectralModel", "lp"] <NEW_LINE> amplitude = Parameter( "amplitude", "1e-12 cm-2 s-1 TeV-1", scale_method="scale10", interp="log" ) <NEW_LINE> reference = Parameter("reference", "10 TeV", frozen=True) <NEW_LINE> alpha = Parameter("alp... | Spectral log parabola model.
For more information see :ref:`logparabola-spectral-model`.
Parameters
----------
amplitude : `~astropy.units.Quantity`
:math:`\phi_0`
reference : `~astropy.units.Quantity`
:math:`E_0`
alpha : `~astropy.units.Quantity`
:math:`\alpha`
beta : `~astropy.units.Quantity`
:math:... | 62598fb1aad79263cf42e831 |
class FileIDType(Enum): <NEW_LINE> <INDENT> SettlementFund = 70 <NEW_LINE> Trade = 84 <NEW_LINE> InvestorPosition = 80 <NEW_LINE> SubEntryFund = 79 <NEW_LINE> CZCECombinationPos = 67 <NEW_LINE> CSRCData = 82 <NEW_LINE> CZCEClose = 76 <NEW_LINE> CZCENoClose = 78 <NEW_LINE> PositionDtl = 68 <NEW_LINE> OptionStrike = 83 <... | 文件标识类型 | 62598fb1e5267d203ee6b966 |
class New(object): <NEW_LINE> <INDENT> form = web.form.Form( web.form.Textbox('name', not_too_short(3), size=30, description='Model name:'), web.form.Textarea('json', not_bad_json, rows=40, cols=80, description=None), web.form.Button('Save') ) <NEW_LINE> def GET(self): <NEW_LINE> <INDENT> return render.new(self.form())... | Create a new model. To create a new model, go here:
* https://csdms.colorado.edu/wmt/models/new
You could also just POST some JSON to this URL.
A valid JSON description of a model is simply a valid JSON file
of an object with a member called *model*. The simplest
example would be::
{ "model": 0 }
> curl -i -X POST... | 62598fb166656f66f7d5a44e |
class RewardRequest(Model): <NEW_LINE> <INDENT> _validation = { 'value': {'required': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': 'float'}, } <NEW_LINE> def __init__(self, *, value: float, **kwargs) -> None: <NEW_LINE> <INDENT> super(RewardRequest, self).__init__(**kwargs) <NEW_LINE> self.v... | Reward given to a rank response.
All required parameters must be populated in order to send to Azure.
:param value: Required. Reward to be assigned to an action. Value should
be between -1 and 1 inclusive.
:type value: float | 62598fb1aad79263cf42e832 |
@tag('medida') <NEW_LINE> class MedidaListViewTestCase(MedidaViewHelper): <NEW_LINE> <INDENT> target_url = reverse('medidas:lista-medidas') <NEW_LINE> def test_url_view_correspondence(self): <NEW_LINE> <INDENT> self.login() <NEW_LINE> response = self.client.get(self.target_url) <NEW_LINE> actual = response.resolver_mat... | Pruebas para la vista de listado de medidas | 62598fb123849d37ff851112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.