code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class CSV(FormattedStats): <NEW_LINE> <INDENT> def __init__(self, stats: dtypes.Stats): <NEW_LINE> <INDENT> super().__init__(stats) <NEW_LINE> self._metadata_header = _METDATA_MAPPING.keys() <NEW_LINE> self._metadata_row = [getattr(stats, v) for v in _METDATA_MAPPING.values()] <NEW_LINE> self._data_header = _STATS_MAPP...
Formats `dtypes.Stats` to CSV. Args: stats (dtypes.Stats): A benchmarking result. Raises: TypeError: If `stats` is not of type `dtypes.Stats`.
62599047711fe17d825e165f
class AdamaxOptimizer(optimizer.Optimizer): <NEW_LINE> <INDENT> def __init__(self, learning_rate=0.001, beta1=0.9, beta2=0.999, use_locking=False, name="Adamax"): <NEW_LINE> <INDENT> super(AdamaxOptimizer, self).__init__(use_locking, name) <NEW_LINE> self._lr = learning_rate <NEW_LINE> self._beta1 = beta1 <NEW_LINE> se...
Optimizer that implements the Adamax algorithm. See [Kingma et. al., 2014](http://arxiv.org/abs/1412.6980) ([pdf](http://arxiv.org/pdf/1412.6980.pdf)). @@__init__
62599047a79ad1619776b403
class TestInvest: <NEW_LINE> <INDENT> @pytest.mark.parametrize('case', InvestData.error_data) <NEW_LINE> def test_invest_error_info_btn(self, case, invest_fixture): <NEW_LINE> <INDENT> invest_page = invest_fixture[0] <NEW_LINE> invest_page.input_invest_amount(case['money']) <NEW_LINE> res = invest_page.get_invest_btn_e...
测试投资用例类
6259904716aa5153ce401870
class GeneralizedMeanPooling(nn.Module): <NEW_LINE> <INDENT> def __init__(self, norm_type, output_size): <NEW_LINE> <INDENT> super(GeneralizedMeanPooling, self).__init__() <NEW_LINE> self.output_size = output_size <NEW_LINE> self.norm_type = norm_type <NEW_LINE> <DEDENT> def forward(self, input): <NEW_LINE> <INDENT> ou...
Applies a 2D power-average adaptive pooling over an input signal composed of several input planes. The function computed is: :math:`f(X) = pow(sum(pow(X, p)), 1/p)` - At p = infinity, one gets Max Pooling - At p = 1, one gets Average Pooling The output is of size H x W, for any input size. The number of outp...
62599047462c4b4f79dbcd82
class Users(object): <NEW_LINE> <INDENT> def configure_admin(self): <NEW_LINE> <INDENT> hookenv.log("Configuring user for jenkins") <NEW_LINE> admin = self._admin_data() <NEW_LINE> api = Api() <NEW_LINE> api.update_password(admin.username, admin.password) <NEW_LINE> host.write_file( paths.ADMIN_PASSWORD, admin.password...
Manage Jenkins users.
625990471f5feb6acb163f79
class PresentationModel(qc.QObject): <NEW_LINE> <INDENT> combo_symbol_text: Dict[str, Sequence[SymbolText]] <NEW_LINE> edited = qc.Signal() <NEW_LINE> def __init__(self, cfg: DumpableAttrs): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.cfg = cfg <NEW_LINE> self.update_widget: Dict[str, List[WidgetUpdater]] = ...
Key-value MVP presentation-model. Qt's built-in model-view framework expects all models to take the form of a database-style numbered [row, column] structure, whereas my model takes the form of a key-value struct exposed as a form. Each GUI BoundWidget generally reads/writes `widget.pmodel[widget.path]`. To access c...
6259904710dbd63aa1c71f5e
class RoomMaster(): <NEW_LINE> <INDENT> def __init__(self, rid, title, url, mrt, publishtime): <NEW_LINE> <INDENT> self.rid = rid; <NEW_LINE> self.title = title; <NEW_LINE> self.url = url; <NEW_LINE> self.mrt = mrt; <NEW_LINE> self.publishtime = publishtime;
classdocs
625990473c8af77a43b688ff
class Methods(Helper): <NEW_LINE> <INDENT> mode = HelperMode.lowerCamelCase <NEW_LINE> GET_UPDATES = Item() <NEW_LINE> SET_WEBHOOK = Item() <NEW_LINE> DELETE_WEBHOOK = Item() <NEW_LINE> GET_WEBHOOK_INFO = Item() <NEW_LINE> GET_ME = Item() <NEW_LINE> SEND_MESSAGE = Item() <NEW_LINE> FORWARD_MESSAGE = Item() <NEW_LINE> S...
Helper for Telegram API Methods listed on https://core.telegram.org/bots/api List is updated to Bot API 3.6
6259904707d97122c4218025
class ReaderError(Exception): <NEW_LINE> <INDENT> pass
Exception class for Readers
6259904707f4c71912bb07b6
class LemonldapAuthenticationMiddleware(object): <NEW_LINE> <INDENT> headers = [ ('username', 'HTTP_AUTH_USER', True), ('firstname', 'HTTP_AUTH_FIRSTNAME', False, None), ('lastname', 'HTTP_AUTH_LASTNAME', False, None), ('mail', 'HTTP_AUTH_MAIL', False, None), ('is_superuser', 'HTTP_AUTH_SUPERUSER', False, 'false'), ('i...
HTTP headers used : - user_infos key name - header key name - is required - default value if not provided
62599047d99f1b3c44d06a24
class ImageList(object): <NEW_LINE> <INDENT> def __init__(self, path_to_dir=None): <NEW_LINE> <INDENT> self.path_to_dir = path_to_dir <NEW_LINE> self.updateFileList() <NEW_LINE> <DEDENT> def updateFileList(self, path_to_new_dir=None): <NEW_LINE> <INDENT> if path_to_new_dir is not None: <NEW_LINE> <INDENT> self.path_to_...
Lists absorption and reference images in a directory
62599047d6c5a102081e34a0
class Role: <NEW_LINE> <INDENT> class RoleState: <NEW_LINE> <INDENT> def __init__(self, hp, mp): <NEW_LINE> <INDENT> self.hp = hp <NEW_LINE> self.mp = mp <NEW_LINE> <DEDENT> <DEDENT> def __init__(self, role_state): <NEW_LINE> <INDENT> self.role_state = role_state <NEW_LINE> <DEDENT> def show(self): <NEW_LINE> <INDENT> ...
Originator class. Here is a game role for saving the role state.
6259904791af0d3eaad3b1a9
class ShoptoolsTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_sample(self): <NEW_LINE> <INDENT> self.assertEqual(1, 1)
Integration tests for shoptools apps.
6259904726068e7796d4dccb
class AdjudicatorForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Adjudicator <NEW_LINE> fields = ('ccid', 'first_name', 'last_name', 'email', 'lang_pref') <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AdjudicatorForm, self).__init__(*args, **kwargs)
Unrestricted Adjudicator form containing all fields
6259904763b5f9789fe864f1
class EndMessage(StanzaMessage): <NEW_LINE> <INDENT> pass
Ending message and a stanza
62599047a79ad1619776b405
class TestTransactionStamp(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.stamp = transactions.TransactionStamp(30, "master_id", 1) <NEW_LINE> <DEDENT> def test_to_json_returns_valid_json(self): <NEW_LINE> <INDENT> self.assertEqual( self.stamp.to_json(), '{"processing_time": 1, "fees"...
Tests the TransactionStamp class.
6259904745492302aabfd857
class CPFPHookScriptTemplate(ScriptTemplate): <NEW_LINE> <INDENT> script_template = "OP_1" <NEW_LINE> witness_template_map = {} <NEW_LINE> witness_templates = {}
OP_TRUE -- a simple script for anyone-can-spend.
625990478e05c05ec3f6f81d
@admin.register(Contenido) <NEW_LINE> class ContenidoAdmin(ImportExportModelAdmin): <NEW_LINE> <INDENT> pass
Docstring
62599047b57a9660fecd2e02
class OWLObjectMaxCardinality(OWLObjectCardinalityRestriction): <NEW_LINE> <INDENT> __slots__ = '_cardinality', '_filler', '_property' <NEW_LINE> type_index: Final = 3010 <NEW_LINE> def __init__(self, cardinality: int, property: OWLObjectPropertyExpression, filler: OWLClassExpression): <NEW_LINE> <INDENT> super().__ini...
Represents a ObjectMaxCardinality restriction in the OWL 2 Specification.
6259904729b78933be26aa85
class Bower(Configurable): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Configurable.__init__(self) <NEW_LINE> Configurable.load(self) <NEW_LINE> self.__web_path = os.path.expanduser("~") + '/.smartrcs/web' <NEW_LINE> <DEDENT> def check_installed(self): <NEW_LINE> <INDENT> return self._config['installed'...
The :class:`Bower <Bower>` class. Bower dependency checker and installer
625990478a349b6b436875d1
class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> verbose_name = _("Additional Entity Characteristic or Mark") <NEW_LINE> verbose_name_plural = _("Additional Entity Characteristics or Marks")
RUS: Метаданные класса.
6259904710dbd63aa1c71f60
@dbus_interface(USER_INTERFACE.interface_name) <NEW_LINE> class UIInterface(KickstartModuleInterfaceTemplate): <NEW_LINE> <INDENT> def connect_signals(self): <NEW_LINE> <INDENT> super().connect_signals() <NEW_LINE> self.watch_property("PasswordPolicies", self.implementation.password_policies_changed) <NEW_LINE> <DEDENT...
DBus interface for the user interface module.
62599047009cb60464d028ba
class ParseError(Exception): <NEW_LINE> <INDENT> def __init__(self, message: str): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.message <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"ParseError({self.message!r})"
Parsing failure converted to an exception. Raised when ``or_die`` method on ``Failure`` is called. Attributes: message (str): A human-readable error message
6259904707f4c71912bb07b8
class Order(models.Model): <NEW_LINE> <INDENT> WAITING = 'WA' <NEW_LINE> PREPARE = 'PR' <NEW_LINE> READY = 'RE' <NEW_LINE> DELIVER = 'DE' <NEW_LINE> CANCELED = 'CA' <NEW_LINE> ORDER_STATUS_CHOICES = [ (WAITING, 'Waiting'), (PREPARE, 'Prepare'), (READY, 'Ready'), (DELIVER, 'Deliver'), (CANCELED, 'Canceled'), ] <NEW_LINE...
model for user orders
6259904763b5f9789fe864f3
class UpdateAuditResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.IsSuccess = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.IsSuccess = params.get("IsSuccess") <NEW_LINE> self.RequestId = params.get("RequestId"...
`UpdateAudit` response parameters structure
62599047ec188e330fdf9c23
class RconClient(object): <NEW_LINE> <INDENT> def __init__(self, host, port, timeout=1.0): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.timeout = timeout <NEW_LINE> self.packet_id = itertools.count(1) <NEW_LINE> self.socket = None <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <IN...
A client implementation for the Source RCON Protocol.
6259904723849d37ff852443
class test(compare_db_errors.test): <NEW_LINE> <INDENT> server0 = None <NEW_LINE> server1 = None <NEW_LINE> server2 = None <NEW_LINE> def setup(self, spawn_servers=True): <NEW_LINE> <INDENT> self.server0 = self.servers.get_server(0) <NEW_LINE> if not self.server0.check_version_compat(5, 6, 5): <NEW_LINE> <INDENT> raise...
check errors for dbcompare This test executes a series of error conditions for the check database utility. It uses the compare_db test as a parent for setup and teardown methods.
6259904794891a1f408ba0b9
class ImageManager: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_image_by_id(image_id: int, related_fields: tuple = ()): <NEW_LINE> <INDENT> if not isinstance(image_id, int) or image_id < 0: <NEW_LINE> <INDENT> raise ImageError(msg='镜像ID参数有误') <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> if related_fields: <NEW...
镜像管理器
62599047baa26c4b54d50631
class cached_property(default_property): <NEW_LINE> <INDENT> def __get__(self, obj, objtype=None): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> ret = super(cached_property, self).__get__(obj, objtype) <NEW_LINE> setattr(obj, self.func.__name__, ret) <NEW_LINE> return ret
Non-data descriptor. Delegates to func only the first time a property is accessed. Usage example: >>> class C(object): ... @cached_property ... def cached(self): ... print("Accessing {cls.__name__}.cached".format(cls=type(self))) ... return 17 ... >>> x = C() >>> x.cached Accessing C.cached 1...
62599047d6c5a102081e34a3
class EquipmentServiceServicer(object): <NEW_LINE> <INDENT> def Identificate(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def Rece...
Missing associated documentation comment in .proto file.
62599047004d5f362081f9aa
class Player(models.Model): <NEW_LINE> <INDENT> champion = models.ForeignKey(Champion) <NEW_LINE> summoner = models.ForeignKey(Summoner) <NEW_LINE> team_id = models.IntegerField() <NEW_LINE> game = models.ForeignKey('Game') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> ordering = ('team_id',) <NEW_LINE> <DEDENT> def __str...
Maps to Riot API fellowPlayer DTO. game-v1.3. fellowPlayer is related to match history query.
6259904750485f2cf55dc30f
class IpPrinter: <NEW_LINE> <INDENT> def __init__ (self, typename, val): <NEW_LINE> <INDENT> self.typename = typename <NEW_LINE> self.val = val <NEW_LINE> <DEDENT> def to_string (self): <NEW_LINE> <INDENT> ip_type = "" <NEW_LINE> addr = "" <NEW_LINE> if self.val['type_'] == 0: <NEW_LINE> <INDENT> x = int(self.val['ipv4...
Print TBB atomic varaiable of some kind
62599047462c4b4f79dbcd86
class ListTree: <NEW_LINE> <INDENT> def __attrnames(self, obj, indent): <NEW_LINE> <INDENT> spaces = ' ' * (indent + 1) <NEW_LINE> result = '' <NEW_LINE> for attr in sorted(obj.__dict__): <NEW_LINE> <INDENT> if attr.startswith('__') and attr.endswith('__'): <NEW_LINE> <INDENT> result += spaces + '{0}\n'.format(attr) <N...
Mix-in that returns an __str__ trace of the entire class tree and all its objects' attrs at and above self; run by print(), str() returns constructed string; uses __X attr names to avoid impacting clients; recurses to superclasses explicitly, uses str.format() for clarity;
625990474e696a045264e7e4
class NotLoadedType: <NEW_LINE> <INDENT> _locked = False <NEW_LINE> @staticmethod <NEW_LINE> def __init__(): <NEW_LINE> <INDENT> if NotLoadedType._locked: <NEW_LINE> <INDENT> raise ValueError('Do not make new instance of NotLoadedType') <NEW_LINE> <DEDENT> NotLoadedType._locked = True <NEW_LINE> <DEDENT> @staticmethod ...
用于表示尚未载入的内容
62599048d53ae8145f9197e8
class CSSVariable(CSSFunction): <NEW_LINE> <INDENT> _functionName = 'CSSVariable' <NEW_LINE> _name = None <NEW_LINE> _fallback = None <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "<css_parser.css.%s object name=%r value=%r at 0x%x>" % ( self.__class__.__name__, self.name, self.value, id(self)) <NEW_LINE> <D...
The CSSVariable represents a CSS variables like ``var(varname)``. A variable has a (nonnormalized!) `name` and a `value` which is tried to be resolved from any available CSSVariablesRule definition.
6259904850485f2cf55dc310
class StructuredDefaultDict(dict): <NEW_LINE> <INDENT> __slots__ = ('layer', 'type', 'args_munger', 'kwargs_munger', 'parent', 'key', '_stuff', 'gettest', 'settest') <NEW_LINE> def __init__(self, layers, type=None, args_munger=_default_args_munger, kwargs_munger=_default_kwargs_munger, gettest=lambda k: None, settest=l...
A ``defaultdict``-like class that expects values stored at a specific depth. Requires an integer to tell it how many layers deep to go. The innermost layer will be ``PickyDefaultDict``, which will take the ``type``, ``args_munger``, and ``kwargs_munger`` arguments supplied to my constructor.
62599048d99f1b3c44d06a27
class AuthorRecipeListView(ListView): <NEW_LINE> <INDENT> paginate_by = settings.PAGINATE_BY <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> author = get_object_or_404(User, username=self.kwargs['username']) <NEW_LINE> self.extra_context = {'author': author} <NEW_LINE> queryset = Recipe.objects.select_related( '...
Display recipe list of a particular author.
62599048a8ecb0332587259a
class _BCSnapshot(object): <NEW_LINE> <INDENT> def __init__(self, bcs): <NEW_LINE> <INDENT> self.bcs = map(weakref.ref, bcs) if bcs is not None else None <NEW_LINE> <DEDENT> def valid(self, bcs): <NEW_LINE> <INDENT> if len(bcs) != len(self.bcs): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> for bc, wbc in zip(bc...
Record the boundary conditions which were applied to a form.
6259904845492302aabfd85a
class Command: <NEW_LINE> <INDENT> name = None <NEW_LINE> def __init__(self, runner): <NEW_LINE> <INDENT> self._runner = runner <NEW_LINE> <DEDENT> def __call__(self, args): <NEW_LINE> <INDENT> self.execute(args) <NEW_LINE> <DEDENT> def _error(self, message): <NEW_LINE> <INDENT> self._runner._error(message, prog=self.n...
The base command to define command-line actions.
62599048498bea3a75a58ea8
class ElementSensor(TemperatureSensor): <NEW_LINE> <INDENT> def __init__(self, _id, _uuid, max_temp: Temperature, min_temp: Temperature): <NEW_LINE> <INDENT> super().__init__(_id, _uuid) <NEW_LINE> self.max_temp = max_temp <NEW_LINE> self.min_temp = min_temp <NEW_LINE> <DEDENT> def check_temperature_limits(self, curren...
This is a class representing an element sensor. Because of the materials used, the element should never exceed specified temperature limits set in the constructor.
6259904876d4e153a661dc3a
class PolymorphicMPTTChildModelAdmin(PolymorphicChildModelAdmin, MPTTModelAdmin): <NEW_LINE> <INDENT> base_model = None <NEW_LINE> base_form = PolymorpicMPTTAdminForm <NEW_LINE> base_fieldsets = None <NEW_LINE> @property <NEW_LINE> def change_form_template(self): <NEW_LINE> <INDENT> templates = super(PolymorphicMPTTChi...
The internal machinery The admin screen for the ``PolymorphicMPTTModel`` objects.
62599048379a373c97d9a3b3
class Solution: <NEW_LINE> <INDENT> def sequenceReconstruction(self, org, seqs): <NEW_LINE> <INDENT> graph = self.build_graph(seqs) <NEW_LINE> topo_order = self.topological_sort(graph) <NEW_LINE> return topo_order == org <NEW_LINE> <DEDENT> def build_graph(self, seqs): <NEW_LINE> <INDENT> graph = {} <NEW_LINE> for seq ...
@param org: a permutation of the integers from 1 to n @param seqs: a list of sequences @return: true if it can be reconstructed only one or false
62599048dc8b845886d54944
class ConstTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_type_attributes(self): <NEW_LINE> <INDENT> @rdpy.core.const.TypeAttributes(rdpy.core.type.UInt16Le) <NEW_LINE> class Test: <NEW_LINE> <INDENT> MEMBER_1 = 1 <NEW_LINE> MEMBER_2 = 2 <NEW_LINE> <DEDENT> self.assertIsInstance(Test.MEMBER_1, rdpy.core.type.UIn...
represent test case for all classes and function present in rdpy.base.const
6259904823849d37ff852445
class Regle: <NEW_LINE> <INDENT> ID = 0 <NEW_LINE> def __init__(self, gauche:list, droite:list, fiab:float=1.) -> None: <NEW_LINE> <INDENT> self.__id = self.ID <NEW_LINE> Regle.ID += 1 <NEW_LINE> self.__left = frozenset(gauche) <NEW_LINE> self.__right = frozenset(droite) <NEW_LINE> self.__fiabilite = fiab <NEW_LINE> <D...
<conditions> -> <conclusions>
6259904830c21e258be99b8f
class WeightLogEntryEditTestCase(WorkoutManagerTestCase): <NEW_LINE> <INDENT> def edit_log_entry(self, fail=True): <NEW_LINE> <INDENT> response = self.client.get(reverse('manager:log:edit', kwargs={'pk': 1})) <NEW_LINE> if fail: <NEW_LINE> <INDENT> self.assertTrue(response.status_code in (302, 403)) <NEW_LINE> <DEDENT>...
Tests editing individual weight log entries
6259904830dc7b76659a0bbc
class Command(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument("--run_time", help="Time to run for.") <NEW_LINE> parser.add_argument("--crash", action="store_true", help="Crash when running.") <NEW_LINE> parser.add_argument("--print", help="Value to print to std...
Test cron job command.
625990483617ad0b5ee074c6
class BoxAround(Enum): <NEW_LINE> <INDENT> TOP_LEFT = 0 <NEW_LINE> TOP_CENTER = 1 <NEW_LINE> TOP_RIGHT = 2 <NEW_LINE> LEFT = 3 <NEW_LINE> CENTER = 4 <NEW_LINE> RIGHT = 5 <NEW_LINE> BOTTOM_LEFT = 6 <NEW_LINE> BOTTOM_CENTER = 7 <NEW_LINE> BOTTOM_RIGHT = 8
Use for Box.around_ref dictionary 0 1 2 3 4 5 6 7 8 Box.around_ref[CENTER] should return self TODO Implement if needed
625990486fece00bbacccd3f
class NetworkManager(TortugaObjectManager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(NetworkManager, self).__init__() <NEW_LINE> self._networkDbApi = NetworkDbApi() <NEW_LINE> <DEDENT> def getNetwork(self, session: Session, address: str, netmask: str) -> Network: <NEW_LINE> <INDENT> ...
Class for network management. Usage: # Getting db instance. from tortuga.network.networkManager import NetworkManager networkManager = NetworkManager()
625990483c8af77a43b68902
@register_model('convtransformer') <NEW_LINE> class ConvTransformerModel(TransformerModel): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def add_args(parser): <NEW_LINE> <INDENT> super(ConvTransformerModel, ConvTransformerModel).add_args(parser) <NEW_LINE> parser.add_argument('--context_size', type=int, default=3, help...
Args: encoder (ConvTransformerEncoder): the encoder decoder (TransformerDecoder): the decoder The Transformer model provides the following named architectures and command-line arguments: .. argparse:: :ref: fairseq.models.transformer_parser :prog:
62599048d10714528d69f052
class FormatNodeItemResultTest(TestCase): <NEW_LINE> <INDENT> def test_values(self): <NEW_LINE> <INDENT> result = MagicMock() <NEW_LINE> result.correct = 0 <NEW_LINE> result.fixed = 1 <NEW_LINE> result.skipped = 2 <NEW_LINE> result.failed = 3 <NEW_LINE> self.assertEqual( format_node_result(result), "0 OK, 1 fixed, 2 sk...
Tests blockwart.cmdline.apply.format_node_item_result.
6259904821a7993f00c672f3
class GenderEvaluator: <NEW_LINE> <INDENT> def __init__(self, gender=None): <NEW_LINE> <INDENT> self.eligible = False <NEW_LINE> self.reasons_eligible = None <NEW_LINE> if gender == 'MALE': <NEW_LINE> <INDENT> self.eligible = True <NEW_LINE> <DEDENT> elif gender == 'FEMALE': <NEW_LINE> <INDENT> self.eligible = True <NE...
Eligible if gender is valid
62599048be383301e0254ba3
class FeatureLine(Feature): <NEW_LINE> <INDENT> def __init__(self, points, thickness): <NEW_LINE> <INDENT> self.line = geom.LineString(points) <NEW_LINE> self.thickness = thickness <NEW_LINE> self._update_shape() <NEW_LINE> self.models = [] <NEW_LINE> <DEDENT> def _update_shape(self): <NEW_LINE> <INDENT> self.shape = s...
Feature corresponding to a linear zone: new functions to manipulate the curve of the feature.
6259904845492302aabfd85c
class AverageMeter(object): <NEW_LINE> <INDENT> def __init__(self, name, fmt=':4g', disp_avg=True): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.fmt = fmt <NEW_LINE> self.disp_avg = disp_avg <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.val = 0 <NEW_LINE> self.avg = 0 <NE...
Computes and stores the average and current value
625990488e05c05ec3f6f820
class Origin(BaseListeningAgent): <NEW_LINE> <INDENT> async def send_schema(self, schema_data_json: str) -> str: <NEW_LINE> <INDENT> logger = logging.getLogger(__name__) <NEW_LINE> logger.debug('Origin.send_schema: >>> schema_data_json: {}'.format(schema_data_json)) <NEW_LINE> req_json = await ledger.build_schema_reque...
Mixin for agent to send schemata and claim definitions to the distributed ledger
62599048baa26c4b54d50635
class ProductionTimeReportResource(Resource): <NEW_LINE> <INDENT> item_methods = ['GET'] <NEW_LINE> resource_methods = ['GET'] <NEW_LINE> privileges = {'GET': 'production_time_report'} <NEW_LINE> schema = { 'desk_stats': { 'type': 'dict', 'required': False, 'schema': {}, 'allow_unknown': True }, 'highcharts': { 'type':...
Desk Activity Report schema
62599048004d5f362081f9ac
class HeapNode: <NEW_LINE> <INDENT> def __init__(self, key: int) -> None: <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.left = None <NEW_LINE> self.right = None <NEW_LINE> self.parent = None <NEW_LINE> <DEDENT> def cut(self) -> None: <NEW_LINE> <INDENT> if self.parent.left == self: <NEW_LINE> <INDENT> self.parent....
A node in a pairing heap. Attributes: key (int): The key value stored by this node. Guaranteed to be less than or equal to all keys in this subheap. left (HeapNode or None): The child of the node. right (HeapNode or None): The sibling of the node. parent (HeapNode or None): The parent of the no...
6259904830c21e258be99b91
class dualwb_intercon(intercon): <NEW_LINE> <INDENT> intercon_type = "dualwb" <NEW_LINE> complement = None <NEW_LINE> sideinfo = "" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> intercon.__init__(self, **kwargs) <NEW_LINE> if not hasattr(self, "data_width"): <NEW_LINE> <INDENT> setattr(self, "data_width"...
Wishbone dual P2P intercon model This intercon defines two bidirectional Wishbone P2P ports.
6259904829b78933be26aa88
class DataMissingError(DataError): <NEW_LINE> <INDENT> pass
An error raised when data is missing from the expected location.
6259904873bcbd0ca4bcb618
class BottleNeck(nn.Module): <NEW_LINE> <INDENT> expansion = 4 <NEW_LINE> def __init__(self, inplanes, planes, stride=1): <NEW_LINE> <INDENT> super(BottleNeck, self).__init__() <NEW_LINE> self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False) <NEW_LINE> self.bn1 = nn.BatchNorm2d(planes) <NEW_LINE> self.con...
ResNet BottleNeck
6259904810dbd63aa1c71f66
class TestPub(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> test_lock.acquire() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> test_lock.release() <NEW_LINE> <DEDENT> def test_pub_unicode(self): <NEW_LINE> <INDENT> from posttroll.message import Message <NEW_LINE> from posttro...
Testing the publishing capabilities.
6259904823e79379d538d889
class NoneTransform(object): <NEW_LINE> <INDENT> def __call__(self, image): <NEW_LINE> <INDENT> return image
Does nothing to the image, to be used instead of None Args: image in, image out, nothing is done
625990483c8af77a43b68903
class MyTestCase(unittest.TestCase): <NEW_LINE> <INDENT> screenshot_path = os.path.join(gl.screenshot_path, os.path.splitext(os.path.basename(__file__))[0]) <NEW_LINE> start_date = '2018-01-01' <NEW_LINE> end_date = '2018-01-31' <NEW_LINE> count = '294' <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE>...
按省区各品牌投放城市
6259904807d97122c421802d
class Config: <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/ihome" <NEW_LINE> SQLALCHEMY_TRACK_MODIFICATIONS = True <NEW_LINE> SQLALCHEMY_COMMIT_ON_TEARDOWN = True <NEW_LINE> HOST = "127.0.0.1" <NEW_LINE> POST = 6379 <NEW_LINE> NUM = 0 <NEW_LINE> SECRET_KEY = "...
基本配置参数
62599048009cb60464d028c0
class ScalingFunction(AliasedFactory): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def scale_to_hertz(self, scale: float) -> float: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def hertz_to_scale(self, hertz: float) -> float: <NEW_LINE> <INDENT> pass
Converts a frequency to some scale and back again
6259904807d97122c421802e
class KinesisStreamHealthCheck: <NEW_LINE> <INDENT> def __init__(self, stream_conn, stream_name): <NEW_LINE> <INDENT> self._stream_connection = stream_conn <NEW_LINE> self.stream_name = stream_name <NEW_LINE> <DEDENT> def check_active(self): <NEW_LINE> <INDENT> return self._check_status() == 'ACTIVE' <NEW_LINE> <DEDENT...
a Kinesis stream health checker to get information on a given stream's operability
625990480fa83653e46f6268
class ListProductsPager: <NEW_LINE> <INDENT> def __init__( self, method: Callable[..., service.ListProductsResponse], request: service.ListProductsRequest, response: service.ListProductsResponse, *, metadata: Sequence[Tuple[str, str]] = () ): <NEW_LINE> <INDENT> self._method = method <NEW_LINE> self._request = service....
A pager for iterating through ``list_products`` requests. This class thinly wraps an initial :class:`google.cloud.channel_v1.types.ListProductsResponse` object, and provides an ``__iter__`` method to iterate through its ``products`` field. If there are more pages, the ``__iter__`` method will make additional ``ListPr...
6259904815baa7234946331c
class eClassSession(Base.WebSession): <NEW_LINE> <INDENT> METHODS = ['sign_all'] <NEW_LINE> def __init__(self, login, passwd): <NEW_LINE> <INDENT> link = '%s/index.php?page_size_change=1&noticeType=%d&signStatus=%d&numPerPage=%d' % (ENOTICE, EXPIRED, NOT_SIGNED, NUM_PAGE) <NEW_LINE> cred = {USERNAME_ID:login, PASSWORD_...
Session for eClass IP 2.5
62599048e64d504609df9d96
class ServiceModel(object): <NEW_LINE> <INDENT> SHAPE_CLASSES = { 'structure': StructureShape, 'list': ListShape, 'map': MapShape, } <NEW_LINE> def __init__(self, service_description, service_name=None): <NEW_LINE> <INDENT> self._service_description = service_description <NEW_LINE> self.metadata = service_description.g...
:ivar service_description: The parsed service description dictionary.
62599048507cdc57c63a6129
class EdxInstanceExternalEnrollment(BaseExternalEnrollment): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "openedX" <NEW_LINE> <DEDENT> def _get_enrollment_headers(self): <NEW_LINE> <INDENT> headers = { "Accept": "application/json", "Content-Type": "application/json", "X-Edx-Api-Key": settings.EDX_...
EdxInstanceExternalEnrollment class.
6259904821a7993f00c672f5
@attr(rank=101, author='wong', scenario='GraphTriggers', doc='', ) <NEW_LINE> class GraphTriggers(object): <NEW_LINE> <INDENT> @attr(duration=0) <NEW_LINE> def test_100_provider_node(self): <NEW_LINE> <INDENT> sshifc = self.get_ssh() <NEW_LINE> cfgifc = self.get_config() <NEW_LINE> emifc = self.get_em() <NEW_LINE> LOG....
This is like a healper class for trigger tests. All trigger tests can be run on any graph. To use this class: class Tests(InterfaceTestCase, GraphTriggers): ...
62599048be383301e0254ba5
class Field(GDALBase): <NEW_LINE> <INDENT> def __init__(self, feat, index): <NEW_LINE> <INDENT> self._feat = feat <NEW_LINE> self._index = index <NEW_LINE> fld_ptr = capi.get_feat_field_defn(feat.ptr, index) <NEW_LINE> if not fld_ptr: <NEW_LINE> <INDENT> raise GDALException('Cannot create OGR Field, invalid pointer giv...
This class wraps an OGR Field, and needs to be instantiated from a Feature object.
62599048379a373c97d9a3b7
class BackupUDBInstanceBinlogResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = {}
BackupUDBInstanceBinlog - 备份UDB指定时间段的binlog列表
62599048b830903b9686ee41
class ProductList(b.Base): <NEW_LINE> <INDENT> admin = False <NEW_LINE> method = "GET" <NEW_LINE> url = "products" <NEW_LINE> documentation_type = "product_list"
List available products for the current users.
62599048d6c5a102081e34a9
class TimedRoute(Route): <NEW_LINE> <INDENT> def __init__(self, route, distances, speed, frequency): <NEW_LINE> <INDENT> self.speed = speed <NEW_LINE> self.frequency = frequency <NEW_LINE> Route.__init__(self, route, distances) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_start_and_end(cls, start_location, end_...
An object for a route that has a desired speed and point frequency. Attributes: speed: how fast the person moves through the route in meters/second frequency: how many points per second the timed route should have (Hz) route: a list of Location objects for each point on the route distances: a list of distances...
625990484e696a045264e7e7
class _LocIndexer: <NEW_LINE> <INDENT> def __init__(self, data_array): <NEW_LINE> <INDENT> self.data_array = data_array <NEW_LINE> <DEDENT> def expand(self, key): <NEW_LINE> <INDENT> if not is_dict_like(key): <NEW_LINE> <INDENT> labels = expanded_indexer(key, self.data_array.ndim) <NEW_LINE> key = dict(zip(self.data_ar...
Provide the unit-wrapped .loc indexer for data arrays.
6259904807d97122c421802f
class calldef_matcher_t( declaration_matcher_t ): <NEW_LINE> <INDENT> def __init__( self, name=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None): <NEW_LINE> <INDENT> if None is decl_type: <NEW_LINE> <INDENT> decl_type = calldef.calldef_t <NEW_LINE> <DEDENT> declaration_matcher_t...
Instance of this class will match callable by the following criteria: * :class:`declaration_matcher_t` criteria * return type. For example: :class:`int_t` or 'int' * argument types
6259904823e79379d538d88c
class v4l2src_bin(gst.Bin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> gst.Bin.__init__(self) <NEW_LINE> self.set_name('jamedia_camara_bin') <NEW_LINE> camara = gst.element_factory_make("v4l2src", "v4l2src") <NEW_LINE> caps = gst.Caps('video/x-raw-yuv,framerate=30/1') <NEW_LINE> camerafilter = gst.elem...
Bin de entrada de camara v4l2src.
6259904815baa7234946331f
class cond_rv_frozen(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(cond_rv_frozen, self).__init__()
Class which encapsulates common functionality between all conditional distributions.
625990487cff6e4e811b6dc7
class Refused(DNSException): <NEW_LINE> <INDENT> code = 5
The server refused to answer for the reply
62599048d4950a0f3b111809
@register_plugin <NEW_LINE> class FFTPlugin(Device, version_type='ADCore'): <NEW_LINE> <INDENT> ... <NEW_LINE> _default_suffix = 'FFT1:' <NEW_LINE> _suffix_re = r'FFT\d:' <NEW_LINE> _plugin_type = 'NDPluginFFT'
Serves as a base class for other versions
62599048b5575c28eb713690
class CustomIndexDashboard(Dashboard): <NEW_LINE> <INDENT> def init_with_context(self, context): <NEW_LINE> <INDENT> site_name = get_admin_site_name(context) <NEW_LINE> self.children.append(modules.AppList( _('Site Components'), collapsible=True, column=1, css_classes=('collapse closed',), exclude=('django.contrib.*',)...
Custom index dashboard for www.
6259904824f1403a92686294
class FreeplaneCannotCompareNodeWithDifferentID(FreeplaneError): <NEW_LINE> <INDENT> pass
Will be raised when a request or node compare is done agains two nodes with different ID. The whole code works on the assumption that ID are unique
62599048a79ad1619776b40f
class SolowModel(problems.IVP): <NEW_LINE> <INDENT> def __init__(self, f, k_star, params): <NEW_LINE> <INDENT> rhs = self._rhs_factory(f) <NEW_LINE> self._equilbrium_capital = k_star <NEW_LINE> self._intensive_output = f <NEW_LINE> super(SolowModel, self).__init__(self._initial_condition, 1, 1, params, rhs) <NEW_LINE> ...
Class representing a generic Solow growth model. Attributes ---------- equilibrium_capital : function Equilibrium value for capital (per unit effective labor). intensive_output : function Output (per unit effective labor supply). params : dict(str: float) Dictionary of model parameters.
625990488e71fb1e983bce54
class Actions(ActionsBase): <NEW_LINE> <INDENT> def configure(self, serviceObj): <NEW_LINE> <INDENT> from CloudscalerLibcloud.imageutil import registerImage <NEW_LINE> name = 'Routeros 6.31' <NEW_LINE> registerImage(serviceObj, name, 'Linux', 10)
process for install ------------------- step1: prepare actions step2: check_requirements action step3: download files & copy on right location (hrd info is used) step4: configure action step5: check_uptime_local to see if process stops (uses timeout $process.stop.timeout) step5b: if check uptime was true will do stop ...
6259904894891a1f408ba0bd
class AddGraphLearnedPositionalEmbeddings(PositionalEncoder): <NEW_LINE> <INDENT> def __init__(self, num_embed: int, max_seq_len: int, prefix: str, embed_weight: Optional[mx.sym.Symbol] = None) -> None: <NEW_LINE> <INDENT> self.num_embed = num_embed <NEW_LINE> self.max_seq_len = max_seq_len <NEW_LINE> self.prefix = pre...
Takes an encoded sequence and adds positional embeddings to it, which are learned jointly. Note that this will limited the maximum sentence length during decoding. :param num_embed: Embedding size. :param max_seq_len: Maximum sequence length. :param prefix: Name prefix for symbols of this encoder. :param embed_weight:...
6259904830c21e258be99b95
class TestMemmapCoalesce(testlib.SimpleTestCase): <NEW_LINE> <INDENT> PARAMETERS = dict(commandline="memmap %(pids)s --coalesce", pid=2624)
Make sure that memmaps are coalesced properly.
62599048b57a9660fecd2e0c
class IntConst(Token): <NEW_LINE> <INDENT> name = "integerConstant" <NEW_LINE> def __init__(self, int_value: int) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.value = int(int_value)
a literal int
625990483c8af77a43b68905
class Node(NamedTuple): <NEW_LINE> <INDENT> ip: bytes <NEW_LINE> port: bytes
ip-port pair, used to identify one side of the connection
62599048596a897236128f77
class LastAction(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey('User') <NEW_LINE> action = models.CharField(blank=False, max_length=128) <NEW_LINE> created = models.DateTimeField(auto_now_add=True)
Tracks user's LastAction
6259904873bcbd0ca4bcb61d
class Tea: <NEW_LINE> <INDENT> def __init__(self, name, origin): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._origin = origin <NEW_LINE> <DEDENT> def getRecipe(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> def getOrigin(self): <NEW_LINE> <INDENT> return self._origin
Represents a cup of tea object
6259904815baa72349463321
class ManagerProxy: <NEW_LINE> <INDENT> def __init__(self, db: Order, instance: _man.StatusManager): <NEW_LINE> <INDENT> self._db, self._instance = db, instance <NEW_LINE> <DEDENT> def json(self): <NEW_LINE> <INDENT> return self._instance.json() <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE>...
代理Manager的访问 add 函数不代理 - 实例化后的状态机不应该改变状态图
625990487cff6e4e811b6dc9
class CertificateEmail(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'location': {'required': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str...
SSL certificate email. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id. :vartype id: str :param name: Resource Name. :type name: str :param kind: Kind of resource. :type kind: str :param location: Resource Location. :type location: str :param type: Resourc...
62599048d4950a0f3b11180a
class CollisionSeriesKindle(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.modeling_cloth_collision_series_kindle" <NEW_LINE> bl_label = "Modeling Cloth Collision Series Kindle" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> collision_series(False) <NEW_LINE> return {'FINISHED'}
Support my addons by checking out my awesome sci fi books
6259904891af0d3eaad3b1b5
class TestV1ConfigMapEnvSource(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 testV1ConfigMapEnvSource(self): <NEW_LINE> <INDENT> pass
V1ConfigMapEnvSource unit test stubs
6259904863b5f9789fe864fd
class APIComponent(ContainerComponent): <NEW_LINE> <INDENT> def __init__( self, components, use_redis=True, do_profiling=False, disable_ratelimits=False, cache_time: int = None, ): <NEW_LINE> <INDENT> super().__init__(components) <NEW_LINE> app.config["owapi_use_redis"] = use_redis <NEW_LINE> app.config["owapi_do_profi...
Container for other components. I think.
625990488e71fb1e983bce56
class RunYearly(Algo): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(RunYearly, self).__init__() <NEW_LINE> self.last_date = None <NEW_LINE> <DEDENT> def __call__(self, target): <NEW_LINE> <INDENT> now = target.now <NEW_LINE> if now is None: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> if se...
Returns True on year change. Returns True if the target.now's year has changed since the last run, if not returns False. Useful for yearly rebalancing strategies. Note: This algo will typically run on the first day of the year (assuming we have daily data)
6259904850485f2cf55dc319
class TokenSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = token_model <NEW_LINE> fields = ["key"]
登入帐号的令牌
6259904826068e7796d4dcd7
class ItemStatus(ModelNormal): <NEW_LINE> <INDENT> allowed_values = { } <NEW_LINE> validations = { } <NEW_LINE> @cached_property <NEW_LINE> def additional_properties_type(): <NEW_LINE> <INDENT> lazy_import() <NEW_LINE> return (bool, date, datetime, dict, float, int, list, str, none_type,) <NEW_LINE> <DEDENT> _nullable ...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Attributes: allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict with a capitalized key describing the a...
625990484e696a045264e7e9
class SubVisitor: <NEW_LINE> <INDENT> def subst(self, node): <NEW_LINE> <INDENT> method_name = 'subst_' + type(node).__name__ <NEW_LINE> substitution = getattr(self, method_name, self.generic_subst) <NEW_LINE> return substitution(node) <NEW_LINE> <DEDENT> def generic_subst(self, node): <NEW_LINE> <INDENT> raise Excepti...
generic visitor class for substitution
6259904815baa72349463322
class BalancedCard(BalancedThing): <NEW_LINE> <INDENT> thing_type = 'card' <NEW_LINE> def __getitem__(self, name): <NEW_LINE> <INDENT> if name == 'id': <NEW_LINE> <INDENT> out = self._customer.href if self._customer is not None else None <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> name = { 'address_1': 'address.line1...
This is a dict-like wrapper around a Balanced Account.
62599048287bf620b6272f7a