code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ProjectSchema(Schema): <NEW_LINE> <INDENT> name = fields.String(required=True, default=None) | Env settings for core feature schema. | 62598f944428ac0f6e6581cb |
class OverviewCategoryDefaulfTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.driver_overview_category_defaulf = OverviewCategoryDefaulfPage(browser()) <NEW_LINE> self.driver_overview_category_defaulf.open(overview_category_defaulf_url) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_... | 登录页面的case | 62598f94f8510a7c17d7dfc8 |
class MooneyRivlinTLTerm(HyperElasticTLBase): <NEW_LINE> <INDENT> name = 'dw_tl_he_mooney_rivlin' <NEW_LINE> family_data_names = ['det_f', 'tr_c', 'sym_inv_c', 'sym_c', 'in2_c'] <NEW_LINE> stress_function = staticmethod(terms.dq_tl_he_stress_mooney_rivlin) <NEW_LINE> tan_mod_function = staticmethod(terms.dq_tl_he_tan_m... | Hyperelastic Mooney-Rivlin term. Effective stress
:math:`S_{ij} = \kappa J^{-\frac{4}{3}} (C_{kk} \delta_{ij} - C_{ij}
- \frac{2}{3 } I_2 C_{ij}^{-1})`.
:Definition:
.. math::
\int_{\Omega} S_{ij}(\ul{u}) \delta E_{ij}(\ul{u};\ul{v})
:Arguments:
- material : :math:`\kappa`
- virtual : :math:`\ul{v}`
... | 62598f94baa26c4b54d4ef51 |
class Catalog: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> parentDir = dirname(abspath(__file__)) <NEW_LINE> print(parentDir) <NEW_LINE> ships = getShips('%s/sources/all-ships.txt' % parentDir) <NEW_LINE> prodstats = ['flight-ready', 'hangar-ready', 'ready', 'in-production', 'in-concept', 'announced'] <... | Catalog object class | 62598f9485dfad0860cbf8c4 |
class Phone(String): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Phone, self).__init__(**kwargs) <NEW_LINE> self.meta['type']='String'; <NEW_LINE> <DEDENT> def check(self, context, data): <NEW_LINE> <INDENT> if not super(Phone, self).check(context, data): <NEW_LINE> <INDENT> return <NEW_... | Just like a string, but checks for valid phone numbers | 62598f94f7d966606f747c86 |
class InvalidInputError(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.value | Raised if the input string does not obey validation requirements. | 62598f944a966d76dd5eeb82 |
class GetPartitionID_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.I32, '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.TBinaryProtocolAcceler... | Attributes:
- success | 62598f948a43f66fc4bf1e1d |
class Net(nn.Module): <NEW_LINE> <INDENT> def __init__(self, params): <NEW_LINE> <INDENT> super(Net, self).__init__() <NEW_LINE> self.embedding = nn.Embedding(params.vocab_size, params.embedding_dim) <NEW_LINE> self.lstm = nn.LSTM(params.embedding_dim, params.lstm_hidden_dim, batch_first=True) <NEW_LINE> self.fc = nn.L... | This is the standard way to define your own network in PyTorch. You typically choose the components
(e.g. LSTMs, linear layers etc.) of your network in the __init__ function. You then apply these layers
on the input step-by-step in the forward function. You can use torch.nn.functional to apply functions
such as F.relu,... | 62598f9407d97122c4216952 |
class LoanActionError(CirculationException): <NEW_LINE> <INDENT> pass | . | 62598f94a17c0f6771d5bedd |
class SkinningOperator(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.skinning_op" <NEW_LINE> bl_label = "Skin curves" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> curves_objects = context.selected_objects <NEW_LINE> n_curves = len(curves_objects)... | Skinning Operator | 62598f9423e79379d538c1a6 |
class CntkDenseConverter(CntkStandardConverter): <NEW_LINE> <INDENT> def __init__(self, cntk_node): <NEW_LINE> <INDENT> weights_shape = cntk_node.inputs[0].shape <NEW_LINE> order = "channel_row_column" <NEW_LINE> if len(weights_shape) == 4: <NEW_LINE> <INDENT> order = "channel_row_column_filter" <NEW_LINE> <DEDENT> eli... | Custom converter for Dense, linear, fully connected etc. | 62598f9460cbc95b06363fe9 |
class ImageSegment(object): <NEW_LINE> <INDENT> def __init__(self, addr, data, file_offs=None): <NEW_LINE> <INDENT> self.addr = addr <NEW_LINE> self.data = pad_to(data, 4, b'\x00') <NEW_LINE> self.file_offs = file_offs <NEW_LINE> self.include_in_checksum = True <NEW_LINE> <DEDENT> def copy_with_new_addr(self, new_addr)... | Wrapper class for a segment in an ESP image
(very similar to a section in an ELFImage also) | 62598f94004d5f362081ee4d |
class ITodo(form.Schema): <NEW_LINE> <INDENT> assignee = Choice( title=_(u"Assignee"), description=_("A user (or a group) assigned to this task"), required=False, vocabulary="plone.principalsource.Principals" ) <NEW_LINE> workspace = TextLine( title=_(u"Workspace"), description=_(u"The workspace assigned to this task")... | Todo schema
| 62598f943617ad0b5ee05dee |
class ModelValidator(HasAModelManager): <NEW_LINE> <INDENT> def __init__(self, app, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(app, **kwargs) <NEW_LINE> self.app = app <NEW_LINE> <DEDENT> def type(self, key, val, types): <NEW_LINE> <INDENT> if not isinstance(val, types): <NEW_LINE> <INDENT> msg = f'must be ... | An object that inspects a dictionary (generally meant to be a set of
new/updated values for the model) and raises an error if a value is
not acceptable. | 62598f94462c4b4f79dbb6aa |
class Queue: <NEW_LINE> <INDENT> front = None <NEW_LINE> rear = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def enqueue(self, data): <NEW_LINE> <INDENT> node = Node(data) <NEW_LINE> if self.front == None and self.rear == None: <NEW_LINE> <INDENT> self.front = node <NEW_LINE> self.re... | This Queue class is used to create Queue. | 62598f94a219f33f346c64bd |
class TestCandidateFlags(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return CandidateFlags( ... | CandidateFlags unit test stubs | 62598f940fa83653e46f4b8c |
class Column: <NEW_LINE> <INDENT> def __init__(self, rel_name: str, name: str, idx: int, type_str: str, trust_set: set): <NEW_LINE> <INDENT> if type_str not in {"INTEGER"}: <NEW_LINE> <INDENT> raise Exception("Type not supported {}".format(type_str)) <NEW_LINE> <DEDENT> self.rel_name = rel_name <NEW_LINE> self.name = n... | Column data structure. | 62598f94b830903b9686e2c5 |
class workflow(Process): <NEW_LINE> <INDENT> def __init__(self,data,db): <NEW_LINE> <INDENT> Process.__init__(self) <NEW_LINE> self.data = data <NEW_LINE> self.db=db <NEW_LINE> <DEDENT> def task_before(self,data): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def task_after(self, data,result): <NEW_LINE> <INDENT> pass <... | workflow之间并行
task之间串行
task node之间串行 | 62598f9445492302aabfc17b |
class class_apply_linked_rotation(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.apply_linked_rotation" <NEW_LINE> bl_label = "Apply Rotation To Linked" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.active_object is not None <NEW_LINE> <DEDENT> def execute(s... | Apply Rotation (Linked) | 62598f9410dbd63aa1c70862 |
class ExternalStorage(base.StorageInterface): <NEW_LINE> <INDENT> def validate(self, task): <NEW_LINE> <INDENT> def _fail_validation(task, reason, exception=exception.InvalidParameterValue): <NEW_LINE> <INDENT> msg = (_("Failed to validate external storage interface for node " "%(node)s. %(reason)s") % {'node': task.no... | Externally driven Storage Interface. | 62598f94460517430c431eac |
class TestImportUtils(InvenioTestCase): <NEW_LINE> <INDENT> def test_autodiscover_modules(self): <NEW_LINE> <INDENT> modules = autodiscover_modules(['invenio.bibformat_elements'], related_name_re='bfe_.+\.py') <NEW_LINE> assert(len(modules) > 10) <NEW_LINE> modules = autodiscover_modules(['invenio'], related_name_re='(... | importutils TestSuite. | 62598f94d7e4931a7ef3bd47 |
class NewDeploymentRequest(MultipartFormInput): <NEW_LINE> <INDENT> @property <NEW_LINE> def options_by_name(self): <NEW_LINE> <INDENT> return {'deployment-name': FormOption(), 'enable-duplicate-filtering': FormOption(), 'deploy-changed-only': FormOption(), 'deployment-source': FormOption(), 'tenant-id': FormOption()} | @see https://docs.camunda.org/manual/7.5/reference/rest/deployment/post-deployment/#request-body
| 62598f9463d6d428bbee2461 |
class PoolScanWind(poolscan.PoolScanner): <NEW_LINE> <INDENT> def __init__(self, address_space): <NEW_LINE> <INDENT> poolscan.PoolScanner.__init__(self, address_space) <NEW_LINE> self.struct_name = "tagWINDOWSTATION" <NEW_LINE> self.object_type = "WindowStation" <NEW_LINE> self.pooltag = obj.VolMagic(address_space).Win... | PoolScanner for window station objects | 62598f948a43f66fc4bf1e1f |
class WestWind: <NEW_LINE> <INDENT> def __init__(self, wind_speed=dict()): <NEW_LINE> <INDENT> self.wind_speed = wind_speed <NEW_LINE> <DEDENT> def blow(self, position): <NEW_LINE> <INDENT> y = position.coordinates()[1] <NEW_LINE> wind_speed = self.wind_speed.get(y, 0) <NEW_LINE> return Move(wind_speed, 0) | Rules for wind blowing to the right | 62598f947cff6e4e811b56c0 |
class Buzz(models.Model): <NEW_LINE> <INDENT> created_at = models.DateTimeField('created', auto_now_add=True) <NEW_LINE> failed_posting = models.BooleanField(default=False) <NEW_LINE> failed_posted_at = models.DateTimeField('failed_posted_at', blank=True, null=True) <NEW_LINE> buzzid = models.CharField(max_length=255)... | Used to store buzzs after getting them from Google and before successfully posting them
on Twitter. After the twitter posting they must be deleted to not clodge the database | 62598f9416aa5153ce40019f |
class RefreshPage: <NEW_LINE> <INDENT> def describe(self) -> str: <NEW_LINE> <INDENT> return "Refresh the page." <NEW_LINE> <DEDENT> @beat("{} refreshes the page.") <NEW_LINE> def perform_as(self, the_actor: Actor) -> None: <NEW_LINE> <INDENT> browser = the_actor.ability_to(BrowseTheWeb).browser <NEW_LINE> browser.refr... | Refresh the browser page!
Abilities Required:
|BrowseTheWeb|
Examples::
the_actor.attempts_to(RefreshPage()) | 62598f9455399d3f056261c3 |
class MinMaxScaler(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, feature_range=(0, 1), copy=True): <NEW_LINE> <INDENT> self.feature_range = feature_range <NEW_LINE> self.copy = copy <NEW_LINE> <DEDENT> def fit(self, X, y=None): <NEW_LINE> <INDENT> X = check_array(X, copy=self.copy, ensure_2d=... | Standardizes features by scaling each feature to a given range.
This estimator scales and translates each feature individually such
that it is in the given range on the training set, i.e. between
zero and one.
The standardization is given by::
X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0))
X_sc... | 62598f941f037a2d8b9e3d86 |
class UserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all().order_by('-date_joined') <NEW_LINE> serializers_class = UserSerializer | API endpoint that allows users to be viewed or edited | 62598f94b7558d58954632d2 |
class User: <NEW_LINE> <INDENT> users = shelve.open("./data/users", protocol=0, writeback=True) <NEW_LINE> def __init__(self, name, level=None, trusted=False,): <NEW_LINE> <INDENT> self.name = name.split("!")[0] <NEW_LINE> self.hostmask = name <NEW_LINE> self.password = None <NEW_LINE> self.trusted = False <NEW_LINE> s... | My instances represent each user in an IRC channel. | 62598f943cc13d1c6d465411 |
class aboutDialog(Gtk.AboutDialog): <NEW_LINE> <INDENT> def __init__(self, main_window): <NEW_LINE> <INDENT> Gtk.AboutDialog.__init__(self, transient_for=main_window, modal=True) <NEW_LINE> icons = os.path.join(FARADAY_CLIENT_BASE, "data", "images", "icons") <NEW_LINE> faraday_icon = GdkPixbuf.Pixbuf.new_from_file( os.... | The simple about dialog displayed when the user clicks on "about"
ont the menu. Could be in application.py, but for consistency reasons
its here | 62598f94b57a9660fecd171f |
class WhitelistGeneratedCertificatesTest(ModuleStoreTestCase): <NEW_LINE> <INDENT> shard = 4 <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(WhitelistGeneratedCertificatesTest, self).setUp() <NEW_LINE> self.course = CourseFactory.create(self_paced=True) <NEW_LINE> self.user = UserFactory.create() <NEW_LINE> Cours... | Tests for whitelisted student auto-certificate generation | 62598f94a79ad16197769d05 |
class TestTeamMod(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 testTeamMod(self): <NEW_LINE> <INDENT> pass | TeamMod unit test stubs | 62598f94004d5f362081ee4e |
class Solution: <NEW_LINE> <INDENT> def productExcludeItself(self, A): <NEW_LINE> <INDENT> left = [1] * len(A) <NEW_LINE> right = [1] * len(A) <NEW_LINE> for i in range(1, len(A)): <NEW_LINE> <INDENT> if (i == 0): <NEW_LINE> <INDENT> left[i] = 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> left[i] = A[i - 1] * left[i ... | @param A: Given an integers array A
@return: An integer array B and B[i]= A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1] | 62598f9421a7993f00c65c22 |
class DynamicArgParseInterface(ArgParseInterface): <NEW_LINE> <INDENT> def parse(self, cmdline_args=None): <NEW_LINE> <INDENT> if cmdline_args is None: <NEW_LINE> <INDENT> cmdline_args = sys.argv[1:] <NEW_LINE> <DEDENT> parser = argparse.ArgumentParser() <NEW_LINE> add_global_parameters(parser) <NEW_LINE> args, unknown... | Uses --module as a way to load modules dynamically
Usage:
.. code-block:: console
python whatever.py --module foo_module FooTask --blah xyz --x 123
This will dynamically import foo_module and then try to create FooTask from this. | 62598f94d486a94d0ba2bc78 |
class Nodo: <NEW_LINE> <INDENT> def __init__(self, elemento,pasw): <NEW_LINE> <INDENT> self.elemento=elemento <NEW_LINE> self.pasw=pasw <NEW_LINE> self.siguiente=None <NEW_LINE> self.anterior=None <NEW_LINE> self.cola=None <NEW_LINE> <DEDENT> def DameCola(self): <NEW_LINE> <INDENT> return self.cola <NEW_LINE> <DEDENT> ... | description of class | 62598f94379a373c97d98cb7 |
class Solution: <NEW_LINE> <INDENT> def levelOrder(self, root: TreeNode) -> List[List[int]]: <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> q = deque() <NEW_LINE> q.append(root) <NEW_LINE> res = [] <NEW_LINE> odd = True <NEW_LINE> while q: <NEW_LINE> <INDENT> temp = [] <NEW_LINE>... | 请实现一个函数按照之字形顺序打印二叉树,
即第一行按照从左到右的顺序打印,
第二层按照从右到左的顺序打印,
第三行再按照从左到右的顺序打印,其他行以此类推。 | 62598f94507cdc57c63a4a38 |
class BbDetailSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Bb <NEW_LINE> fields = ('id', 'title', 'content', 'price', 'created_at', 'contacts', 'image') | Сериализатор для подробной информации о выбранном объявлении | 62598f94435de62698e9ba97 |
class GroupExperimentConfigurationHelpTest(ContainerBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(GroupExperimentConfigurationHelpTest, self).setUp() <NEW_LINE> self.group_configuration_page = GroupConfigurationsPage( self.browser, self.course_info['org'], self.course_info['number'], self.course... | Tests help links on course Group Configurations settings page
It is related to Experiment Group Configurations on the page. | 62598f94be8e80087fbbed02 |
class TrackerResponse: <NEW_LINE> <INDENT> def __init__(self, data: dict): <NEW_LINE> <INDENT> self.data: dict = data <NEW_LINE> self.failed: bool = "failure reason" in self.data <NEW_LINE> <DEDENT> @property <NEW_LINE> def failure_reason(self) -> Optional[str]: <NEW_LINE> <INDENT> if self.failed: <NEW_LINE> <INDENT> r... | TrackerResponse received from the tracker after an announce request. | 62598f9491af0d3eaad39aab |
class ContinuousRecorder(object): <NEW_LINE> <INDENT> def __init__(self, mixing_mode='average', integration_mode='traps', interpolation_mode='linear'): <NEW_LINE> <INDENT> self._sa_buffer = deque() <NEW_LINE> self._sa_lock = Lock() <NEW_LINE> self._r_buffer = IntegratorBuffer(integration_mode=integration_mode, interpol... | Merges asynchronous state-action and reward streams to produce
state-action-reward (SAR) tuples.
Assumes that state-action tuples and rewards are reported in monotonically
increasing temporal order, respectively, and that the system evolves
continuously. For systems with discontinuities or episodic behavior, see
Epis... | 62598f9407f4c71912baf0f0 |
class BackTranslationAug(WordAugmenter): <NEW_LINE> <INDENT> def __init__(self, from_model_name='facebook/wmt19-en-de', to_model_name='facebook/wmt19-de-en', name='BackTranslationAug', device='cpu', batch_size=32, max_length=300, force_reload=False, verbose=0): <NEW_LINE> <INDENT> super().__init__( action='substitute',... | Augmenter that leverage two translation models for augmentation. For example, the source is English. This
augmenter translate source to German and translating it back to English. For detail, you may visit
https://towardsdatascience.com/data-augmentation-in-nlp-2801a34dfc28
:param str from_model_name: Any model from ht... | 62598f9499cbb53fe6830b74 |
class CommandCollector: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.options_for_tool = {} <NEW_LINE> <DEDENT> def list_intersection(self, list1, list2): <NEW_LINE> <INDENT> if len(list2) > len(list1): <NEW_LINE> <INDENT> tmp = list2 <NEW_LINE> list2 = list1 <NEW_LINE> list1 = tmp <NEW_LINE> <DEDENT... | Command line aggregator.
Aggregator that computes an ordered intersection between options for a
specific tool. The order is kept because, for example, linker options
(--largs) should not be lost.
ATTRIBUTES
options_for_tool: dict containing all common options gathered
for a specific tool | 62598f94baa26c4b54d4ef54 |
class TestBgpMaxPaths(BaseActionTestCase): <NEW_LINE> <INDENT> action_cls = bgp_max_paths <NEW_LINE> def test_action(self): <NEW_LINE> <INDENT> action = self.get_action_instance() <NEW_LINE> mock_callback = MockCallback() <NEW_LINE> kwargs = { 'username': '', 'paths': '10', 'afi': 'ipv4', 'get': False, 'ip': '', 'vrf':... | Test holder class
| 62598f9445492302aabfc17d |
class QuickCut(Ability): <NEW_LINE> <INDENT> name = "quick cut" <NEW_LINE> description = "Cut em up!" <NEW_LINE> energy_required = 1 <NEW_LINE> requirements = None <NEW_LINE> requires_target = "enemy" <NEW_LINE> @staticmethod <NEW_LINE> def can_use(user, target=None): <NEW_LINE> <INDENT> if not target: <NEW_LINE> <INDE... | Exactly like cut, except takes less energy and suffers
more penalties for armored opoentns.
Cutting attack for small bladed weapons, like daggers.
Effective against unarmoed oponents, weak against armored oponents.
High chance to hit.
Higher chance to hit big and slow oponents.
chance to hit = accuracy * dexterity... | 62598f94f8510a7c17d7dfca |
class ReplaceFilter(Filter): <NEW_LINE> <INDENT> def __init__(self, input=(None, None), output=(None, None)): <NEW_LINE> <INDENT> self._input_from, self._input_to = input <NEW_LINE> self._output_from, self._output_to = output <NEW_LINE> <DEDENT> def input(self, in_, out, **kw): <NEW_LINE> <INDENT> if self._input_from: ... | Filter that does a simple string replacement.
| 62598f94be383301e02534ab |
class RemainderAction(argparse._StoreAction): <NEW_LINE> <INDENT> def __init__(self, example=None, *args, **kwargs): <NEW_LINE> <INDENT> if kwargs['nargs'] is not argparse.REMAINDER: <NEW_LINE> <INDENT> raise ValueError( 'The RemainderAction should only be used when ' 'nargs=argparse.REMAINDER.') <NEW_LINE> <DEDENT> se... | An action with a couple of helpers to better handle --.
argparse on its own does not properly handle -- implementation args.
argparse.REMAINDER greedily steals valid flags before a --, and nargs='*' will
bind to [] and not parse args after --. This Action represents arguments to
be passed through to a subcommand afte... | 62598f9463d6d428bbee2463 |
class DiscoNode(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.info = DiscoInfo() <NEW_LINE> self.items = DiscoItems() <NEW_LINE> self.info['node'] = name <NEW_LINE> self.items['node'] = name <NEW_LINE> self._map(self.items, 'items', ['get', 'set', 'del']) <N... | Collection object for grouping info and item information
into nodes. | 62598f94adb09d7d5dc0a22e |
class ListKeyAliasByRegionRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.KmsRegion = None <NEW_LINE> self.Limit = None <NEW_LINE> self.Offset = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.KmsRegion = params.get("KmsRegion") <NEW_LINE> self.... | ListKeyAliasByRegion请求参数结构体
| 62598f9424f1403a92685704 |
class MsgBaselineNED(SBP): <NEW_LINE> <INDENT> _parser = Struct("MsgBaselineNED", ULInt32('tow'), SLInt32('n'), SLInt32('e'), SLInt32('d'), ULInt16('h_accuracy'), ULInt16('v_accuracy'), ULInt8('n_sats'), ULInt8('flags'),) <NEW_LINE> __slots__ = [ 'tow', 'n', 'e', 'd', 'h_accuracy', 'v_accuracy', 'n_sats', 'flags', ] <N... | SBP class for message MSG_BASELINE_NED (0x020C).
You can have MSG_BASELINE_NED inherit its fields directly
from an inherited SBP object, or construct it inline using a dict
of its fields.
This message reports the baseline solution in North East Down
(NED) coordinates. This baseline is the relative vector d... | 62598f9430dc7b766599f4f7 |
class StatsMapModel(models.Model): <NEW_LINE> <INDENT> dateget = models.DateTimeField(blank=True, null=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return '%s' % self.mapname | Stores the maps to bind fields to each project | 62598f94f7d966606f747c8a |
class Contact(ndb.Model): <NEW_LINE> <INDENT> name = ndb.StringProperty() <NEW_LINE> birth_day = ndb.DateProperty() <NEW_LINE> address = ndb.StringProperty() <NEW_LINE> company_title = ndb.StringProperty() <NEW_LINE> company_name = ndb.StringProperty() <NEW_LINE> company_description = ndb.TextProperty() <NEW_LINE> comp... | A Contact model with KeyProperty. | 62598f9430dc7b766599f4f8 |
class KeepAlive (WebDAVElement): <NEW_LINE> <INDENT> name = "keepalive" <NEW_LINE> allowed_children = { (dav_namespace, "href"): (0, None), PCDATAElement: (0, 1), } <NEW_LINE> def __init__(self, *children, **attributes): <NEW_LINE> <INDENT> super(KeepAlive, self).__init__(*children, **attributes) <NEW_LINE> type = None... | Specifies requirements for the copying/moving or live properties. (RFC 2518,
section 12.12.1) | 62598f94d53ae8145f918132 |
class AbstractSourceStep(AbstractStep): <NEW_LINE> <INDENT> def __init__(self, pipeline): <NEW_LINE> <INDENT> super(AbstractSourceStep, self).__init__(pipeline) | A subclass all source steps inherit from and which distinguishes source
steps from all real processing steps because they do not yield any tasks,
because their "output files" are in fact files which are already there.
Note that the name might be a bit misleading because this class only
applies to source steps which 's... | 62598f9416aa5153ce4001a1 |
class PercentFormatter(Formatter): <NEW_LINE> <INDENT> def __init__(self, decimals=2, *args, **vargs): <NEW_LINE> <INDENT> super().__init__(*args, **vargs) <NEW_LINE> assert isinstance(decimals, int) <NEW_LINE> self.decimals = decimals <NEW_LINE> <DEDENT> def format_value(self, value): <NEW_LINE> <INDENT> return ('{:.'... | Format a number as a percentage. | 62598f9455399d3f056261c5 |
class Djbs10FormView(FormView): <NEW_LINE> <INDENT> template_name = 'mdl2tbl/djbs10.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> self.form_class = AttrNameForm <NEW_LINE> gets = self.request.GET <NEW_LINE> self.form_class.yws_gets = gets.copy() <NEW_LINE> self.form_class.yws_gets['title'] ... | 속성사용테이블 | 62598f94eab8aa0e5d30ba28 |
class Info(bot.Extension): <NEW_LINE> <INDENT> @bot.command() <NEW_LINE> async def info(ctx, message): <NEW_LINE> <INDENT> embed = discord.Embed() <NEW_LINE> embed.add_field(name="Profile", value=ctx.profile.name) <NEW_LINE> embed.add_field(name="Mode", value=ctx.profile.mode) <NEW_LINE> embed.set_author(name=ctx.user.... | Provides information about the Bot and loaded extensions | 62598f9421a7993f00c65c24 |
class QNetwork(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed): <NEW_LINE> <INDENT> super(QNetwork, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> hidden_size1 = 128 <NEW_LINE> hidden_size2 = 64 <NEW_LINE> hidden_size3 = 32 <NEW_LINE> self.fully_connected1 =... | Defining an actor (policy) model | 62598f94d6c5a102081e1de9 |
class DatabaseInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.DatabaseName = None <NEW_LINE> self.Comment = None <NEW_LINE> self.Properties = None <NEW_LINE> self.Location = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.DatabaseName = params.get(... | 数据库对象
| 62598f941b99ca400228f380 |
class Notification(models.Model): <NEW_LINE> <INDENT> content = NormalTextField(null=True, blank=True) <NEW_LINE> status = models.IntegerField(null=True, blank=True) <NEW_LINE> involved_type = models.IntegerField(null=True, blank=True) <NEW_LINE> involved_user = models.ForeignKey(SiteUser, related_name='notify_user', n... | 通知消息 | 62598f940c0af96317c5602a |
class LogicalSwitchPortCreateDownEvent(row_event.RowEvent): <NEW_LINE> <INDENT> def __init__(self, driver): <NEW_LINE> <INDENT> self.driver = driver <NEW_LINE> table = 'Logical_Switch_Port' <NEW_LINE> events = (self.ROW_CREATE,) <NEW_LINE> super(LogicalSwitchPortCreateDownEvent, self).__init__( events, table, (('up', '... | Row create event - Logical_Switch_Port 'up' = False
On connection, we get a dump of all ports, so if there is a neutron
port that is up that has since been deactivated, we'll catch it here.
This event will not be generated for new ports getting created. | 62598f949b70327d1c57ea48 |
class Window(core.Window): <NEW_LINE> <INDENT> def __init__(self, title, size, origin=DEFAULT_WINDOW_POSITION, style=STYLE_GENERAL_WINDOW, activate=False): <NEW_LINE> <INDENT> super().__init__(title, size, origin, style) <NEW_LINE> if activate: <NEW_LINE> <INDENT> self.activate() <NEW_LINE> <DEDENT> <DEDENT> def __del_... | System Window Helper Class
You can handle window, keyboard, mouse event
event methods will invoked on MAIN-THREAD | 62598f94435de62698e9ba99 |
class Priority(object): <NEW_LINE> <INDENT> VERY_FIRST = 1 <NEW_LINE> FIRST = 2 <NEW_LINE> NORMAL = 3 <NEW_LINE> LAST = 4 <NEW_LINE> VERY_LAST = 5 | Enum for the order in which to load various components. | 62598f9423849d37ff850d6c |
class ArrayContentNotHomogenousError(ProgrammingError): <NEW_LINE> <INDENT> pass | Raised when attempting to transmit an array that doesn't contain only a
single type of object. | 62598f940fa83653e46f4b90 |
class UserMoneyView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> return render(request, 'member_money.html') | 资金管理 | 62598f9463b5f9789fe84e1c |
class ListCorrector(Corrector): <NEW_LINE> <INDENT> def __init__(self, wordlist): <NEW_LINE> <INDENT> self.wordlist = wordlist <NEW_LINE> <DEDENT> def _suggestions(self, text, maxdist, prefix): <NEW_LINE> <INDENT> from whoosh.automata.lev import levenshtein_automaton <NEW_LINE> from whoosh.automata.fsa import find_all_... | Suggests corrections based on the content of a sorted list of strings. | 62598f944527f215b58e9b8b |
class CommandOptions(HelpProvider): <NEW_LINE> <INDENT> help_spec = { HELP_NAME : 'crc32c', HELP_NAME_ALIASES : ['crc32', 'crc', 'crcmod'], HELP_TYPE : HelpType.ADDITIONAL_HELP, HELP_ONE_LINE_SUMMARY : 'CRC32C and Installing crcmod', HELP_TEXT : _detailed_help_text, } | Additional help about CRC32C and installing crcmod. | 62598f94435de62698e9ba9a |
class EXEOAM: <NEW_LINE> <INDENT> binOamData = b"" <NEW_LINE> startTile = 0 <NEW_LINE> posX = 0 <NEW_LINE> posY = 0 <NEW_LINE> sizeX = 0 <NEW_LINE> sizeY = 0 <NEW_LINE> flipV = 0 <NEW_LINE> flipH = 0 <NEW_LINE> palIndex = 0 <NEW_LINE> def __init__(self, binOamData): <NEW_LINE> <INDENT> self.binOamData = binOamData <NEW... | OAM
| 62598f942ae34c7f260aad91 |
class RequestStream (BaseRequest, ) : <NEW_LINE> <INDENT> need_watching = True <NEW_LINE> must_be_argument = ( 'Type', ) <NEW_LINE> def do_check (self, client, ) : <NEW_LINE> <INDENT> super(RequestStream, self).do_check(client, ) <NEW_LINE> if type(self.body.get('Type', ), ) not in (str, unicode, ) : <NEW_LINE> <INDENT... | {"Type": "member-join,user:deploy"}` | 62598f94656771135c489327 |
class testDiffDict(unittest.TestCase): <NEW_LINE> <INDENT> def testEqual(self): <NEW_LINE> <INDENT> firstdict = {1:1, 2:2, 3:3} <NEW_LINE> seconddict = {1:1, 2:2, 3:3} <NEW_LINE> dd = dictdiff.DictDiff(firstdict, seconddict) <NEW_LINE> added = dd.added() <NEW_LINE> removed = dd.removed() <NEW_LINE> changed = dd.changed... | Test the Diff Dict functions work as expected | 62598f9410dbd63aa1c70866 |
class Dog: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.life = 50 <NEW_LINE> self.hunger = 50 <NEW_LINE> <DEDENT> def add_weight(self, weight): <NEW_LINE> <INDENT> self.weight = weight <NEW_LINE> <DEDENT> def add_hunger(self, hunger): <NEW_LINE> <INDENT> self.hunger... | This is the beginning of a class for the Man's best friend. The Dog | 62598f940a50d4780f70507d |
class ImproperlyConfigured(Exception): <NEW_LINE> <INDENT> pass | Exception to be raised when encountering configuration errors | 62598f9463d6d428bbee2465 |
class Privacy(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> user = users.get_current_user() <NEW_LINE> if user: <NEW_LINE> <INDENT> self.redirect('/nusprivacy') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> template_values = { 'home': self.request.host_url, } <NEW_LINE> template = jinj... | Handler for privacy policy page. | 62598f94e64d504609df920a |
class Isa(object): <NEW_LINE> <INDENT> ft_per_hpa = 27 <NEW_LINE> subtract_c_per_tousandfeet = 2 <NEW_LINE> feet_per_c = 120 <NEW_LINE> base_qnh = 1013.25 <NEW_LINE> tmp_ams = 15 <NEW_LINE> earliest_sunset = "16:30" <NEW_LINE> latest_sunrise = "08:30" <NEW_LINE> def __set__(self, instance, value): <NEW_LINE> <INDENT> r... | Class which describes the ideal athmosphere | 62598f9476e4537e8c3ef25a |
class RestorableDatabaseAccountGetResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'api_type': {'readonly': True}, 'restorable_locations': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'typ... | A Azure Cosmos DB restorable database account.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:va... | 62598f9471ff763f4b5e741f |
class ExpressRoutePeeringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> AZURE_PUBLIC_PEERING = "AzurePublicPeering" <NEW_LINE> AZURE_PRIVATE_PEERING = "AzurePrivatePeering" <NEW_LINE> MICROSOFT_PEERING = "MicrosoftPeering" | The peering type.
| 62598f94b57a9660fecd1723 |
class TestingConfig(Config): <NEW_LINE> <INDENT> TESTING = True <NEW_LINE> SQLALCHEMY_DATABASE_URI = "mysql://root:password@127.0.0.1:3306/ihome_testcase" | 测试环境配置类 | 62598f94cb5e8a47e493bfc7 |
class SocketEvents(BaseModel): <NEW_LINE> <INDENT> action = TextField(help_text="The socket action (bind, listen, close)") <NEW_LINE> pid = BigIntegerField(help_text="Process (or thread) ID") <NEW_LINE> path = TextField(help_text="Path of executed file") <NEW_LINE> fd = TextField(help_text="The file description for the... | Track network socket opens and closes. | 62598f9430bbd722464697cb |
class MockRedis(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.kv = StringDict() <NEW_LINE> <DEDENT> def pipeline(self, **kw): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get(self, key): <NEW_LINE> <INDENT> return sel... | A fake redis we can use for testing. | 62598f94435de62698e9ba9b |
class ShutdownClusters(mortartask.MortarClusterShutdownTask): <NEW_LINE> <INDENT> output_base_path = luigi.Parameter() <NEW_LINE> table_name_prefix = luigi.Parameter() <NEW_LINE> def requires(self): <NEW_LINE> <INDENT> return [SanityTestUITable(output_base_path=self.output_base_path, table_name_prefix=self.table_name_p... | This is the very last task in the pipeline. It will shut down all active
clusters that are not currently running jobs. | 62598f9423849d37ff850d6e |
class Puppy(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> age = models.IntegerField() <NEW_LINE> breed = models.CharField(max_length=255) <NEW_LINE> colour = models.CharField(max_length=255) <NEW_LINE> created_at = models.DateTimeField(auto_now_add=True) <NEW_LINE> updated_at = m... | Puppy Model
Defines the attributes of a puppy. | 62598f94f7d966606f747c8d |
class EclipseJava(BaseEclipse): <NEW_LINE> <INDENT> download_keyword = 'eclipse-java-' <NEW_LINE> executable = 'eclipse' <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(name="Eclipse", description=_("Eclipse Java IDE"), dir_to_decompress_in_tarball='eclipse', desktop_filename='eclipse-java... | The Eclipse Java Edition distribution. | 62598f9499cbb53fe6830b78 |
class TestV1ScaleSpec(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 testV1ScaleSpec(self): <NEW_LINE> <INDENT> model = k8sv1.models.v1_scale_spec.V1ScaleSpec() | V1ScaleSpec unit test stubs | 62598f942ae34c7f260aad93 |
class Cerium(Bitcoin): <NEW_LINE> <INDENT> name = 'cerium' <NEW_LINE> symbols = ('XCE', ) <NEW_LINE> nodes = ("104.131.117.31", ) <NEW_LINE> port = 45455 <NEW_LINE> message_start = b'\xa4\xd2\xf8\xa6' <NEW_LINE> base58_prefixes = { 'PUBKEY_ADDR': 28, 'SCRIPT_ADDR': 85, 'SECRET_KEY': 156 } | Class with all the necessary Cerium network information based on
https://github.com/ceriumdev/cerium/blob/master/src/net.cpp
(date of access: 02/14/2018) | 62598f94ac7a0e7691f721b5 |
class GradientClassificationConfidence: <NEW_LINE> <INDENT> def __init__(self, model, num_classes=None, aggregation="l2_norm", loss=None): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.aggregation = aggregation <NEW_LINE> self.num_classes = None <NEW_LINE> self.agg_fn = AGGREGATION_FNS[self.aggregation] <NEW_L... | Implementation of gradient uncertainty for classifiers.
It only needs to provide a model, an aggregation function (to transform gradient to a scalar),
and optionally a loss to compute the gradient from.
Reference: Oberdiek et al. Classification Uncertainty of Deep Neural Networks
Based on Gradient Informati... | 62598f944428ac0f6e6581d3 |
class Opcode(object): <NEW_LINE> <INDENT> OPCODE = None <NEW_LINE> OPCODE_NAME = None <NEW_LINE> FLAGS = 0 <NEW_LINE> PYTHON_VERSION = None <NEW_LINE> def __init__( self, offset, end, line, arg, arg_val, arg_repr, is_jump_target): <NEW_LINE> <INDENT> self.offset = offset <NEW_LINE> self.end = end <NEW_LINE> self.line =... | Base opcode definition | 62598f9494891a1f408b9545 |
class ParallelGripperActionController: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> rospy.init_node('gripper_controller') <NEW_LINE> self.pad_width = rospy.get_param('~pad_width', 0.01) <NEW_LINE> self.finger_length = rospy.get_param('~finger_length', 0.02) <NEW_LINE> self.min_opening = rospy.get_param('... | A simple controller that operates two opposing servos to
open/close to a particular size opening. | 62598f94adb09d7d5dc0a232 |
class TestApiResponseOptionsExpirations(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 testApiResponseOptionsExpirations(self): <NEW_LINE> <INDENT> pass | ApiResponseOptionsExpirations unit test stubs | 62598f94e64d504609df920b |
class Dog(): <NEW_LINE> <INDENT> def __init__(self, name, age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def sit(self): <NEW_LINE> <INDENT> print(self.name.title() + " is now sitting.") <NEW_LINE> <DEDENT> def roll_over(self): <NEW_LINE> <INDENT> print(self.name.title() + " rol... | 一次模拟小狗的简单尝试 | 62598f94925a0f43d25e7ce4 |
class Column: <NEW_LINE> <INDENT> SIZE, COUNT, MTIME, TAG, CKSUM, PATH, TOOLTIP = range(7) <NEW_LINE> TYPES = [float, int, int, int, int, str, str] <NEW_LINE> @staticmethod <NEW_LINE> def make_row(md_map): <NEW_LINE> <INDENT> is_original = md_map.get('is_original', False) <NEW_LINE> if md_map.get('type', '').startswith... | Column Enumeration to avoid using direct indices.
Only this class needs to be changed when adding/modifying columns. | 62598f9445492302aabfc182 |
class AfterShipSensor(SensorEntity): <NEW_LINE> <INDENT> _attr_attribution = ATTRIBUTION <NEW_LINE> _attr_native_unit_of_measurement: str = "packages" <NEW_LINE> _attr_icon: str = ICON <NEW_LINE> def __init__(self, aftership: Tracking, name: str) -> None: <NEW_LINE> <INDENT> self._attributes: dict[str, Any] = {} <NEW_L... | Representation of a AfterShip sensor. | 62598f941f037a2d8b9e3d8c |
class AutoSlugField(SlugField): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.populate_from = kwargs.pop('populate_from', None) <NEW_LINE> super(AutoSlugField, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def pre_save(self, instance, add): <NEW_LINE> <INDENT> default = super(A... | Auto populates itself from another field.
It behaves like a regular SlugField.
When populate_from is provided it'll populate itself on creation,
only if a slug was not provided. | 62598f94b7558d58954632d8 |
class Module(PrinterBase): <NEW_LINE> <INDENT> def get_import_packages(self): <NEW_LINE> <INDENT> idt = ' ' * self.isize <NEW_LINE> pkgs = self.pmod['import'] <NEW_LINE> nbpkgs = len(pkgs) <NEW_LINE> strval = '' <NEW_LINE> if nbpkgs != 0: <NEW_LINE> <INDENT> strval = idt + 'import ' <NEW_LINE> for i in range(nbpkgs): <... | Returns the reformatted module string given in the
constructor. | 62598f9426068e7796d4c60c |
class FieldsTestCase(_BaseTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super().setUpClass() <NEW_LINE> if not selectors.bug_is_fixed(1933, cls.cfg.pulp_version): <NEW_LINE> <INDENT> raise unittest.SkipTest('https://pulp.plan.io/issues/1933') <NEW_LINE> <DEDENT> client ... | Ask for several fields in search results.
==== ====
GET ``field=login&field=roles``
POST ``{'criteria': {'fields': ['login', 'roles']}}``
==== ==== | 62598f946e29344779b00304 |
class Preference_list(APIView): <NEW_LINE> <INDENT> def get(self,request): <NEW_LINE> <INDENT> mes = {} <NEW_LINE> todaydate = datetime.now().strftime("%Y-%m-%d") <NEW_LINE> flashdate = Goods.objects.filter( promotionStartTime__lte=todaydate, promotionEndTime__gte=todaydate).all() <NEW_LINE> good = GoodsModelSerializer... | 特惠首页 | 62598f943cc13d1c6d465417 |
class RestUrlPath(object): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.url_original = url <NEW_LINE> self.url = urllib.parse.unquote(url) <NEW_LINE> self.url_path = urllib.parse.urlparse(self.url) <NEW_LINE> self.path_parts = self.url_path.path.lstrip("/").split("/") <NEW_LINE> self.version = ... | Parser to get path parts from a REST API URL. | 62598f94097d151d1a2c0cd7 |
class BgpNeighborAfiSafi(elements.BaseElement): <NEW_LINE> <INDENT> _FIELDS = ("afi_safi_name", "config") <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> super(BgpNeighborAfiSafi, self).__init__("afi-safi") <NEW_LINE> self.afi_safi_name = BgpNeighborAfiSafiName(name) <NEW_LINE> self.config = BgpNeighborAfiSafi... | Neteork instance protocol(BGP/neighbor/afi-safis/afi-safi) element. | 62598f94eab8aa0e5d30ba2c |
class TestCraftingTorches(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.i = Equipment() <NEW_LINE> <DEDENT> def test_trivial(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_check_crafting(self): <NEW_LINE> <INDENT> self.i.crafting[0] = Slot(bravo.blocks.items["coal"].slo... | Test basic crafting functionality.
Assumes that the basic torch recipe is present and enabled. This recipe
was chosen because somebody was having problems crafting torches. | 62598f94d6c5a102081e1ded |
class PackagesTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.data_loader = InMemoryPackageDataLoader() <NEW_LINE> set_data_loader(self.data_loader) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> set_data_loader(None) | Base class for the packages tests.
This takes care of setting up an in-memory data loader, so that responses
can be populated without hitting the main repository. | 62598f941b99ca400228f382 |
class BcapHandler(webapp.RequestHandler): <NEW_LINE> <INDENT> def initialize(self, request, response): <NEW_LINE> <INDENT> super(BcapHandler, self).initialize(request, response) <NEW_LINE> if request: <NEW_LINE> <INDENT> self.cap_server = CapServer(self.server_url(ProxyHandler.cap_prefix)) <NEW_LINE> <DEDENT> <DEDENT> ... | A base class which implements the details of the BCAP protocol binding
for HTTP. Handlers for well-known capabilities which have no bound entity may
extend directly from this class.
This class will respond to HTTP OPTIONS requests
indicating that the handler can be invoked from any origin, using
the method indicate... | 62598f944e4d5625663720cc |
class MidiHeader(object): <NEW_LINE> <INDENT> def __init__(self, format, number_of_tracks=0, time_division=480): <NEW_LINE> <INDENT> self.format = format <NEW_LINE> self.number_of_tracks = number_of_tracks <NEW_LINE> self.time_division = time_division <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'M... | Class representing MIDI header information.
Parameters
----------
format : specify MIDI format 0, 1, or 2
number_of_tracks : number of tracks, optional. Default: 0
time_division : number, optional. Default: 480 | 62598f9499cbb53fe6830b79 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.