code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Ec2ErrorResponseTestCase(test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(Ec2ErrorResponseTestCase, self).setUp() <NEW_LINE> self.context = context.RequestContext('test_user_id', 'test_project_id') <NEW_LINE> self.req = wsgi.Request.blank('/test') <NEW_LINE> self.req.environ['nova.co... | Test EC2 error responses.
This deals mostly with api/ec2/__init__.py code, especially
the ec2.ec2_error_ex helper. | 62598f94507cdc57c63a4a3e |
class File(BaseEntry): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.st_mode |= stat.S_IFREG <NEW_LINE> self.content = b'' <NEW_LINE> <DEDENT> @property <NEW_LINE> def content(self): <NEW_LINE> <INDENT> if self._content is None: <NEW_LINE>... | A class that represents a filesystem file.
If a file is supposed to be synced, set the ``content`` attribute to `None`
after initialization. | 62598f947b25080760ed714b |
class Formatter(object): <NEW_LINE> <INDENT> name = None <NEW_LINE> def format(self, context, result): <NEW_LINE> <INDENT> raise NotImplementedError | Base class for formatter objects. | 62598f94bde94217f37074be |
class SequenceMeasurement: <NEW_LINE> <INDENT> key_ignorelist = ["matrix_enable", "matrix_channels", "analyze_function"] <NEW_LINE> def __init__(self, name, type, id=None, enabled=True, tags=None, description="", parameters=None): <NEW_LINE> <INDENT> self.id = id or make_id(name) <NEW_LINE> self.name = name <NEW_LINE> ... | Sequence measurement configuration. | 62598f948e7ae83300ee8d48 |
class ServiceObjectiveListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'required': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[ServiceObjective]'}, } <NEW_LINE> def __init__( self, *, value: List["ServiceObjective"], **kwargs ): <NEW_LINE> <INDENT> sup... | Represents the response to a get database service objectives request.
All required parameters must be populated in order to send to Azure.
:ivar value: Required. The list of database service objectives.
:vartype value: list[~azure.mgmt.sql.models.ServiceObjective] | 62598f9463b5f9789fe84e20 |
class RequestType(Enum): <NEW_LINE> <INDENT> NON = 0 <NEW_LINE> RED = 1 | Types represent request-to-reserve for Vlan Id
They are called Non Redundant and Redundant.
Non-Redundant means request that do not need to be stored in both prim and sec; just prim.
Redundancy means the message must be stored in both a prim and sec vlaid both with the same id number on the device.
Used in RequestMsg... | 62598f948c0ade5d55dc34e3 |
class Block(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, pos, color=colors.BLUE, width=16, height=16): <NEW_LINE> <INDENT> super(Block, self).__init__() <NEW_LINE> self.image = pygame.Surface((width, height)) <NEW_LINE> self.image.fill(color) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self... | Constructor | 62598f940a50d4780f705081 |
class KNN: <NEW_LINE> <INDENT> @property <NEW_LINE> def n_sample_fit_(self) -> int: <NEW_LINE> <INDENT> return self.fit_X.shape[0] <NEW_LINE> <DEDENT> @property <NEW_LINE> def classes_(self) -> np.ndarray: <NEW_LINE> <INDENT> return np.unique(self.fit_y) <NEW_LINE> <DEDENT> @property <NEW_LINE> def nclass_(self) -> int... | Class to create k-nearest neighbors model | 62598f9438b623060ffa8d37 |
class TestLoginForm: <NEW_LINE> <INDENT> def test_validate_success(self, user): <NEW_LINE> <INDENT> user.set_password("31Ch@mbers") <NEW_LINE> user.save() <NEW_LINE> form = LoginForm(email=user.email, password="31Ch@mbers") <NEW_LINE> assert form.validate() is True <NEW_LINE> assert form.user == user <NEW_LINE> <DEDENT... | Login form. | 62598f94596a897236127928 |
class re(Function): <NEW_LINE> <INDENT> is_real = True <NEW_LINE> unbranched = True <NEW_LINE> @classmethod <NEW_LINE> def eval(cls, arg): <NEW_LINE> <INDENT> if arg is S.NaN: <NEW_LINE> <INDENT> return S.NaN <NEW_LINE> <DEDENT> elif arg is S.ComplexInfinity: <NEW_LINE> <INDENT> return S.NaN <NEW_LINE> <DEDENT> elif ar... | Returns real part of expression. This function performs only
elementary analysis and so it will fail to decompose properly
more complicated expressions. If completely simplified result
is needed then use Basic.as_real_imag() or perform complex
expansion on instance of this function.
Examples
========
>>> from sympy i... | 62598f94adb09d7d5dc0a234 |
class WeightedLanguagePairDataset(data.language_pair_dataset.LanguagePairDataset): <NEW_LINE> <INDENT> def __init__( self, src, src_sizes, src_dict, tgt=None, tgt_sizes=None, tgt_dict=None, weights=None, **kwargs, ): <NEW_LINE> <INDENT> super().__init__( src, src_sizes, src_dict, tgt, tgt_sizes, tgt_dict, **kwargs ) <N... | Extension of fairseq.data.LanguagePairDataset where each example
has a weight in [0.0, 1.0], which will be used to weigh the loss. | 62598f947cff6e4e811b56c8 |
class RestartCommand(ObservationCommand, ResponseCommand, CompletionCommand): <NEW_LINE> <INDENT> def __init__(self, target, op_state_model, obs_state_model, logger=None): <NEW_LINE> <INDENT> super().__init__( target, obs_state_model, "restart", op_state_model, logger=logger ) <NEW_LINE> <DEDENT> def do(self): <NEW_LIN... | A class for SKASubarray's Restart() command. | 62598f944a966d76dd5eeb8c |
class InvalidWriteError(Exception): <NEW_LINE> <INDENT> pass | Raised to indicate that writing to a particular key
in the KeyValueStore is disabled | 62598f94e64d504609df920c |
class IntegrationTestAweber(IntegrationTestCase): <NEW_LINE> <INDENT> @patch("niteoweb.aweber.controlpanel.AWeberAPI") <NEW_LINE> def test_set_list_names(self, mocked_AWeberAPI): <NEW_LINE> <INDENT> list_names = [] <NEW_LINE> for i in range(30): <NEW_LINE> <INDENT> obj = Mock() <NEW_LINE> obj.name = u"listname{0}".form... | Integration test of Aweber. | 62598f94b5575c28eb712b21 |
class JarTaskTestBase(NailgunTaskTestBase): <NEW_LINE> <INDENT> pass | Prepares an ephemeral test build root that supports jar tasks. | 62598f94cc0a2c111447acc0 |
class InitTest(_FlamegraphBaseTest): <NEW_LINE> <INDENT> @mock.patch('marple.display.interface.flamegraph.config') <NEW_LINE> def test(self, config_mock): <NEW_LINE> <INDENT> config_mock.get_option_from_section.return_value = self.coloring <NEW_LINE> fg = flamegraph.Flamegraph(self.data) <NEW_LINE> self.assertEqual(sel... | Test the __init__ function for interface calls | 62598f941f037a2d8b9e3d8e |
class TestGetCohortedUserPartition(ModuleStoreTestCase): <NEW_LINE> <INDENT> MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(TestGetCohortedUserPartition, self).setUp() <NEW_LINE> self.course_key = SlashSeparatedCourseKey("edX", "toy", "2012_Fall") <NEW_LINE> self.cou... | Test that `get_cohorted_user_partition` returns the first user_partition with scheme `CohortPartitionScheme`. | 62598f94498bea3a75a577d6 |
class GhArtifactItem(MetadataMap): <NEW_LINE> <INDENT> def created_at(self): <NEW_LINE> <INDENT> return self._metadata['created_at'] <NEW_LINE> <DEDENT> def download(self, data_dir, auth): <NEW_LINE> <INDENT> with _requests.get(self._download_url(), stream=True, auth=auth) as req: <NEW_LINE> <INDENT> req.raise_for_stat... | Single artifact metadata | 62598f948e71fb1e983bb760 |
class TrainerFactory(object): <NEW_LINE> <INDENT> trainer_map = { 'sick': SICKTrainer, 'eng_fre':SICKTrainer } <NEW_LINE> @staticmethod <NEW_LINE> def get_trainer(dataset_name, model, embedding, train_loader, trainer_config, train_evaluator, test_evaluator, dev_evaluator=None, nce=False): <NEW_LINE> <INDENT> if nce: <N... | Get the corresponding Trainer class for a particular dataset. | 62598f9407d97122c421695d |
class binary_dice_loss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, opt): <NEW_LINE> <INDENT> super(binary_dice_loss, self).__init__() <NEW_LINE> self.epsilon = opt.Training['epsilon'] <NEW_LINE> self.require_weightmaps = False <NEW_LINE> self.require_one_hot = False <NEW_LINE> self.r... | Smooth surrogate loss for Binary Dice Score Evaluation. | 62598f946aa9bd52df0d4b7a |
@python_2_unicode_compatible <NEW_LINE> class Inventory(InventoryBase): <NEW_LINE> <INDENT> copies = models.ManyToManyField(Card, through="InventoryCopies", blank=True) <NEW_LINE> shelf = models.ForeignKey("Shelf", blank=True, null=True, verbose_name=__("shelf")) <NEW_LINE> place = models.ForeignKey("Place", blank=True... | We can do inventories of baskets, publishers, places, shelves. | 62598f9421a7993f00c65c2a |
class ExposedPodsHandler(Vulnerability, Event): <NEW_LINE> <INDENT> def __init__(self, pods): <NEW_LINE> <INDENT> Vulnerability.__init__( self, component=Kubelet, name="Exposed Pods", category=AccessKubeletAPITechnique, vid="KHV052" ) <NEW_LINE> self.pods = pods <NEW_LINE> self.evidence = f"count: {len(self.pods)}" | An attacker could view sensitive information about pods that are
bound to a Node using the /pods endpoint | 62598f94b57a9660fecd1727 |
class GoodsCategory(models.Model): <NEW_LINE> <INDENT> CATEGORY_TYPE = ( (1, "一级类目"), (2, "二级类目"), (3, "三级类目"), ) <NEW_LINE> name = models.CharField('类别名',default="", max_length=30,help_text="类别名") <NEW_LINE> code = models.CharField("类别code",default="", max_length=30,help_text="类别code") <NEW_LINE> desc = models.TextFie... | 商品分类 | 62598f944e4d5625663720ce |
class Tracker(object): <NEW_LINE> <INDENT> def __init__(self, host, port=9190, port_end=9199, silent=False): <NEW_LINE> <INDENT> if silent: <NEW_LINE> <INDENT> logger.setLevel(logging.WARN) <NEW_LINE> <DEDENT> sock = socket.socket(base.get_addr_family((host, port)), socket.SOCK_STREAM) <NEW_LINE> self.port = None <NEW_... | Start RPC tracker on a seperate process.
Python implementation based on multi-processing.
Parameters
----------
host : str
The host url of the server.
port : int
The TCP port to be bind to
port_end : int, optional
The end TCP port to search
silent: bool, optional
Whether run in silent mode | 62598f940c0af96317c5602f |
class _Useflag: <NEW_LINE> <INDENT> def __init__(self, node): <NEW_LINE> <INDENT> self.name = node.get("name") <NEW_LINE> self.restrict = node.get("restrict") <NEW_LINE> _desc = "" <NEW_LINE> if node.text: <NEW_LINE> <INDENT> _desc = node.text <NEW_LINE> <DEDENT> for child in node.iter(): <NEW_LINE> <INDENT> if child.t... | An object for representing one USE flag.
@todo: Is there any way to have a keyword option to leave in
<pkg> and <cat> for later processing?
@type name: str or None
@ivar name: USE flag
@type restrict: str or None
@ivar restrict: e.g. >=portage-2.2 means flag is only avaiable in
versions greater than... | 62598f9496565a6dacd2cdd0 |
class ActivationKey(object): <NEW_LINE> <INDENT> command_base = 'activation-key' <NEW_LINE> @classmethod <NEW_LINE> def add_host_collection(cls, options=None): <NEW_LINE> <INDENT> cls.command_sub = 'add-host-collection' <NEW_LINE> return cls.execute(cls._construct_command(options)) <NEW_LINE> <DEDENT> @classmethod <NEW... | Manipulates Katello's activation-key. | 62598f948e7ae83300ee8d4a |
class Jetons: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.total = 100 <NEW_LINE> self.bet = 0 <NEW_LINE> self.winnings = 0 <NEW_LINE> <DEDENT> def win_bet(self): <NEW_LINE> <INDENT> self.total += self.bet <NEW_LINE> self.winnings += 1 <NEW_LINE> <DEDENT> def loss_bet(self): <NEW_LINE> <INDENT> self... | Jetons des joueurs pour faire des paris et ajouter ou enlever le total du joueur | 62598f94435de62698e9baa0 |
class RemoveProductFromProductSetRequest(proto.Message): <NEW_LINE> <INDENT> name = proto.Field(proto.STRING, number=1,) <NEW_LINE> product = proto.Field(proto.STRING, number=2,) | Request message for the ``RemoveProductFromProductSet`` method.
Attributes:
name (str):
Required. The resource name for the ProductSet to modify.
Format is:
``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``
product (str):
Required. The resource name for the Pr... | 62598f94656771135c48932d |
class PluginManage(): <NEW_LINE> <INDENT> def __init__(self,hostname=None): <NEW_LINE> <INDENT> self.hostname=hostname <NEW_LINE> self.debug=settings.DEBUG <NEW_LINE> self.plugin_dict=settings.PLUGINS_DICT <NEW_LINE> self.mode=settings.MODE <NEW_LINE> if self.mode=='SSH': <NEW_LINE> <INDENT> self.hostname=hostname <NEW... | 插件管理 | 62598f94e76e3b2f99fd86e6 |
class ResourceContainer(object): <NEW_LINE> <INDENT> __remote_info_cache = {} <NEW_LINE> __combined_message_class = None <NEW_LINE> def __init__(self, _body_message_class=message_types.VoidMessage, **kwargs): <NEW_LINE> <INDENT> self.body_message_class = _body_message_class <NEW_LINE> self.parameters_message_class = ty... | Container for a request body resource combined with parameters.
Used for API methods which may also have path or query parameters in addition
to a request body.
Attributes:
body_message_class: A message class to represent a request body.
parameters_message_class: A placeholder message class for request
para... | 62598f944428ac0f6e6581d7 |
class JobCollection: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.jobs = collections.MappingCollection("jobs") <NEW_LINE> self.proxy = proxy.CollectionProxy( self.jobs.values, [ proxy.func_proxy("enable", lambda seq: all(list(seq))), proxy.func_proxy("disable", lambda seq: all(list(seq))), proxy.fun... | A collection of jobs. | 62598f94090684286d59352f |
class S3SshkeyMapParser(S3MapParser): <NEW_LINE> <INDENT> def _ReadEntry(self, name, entry): <NEW_LINE> <INDENT> map_entry = sshkey.SshkeyMapEntry() <NEW_LINE> map_entry.name = name <NEW_LINE> map_entry.sshkey = entry.get('sshPublicKey', '') <NEW_LINE> return map_entry | Class for parsing nss_files module sshkey cache. | 62598f94bd1bec0571e14f1b |
class AutozapiviewGetIterKeyTd(NetAppObject): <NEW_LINE> <INDENT> _key_2 = None <NEW_LINE> @property <NEW_LINE> def key_2(self): <NEW_LINE> <INDENT> return self._key_2 <NEW_LINE> <DEDENT> @key_2.setter <NEW_LINE> def key_2(self, val): <NEW_LINE> <INDENT> if val != None: <NEW_LINE> <INDENT> self.validate('key_2', val) <... | Key typedef for table dummy_autozapiview | 62598f94adb09d7d5dc0a236 |
class Rectangle(BaseGeometry): <NEW_LINE> <INDENT> def __init__(self, width, height): <NEW_LINE> <INDENT> self.integer_validator("width", width) <NEW_LINE> self.integer_validator("height", height) <NEW_LINE> self.__width = width <NEW_LINE> self.__height = height <NEW_LINE> <DEDENT> def area(self): <NEW_LINE> <INDENT> r... | class Rectangle that inherits from BaseGeometry | 62598f94f8510a7c17d7dfce |
class JsonTextColor(JsonText): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.lexer = JsonLexer() <NEW_LINE> self.formatter = TerminalFormatter() <NEW_LINE> <DEDENT> def __call__(self, event: dict): <NEW_LINE> <INDENT> return highlight( sup... | Format event as a highlighted JSON string.
| 62598f94f7d966606f747c92 |
class DebugColrPrinter(DebugPrinter): <NEW_LINE> <INDENT> textcolor = 'green' <NEW_LINE> errorcolor = 'red' <NEW_LINE> def __init__( self, fmt=None, ljustwidth=40, basename=True, file=None, should_raise=False): <NEW_LINE> <INDENT> if default_colr_format is None: <NEW_LINE> <INDENT> if sys.version_info.major < 3: <NEW_L... | A debug printer that remembers it's config on initilization,
and uses it until changed. | 62598f940a50d4780f705084 |
class CobolCodeEdit(CodeEditBase): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent, free_format=Settings().free_format) <NEW_LINE> self.syntax_highlighter.color_scheme = ColorScheme( Settings().color_scheme) <NEW_LINE> self.linter_mode = self.modes.append(CobolLinterMode... | Cobol code editor. We specialise the pyqode.cobol code edit to add support
for our settings system and for some custom properties (such as the
file type). | 62598f9476e4537e8c3ef260 |
class DrawableGraph(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def graph(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def layout(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @abstractmethod... | A drawable graph is a graph with a method draw that
returns a matplotlib.pyplot instance that can be
rendered | 62598f94b7558d58954632dc |
class LiftingSurface(Componenet): <NEW_LINE> <INDENT> def __init__(self, name, mass, cg_loc, inertias, lift_model, param_dict): <NEW_LINE> <INDENT> assert isinstance(lift_model, lift_models.LiftModels) <NEW_LINE> Component.__init__(self, name, mass, cg_loc, inertias) <NEW_LINE> self.LiftModel = lift_model.__init__(para... | LiftingSurfaces generate aerodynamic lift to counteract the weigth of
the vehicle.
They are assumed to be aligned such that the lift force is perpendicular to
the direction of travel. | 62598f945f7d997b871f9233 |
class DbConnect(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> <DEDENT> def openConnection(self): <NEW_LINE> <INDENT> connectionString = 'mysql+mysqldb://{0}:{1}@{2}/{3}?charset=utf8'.format(self.config['user'], self.config['pass'], self.config['host'], self... | classdocs | 62598f94dd821e528d6d8be3 |
class Profile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, on_delete=models.CASCADE) <NEW_LINE> high_score = models.IntegerField(default=0) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.user.username | Website users | 62598f94b57a9660fecd1729 |
class CacheInfo(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dirty = False <NEW_LINE> self.refCount = 0 | An internal data structure used by LruCacheStore. | 62598f94fff4ab517ebcd49b |
class ExportsInfo(FeatureType): <NEW_LINE> <INDENT> name = 'exports' <NEW_LINE> dim = 128 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(FeatureType, self).__init__() <NEW_LINE> <DEDENT> def raw_features(self, bytez, lief_binary): <NEW_LINE> <INDENT> if lief_binary is None: <NEW_LINE> <INDENT> return [] <NEW_... | Information about exported functions. Note that the total number of exported
functions is contained in GeneralFileInfo. | 62598f94a05bb46b3848a52d |
class GenericMeta(object): <NEW_LINE> <INDENT> def __init__(self, *kwargs): <NEW_LINE> <INDENT> args_handler(self, kwargs=kwargs) <NEW_LINE> <DEDENT> def get_meta_attrs(self, parent_obj, skip_list=None, skip_startswith='_', overwrite=True): <NEW_LINE> <INDENT> if skip_list is None: <NEW_LINE> <INDENT> skip_list = [] <N... | Base object to use for creating meta objects. This will copy all attrs from the meta object to the parent object.
This can be used to assign lists or other mutatable objects to Classes as well as to create standard sets of metadata
for classes that can be reused.
This uses :py:func:`args_handler` to copy kwargs to t... | 62598f9499cbb53fe6830b7d |
class PermuteTest(asl.Sketch): <NEW_LINE> <INDENT> def sketch(self, images, ): <NEW_LINE> <INDENT> import pdb; pdb.set_trace() <NEW_LINE> (sentence, ) = describe(images, rand_img_id) <NEW_LINE> permuted_images = random.sample(images, len(images)) <NEW_LINE> (score, ) = which_image(permuted_images, sentence) <NEW_L... | Generate clevr image from noise | 62598f94d99f1b3c44d0535e |
class MozcVersion(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self._properties = {} <NEW_LINE> if not os.path.isfile(path): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> for line in open(path): <NEW_LINE> <INDENT> matchobj = re.match(r'(\w+)=(.*)', line.strip()) <NEW_LINE> if matchobj: <... | A class to parse and maintain the version definition data.
Note that this class is not intended to parse "template" file but to
"generated" file.
Typical usage is;
GenerateVersionFileFromTemplate(template_path, version_path, format)
version = MozcVersion(version_path) | 62598f940a50d4780f705085 |
class AppNameParser(HTMLParser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> HTMLParser.__init__(self) <NEW_LINE> self.recording = False <NEW_LINE> self.appname = [] <NEW_LINE> <DEDENT> def handle_starttag(self, tag, attrs): <NEW_LINE> <INDENT> if tag == 'li' and len(attrs) >= 1: <NEW_LINE> <INDENT> if ... | Parse the download page of anruan.com, get app names
the encoding type of anruan.com is gbk, so we have to
decode the app names using gbk and encode it with utf-8 | 62598f943eb6a72ae038a2ea |
class PrimeClass(object): <NEW_LINE> <INDENT> def is_prime(self, num_int): <NEW_LINE> <INDENT> if num_int == 1: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> for num in range(2, num_int): <NEW_LINE> <INDENT> if num_int % num == 0: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> <DE... | Class with the function is_prime. | 62598f94f7d966606f747c94 |
class UserManager(BaseUserManager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(UserManager, self).__init__() <NEW_LINE> self.model = User() <NEW_LINE> <DEDENT> def create_user(self, username=None, email=None, password=None): <NEW_LINE> <INDENT> if not username: <NEW_LINE> <INDENT> raise ValueErro... | a manager class for User class, responsible for creation of user instances | 62598f94009cb60464d011da |
class TestCase(TransactionTestCase): <NEW_LINE> <INDENT> def _fixture_setup(self): <NEW_LINE> <INDENT> if not connections_support_transactions(): <NEW_LINE> <INDENT> return super(TestCase, self)._fixture_setup() <NEW_LINE> <DEDENT> assert not self.reset_sequences, 'reset_sequences cannot be used on TestCase instances' ... | Does basically the same as TransactionTestCase, but surrounds every test
with a transaction, monkey-patches the real transaction management routines
to do nothing, and rollsback the test transaction at the end of the test.
You have to use TransactionTestCase, if you need transaction management
inside a test. | 62598f94442bda511e95c114 |
class Eth_100Gbase_Sr4Identity(Ethernet_Pmd_TypeIdentity): <NEW_LINE> <INDENT> _prefix = 'oc-opt-types' <NEW_LINE> _revision = '2016-06-17' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Ethernet_Pmd_TypeIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ... | Ethernet compliance code\: 100GBASE\_SR4 | 62598f946e29344779b0030a |
class ExtendedLocation(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, name: Optional[str] = None, type: Optional[Union[str, "ExtendedLocationTypes"]] = None, **kwargs ): <NEW_LINE> <I... | The complex type of the extended location.
:ivar name: The name of the extended location.
:vartype name: str
:ivar type: The type of the extended location. Possible values include: "EdgeZone".
:vartype type: str or ~azure.mgmt.containerservice.v2021_07_01.models.ExtendedLocationTypes | 62598f9455399d3f056261cf |
class PropExceptTest(unittest.TestCase): <NEW_LINE> <INDENT> def testExport(self): <NEW_LINE> <INDENT> a = alembic.Abc.OArchive("testPropException.abc") <NEW_LINE> t = a.getTop() <NEW_LINE> x = alembic.AbcGeom.OXform(t, "myxform") <NEW_LINE> p = alembic.Abc.OStringProperty(x.getProperties(), "myprop") <NEW_LINE> test =... | This tests for exceptions being thrown by PyAlembic when an invalid property
index or name is passed into getProperty on either an IObject or an OObject. | 62598f9423e79379d538c1b1 |
class NonIsoTerritoryCode (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'NonIsoTerritoryCode') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/20120404/ddex.xsd', 2898, 3) <NEW_LINE> _Documenta... | A TerritoryId which is not a TerritoryId according to the ISO 3166-1 standard. | 62598f9407f4c71912baf0fb |
class Event(PythonTrigger): <NEW_LINE> <INDENT> def __init__(self, name=""): <NEW_LINE> <INDENT> PythonTrigger.__init__(self) <NEW_LINE> self._pending = [] <NEW_LINE> self.name = name <NEW_LINE> self.fired = False <NEW_LINE> self.data = None <NEW_LINE> <DEDENT> def prime(self, callback, trigger): <NEW_LINE> <INDENT> Tr... | Event to permit synchronisation between two coroutines | 62598f941b99ca400228f385 |
class FrequentlyAskedQuestionPageFactory(wagtail_factories.PageFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = FrequentlyAskedQuestionPage | FrequentlyAskedQuestionPage factory class | 62598f94d486a94d0ba2bc84 |
class Editor: <NEW_LINE> <INDENT> def __init__(self, ed_func , incr, par_list): <NEW_LINE> <INDENT> self.func = getattr(edfuncs.Edfuncs, ed_func) <NEW_LINE> self.name = ed_func <NEW_LINE> self.incr = incr <NEW_LINE> self.par_list = par_list <NEW_LINE> <DEDENT> def run_it(self, from_file, to_file): <NEW_LINE> <INDENT> l... | A very thin wrapper class to store a reference to an editor function
and its parameters | 62598f94379a373c97d98cc2 |
class TestPUTWriteOffInvoiceResponseCreditMemo(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 testPUTWriteOffInvoiceResponseCreditMemo(self): <NEW_LINE> <INDENT> pass | PUTWriteOffInvoiceResponseCreditMemo unit test stubs | 62598f943617ad0b5ee05dfc |
class TestPOSTTierType(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 testPOSTTierType(self): <NEW_LINE> <INDENT> pass | POSTTierType unit test stubs | 62598f940c0af96317c56033 |
class ResNetEmbeddings(nn.Sequential): <NEW_LINE> <INDENT> def __init__(self, num_channels: int, out_channels: int, activation: str = "relu"): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.embedder = ResNetConvLayer(num_channels, out_channels, kernel_size=7, stride=2, activation=activation) <NEW_LINE> self.poo... | ResNet Embedddings (stem) composed of a single aggressive convolution. | 62598f94379a373c97d98cc3 |
class Textbox(CompoundElement): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> assert 'top' in kwargs, "top attribute missing" <NEW_LINE> assert 'left' in kwargs, "left attribute missing" <NEW_LINE> assert 'width' in kwargs, "width attribute missing" <NEW_LINE> assert 'height' in kwargs, "... | A textbox is a amount of text on a PDF page, with *top*, *left*,
*width* and *height* properties that specifies the bounding box of the
text. The *font* property specifies the id of font used (use
:py:meth:`~ferenda.pdfreader.Textbox.getfont` to get a dict of all
font properties). A textbox consists of a list of Textel... | 62598f94f7d966606f747c95 |
class Plugin(object): <NEW_LINE> <INDENT> key = None <NEW_LINE> can_fail = True <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.log = logging.getLogger("dock.plugins." + self.key) <NEW_LINE> self.args = args <NEW_LINE> self.kwargs = kwargs <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDE... | abstract plugin class | 62598f94507cdc57c63a4a44 |
class Template(object): <NEW_LINE> <INDENT> def __init__(self, path_template, header, doc, offset=0): <NEW_LINE> <INDENT> super(Template, self).__init__() <NEW_LINE> if path_template is None: <NEW_LINE> <INDENT> path_template = os.path.join( sys.path[0], "template", "default_template.html") <NEW_LINE> <DEDENT> with ope... | docstring for Template | 62598f94462c4b4f79dbb6b8 |
class FileWriter(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.file=None <NEW_LINE> <DEDENT> def fileOpen(self,filename): <NEW_LINE> <INDENT> self.file=file(filename,'wb') <NEW_LINE> <DEDENT> def writeToFile(self,data): <NEW_LINE> <INDENT> self.file.write(data) <NEW_LINE> <DEDENT> def fileClose(se... | File Writer writes data to a file
Call fileOpen to create an output file
Call writeToFile to write to the file
Call fileClose to close the file | 62598f94b830903b9686e2cc |
class SectionControl(common.QTICommentContainer): <NEW_LINE> <INDENT> XMLNAME = 'sectioncontrol' <NEW_LINE> XMLATTR_feedbackswitch = ( 'feedbackSwitch', core.ParseYesNo, core.FormatYesNo) <NEW_LINE> XMLATTR_hintswitch = ('hintSwitch', core.ParseYesNo, core.FormatYesNo) <NEW_LINE> XMLATTR_solutionswitch = ( 'solutionSwi... | The control switches that are used to enable or disable the display of
hints, solutions and feedback within the Section::
<!ELEMENT sectioncontrol (qticomment?)>
<!ATTLIST sectioncontrol feedbackswitch (Yes | No ) 'Yes'
hintswitch (Yes | No ) 'Yes'
solutionswitch (Yes | No ) 'Yes'
view ... | 62598f948e7ae83300ee8d4e |
class ModuleMessage(Message): <NEW_LINE> <INDENT> def __init__(self, tag, global_step, train_step, epoch, kind, named_module, data): <NEW_LINE> <INDENT> super().__init__(tag, global_step, train_step, epoch, kind) <NEW_LINE> self._module = named_module <NEW_LINE> if data is None: <NEW_LINE> <INDENT> raise ValueError('D... | A message tied to a specific module, with tensor data attached. | 62598f94fbf16365ca793d65 |
class MediaGraphIoTHubMessageSource(MediaGraphSource): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': '@type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'hub_input_name': {'key': 'hubInputName', 'type': 'str'}, } ... | Enables a media graph to receive messages via routes declared in the IoT Edge deployment manifest.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of the source node. The discriminator for derived
types.Constant filled by server.
:type type: str
:param name: Requi... | 62598f94460517430c431eb3 |
class AddCommentsView(View): <NEW_LINE> <INDENT> def post(self,request): <NEW_LINE> <INDENT> if not request.user.is_authenticated: <NEW_LINE> <INDENT> return HttpResponse('{"status":"fail","msg":"用户未登录"}', content_type='application/json') <NEW_LINE> <DEDENT> course_id = request.POST.get('course_id',0) <NEW_LINE> commen... | 用户添加评论 | 62598f940a50d4780f705087 |
class LoopBackDevices(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dir = tempfile.mkdtemp('_stratis_loop_back') <NEW_LINE> self.count = 0 <NEW_LINE> self.devices = {} <NEW_LINE> <DEDENT> def create_device(self): <NEW_LINE> <INDENT> backing_file = os.path.join(self.dir, 'block_device_%d' % self.co... | Class for creating and managing loop back devices which are needed for
specific types of udev event testing. | 62598f94baa26c4b54d4ef60 |
class UNet2d(_UNetNd): <NEW_LINE> <INDENT> def __init__(self, channel, layers, kernel_size=3, in_planes=1, out_planes=1): <NEW_LINE> <INDENT> super().__init__(order=2, channel=channel, layers=layers, kernel_size=kernel_size, in_planes=in_planes, out_planes=out_planes) | 2D convolutional network based U-Net
This moule is a built-in model for convolutional U-Net. The network is
inspired by:
https://github.com/milesial/Pytorch-UNet
The network would down-sample and up-sample the input data according to
the network depth. The depth is given by the length of the argument
"layers". | 62598f94adb09d7d5dc0a23a |
class MyLiteralRule(CompoundRule): <NEW_LINE> <INDENT> spec = "say <my_format_rule>" <NEW_LINE> extras = [my_format_rule] <NEW_LINE> def _process_recognition(self, node, extras): <NEW_LINE> <INDENT> extras["my_format_rule"].execute() | Rule for saying MyFormatRule literally (without interruptions by other rules) | 62598f948da39b475be02e94 |
class FrictionFactorTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_colebrook(self): <NEW_LINE> <INDENT> self.assertAlmostEqual(utils.colebrook(0.020, 2e5), 0.0488, delta = 0.0006) <NEW_LINE> self.assertAlmostEqual(utils.colebrook(0.070, 3e4), 0.0850, delta = 0.0006) <NEW_LINE> self.assertAlmostEqual(utils.coleb... | Runs unit tests on all functions related to friction factors. | 62598f94287bf620b6271870 |
class DelEnemyCommand(Command): <NEW_LINE> <INDENT> def __init__(self, config, cmd=None, has_args=False): <NEW_LINE> <INDENT> super().__init__(config, cmd if cmd else "/del enemy", has_args if has_args else True) <NEW_LINE> <DEDENT> def usage(self): <NEW_LINE> <INDENT> msg = "`/del enemy [プレイヤー名] [カンパニー名]`" ... | 敵プレイヤー削除コマンド. | 62598f94b5575c28eb712b24 |
class Response(BaseResponse): <NEW_LINE> <INDENT> def __init__(self, body = ''): <NEW_LINE> <INDENT> super(Response, self).__init__() <NEW_LINE> self.status = 200 <NEW_LINE> self.headerlist = [('Content-type', 'text/html')] <NEW_LINE> self.charset = 'utf-8' <NEW_LINE> self.body = body.encode(ENCODING) | Simple response class with 200 http header status | 62598f94f7d966606f747c96 |
class PotsdamFileGenerator(FileGenerator): <NEW_LINE> <INDENT> def __init__(self, active_input_inds, train_ratio, cross_validation): <NEW_LINE> <INDENT> self.dataset = PotsdamDataset() <NEW_LINE> self.file_inds = [ (2, 10), (3, 10), (3, 11), (3, 12), (4, 11), (4, 12), (5, 10), (5, 12), (6, 10), (6, 11), (6, 12), (6, 8)... | A data generator for the Potsdam dataset that creates batches from
files on disk. | 62598f94cc0a2c111447acc6 |
class CourseEmailTemplate(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = "bulk_email" <NEW_LINE> <DEDENT> html_template = models.TextField(null=True, blank=True) <NEW_LINE> plain_template = models.TextField(null=True, blank=True) <NEW_LINE> name = models.CharField(null=True, max_length=2... | Stores templates for all emails to a course to use.
This is expected to be a singleton, to be shared across all courses.
Initialization takes place in a migration that in turn loads a fixture.
The admin console interface disables add and delete operations.
Validation is handled in the CourseEmailTemplateForm class.
.... | 62598f9407d97122c4216962 |
class ValidationError(ValueError): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> if not isinstance(message, (list, tuple)): <NEW_LINE> <INDENT> messages = [message] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> messages = message <NEW_LINE> <DEDENT> messages = map(unicode, messages) <NEW_LINE> Ex... | Exception raised when invalid data is encountered. | 62598f9485dfad0860cbf8cc |
class ComparePositions: <NEW_LINE> <INDENT> def __init__(self, translate=True): <NEW_LINE> <INDENT> self._translate = translate <NEW_LINE> <DEDENT> def __call__(self, atoms1, atoms2): <NEW_LINE> <INDENT> atoms1 = atoms1.copy() <NEW_LINE> atoms2 = atoms2.copy() <NEW_LINE> if not self._translate: <NEW_LINE> <INDENT> dmax... | Class that compares the atomic positions between two ASE atoms
objects. Returns the maximum distance that any atom has moved, assuming
all atoms of the same element are indistinguishable. If translate is
set to True, allows for arbitrary translations within the unit cell,
as well as translations across any periodic bou... | 62598f944527f215b58e9b96 |
class ClassroomsTimeblock(db.Model, SqlalchemySerializer): <NEW_LINE> <INDENT> __tablename__ = 'classrooms_timeblocks' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> active = db.Column(db.Boolean, nullable=False, default=True) <NEW_LINE> priority = db.Column(db.String(128), nullable=False, default='... | ORM Object for linking table between classrooms and timeblocks | 62598f94a8ecb03325870eba |
class AddInteriorColorView(LoginRequiredMixin, CreateView): <NEW_LINE> <INDENT> template_name = 'components/add_interior.html' <NEW_LINE> model = InteriorColor <NEW_LINE> fields = ['name', 'cost'] <NEW_LINE> success_url = reverse_lazy('component') <NEW_LINE> login_url = reverse_lazy('auth_login') <NEW_LINE> def get(sel... | Add new interior color. | 62598f9460cbc95b06363ff9 |
class QueueMenu(Menu): <NEW_LINE> <INDENT> def __init__(self, window, source, child=None, active=False) -> None: <NEW_LINE> <INDENT> super().__init__(window, source, child=child, active=active) <NEW_LINE> <DEDENT> def __len__(self) -> int: <NEW_LINE> <INDENT> return self._source.length <NEW_LINE> <DEDENT> @property <NE... | The menu for the player queue. | 62598f94d58c6744b42dc128 |
class LRN2D(Layer): <NEW_LINE> <INDENT> def __init__(self, alpha=1e-4, k=2, beta=0.75, n=5): <NEW_LINE> <INDENT> if n % 2 == 0: <NEW_LINE> <INDENT> raise NotImplementedError("LRN2D only works with odd n. n provided: " + str(n)) <NEW_LINE> <DEDENT> super(LRN2D, self).__init__() <NEW_LINE> self.alpha = alpha <NEW_LINE> s... | This code is adapted from pylearn2.
License at: https://github.com/lisa-lab/pylearn2/blob/master/LICENSE.txt | 62598f94379a373c97d98cc4 |
class propertySheetDlg(QDialog): <NEW_LINE> <INDENT> def __init__(self,title,context,data,parent=None): <NEW_LINE> <INDENT> super(propertySheetDlg, self).__init__(parent) <NEW_LINE> self.context = context <NEW_LINE> self.data = data <NEW_LINE> InicioLabel = QLabel(title) <NEW_LINE> self.sheet=WPropertySheet(context,dat... | Genera (mas o menos) una hoja de propiedades | 62598f94379a373c97d98cc5 |
class DALQueryError(DALAccessError): <NEW_LINE> <INDENT> _defreason = "Unknown DAL Query Error" <NEW_LINE> def __init__(self, reason=None, label=None, url=None): <NEW_LINE> <INDENT> super().__init__(reason, url) <NEW_LINE> self._label = label <NEW_LINE> <DEDENT> @property <NEW_LINE> def label(self): <NEW_LINE> <INDENT>... | an exception indicating an error by a working DAL service while processing
a query. Generally, this would be an error that the service successfully
detected and consequently was able to respond with a legal error response--
namely, a VOTable document with an INFO element contains the description
of the error. Possibl... | 62598f949b70327d1c57ea54 |
class EdgeNGramTokenFilter(TokenFilter): <NEW_LINE> <INDENT> _validation = { 'odata_type': {'required': True}, 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'min_gram': {'key': 'minGram', 'type': 'int'}, 'max_gr... | Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene.
All required parameters must be populated in order to send to Azure.
:ivar odata_type: Required. Identifies the concrete type of the token filter.Constant filled by
serv... | 62598f94a79ad16197769d14 |
class OpenAtlasTurkeyDialogTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dialog = OpenAtlasTurkeyDialog(None) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.dialog = None <NEW_LINE> <DEDENT> def test_dialog_ok(self): <NEW_LINE> <INDENT> button = self.dialog.but... | Test dialog works. | 62598f942c8b7c6e89bd3481 |
class Component(component.Main): <NEW_LINE> <INDENT> def addObjects(self): <NEW_LINE> <INDENT> if self.settings["neutralRotation"]: <NEW_LINE> <INDENT> t = transform.getTransformFromPos(self.guide.pos["root"]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> t = self.guide.tra["root"] <NEW_LINE> if self.settings["mirrorBe... | Shifter component Class | 62598f9499cbb53fe6830b82 |
class AllowRequests(unittest.TestCase): <NEW_LINE> <INDENT> def test_allow_requests_blank(self): <NEW_LINE> <INDENT> self.assertEquals(None, controller.allow_requests()) <NEW_LINE> <DEDENT> def test_allow_requests_invalid(self): <NEW_LINE> <INDENT> self.assertRaises(cherrypy.HTTPError, controller.allow_requests, ["TEST... | Only allow specified request methods. | 62598f9410dbd63aa1c70871 |
class IP(object): <NEW_LINE> <INDENT> def __init__(self,Protocol=None): <NEW_LINE> <INDENT> if Protocol: <NEW_LINE> <INDENT> self.Protocol = Protocol <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.Protocol = 'ip' <NEW_LINE> <DEDENT> self.Name = 'IP '+str(self.Protocol) | CLASS FOR IP OBJECT PROTOCOL | 62598f94be383301e02534b9 |
class SimulationParameters: <NEW_LINE> <INDENT> def __init__(self, params): <NEW_LINE> <INDENT> self.start_date = '1/1/2019' <NEW_LINE> self.n_intervals = 24*7 <NEW_LINE> self.interval_time = 60 <NEW_LINE> self.interest_rate = 0.03 <NEW_LINE> self.print_progress = False <NEW_LINE> self.show_debug_flag = True <NEW_LINE>... | Class to store parameters for smooth simulation.
:param start_date: the first evaluated time period. Defaults to '1/1/2019'
:type start_date: string representation of date
:param n_intervals: number of time steps. Defaults to 24*7=168
:type n_intervals: integer
:param interval_time: length of one time step in minutes.... | 62598f94baa26c4b54d4ef62 |
class Meta(object): <NEW_LINE> <INDENT> verbose_name = 'Send Email Confirmation' | Django properties | 62598f94bd1bec0571e14f1e |
class Room (): <NEW_LINE> <INDENT> def __init__ (self, x, y): <NEW_LINE> <INDENT> self.tileList = [] <NEW_LINE> self._loadFile(x, y) <NEW_LINE> <DEDENT> def _loadFile (self, x, y): <NEW_LINE> <INDENT> fileName = os.path.join(StaticPath.DUNGEON_LAYOUT_DIR, "%d-%d.txt" % (y, x)) <NEW_LINE> try: <NEW_LINE> <INDENT> with o... | Rooms are 2D Lists consisting of characters representing terrain.
Reads from text-files named by given coordinates. | 62598f94f8510a7c17d7dfd1 |
class Friend(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'friend' <NEW_LINE> id=db.Column(db.Integer,primary_key=True) <NEW_LINE> send=db.Column(db.Integer,nullable=False) <NEW_LINE> receive=db.Column(db.Integer,nullable=False) <NEW_LINE> room_name=db.Column(db.String(25),nullable=False) <NEW_LINE> def __init__(self... | User Friend | 62598f9401c39578d7f12a3c |
class BookModelTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = UserFactory.create() <NEW_LINE> self.client.force_login(user=self.user) <NEW_LINE> self.book = BookFactory(owner=self.user) <NEW_LINE> self.today = datetime.date.today() <NEW_LINE> <DEDENT> def test_book(self): <NEW_LINE... | Testing the Book Model | 62598f94b5575c28eb712b25 |
class MQTTCommunicationAdapter(lingerAdapters.LingerBaseAdapter): <NEW_LINE> <INDENT> def __init__(self, configuration): <NEW_LINE> <INDENT> super(MQTTCommunicationAdapter, self).__init__(configuration) <NEW_LINE> self.logger.debug("MQTTCommunicationAdapter started") <NEW_LINE> self.mqtt_adapter_uuid = configuration["m... | MQTTCommunicationAdapter ables publishing messages to an MQTT broker with a predefined topic | 62598f94e64d504609df9210 |
class LoginRoom(Room): <NEW_LINE> <INDENT> def add(self, session): <NEW_LINE> <INDENT> Room.add(self, session) <NEW_LINE> session.push('连接成功'.encode('utf-8')) <NEW_LINE> <DEDENT> def do_login(self, session, line): <NEW_LINE> <INDENT> name = line.strip() <NEW_LINE> if not name: <NEW_LINE> <INDENT> session.push('用户名为空'.e... | 处理登录用户 | 62598f94f7d966606f747c98 |
class LowSpeedShaftCost2015(om.ExplicitComponent): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.add_input("lss_mass", 0.0, units="kg") <NEW_LINE> self.add_input("lss_mass_cost_coeff", 11.9, units="USD/kg") <NEW_LINE> self.add_output("lss_cost", 0.0, units="USD") <NEW_LINE> <DEDENT> def compute(self, in... | Compute low speed shaft cost in the form of :math:`cost = k*mass`.
Value of :math:`k` was updated in 2015 to be $11.9 USD/kg.
Cost includes materials and manufacturing costs.
Parameters
----------
lss_mass : float, [kg]
component mass
lss_mass_cost_coeff : float, [USD/kg]
low speed shaft mass-cost coeff
Retur... | 62598f94d53ae8145f918140 |
class ZeissLamp(LightSource): <NEW_LINE> <INDENT> TRANSMISSIVE = "Transmissive" <NEW_LINE> REFLECTIVE = "Reflective" <NEW_LINE> def __init__(self, dm, config, name): <NEW_LINE> <INDENT> super(ZeissLamp, self).__init__(dm, config, name) <NEW_LINE> self._zeiss = ZeissMtbSdk.getSingleton(config.get("apiDllLocation", None)... | Config Options
--------------
transOrReflect : str
"Transmissive" | "Reflective" Which of the two standard light sources to represent
(Defaults to "Transmissive")
ZeissMtbComponentID : str
If pointing to a different Zeiss component, this overrides `transOrReflect`.
apiDllLocation : str
The path for the ... | 62598f9415baa72349461c34 |
class getProfilePicture_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolA... | Attributes:
- success | 62598f94442bda511e95c118 |
class AbstractField(models.Model): <NEW_LINE> <INDENT> label = models.CharField(_("Label"), max_length=settings.LABEL_MAX_LENGTH) <NEW_LINE> slug = models.SlugField(_('Slug'), max_length=100, blank=True, default="") <NEW_LINE> field_type = models.IntegerField(_("Type"), choices=fields.NAMES) <NEW_LINE> required = model... | A field for a user-built form. | 62598f9471ff763f4b5e742b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.