code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class MissingProviderToken(APNsException): <NEW_LINE> <INDENT> pass | No provider certificate was used to connect to APNs and Authorization header was missing or no provider token was specified. | 62598ee0cb5e8a47e493b46c |
class PageNotFound(Exception): <NEW_LINE> <INDENT> pass | Exception raised when a page does not exist | 62598ee0baa26c4b54d4d8b7 |
class City: <NEW_LINE> <INDENT> def __init__(self, x:float, y:float): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def distance_to_city(self, city): <NEW_LINE> <INDENT> x_distance = abs(self.x - city.x) <NEW_LINE> y_distance = abs(self.y - city.y) <NEW_LINE> euclidean = np.sqrt(x_distance**2... | Representation of a city
:attribute x: X Coordinate
:attribute y: Y Coordinate | 62598ee04527f215b58e84ec |
class PartialHandler(QObject): <NEW_LINE> <INDENT> partial_matches = pyqtSignal(str, object) <NEW_LINE> partial_cleared = pyqtSignal() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.count = TempKeyStorage() <NEW_LINE> self.keys = TempKeyStorage() <NEW_LINE> self.keys.timeout.conne... | Handle partial matches and counts for EventHandlerMixin.
Attributes:
count: TempKeyStorage for counts.
keys: TempKeyStorage for partially matched keys.
Signals:
partial_matches: Emitted when there are partial matches for a keybinding.
arg1: Prefix for which partial matches exist.
arg2: Ite... | 62598ee045492302aabfaa99 |
class GroupedTable(object): <NEW_LINE> <INDENT> def __init__(self, java_table, t_env): <NEW_LINE> <INDENT> self._j_table = java_table <NEW_LINE> self._t_env = t_env <NEW_LINE> <DEDENT> def select(self, *fields: Union[str, Expression]): <NEW_LINE> <INDENT> if all(isinstance(f, Expression) for f in fields): <NEW_LINE> <I... | A table that has been grouped on a set of grouping keys. | 62598ee099fddb7c1ca620f9 |
class Role(UserMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = "roles" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return f'Post{self.name}' | class modelling the role of each user | 62598ee099cbb53fe682f498 |
class ServerDetails(messages.Message): <NEW_LINE> <INDENT> server_version = messages.StringField(1) <NEW_LINE> bot_version = messages.StringField(2) <NEW_LINE> machine_provider_template = messages.StringField(3) <NEW_LINE> display_server_url_template = messages.StringField(4) <NEW_LINE> luci_config = messages.StringFie... | Reports details about the server. | 62598ee038b623060ffa767b |
class TestCoder: <NEW_LINE> <INDENT> def test_coder_special_clones_party_member(self): <NEW_LINE> <INDENT> anya_the_wizard = Wizard('Anya') <NEW_LINE> cleo_the_coder = Coder('Cleo') <NEW_LINE> party = Party([anya_the_wizard, cleo_the_coder]) <NEW_LINE> cleo_the_coder.special(anya_the_wizard) <NEW_LINE> assert len(party... | The coder's special clones a party member. The new character is included in the party, and their name is the
reverse of their originator - for example, 'Lucy' would become 'Ycul'. Coders cannot clone Coders! | 62598ee03eb6a72ae0388c28 |
class OutputModel(Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> table_name = "poc-fifo-q-output" <NEW_LINE> region = "us-east-1" <NEW_LINE> billing_mode = pynamodb.models.PAY_PER_REQUEST_BILLING_MODE <NEW_LINE> <DEDENT> gid = UnicodeAttribute(hash_key=True) <NEW_LINE> processed = ListAttribute(of=NumberAt... | This model can store up to 82500 member. For example this object is appr
256KB in dynamodb:
{
gid: "1",
processed: [1, 2, ..., 82500]
} | 62598ee0442bda511e95aa4e |
class RefLeaveRequestStatusSerializer(AbstractBaseSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = RefLeaveRequestStatus <NEW_LINE> fields = [ 'id', 'leave_request_status_name', 'description' ] + AbstractBaseSerializer.Meta.fields | This model contains the serializer for lEAVE REQUEST STATUS model | 62598ee09c8ee8231303f44b |
class Generated_Twitter_Test(DataSet): <NEW_LINE> <INDENT> def __init__(self, inst=None): <NEW_LINE> <INDENT> DataSet.__init__(self, inst=inst) <NEW_LINE> if inst is None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return "gen_twittertest" <NEW_LINE> <... | Manually generated Twitter testing dataset. | 62598ee0adb09d7d5dc08bae |
class ComputeTargetHttpsProxiesSetSslCertificatesRequest(_messages.Message): <NEW_LINE> <INDENT> project = _messages.StringField(1, required=True) <NEW_LINE> targetHttpsProxiesSetSslCertificatesRequest = _messages.MessageField('TargetHttpsProxiesSetSslCertificatesRequest', 2) <NEW_LINE> targetHttpsProxy = _messages.Str... | A ComputeTargetHttpsProxiesSetSslCertificatesRequest object.
Fields:
project: Project ID for this request.
targetHttpsProxiesSetSslCertificatesRequest: A
TargetHttpsProxiesSetSslCertificatesRequest resource to be passed as the
request body.
targetHttpsProxy: Name of the TargetHttpsProxy resource to set a... | 62598ee0f7d966606f7465d7 |
class EpetraCommWrapper(AbstractCommWrapper): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.epetra_comm = Epetra.PyComm() <NEW_LINE> super(EpetraCommWrapper, self).__init__() <NEW_LINE> <DEDENT> @property <NEW_LINE> def procID(self): <NEW_LINE> <INDENT> return self.epetra_comm.MyPID() <NEW_LINE> <DED... | MPI Communicator wrapper
Encapsulates capabilities needed for Epetra.
Some capabilities are not parallel. | 62598ee023849d37ff84f6a1 |
class MetricCacheMixin: <NEW_LINE> <INDENT> def __init__(self, cache_man): <NEW_LINE> <INDENT> self.cache_man = cache_man <NEW_LINE> super().__init__() <NEW_LINE> <DEDENT> def get_key(self, host_id): <NEW_LINE> <INDENT> raise Exception("Define in derived/mixin") <NEW_LINE> <DEDENT> def get_metrics_base(self, rc_describ... | Mixin for metrics_* classes to get Caching | 62598ee056ac1b37e63007d3 |
class Record(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.entry_name = None <NEW_LINE> self.data_class = None <NEW_LINE> self.molecule_type = None <NEW_LINE> self.sequence_length = None <NEW_LINE> self.accessions = [] <NEW_LINE> self.created = None <NEW_LINE> self.sequence_update = None <NE... | Holds information from a SwissProt record.
Attributes:
- entry_name Name of this entry, e.g. RL1_ECOLI.
- data_class Either 'STANDARD' or 'PRELIMINARY'.
- molecule_type Type of molecule, 'PRT',
- sequence_length Number of residues.
- accessions List of the accession numbers, e.g. ['P003... | 62598ee02ae34c7f260a96cf |
class RepeatDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, input_dataset, count): <NEW_LINE> <INDENT> super(RepeatDataset, self).__init__() <NEW_LINE> self._input_dataset = input_dataset <NEW_LINE> if count is None: <NEW_LINE> <INDENT> self._count = constant_op.constant(-1, dtype=dtypes.int64, name="count") <... | A `Dataset` that repeats its input several times. | 62598ee023849d37ff84f6a2 |
class VarDB(): <NEW_LINE> <INDENT> priority_from_type = {'Bool': 1, 'Rat': 2} <NEW_LINE> def __init__(self, stats): <NEW_LINE> <INDENT> self.stats = stats <NEW_LINE> self.vars = {} <NEW_LINE> self.watches = Watches() <NEW_LINE> self.pq = MaxPriorityQ() <NEW_LINE> <DEDENT> def add(self, var): <NEW_LINE> <INDENT> assert ... | Variables database
Handles:
- priority of assignment
- mapping name -> Var (??? unicity of name)
- semantic propagation | 62598ee076e4537e8c3edb9f |
class RetrieveInOrderSentence(interface.WordChooserInterface): <NEW_LINE> <INDENT> def __init__(self, lesson): <NEW_LINE> <INDENT> self.lesson = lesson <NEW_LINE> self.index = 0 <NEW_LINE> self.sentence_ind = 0 <NEW_LINE> self.retriever = RetrieveInOrder(lesson.chord_translation_dict, lesson.chords_list) <NEW_LINE> <DE... | Retrieve words in order, but display sentence for context. | 62598ee032920d7e50bc4615 |
class SvDualMeshNode(bpy.types.Node, SverchCustomTreeNode): <NEW_LINE> <INDENT> bl_idname = 'SvDualMeshNode' <NEW_LINE> bl_label = "Dual Mesh" <NEW_LINE> bl_icon = 'OUTLINER_OB_EMPTY' <NEW_LINE> sv_icon = 'SV_DUAL_MESH' <NEW_LINE> def sv_init(self, context): <NEW_LINE> <INDENT> self.inputs.new('SvVerticesSocket', 'Vert... | Trigers: Dual Mesh
Tooltip: Create dual mesh for the given mesh | 62598ee0097d151d1a2bf606 |
class rhs_fenics_mesh(object): <NEW_LINE> <INDENT> def __init__(self, init): <NEW_LINE> <INDENT> if isinstance(init, type(self)): <NEW_LINE> <INDENT> self.impl = fenics_mesh(init.impl) <NEW_LINE> self.expl = fenics_mesh(init.expl) <NEW_LINE> <DEDENT> elif isinstance(init, df.FunctionSpace): <NEW_LINE> <INDENT> self.imp... | RHS data type for meshes with implicit and explicit components
This data type can be used to have RHS with 2 components (here implicit and explicit)
Attributes:
impl (fenics_mesh): implicit part
expl (fenics_mesh): explicit part | 62598ee0656771135c487c79 |
class regnemaskine(object): <NEW_LINE> <INDENT> res=1 <NEW_LINE> tal=1 <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return('Min regnemaskine klasse 1') <NEW_LINE> <DEDENT> def __init__(self, tal , res): <NEW_LINE> <INDENT> self.res=res <NEW_LINE> self.navn = 'truttelut' <NEW_LINE> <DEDENT> def plus(self, tal): <NE... | Min regnemaskine kan meget | 62598ee09b70327d1c57d3a3 |
class RegexConverter(BaseConverter): <NEW_LINE> <INDENT> def __init__(self, url_map, regex): <NEW_LINE> <INDENT> super(RegexConverter, self).__init__(url_map) <NEW_LINE> self.regex = regex | 自定义过滤器 | 62598ee0097d151d1a2bf607 |
class TestDvirVehicle(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 DvirVehicle( ) <NEW... | DvirVehicle unit test stubs | 62598ee097e22403b38394d7 |
class NaiveBayesDependencyScorer(DependencyScorerI): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, graphs): <NEW_LINE> <INDENT> labeled_examples = [] <NEW_LINE> for graph in graphs: <NEW_LINE> <INDENT> for head_node in graph.nodelist: <NEW_LINE> <INDENT> for child_... | A dependency scorer built around a MaxEnt classifier. In this
particular class that classifier is a ``NaiveBayesClassifier``.
It uses head-word, head-tag, child-word, and child-tag features
for classification. | 62598ee00a50d4780f703991 |
class UserTestManager(Base): <NEW_LINE> <INDENT> __tablename__ = 'user_test_managers' <NEW_LINE> __table_args__ = ( UniqueConstraint('user_test_id', 'filename', name='cst_managers_user_test_id_filename'), ) <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> filename = Column(String, nullable=False) <NEW_LINE>... | Class to store additional files needed to compile or evaluate a
user test (e.g., graders). Not to be used directly (import it from
SQLAlchemyAll). | 62598ee0379a373c97d975e2 |
class Error(error.Generic): <NEW_LINE> <INDENT> pass | Base class for light controller module exceptions | 62598ee0379a373c97d975e3 |
class RewardCreateView(RewardMixin, CreateView): <NEW_LINE> <INDENT> success_url = '.' <NEW_LINE> def get_form(self, form_class): <NEW_LINE> <INDENT> form = super(RewardCreateView, self).get_form(form_class) <NEW_LINE> owned_relations = Relation.objects.owned_by(self.request.user) <NEW_LINE> form.fields['quester'].quer... | A generic view providing context information and functionality for reward creation. | 62598ee0d268445f26638e82 |
class Old_AES: <NEW_LINE> <INDENT> BLOCK_SIZE = algorithms.AES.block_size / 8 <NEW_LINE> def __init__(self, password = None, salt = None): <NEW_LINE> <INDENT> self.algorithm = 'AES' <NEW_LINE> self.storage_key = None <NEW_LINE> self.storage_key_salt = salt <NEW_LINE> self.backend = default_backend() <NEW_LINE> if passw... | Old and insecure AES encryption. | 62598ee07b25080760ed5a83 |
class UserProfile(db.Document): <NEW_LINE> <INDENT> meta = {'collection': 'user_profile'} <NEW_LINE> nick_name = db.StringField(required=True, max_length=24) <NEW_LINE> email = db.EmailField(required=True) <NEW_LINE> role_id = db.StringField(max_length=20, choices=PERMISSION, default=PERMISSION[1]) <NEW_LINE> real_name... | User profile information. | 62598ee0dd821e528d6d752f |
class MountedDataDisk(messages.Message): <NEW_LINE> <INDENT> dataDisk = messages.StringField(1) | A MountedDataDisk object.
Fields:
dataDisk: A string attribute. | 62598ee13cc13d1c6d463d54 |
class NoSuchAttributeException(WebDriverException): <NEW_LINE> <INDENT> pass | Thrown when the attribute of element could not be found.
You may want to check if the attribute exists in the particular browser you are
testing against. Some browsers may have different property names for the same
property. (IE8's .innerText vs. Firefox .textContent) | 62598ee1d6c5a102081e0719 |
class ListImagesTest(base.BaseV2ImageTest): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(ListImagesTest, cls).setUpClass() <NEW_LINE> for x in xrange(0, 10): <NEW_LINE> <INDENT> cls._create_standard_image(x) <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def _create_s... | Here we test the listing of image information | 62598ee18e71fb1e983ba059 |
class NullData(LightData): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(NullData, self).__init__() <NEW_LINE> self.DeviceFamily = 'Null' | This is known only within the Null family package. | 62598ee13617ad0b5ee04717 |
class Users(UserMixin, Model): <NEW_LINE> <INDENT> username = CharField(unique=True) <NEW_LINE> email = CharField(unique=True) <NEW_LINE> password = CharField(max_length=100) <NEW_LINE> is_admin = BooleanField(default=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'users' <NEW_LINE> database = DATABASE <N... | User model for app users | 62598ee14428ac0f6e656b3b |
class ServiceWorkersTest(pbtest.PBSeleniumTest): <NEW_LINE> <INDENT> def get_tab_data_domains(self): <NEW_LINE> <INDENT> domains = self.js( "let tabData = chrome.extension.getBackgroundPage().badger.tabData;" "return (Object.keys(tabData).map(tab_id => {" " return tabData[tab_id].frames[0].host;" "}));" ) <NEW_LINE> r... | Verifies interaction with sites that use Service Worker caches | 62598ee14e4d562566370a02 |
class NgwPluginSettings(PluginSettings): <NEW_LINE> <INDENT> _company_name = 'NextGIS' <NEW_LINE> _product = 'NextGIS WEB API' <NEW_LINE> @classmethod <NEW_LINE> def remove_ngw_connection(cls, connection_name): <NEW_LINE> <INDENT> settings = cls.get_settings() <NEW_LINE> key = '/connections/' + connection_name <NEW_LIN... | Settings class for working with ngw connection settings | 62598ee1adb09d7d5dc08bb0 |
class VIEW3D_TP_OBJECT_OT_hide_select_clear(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.hide_select_clear" <NEW_LINE> bl_label = "Clear All Restrict Select" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> scn = context.scene <NEW_LINE> active_layers = [i for i, l in enumerate(scn.layers) if ... | Unlocks all visible objects | 62598ee18c0ade5d55dc2978 |
class Isalnum(Validator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.err_message = "must be numbers and letters" <NEW_LINE> self.not_message = "must not be numbers and letters" <NEW_LINE> <DEDENT> def __call__(self, value): <NEW_LINE> <INDENT> if is_str(value): <NEW_LINE> <INDENT> return value.isa... | 判断字符串中只能由字母和数字的组合,不能有特殊符号 | 62598ee1b7558d5895461c35 |
class EditNormals_Transfer(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "tp_ops.editnormals_transfer" <NEW_LINE> bl_label = "Transfer Vertex Normals" <NEW_LINE> bl_description = "Transfer shading from active object to selected objects." <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> influence = bpy.pro... | Transfers nearest worldspace vertex normals from active object to selected.
When 'Boundary Edges' is set to Only, each object checks all other objects.
Example uses: baking, mollifying lowpoly foliage, hiding sub-object seams. | 62598ee1fbf16365ca79268d |
class VolumePatch(Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'usage_threshold': {'maximum': 109951162777600, 'minimum': 107374182400}, } <NEW_LINE> _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'id': {'key': 'id', 't... | Volume patch resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param location: Resource location
:type location: str
:ivar id: Resource Id
:vartype id: str
:ivar name: Resource name
:vartype name: str
:ivar type: Resource type
:vartype type: str
:param tags: Resource t... | 62598ee16fb2d068a7693117 |
class DBRefError(DBError): <NEW_LINE> <INDENT> @property <NEW_LINE> def message(self): <NEW_LINE> <INDENT> ref = self.args[0] <NEW_LINE> return '关联数据"%(ref_desc)s", %(ref_count)d条' % {'ref_desc': ref.ref_desc, 'ref_count': ref.ref_count} | 数据关联错误。 | 62598ee14e4d562566370a03 |
class TestSoftLinks(BaseGroup): <NEW_LINE> <INDENT> def test_spath(self): <NEW_LINE> <INDENT> sl = SoftLink('/foo') <NEW_LINE> self.assertEqual(sl.path, '/foo') <NEW_LINE> <DEDENT> def test_srepr(self): <NEW_LINE> <INDENT> sl = SoftLink('/foo') <NEW_LINE> self.assertIsInstance(repr(sl), six.string_types) <NEW_LINE> <DE... | Feature: Create and manage soft links with the high-level interface | 62598ee192d797404e387e70 |
class CustomUserManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, phonenumber, password, **extra_fields): <NEW_LINE> <INDENT> if not phonenumber: <NEW_LINE> <INDENT> raise ValueError(_('The Phone Number must be set')) <NEW_LINE> <DEDENT> user = self.model(phonenumber=phonenumber, **extra_fields) <NEW... | Custom user model manager where email is the unique identifiers
for authentication instead of usernames. | 62598ee1498bea3a75a5611f |
class FrozenAttributeError(FrozenError): <NEW_LINE> <INDENT> pass | A frozen attribute has been attempted to be modified.
.. versionadded:: 20.1.0 | 62598ee12c8b7c6e89bd1da9 |
class NoLocationHintsError(Exception): <NEW_LINE> <INDENT> pass | We cannot make a connection without some location hints | 62598ee167a9b606de5445b8 |
class _ReplaceSymbols(Transformer_InPlace): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.names = {} <NEW_LINE> <DEDENT> def value(self, c): <NEW_LINE> <INDENT> if len(c) == 1 and isinstance(c[0], Symbol) and c[0].name in self.names: <NEW_LINE> <INDENT> return self.names[c[0].name] <NEW_LINE> <DEDENT... | Helper for ApplyTemplates | 62598ee1e5267d203ee69eee |
class OrgMember(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Uin = None <NEW_LINE> self.Name = None <NEW_LINE> self.Remark = None <NEW_LINE> self.JoinTime = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Uin = params.get("Uin") <NEW_LINE> self.Name ... | Information on an organization member.
| 62598ee17b25080760ed5a85 |
class NetworkInterfaceIPConfigurationPaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[NetworkInterfaceIPConfiguration]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(NetworkInterfaceIPConfigura... | A paging container for iterating over a list of :class:`NetworkInterfaceIPConfiguration <azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration>` object | 62598ee145492302aabfaa9d |
class CppycmHighlightProblemsCommand(sublime_plugin.WindowCommand): <NEW_LINE> <INDENT> def __init__(self, window): <NEW_LINE> <INDENT> global output_panel <NEW_LINE> self.window = window <NEW_LINE> self.output_panel = self.window.create_output_panel( 'CppYCM.{}'.format(self.window.id())) <NEW_LINE> self.output_panel_n... | Goto command | 62598ee14527f215b58e84f0 |
class Int(Specifier): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'int' | Unsized signed int | 62598ee167a9b606de5445b9 |
class Action31(Action): <NEW_LINE> <INDENT> def execute(self, instance): <NEW_LINE> <INDENT> raise NotImplementedError('%s not implemented' % ( str(self))) | Misc->Make a screenshot | 62598ee13eb6a72ae0388c2c |
class TestMulConvert(OPConvertAutoScanTest): <NEW_LINE> <INDENT> def sample_convert_config(self, draw): <NEW_LINE> <INDENT> input_shape0 = draw( st.lists( st.integers( min_value=2, max_value=10), min_size=2, max_size=4)) <NEW_LINE> input_shape1 = input_shape0.copy() <NEW_LINE> input_shape1.reverse() <NEW_LINE> size = l... | api: paddle.fluid.layers.mul
OPset version: 7, 9, 15 | 62598ee10a50d4780f703994 |
class PicamFrameProcessor(FrameProcessor): <NEW_LINE> <INDENT> def _init_video_capture(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _run_capture(self): <NEW_LINE> <INDENT> pass | Placeholder class in the event that we decide to use the RPi
camera, has to pull frames differently than USB cameras.
ToDo: Implement. | 62598ee18a43f66fc4bf075d |
@dataclasses.dataclass(init=True, repr=True, eq=False, order=False, unsafe_hash=False, frozen=True) <NEW_LINE> class AaveLiquidationEvent(AaveEvent): <NEW_LINE> <INDENT> collateral_asset: Asset <NEW_LINE> collateral_balance: Balance <NEW_LINE> principal_asset: Asset <NEW_LINE> principal_balance: Balance <NEW_LINE> def ... | A simple event of the Aave protocol. Deposit or withdrawal | 62598ee1851cf427c66b68bc |
class PasswordResetConfirm(PasswordResetConfirmView): <NEW_LINE> <INDENT> template_name = "login/password_reset_confirm.html" <NEW_LINE> success_url = reverse_lazy("reset_complete") <NEW_LINE> extra_context = {'form': ResetPasswordForm} | Controlador donde se establece la nueva contraseña del usuario. | 62598ee1a79ad16197768602 |
class InvalidResourceMethod(BitGoResourceException): <NEW_LINE> <INDENT> pass | Raised when an invalid method was passed
to be used for requesting a resource's endpoint
could not be found.This happens when neither
'GET','POST','PUT' or 'DELETE' was found as a valid
http(s) method | 62598ee19c8ee8231303f44d |
class NormalStudentVisibilityTest(MasqueradeTestCase): <NEW_LINE> <INDENT> def create_user(self): <NEW_LINE> <INDENT> return UserFactory() <NEW_LINE> <DEDENT> @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) <NEW_LINE> def test_staff_debug_not_visible(self): <NEW_LINE> <INDENT> self.verify_s... | Verify the course displays as expected for a "normal" student (to ensure test setup is correct). | 62598ee16aa9bd52df0d3499 |
class TestMonsterType: <NEW_LINE> <INDENT> def test1(self): <NEW_LINE> <INDENT> simple1 = np.dtype({'names': ['r', 'b'], 'formats': ['u1', 'u1'], 'titles': ['Red pixel', 'Blue pixel']}) <NEW_LINE> a = np.dtype([('yo', int), ('ye', simple1), ('yi', np.dtype((int, (3, 2))))]) <NEW_LINE> b = np.dtype([('yo', int), ('ye', ... | Test deeply nested subtypes. | 62598ee1eab8aa0e5d30a363 |
class Tiling(object): <NEW_LINE> <INDENT> def __init__(self, target, reference_frequency, overlap): <NEW_LINE> <INDENT> self._beams = [] <NEW_LINE> self.target = target <NEW_LINE> self.reference_frequency = reference_frequency <NEW_LINE> self.overlap = overlap <NEW_LINE> self.tiling = None <NEW_LINE> <DEDENT> @property... | Wrapper class for a collection of beams in a tiling pattern
| 62598ee1e64d504609df86b5 |
class StringIOu(StringIO): <NEW_LINE> <INDENT> def __init__(self, buf=''): <NEW_LINE> <INDENT> StringIO.__init__(self, universal_newlines(buf)) | StringIO which converts all new line formats in buf to POSIX newlines. | 62598ee110dbd63aa1c6f15c |
class myGui(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.win = Tk() <NEW_LINE> self.win.title("My Book Store") <NEW_LINE> self.create_widgets() <NEW_LINE> self.start_gui() <NEW_LINE> <DEDENT> def create_widgets(self): <NEW_LINE> <INDENT> l1 = Label(self.win, text = "Title") <NEW_LINE> l2 = ... | docstring for myGui. | 62598ee163d6d428bbee0dbe |
class MigratePackages(Operation): <NEW_LINE> <INDENT> def __init__(self, from_gphome, to_gphome, standby_host, segment_host_list): <NEW_LINE> <INDENT> self.from_gphome = from_gphome <NEW_LINE> self.to_gphome = to_gphome <NEW_LINE> self.standby_host = standby_host <NEW_LINE> self.segment_host_list = segment_host_list <N... | Migrates packages from another $GPHOME to this one
This functionality is meant to facilitate minor version upgrade, whereby old packages
need to be brought over from the older $GPHOME to the newer $GPHOME.
Presumably, this could also be used to migrate packages across arbitrary choices
of $GPHOMEs. However, the migra... | 62598ee1a8ecb0332586f7d3 |
class WeatherForecast(models.Model): <NEW_LINE> <INDENT> smarthome = models.ForeignKey( 'smarthome.SmartHome', verbose_name=_("Smart Home that this Weather Forecast belongs to"), on_delete=models.CASCADE, ) <NEW_LINE> created_at = models.DateTimeField( auto_created=True, auto_now_add=True, db_index=True, verbose_name=_... | A Speedtest Entry is a special sensor that belongs to a smarthome | 62598ee155399d3f05624b1b |
class Data_Clean(): <NEW_LINE> <INDENT> def __init__(self, interact_pth='data/user-item-interactions.csv', articles_pth='data/articles_community.csv'): <NEW_LINE> <INDENT> self.interacts_clean = None <NEW_LINE> self.articles_clean = None <NEW_LINE> self.interacts = pd.read_csv(interact_pth) <NEW_LINE> self.articles = ... | This Data_Clean is used to build the dataset, clean the dataset | 62598ee13c8af77a43b67228 |
class Telescope(OpticalElement, ConnectableDevice): <NEW_LINE> <INDENT> def __init__(self, diameter, transmission): <NEW_LINE> <INDENT> ConnectableDevice.__init__(self) <NEW_LINE> OpticalElement.__init__(self, transmission) <NEW_LINE> self.diameter = diameter | A Telescope. | 62598ee1a8370b77170ee9d0 |
class TrackComment(ndb.Model): <NEW_LINE> <INDENT> comment = ndb.TextProperty(required=True, indexed=True) <NEW_LINE> dtCreated = ndb.DateTimeProperty(auto_now_add=True) <NEW_LINE> rank = ndb.IntegerProperty(default=0, required=True) <NEW_LINE> user = ndb.StringProperty(required=True) | Track class for storing in GAE, all fields are required and Track is its parent | 62598ee1b7558d5895461c37 |
class Dice(object): <NEW_LINE> <INDENT> def __init__(self, dice_count=2, values=range(1, 7)): <NEW_LINE> <INDENT> self.dice_count = dice_count <NEW_LINE> self.values = values <NEW_LINE> <DEDENT> def roll(self): <NEW_LINE> <INDENT> return sum(random.choice(self.values) for _ in range(self.dice_count)) | Represents a set of game dice.
Args:
dice_count (int): Number of dice in the game.
range (list): List of possible dice values. | 62598ee157b8e32f525073fb |
class FileCache(object): <NEW_LINE> <INDENT> def __init__(self,dir): <NEW_LINE> <INDENT> self._dir=dir <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> <DEDENT> def set_tile(self,group,x,y,z,binary): <NEW_LINE> <INDENT> with self._lock: <NEW_LINE> <INDENT> set_cache_to_file(self._dir,group,z,x,y,binary) <NEW_LINE> <... | ファイル保存 | 62598ee1097d151d1a2bf60a |
class ZenMakeDirNotFoundError(ZenMakePathNotFoundError): <NEW_LINE> <INDENT> def __init__(self, path, msg = None): <NEW_LINE> <INDENT> if not msg: <NEW_LINE> <INDENT> msg = "Directory %r doesn't exist." % path <NEW_LINE> <DEDENT> super().__init__(path, msg) | Directory doesn't exist | 62598ee191af0d3eaad38403 |
class NameUnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> INVALID = "Invalid" <NEW_LINE> ALREADY_EXISTS = "AlreadyExists" | reason of name unavailable.
| 62598ee1796e427e5384cd84 |
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 1200 <NEW_LINE> self.screen_height = 800 <NEW_LINE> self.bg_color = (230, 230, 230) <NEW_LINE> self.ship_limit = 3 <NEW_LINE> self.bullet_width = 3 <NEW_LINE> self.bullet_height = 15 <NEW_LINE> self.bullet_color = (60, 60,... | 存储《外星人入侵》相关配置的类 | 62598ee192d797404e387e71 |
class SyncProxyOrganizationRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Agent = None <NEW_LINE> self.ProxyOrganizationName = None <NEW_LINE> self.UniformSocialCreditCode = None <NEW_LINE> self.BusinessLicense = None <NEW_LINE> self.Operator = None <NEW_LINE> <DEDENT> def _des... | SyncProxyOrganization请求参数结构体
| 62598ee12c8b7c6e89bd1dab |
class require(object): <NEW_LINE> <INDENT> def __init__(self, *attr_names): <NEW_LINE> <INDENT> self.attr_names = attr_names <NEW_LINE> <DEDENT> def __call__(self, func): <NEW_LINE> <INDENT> @wraps(func) <NEW_LINE> def wrapper(*args, **kwargs): <NEW_LINE> <INDENT> cinemate = __get_cinemate__(args[0]) <NEW_LINE> if not ... | Декоратор проверяет наличие указанных атрибутов у объекта cinemate.
| 62598ee1925a0f43d25e6619 |
class Dataset(Container): <NEW_LINE> <INDENT> def __init__(self, data=None, meta=None, loader=None, name=None): <NEW_LINE> <INDENT> Container.__init__(self, loader=loader) <NEW_LINE> self._data = data <NEW_LINE> self._name = name <NEW_LINE> if meta is not None: <NEW_LINE> <INDENT> self._meta.update(OrderedDict(meta)) <... | A generic container for RecordingSequence, SyncRecording, Recording, and TSeries instances that
were acquired together.
The boundaries between one experiment and the next are sometimes ambiguous, but
in general we group multiple recordings into an experiment if they are likely to
be analyzed together. Likewise, record... | 62598ee1cad5886f8bdc38ec |
@inherit_doc <NEW_LINE> @ignore_unicode_prefix <NEW_LINE> class Word2Vec(JavaEstimator, HasStepSize, HasMaxIter, HasSeed, HasInputCol, HasOutputCol): <NEW_LINE> <INDENT> vectorSize = Param(Params._dummy(), "vectorSize", "the dimension of codes after transforming from words") <NEW_LINE> numPartitions = Param(Params._dum... | Word2Vec trains a model of `Map(String, Vector)`, i.e. transforms a word into a code for further
natural language processing or machine learning process.
>>> sent = ("a b " * 100 + "a c " * 10).split(" ")
>>> doc = sqlContext.createDataFrame([(sent,), (sent,)], ["sentence"])
>>> model = Word2Vec(vectorSize=5, seed=42,... | 62598ee1f548e778e5969b82 |
class Config: <NEW_LINE> <INDENT> REPODIR = os.environ.get('REPODIR', '/mnt/data/repos') <NEW_LINE> VIRTUAL_ENV = os.environ.get('VIRTUAL_ENV', '/edx/app/edxapp/venvs/edxapp') <NEW_LINE> LMS_CFG = os.environ.get('LMS_CFG', '/edx/etc/lms.yml') <NEW_LINE> REVISION_CFG = os.environ.get('REVISION_CFG', '/edx/etc/revisions.... | Configuration for the app | 62598ee13539df3088eca89e |
class AgentState(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.state = None <NEW_LINE> <DEDENT> def clone(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def clone_state(self): <NEW_LINE> <INDENT> return self.state.clone() <NEW_LINE> <DEDENT> def get_state(self): <NEW_LINE> <INDENT> retu... | AgentState class.
Agent state is a class that specifies current agent behaviour. It
provides methods that describe the way agent cooperate with
percepted stimulus coming from environment.
@attention: You can redefine or change this class to provide new
functionality to an agent. It is recommended to change AgentState... | 62598ee1460517430c430a75 |
class InactivityMode(GXIntEnum): <NEW_LINE> <INDENT> NONE = 0 <NEW_LINE> KEEPALIVE = 1 <NEW_LINE> REOPEN = 2 <NEW_LINE> REOPENACTIVE = 3 <NEW_LINE> DISCONNECT = 4 | Enumerates inactivity modes that are used, when communicating with IEC
using serial port connection. | 62598ee1379a373c97d975e7 |
class xmerge (xbase.xbase): <NEW_LINE> <INDENT> def __init__(self, input0 = None, input1 = None, comp = cmp): <NEW_LINE> <INDENT> self.__in0, self.__in1 = xbase.xsingle_buffer(input0), xbase.xsingle_buffer(input1) <NEW_LINE> self.__comp = comp <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <IND... | Merges two sorted sequences.
Produces a sorted sequence. Optionally can take a comparision
object.
Stability: If equivalent elements occur in both input sequences,
the output sequence contains all equivalent elements from the
first input sequence, followed by all equivalent elements from
the second input sequence.
... | 62598ee132920d7e50bc4619 |
class Production(object): <NEW_LINE> <INDENT> def __init__(self, *terms): <NEW_LINE> <INDENT> self.terms = terms <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return " ".join(str(t) for t in self.terms) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if not isinstance(other, Production): ... | docstring for Production | 62598ee199fddb7c1ca620fc |
class Wallpost(PolymorphicModel): <NEW_LINE> <INDENT> author = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('author'), related_name="%(class)s_wallpost", blank=True, null=True) <NEW_LINE> editor = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('editor'), blank=True, null=True, help_text=_("The... | The Wallpost base class. This class will never be used directly because the content of a Wallpost is always defined
in the child classes.
Implementation Note: Normally this would be an abstract class but it's not possible to make this an abstract class
and have the polymorphic behaviour of sorting on the common fields... | 62598ee1c432627299fa15a3 |
class DeleteMeasurementTag(DeleteView): <NEW_LINE> <INDENT> template_name = "delete_base.html" <NEW_LINE> model = MeasurementTag <NEW_LINE> success_url = reverse_lazy('list_measurement_tag') | View to delete a MeasurementTag | 62598ee1d58c6744b42db5ad |
class DisplayTests(FunctionalTests): <NEW_LINE> <INDENT> def test_notes_displaying(self): <NEW_LINE> <INDENT> list_of_notes = self.full_list_of_notes() <NEW_LINE> todo = list_of_notes[1] <NEW_LINE> python_work = list_of_notes[4] <NEW_LINE> note_lines = data("notes/TODO-list").splitlines() <NEW_LINE> note_lines[0] = ( "... | Tests for the 'display' action. | 62598ee13d592f4c4edb94e1 |
class TestCaseRemove_Student(TestCourse): <NEW_LINE> <INDENT> def test_remove_student_nil(self): <NEW_LINE> <INDENT> self.csc148.remove_student(self.david) <NEW_LINE> <DEDENT> def test_remove_student_simple(self): <NEW_LINE> <INDENT> self.csc148.add_student(self.david) <NEW_LINE> self.csc148.add_student(self.bill) <NEW... | Test cases for Course.remove_student(student_obj)
There should not be any raised errors whether or not student_obj is in
the list of students of the Course | 62598ee17d43ff24874266f2 |
class AlarmLevelListViewSet(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = AlarmLevel.objects.all() <NEW_LINE> serializer_class = AlarmLevelSerializer | This viewset will provide 'list' action. | 62598ee16e29344779afec1b |
class StateList(object): <NEW_LINE> <INDENT> pass | .. deprecated:: 0.5.0
use flag instead
Base class for a set of states that can be set by a relation or layer.
This class should be used so that they can be discovered and introspected,
for documentation, composition, or linting.
Example usage::
class MyRelation(RelationBase):
class states(StateList):... | 62598ee18c0ade5d55dc297a |
class WorkerSetupRequest(object): <NEW_LINE> <INDENT> def __init__(self, opts, args, default_dir): <NEW_LINE> <INDENT> self.id = 'worker_setup' <NEW_LINE> self.opts = opts <NEW_LINE> self.args = args <NEW_LINE> self.default_dir = default_dir <NEW_LINE> <DEDENT> def id(self): <NEW_LINE> <INDENT> return self.__class__.__... | Request the worker to run the setup function. | 62598ee1cc0a2c11144795f0 |
class DorsaleBaseAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> view_on_site = False <NEW_LINE> def save_model(self, request, obj, form, change): <NEW_LINE> <INDENT> if not change: <NEW_LINE> <INDENT> if hasattr(obj, 'createdby'): <NEW_LINE> <INDENT> obj.createdby = request.user <NEW_LINE> <DEDENT> if hasattr(obj, 'creat... | ModelAdmin for DorsaleBaseModels, automaticalls sets createdby,
createdon, lastchangedby, lastchangedon, site and deleted fields.
Beware, this overrides "queryset" and "has_change_permissions"!
TODO: Permissions
TODO: see http://www.stereoplex.com/blog/filtering-dropdown-lists-in-the-django-admin | 62598ee1d53ae8145f916a79 |
class LiuEtAl2006NSRC(NormalizedSlipRateCalculator): <NEW_LINE> <INDENT> def __call__(self, time_delta, rise_time, validate=True): <NEW_LINE> <INDENT> if validate is True: <NEW_LINE> <INDENT> assert(is_pos_number(rise_time)) <NEW_LINE> <DEDENT> if rise_time <= time_delta: <NEW_LINE> <INDENT> return np.array([0, 1 / tim... | Normalized slip rate calculator of Liu et al. (2006). | 62598ee176e4537e8c3edba5 |
class Portal: <NEW_LINE> <INDENT> def __init__(self, debug=False): <NEW_LINE> <INDENT> self.debug = debug <NEW_LINE> <DEDENT> def get(self, debug=False): <NEW_LINE> <INDENT> request = Request() <NEW_LINE> url = 'http://www.meethue.com/api/nupnp' <NEW_LINE> status, content = request.get(url) <NEW_LINE> if debug: <NEW_LI... | @status: Done | 62598ee124f1403a92684b9b |
class CConsole: <NEW_LINE> <INDENT> def __init__( self, session_manager, stdin = None, stdout = None, fSplit = False ): <NEW_LINE> <INDENT> self.m_ci = CConsoleInternal( session_manager, stdin, stdout, fSplit ) <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> return self.m_ci.start() <NEW_LINE> <DEDENT> def joi... | Interface to a debugger console. | 62598ee1097d151d1a2bf60c |
class UnitBuilding(UnitLiving): <NEW_LINE> <INDENT> name_struct = "unit_building" <NEW_LINE> name_struct_file = "unit" <NEW_LINE> struct_description = "construction graphics and garrison building properties for units." <NEW_LINE> data_format = ( (READ_EXPORT, None, IncludeMembers(cls=UnitLiving)), (READ_EXPORT... | type_id >= 80 | 62598ee107f4c71912bada43 |
class Role(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'roles' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(64), unique=True) <NEW_LINE> default = db.Column(db.Boolean, default=False, index=True) <NEW_LINE> permissions = db.Column(db.Integer) <NEW_LINE> users = db.rel... | 角色表
User 普通用户
Publisher 发布者
Moderator 审查者
Administrator 管理者 | 62598ee16fb2d068a7693119 |
class Pilot: <NEW_LINE> <INDENT> compteur = 0 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.name = PILOT[Pilot.compteur] <NEW_LINE> self.normal_speed = random()+0.5 <NEW_LINE> self.rapid_speed = random()+0.5 <NEW_LINE> self.subtle_speed = random()+0.5 <NEW_LINE> Pilot.compteur += 1 | Set up a pilot with a name | 62598ee19b70327d1c57d3a9 |
class StructureOrNoneRelated(models.Model): <NEW_LINE> <INDENT> structure = models.ForeignKey(Structure, on_delete=models.CASCADE, verbose_name=_("Related structure"), blank=True, null=True) <NEW_LINE> objects = models.Manager() <NEW_LINE> check_structure_in_forms = True <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstr... | A mixin used for any entities that belong to a structure or None entity | 62598ee191af0d3eaad38405 |
class Move: <NEW_LINE> <INDENT> def __init__(self, board, x, y, value): <NEW_LINE> <INDENT> self._board = board <NEW_LINE> self._x = x <NEW_LINE> self._y = y <NEW_LINE> self._value = value <NEW_LINE> <DEDENT> @property <NEW_LINE> def valid(self): <NEW_LINE> <INDENT> return self._board[self._x, self._y] == Tile.EMPTY <N... | One move in a game, relative to a certain board. Immutable. | 62598ee156ac1b37e63007da |
class JobConnectionResult(models.Model): <NEW_LINE> <INDENT> results = models.ManyToManyField(TaskConnectionResult) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return '{ id:%s, results:%s }' % (self.id, self.results) <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = _(messages.PLURAL_SCAN_... | The results of a connection scan. | 62598ee1627d3e7fe0e05475 |
class PluginStorage(object): <NEW_LINE> <INDENT> def __init__(self, config, classkey): <NEW_LINE> <INDENT> self._config = config <NEW_LINE> self._classkey = classkey <NEW_LINE> self._initialized = False <NEW_LINE> self._data = None <NEW_LINE> self._storagepath = None <NEW_LINE> <DEDENT> def _initialize_storage(self): <... | Class implementing storage functionality for plugins | 62598ee1796e427e5384cd86 |
class BgpNeighborTimersConfig(elements.BaseElement): <NEW_LINE> <INDENT> _FIELDS = ("hold_time", "keepalive_interval") <NEW_LINE> def __init__(self, hold_time=None, keepalive_interval=None): <NEW_LINE> <INDENT> super(BgpNeighborTimersConfig, self).__init__(constants.CONFIG) <NEW_LINE> self.hold_time = hold_time <NEW_LI... | Neteork instance protocol(BGP/neighbor/timers/config) element. | 62598ee1462c4b4f79db9fe7 |
class StudyProgram(models.Model): <NEW_LINE> <INDENT> full_name = models.CharField( _('fullt navn'), max_length=60, help_text=_('F.eks. "Fysikk og matematikk"') ) <NEW_LINE> display_name = models.CharField( _('visningsnavn / kallenavn'), max_length=60, help_text=_('F.eks. "Fysmat"') ) <NEW_LINE> slug = AutoSlugField( p... | Contains top level information for a specific study program. | 62598ee1925a0f43d25e661b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.