code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ProviderException(Exception): <NEW_LINE> <INDENT> def __unicode__(self): <NEW_LINE> <INDENT> return self.args[0] <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if sys.version_info < (3,): <NEW_LINE> <INDENT> return self.__bytes__() <NEW_LINE> <DEDENT> return self.__unicode__() <NEW_LINE> <DEDENT> def ... | If a provider could not return information | 62598f7cdc8b845886d52f4b |
class DeleteLabelResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_NewAccessToken(self): <NEW_LINE> <INDENT> return self._output.get('NewAccessToken', None) <NEW_LINE> <DEDENT> def get_ResponseStatusCode(self): <NEW_LINE> <... | A ResultSet with methods tailored to the values returned by the DeleteLabel Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598f7c07d97122c4216638 |
class KatcpSyntaxError(ValueError): <NEW_LINE> <INDENT> pass | Exception raised by parsers on encountering syntax errors. | 62598f7c38b623060ffa8a2e |
class Place(db.Model, CRUDMixin, MarshmallowMixin): <NEW_LINE> <INDENT> __schema__ = PlaceSchema <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> unique = db.Column(db.String(255), unique=True, default=id_generator) <NEW_LINE> name = db.Column(db.String(255)) <NEW_LINE> description = db.Column(db.Stri... | Description.
:param int id: the database object identifier
:param str unique: alpha-numeric code for shorthand identifier
:param str name: what the place is called
:param int :
:param int :
:param int :
:param int :
:param int :
:param int : | 62598f7cbe8e80087fbbe9f8 |
class NiamotoPortalTaxonDataPublisher(TaxonDataPublisher): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_key(cls): <NEW_LINE> <INDENT> return 'portal_taxa' <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_description(cls): <NEW_LINE> <INDENT> return "Publish the Niamoto taxonomy formatted for the Niamoto " ... | Publish taxon at the Niamoto portal format. | 62598f7cd4950a0f3b110b00 |
@override_settings(MIDDLEWARE_CLASSES = TEST_MIDDLEWARE) <NEW_LINE> class AdminInlines(BaseGrantTestCase): <NEW_LINE> <INDENT> fixtures = LIVE_FIXTURES <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.logInAdmin() <NEW_LINE> <DEDENT> def test_organization(self): <NEW_LINE> <INDENT> organization = models.Organizatio... | Verify basic display of related inlines for grants objects in admin | 62598f7c29b78933be269da7 |
class RegisterFixedHeaderScript(UpgradeStep): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> self.install_upgrade_profile() | Register fixed header script.
| 62598f7c8e71fb1e983bb44d |
class DuplicateDUIDFilter(SimpleListFilter): <NEW_LINE> <INDENT> title = _('Duplicate DUIDs') <NEW_LINE> parameter_name = 'duplicate_duid' <NEW_LINE> def lookups(self, request: HttpRequest, model_admin: admin.ModelAdmin) -> Iterable[Tuple[str, str]]: <NEW_LINE> <INDENT> return (('yes', _('DUID on different ports')), ) ... | Filter on multiple DUIDs per remote-id/interface-id | 62598f7c1d351010ab8f34d6 |
class FontMeasurements(object): <NEW_LINE> <INDENT> def __init__(self, font): <NEW_LINE> <INDENT> aWidget = wx.GetApp().mainFrame <NEW_LINE> dc = wx.ClientDC(aWidget) <NEW_LINE> oldWidgetFont = aWidget.GetFont() <NEW_LINE> try: <NEW_LINE> <INDENT> dc.SetFont(font) <NEW_LINE> aWidget.SetFont(font) <NEW_LINE> self.height... | Measurements that we cache with each font | 62598f7c0383005118f6d099 |
class ClassName(TestCase): <NEW_LINE> <INDENT> def test_calculator(self): <NEW_LINE> <INDENT> self.assertEqual(5, calculator(2,3,'add')) | docstring for . | 62598f7c15baa72349461917 |
class _Head(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> @abc.abstractproperty <NEW_LINE> def name(self): <NEW_LINE> <INDENT> raise NotImplementedError('Calling an abstract method.') <NEW_LINE> <DEDENT> @abc.abstractproperty <NEW_LINE> def logits_dimension(self): <NEW_LINE> <INDENT> raise NotImpl... | Interface for the head/top of a model.
Given logits (or output of a hidden layer), a Head knows how to compute
predictions, loss, train_op, metrics and export outputs. It is meant to:
1. Simplify writing model_fn and to make model_fn more configurable
2. Support wide range of machine learning models. Since most heads... | 62598f7cbe383301e0253190 |
class Student: <NEW_LINE> <INDENT> def __init__(self, first_name, last_name, age): <NEW_LINE> <INDENT> self.first_name = first_name <NEW_LINE> self.last_name = last_name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def to_json(self): <NEW_LINE> <INDENT> return self.__dict__ | A student | 62598f7c287bf620b6271550 |
class Example(object): <NEW_LINE> <INDENT> def __init__(self, article, abstract_sentences, vocab, hps): <NEW_LINE> <INDENT> self.hps = hps <NEW_LINE> start_decoding = vocab.word2id(data.START_DECODING) <NEW_LINE> stop_decoding = vocab.word2id(data.STOP_DECODING) <NEW_LINE> article_words = article.split() <NEW_LINE> if ... | Class representing a train/val/test example for text summarization. | 62598f7cb57a9660fecd1416 |
class Generator: <NEW_LINE> <INDENT> def __init__(self, n_classes, name='Generator'): <NEW_LINE> <INDENT> self.n_classes = n_classes <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def __call__(self, tensor_in, condition=None, training=None): <NEW_LINE> <INDENT> norm = get_normalization(NORMALIZATION, training) <NEW_LI... | Class that defines the generator. | 62598f7c1f5feb6acb1625ce |
class LiveReaderBase(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__data = None <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> child_name = self.__class__.__name__ <NEW_LINE> try: <NEW_LINE> <INDENT> return self.__data[key] <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT... | A base object for data that can be retrieved on demand. | 62598f7c6fece00bbaccb31f |
class Skill(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=500) | model for skill | 62598f7cd10714528d69d866 |
class ReviewItem(scrapy.Item): <NEW_LINE> <INDENT> title = scrapy.Field() <NEW_LINE> description = scrapy.Field() <NEW_LINE> rating = scrapy.Field() <NEW_LINE> datePublished = scrapy.Field() <NEW_LINE> upvotes = scrapy.Field() <NEW_LINE> downvotes = scrapy.Field() <NEW_LINE> reviewer = scrapy.Field() | Review item | 62598f7c16aa5153ce3ffe97 |
class MultiLiteralAsserter(grok.Adapter): <NEW_LINE> <INDENT> grok.context(IMultiLiteralPredicateHandler) <NEW_LINE> grok.provides(IAsserter) <NEW_LINE> def characterize(self, obj): <NEW_LINE> <INDENT> context = aq_inner(self.context) <NEW_LINE> return [(rdflib.URIRef(context.predicateURI), rdflib.Literal(i.strip())) f... | Describes subjects using predicates with multiple literal complementary objects. | 62598f7c30c21e258be981a0 |
class Window (QMainWindow): <NEW_LINE> <INDENT> def _init_(self, parent=None): <NEW_LINE> <INDENT> super()._init_(parent) <NEW_LINE> self.setWindowTitle('QMainWindow') <NEW_LINE> self.setCentralWidget(QLabel("I am Central Widget")) <NEW_LINE> self._createMenu() <NEW_LINE> self._createToolBar() <NEW_LINE> self._createSt... | Main Window. | 62598f7c21bff66bcd7225fe |
class ParameterViolation(Exception): <NEW_LINE> <INDENT> pass | Invalid parameter values cause these - usually we just return -inf for probability and continue | 62598f7c287bf620b6271551 |
class PrivateUserApiTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = create_user( email='test@test.com', password='testpass', name='fname', ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(user=self.user) <NEW_LINE> <DEDENT> def test_retrieve_profile_s... | Test api requests that require authentication | 62598f7c94891a1f408b93bb |
class EnvSetting(object): <NEW_LINE> <INDENT> def __init__(self, setting, varname, type=None): <NEW_LINE> <INDENT> self.setting = setting <NEW_LINE> self.varname = varname <NEW_LINE> if type is not None: <NEW_LINE> <INDENT> self.type = type <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.type = str <NEW_LINE> <DEDEN... | An (optionally typed) setting read from an environment variable. | 62598f7cb5575c28eb712992 |
class PersistentQueryExampleSerializer(DocumentSerializer): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> model = PersistentQueryExample <NEW_LINE> fields = ["id", "user_id", "content", "templates", "name"] <NEW_LINE> read_only_fields = ("id", "user_id") <NEW_LINE> <DEDENT> def create(self, validated_data... | Persistent query example | 62598f7cf8510a7c17d7de45 |
class Property(BaseEmitter): <NEW_LINE> <INDENT> _SUFFIX = '_value' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Property, self).__init__(*args, **kwargs) <NEW_LINE> self._defaults = inspect.getargspec(self._func).defaults <NEW_LINE> <DEDENT> def __set__(self, instance, value): <NEW_LINE> <... | A value that is gettable and settable.
| 62598f7cbe383301e0253192 |
class LogisticRegression: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.learned = False <NEW_LINE> self.weights = np.NaN <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def logistic_function(logistic_input): <NEW_LINE> <INDENT> return 1 / (1 + np.exp(-logistic_input)) <NEW_LINE> <DEDENT> def grad(self, ... | Logistic Regression classifier with gradient descent implementation | 62598f7c66673b3332c2fd5e |
class TestResetPasswordStep1Model(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 testResetPasswordStep1Model(self): <NEW_LINE> <INDENT> pass | ResetPasswordStep1Model unit test stubs | 62598f7c10dbd63aa1c7054a |
class BlockUserForm(UserForm): <NEW_LINE> <INDENT> to_user = forms.CharField(widget=forms.HiddenInput) <NEW_LINE> def clean_to_user(self): <NEW_LINE> <INDENT> to_username = self.cleaned_data["to_user"] <NEW_LINE> try: <NEW_LINE> <INDENT> User.objects.get(username=to_username) <NEW_LINE> <DEDENT> except User.DoesNotExis... | Provides form for a specific user to block another specific user from contacting them. | 62598f7cac7a0e7691f71eb2 |
class OrderViewset(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, mixins.DestroyModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated, IsOwnerOrReadOnly) <NEW_LINE> authentication_classes = (JSONWebTokenAuthentication, SessionAuthentication) <NEW_LIN... | 订单管理
list:
获取个人订单
delete:
删除订单
create:
新增订单 | 62598f7c30dc7b766599f1f3 |
class ShellCliCompleter(Completer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root = {'gcloud': gcloud_tree} <NEW_LINE> self.index = 0 <NEW_LINE> self.experimental_autocomplete_enabled = ExperimentalAutocompleteEnabled() <NEW_LINE> <DEDENT> def get_completions(self, doc, complete_event): <NEW_LIN... | A prompt_toolkit shell CLI completer. | 62598f7cfb3f5b602db47e7d |
class Flow: <NEW_LINE> <INDENT> def __init__( self, ID = 'Flow', msg = None ): <NEW_LINE> <INDENT> self.ID = ID <NEW_LINE> self.msg = Messenger( ID + '_msg', 3, stdout ) if msg is None else msg <NEW_LINE> self.algs = list() <NEW_LINE> self.data = dict() <NEW_LINE> self.pars = dict() <NEW_LINE> self.msg( 'Debug', 'Fl... | Main sequencer. It controls everything that is linked to it and executes a list of algorithms. | 62598f7ca05bb46b3848a216 |
class RandomWalk(): <NEW_LINE> <INDENT> def __init__(self, numofpoints=5000): <NEW_LINE> <INDENT> self.numofpoints = numofpoints <NEW_LINE> self.xval = [0] <NEW_LINE> self.yval = [0] <NEW_LINE> <DEDENT> def fillWalk(self): <NEW_LINE> <INDENT> while len(self.xval) < self.numofpoints: <NEW_LINE> <INDENT> xdirection = cho... | A class to generate random walks. | 62598f7cd99f1b3c44d05047 |
class DeleteLiveDomainResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId") | DeleteLiveDomain返回参数结构体
| 62598f7cbe8e80087fbbe9fc |
class RawDataTask(models.Model): <NEW_LINE> <INDENT> profile_id = models.IntegerField(null=False) <NEW_LINE> start_date = models.DateField(null=False) <NEW_LINE> end_date = models.DateField(null=False) <NEW_LINE> command = models.CharField(max_length=50) <NEW_LINE> email = models.EmailField(max_length=50) <NEW_LINE> is... | WD web类型profile日志model | 62598f7c8a349b6b43685bdd |
class HybridSequential(HybridBlock): <NEW_LINE> <INDENT> def __init__(self, prefix=None, params=None): <NEW_LINE> <INDENT> super(HybridSequential, self).__init__(prefix=prefix, params=params) <NEW_LINE> <DEDENT> def add(self, *blocks): <NEW_LINE> <INDENT> for block in blocks: <NEW_LINE> <INDENT> self.register_child(blo... | Stacks HybridBlocks sequentially.
Example::
net = nn.HybridSequential()
# use net's name_scope to give child Blocks appropriate names.
with net.name_scope():
net.add(nn.Dense(10, activation='relu'))
net.add(nn.Dense(20))
net.hybridize() | 62598f7ca4f1c619b294df88 |
class ImportSU2MeshData(Operator, ImportHelper): <NEW_LINE> <INDENT> bl_idname = "import_su2.mesh_data" <NEW_LINE> bl_label = "Import SU2 Mesh Data" <NEW_LINE> filename_ext = ".su2" <NEW_LINE> filter_glob = StringProperty( default="*.su2", options={'HIDDEN'}, ) <NEW_LINE> use_setting = BoolProperty( name="Example Boole... | This appears in the tooltip of the operator and in the generated docs | 62598f7c1d351010ab8f34da |
class GetRegionResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_NewAccessToken(self): <NEW_LINE> <INDENT> return self._output.get('NewAccessToken', None) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> retu... | A ResultSet with methods tailored to the values returned by the GetRegion Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598f7c507cdc57c63a4728 |
class MatrixSubspaces(MatrixReductions): <NEW_LINE> <INDENT> def columnspace(self, simplify=False): <NEW_LINE> <INDENT> reduced, pivots = self.echelon_form(simplify=simplify, with_pivots=True) <NEW_LINE> return [self.col(i) for i in pivots] <NEW_LINE> <DEDENT> def nullspace(self, simplify=False): <NEW_LINE> <INDENT> re... | Provides methods relating to the fundamental subspaces
of a matrix. Should not be instantiated directly. | 62598f7cc432627299fa2974 |
class PropertyEffect(DefaultEffect): <NEW_LINE> <INDENT> def __init__(self, user: Entity, name: str): <NEW_LINE> <INDENT> super().__init__(user, name, None) | Should be implemented when referring to an effect that is not mentioned | 62598f7c596a89723612760e |
class update_referint(Updater): <NEW_LINE> <INDENT> referint_dn = DN(('cn', 'referential integrity postoperation'), ('cn', 'plugins'), ('cn', 'config')) <NEW_LINE> def execute(self, **options): <NEW_LINE> <INDENT> root_logger.debug("Upgrading referential integrity plugin configuration") <NEW_LINE> ldap = self.api.Backe... | Update referential integrity configuration to new style
http://directory.fedoraproject.org/docs/389ds/design/ri-plugin-configuration.html
old attr -> new attr
nsslapd-pluginArg0 -> referint-update-delay
nsslapd-pluginArg1 -> referint-logfile
nsslapd-pluginArg2 -> referint-logchanges
nsslapd-plugi... | 62598f7c3eb6a72ae0389fde |
class MappingCompressedResource(athena.MappingResource): <NEW_LINE> <INDENT> implements(inevow.IResource) <NEW_LINE> def __init__(self, mapping): <NEW_LINE> <INDENT> self.mapping = mapping <NEW_LINE> <DEDENT> def canCompress(self, req): <NEW_LINE> <INDENT> value = req.getHeader('accept-encoding') <NEW_LINE> if value is... | L{inevow.IResource} which looks up segments in a mapping between symbolic
names and the files they correspond to. Additionally if a compressed version
is present and content negotiation allows zipped resources, the zipped
file is preferred
@type mapping: C{dict}
@ivar mapping: A map between symbolic, requestable names... | 62598f7ce76e3b2f99fd83cf |
class ErpServiceApiResponse: <NEW_LINE> <INDENT> def __init__(self, response, results, mime_parts): <NEW_LINE> <INDENT> self.response = response <NEW_LINE> self.success = response.ok <NEW_LINE> self.results = results <NEW_LINE> self.mime_parts = mime_parts <NEW_LINE> self.value = None <NEW_LINE> <DEDENT> def __str__(se... | response class to capture the detials | 62598f7c50485f2cf55da90d |
class _AbstractNonTopPbType(with_metaclass(ABCMeta, object)): <NEW_LINE> <INDENT> @abstractproperty <NEW_LINE> def name(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> name.fget.__annotations__ = {"return": str} <NEW_LINE> @property <NEW_LINE> def num_pb(self): <NEW_LINE> <INDENT> return 1 <NEW... | Forward declaration of abstract base classes for leaf pb_type and intermediate pb_type. | 62598f7cd53ae8145f917e33 |
class _Transformer(object): <NEW_LINE> <INDENT> def __init__(self, columns_to_tensors): <NEW_LINE> <INDENT> self._columns_to_tensors = columns_to_tensors <NEW_LINE> <DEDENT> def transform(self, feature_column): <NEW_LINE> <INDENT> logging.debug('Transforming feature_column %s', feature_column) <NEW_LINE> if feature_col... | Handles all the transformations defined by FeatureColumn if needed.
FeatureColumn specifies how to digest an input column to the network. Some
feature columns require data transformations. This class handles those
transformations if they are not handled already.
Some features may be used in more than one place. For e... | 62598f7c8a43f66fc4bf1b1b |
class WindowsPath(Path, PureWindowsPath): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def is_mount(self): <NEW_LINE> <INDENT> raise NotImplementedError("Path.is_mount() is unsupported on this system") | Path subclass for Windows systems.
On a Windows system, instantiating a Path should return this object. | 62598f7cbe8e80087fbbe9fe |
class Login(auth_views.LoginView): <NEW_LINE> <INDENT> template_name = 'accounts/login.html' | Login view. | 62598f7c0fa83653e46f488d |
class CardSerializer(ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Card <NEW_LINE> fields = (CARD_UNIQUE_ID, CARD_PARENT_DECK, CARD_FRONT, CARD_BACK) | This serializes the Card model | 62598f7c8e05c05ec3f6eb15 |
class HackMember(HierarchyMember): <NEW_LINE> <INDENT> async def convert(self, ctx, arg): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> member = await super().convert(ctx, arg) <NEW_LINE> return member.id <NEW_LINE> <DEDENT> except commands.BadArgument: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return int(arg) <NEW_L... | A member converter that also allows arbitrary IDs to be passed. | 62598f7cd10714528d69d86b |
class QueryParameter(object): <NEW_LINE> <INDENT> def __init__(self, parameter): <NEW_LINE> <INDENT> self.parameter = parameter <NEW_LINE> <DEDENT> def match(self, value): <NEW_LINE> <INDENT> if callable(self.parameter): <NEW_LINE> <INDENT> return self.parameter(value) <NEW_LINE> <DEDENT> return bool(value == self.para... | Generic query parameter class. Can be overwritten to allow more specific queries parameters. | 62598f7c23e79379d538be96 |
class Node: <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.left = None <NEW_LINE> self.right = None <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "{}".format(self.value) | Individual node in tree. | 62598f7ca4f1c619b294df8a |
class BaseSearchFilterBackend(BaseFilterBackend, FilterBackendMixin): <NEW_LINE> <INDENT> query_backends = [] <NEW_LINE> matching = DEFAULT_MATCHING_OPTION <NEW_LINE> search_param = api_settings.SEARCH_PARAM <NEW_LINE> def get_search_query_params(self, request): <NEW_LINE> <INDENT> query_params = request.query_params.c... | Base search filter backend. | 62598f7c66673b3332c2fd62 |
class Detail_(SamlBase): <NEW_LINE> <INDENT> c_tag = 'detail' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = SamlBase.c_children.copy() <NEW_LINE> c_attributes = SamlBase.c_attributes.copy() <NEW_LINE> c_child_order = SamlBase.c_child_order[:] <NEW_LINE> c_cardinality = SamlBase.c_cardinality.copy() | The http://schemas.xmlsoap.org/soap/envelope/:detail element | 62598f7c23e79379d538be97 |
class FakeFilesyncDatabase(store.FilesyncDatabase): <NEW_LINE> <INDENT> connection_factory = FakeConnection | A FilesyncDatabase that createse FakeConnection. | 62598f7c16aa5153ce3ffe9d |
class HomeKitBatterySensor(HomeKitEntity): <NEW_LINE> <INDENT> def get_characteristic_types(self): <NEW_LINE> <INDENT> return [ CharacteristicsTypes.BATTERY_LEVEL, CharacteristicsTypes.STATUS_LO_BATT, CharacteristicsTypes.CHARGING_STATE, ] <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_class(self) -> str: <NEW_LIN... | Representation of a Homekit battery sensor. | 62598f7c596a897236127610 |
class ImmutableBase(type): <NEW_LINE> <INDENT> def __setattr__(cls, name, value): <NEW_LINE> <INDENT> raise AttributeError("Cannot alter '{}' class".format(pp_class(cls))) | Any class that uses this base class as a metaclass cannot have class
level attributes set on it. | 62598f7c29b78933be269daa |
class CourseRunEnrollmentFactory(DjangoModelFactory): <NEW_LINE> <INDENT> user = SubFactory(UserFactory) <NEW_LINE> run = SubFactory(CourseRunFactory) <NEW_LINE> order = SubFactory("ecommerce.factories.OrderFactory") <NEW_LINE> class Params: <NEW_LINE> <INDENT> has_company_affiliation = Trait(company=SubFactory(Company... | Factory for CourseRunEnrollment | 62598f7cc432627299fa2976 |
class RootAndPresetTests(SynchronousTestCase): <NEW_LINE> <INDENT> def test_root(self): <NEW_LINE> <INDENT> core = MimicCore(Clock(), []) <NEW_LINE> root = MimicRoot(core).app.resource() <NEW_LINE> (response, content) = self.successResultOf(request_with_content( self, root, 'GET', '/')) <NEW_LINE> self.assertEqual(200,... | Tests for ``/`` (handled by :func:`MimicRoot.help`) and
``/mimic/v1.0/presets`` (handled by :func:`MimicRoot.get_mimic_presets`)
These are placeholder tests because these two endpoints don't do much yet. | 62598f7cfb3f5b602db47e7f |
class CreateVehicleCategoryVehicleCategoryForm(object): <NEW_LINE> <INDENT> swagger_types = { 'name': 'str', 'owner': 'int', 'type': 'int' } <NEW_LINE> attribute_map = { 'name': 'name', 'owner': 'owner', 'type': 'type' } <NEW_LINE> def __init__(self, name=None, owner=None, type=None): <NEW_LINE> <INDENT> self._name = N... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f7c3eb6a72ae0389fe0 |
class FeedsNavigation(Navigation): <NEW_LINE> <INDENT> usedfor = IFeedsApplication <NEW_LINE> newlayer = FeedsLayer <NEW_LINE> @stepto('+index') <NEW_LINE> def redirect_index(self): <NEW_LINE> <INDENT> return self.redirectSubTree( 'https://help.launchpad.net/Feeds', status=301) <NEW_LINE> <DEDENT> def traverse(self, na... | Navigation for `IFeedsApplication`. | 62598f7c8da39b475be02b82 |
class FamilyAdmin(CurrentSiteGenAdmin, VersionAdmin): <NEW_LINE> <INDENT> fieldsets = ( ('', {'fields': ('name', ('father', 'father_os', ), ('mother', 'mother_os', ), 'comments', )}), ('Daten', {'classes': ('grp-collapse grp-open', ), 'fields': ('family_rel_type', ('start_date', 'end_date', ), )}), ('Familienbäume', {'... | The FamilyAdmin class. | 62598f7c9b70327d1c57e743 |
class ModifyCustomImageAttributeRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageId = None <NEW_LINE> self.ImageName = None <NEW_LINE> self.ImageDescription = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageId = params.get("ImageId") <N... | ModifyCustomImageAttribute请求参数结构体
| 62598f7c07d97122c4216640 |
class FileReader: <NEW_LINE> <INDENT> def __init__(self,file_path): <NEW_LINE> <INDENT> self.file_path = file_path <NEW_LINE> self.open_file = open(self.file_path,"r") <NEW_LINE> self.get_line_count = 0 <NEW_LINE> <DEDENT> def getLine(self): <NEW_LINE> <INDENT> line = self.open_file.readline() <NEW_LINE> if not line: <... | Reads a file line by line without loading it into memory | 62598f7c8a43f66fc4bf1b1d |
class ScriptCollection(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_dict(cls, apps): <NEW_LINE> <INDENT> self = cls() <NEW_LINE> for script_name, app in apps.iteritems(): <NEW_LINE> <INDENT> self.scripts[script_name] = app <NEW_LINE> <DEDENT> return self <NEW_LINE> <DEDENT> @property <NEW_LINE> def scr... | organize a pile of applications by "script_name".
Mount some applications at assorted uri's
>>> from webob import Request, Response
>>> collection = ScriptCollection.from_dict(
... {'': Response(body="Welcome"),
... '/beer': exc.HTTPUnauthorized("21 and Over"),
... '/foo/bar/baz/long... | 62598f7cf7d966606f747986 |
class User: <NEW_LINE> <INDENT> username = None <NEW_LINE> account = None <NEW_LINE> admin = False <NEW_LINE> access = {} <NEW_LINE> system = False <NEW_LINE> is_active = True | A request User. | 62598f7c63f4b57ef0085a3d |
class BeckeWPart(WPart): <NEW_LINE> <INDENT> name = 'b' <NEW_LINE> options = ['lmax', 'k'] <NEW_LINE> linear = True <NEW_LINE> def __init__(self, coordinates, numbers, pseudo_numbers, grid, moldens, spindens=None, local=True, lmax=3, k=3): <NEW_LINE> <INDENT> self._k = k <NEW_LINE> WPart.__init__(self, coordinates, num... | Becke partitioning with Becke-Lebedev grids | 62598f7c15baa7234946191f |
class ExpressRouteServiceProvider(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': '... | A ExpressRouteResourceProvider object.
Variables are only populated by the server, and will be ignored when sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Resource location.
:type location: str
:para... | 62598f7c73bcbd0ca4bc9bef |
class SettingValue: <NEW_LINE> <INDENT> def __init__(self, config: dict): <NEW_LINE> <INDENT> self.value = None <NEW_LINE> self.name = config.get('name') <NEW_LINE> self.description = config.get('description') <NEW_LINE> self.reboot_rule = config.get('reboot_rule') <NEW_LINE> self.multi_select = config.get('multi_selec... | Base Settings Value class.
It represents single setting configuration. | 62598f7c9b70327d1c57e744 |
class State(object): <NEW_LINE> <INDENT> def __init__(self, name, image, *atlist, **properties): <NEW_LINE> <INDENT> if image and not isinstance(image, renpy.display.core.Displayable): <NEW_LINE> <INDENT> image = renpy.easy.displayable(image) <NEW_LINE> <DEDENT> self.name = name <NEW_LINE> self.image = image <NEW_LINE>... | This creates a state that can be used in a SMAnimation. | 62598f7c1f037a2d8b9e3a8a |
@inherit_doc <NEW_LINE> class VectorSizeHint(JavaTransformer, HasInputCol, HasHandleInvalid, JavaMLReadable, JavaMLWritable): <NEW_LINE> <INDENT> size = Param(Params._dummy(), "size", "Size of vectors in column.", typeConverter=TypeConverters.toInt) <NEW_LINE> handleInvalid = Param(Params._dummy(), "handleInvalid", "Ho... | A feature transformer that adds size information to the metadata of a vector column.
VectorAssembler needs size information for its input columns and cannot be used on streaming
dataframes without this metadata.
.. note:: VectorSizeHint modifies `inputCol` to include size metadata and does not have an
outputCol.
... | 62598f7c15baa72349461920 |
class KidsHandler(logging.Handler): <NEW_LINE> <INDENT> def __init__(self, port=3388, host="localhost", topic=None): <NEW_LINE> <INDENT> super(KidsHandler, self).__init__() <NEW_LINE> self.kids = redis.StrictRedis(host=host, port=port) <NEW_LINE> self.formatter = KidsFormatter() <NEW_LINE> self.topic = topic <NEW_LINE>... | Kids Log Handler.
| 62598f7cfb3f5b602db47e80 |
class FlightDataFilter(django_filters.rest_framework.FilterSet): <NEW_LINE> <INDENT> flight_type = django_filters.NumberFilter(field_name='flight_type') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = FlightData <NEW_LINE> fields = ['flight_type'] | FlightData过滤器 | 62598f7cb57a9660fecd141e |
class RandomExchange(Exchange): <NEW_LINE> <INDENT> lag_time = 0 <NEW_LINE> def __init__(self, starting_balance, market, start_date=0, lag_time=0): <NEW_LINE> <INDENT> self.balance = starting_balance <NEW_LINE> self.lag_time=lag_time <NEW_LINE> self.supported_pairs = { TradingPair('btc/usd'), TradingPair('eth/usd'), } ... | Randomized buy/sell. Sumulate exchange behavior for testing purposes. | 62598f7c21bff66bcd722606 |
class checkinTimeProp(SchemaProperty): <NEW_LINE> <INDENT> _prop_schema = 'checkinTime' <NEW_LINE> _expected_schema = None <NEW_LINE> _enum = False <NEW_LINE> _format_as = "DateTimeField" | SchemaField for checkinTime
Usage: Include in SchemaObject SchemaFields as your_django_field = checkinTimeProp()
schema.org description:The earliest someone may check into a lodging establishment.
prop_schema returns just the property without url#
format_as is used by app templatetags based upon schema.org datatype | 62598f7ca79ad161977699ff |
class ListenerValidator(ValidatorBase): <NEW_LINE> <INDENT> def _validateArgs(self, listener, paramsInfo): <NEW_LINE> <INDENT> if (paramsInfo.getAllArgs() == ()) and paramsInfo.acceptsAllUnnamedArgs: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if paramsInfo.getAllArgs() == (): <NEW_LINE> <INDENT> msg = 'Must have at... | Accept one arg or *args; accept any **kwarg,
and require that the Listener have at least all the kwargs (can
have extra) of Topic. | 62598f7cdc8b845886d52f55 |
class NoUserAccessException(APIException): <NEW_LINE> <INDENT> status_code = status.HTTP_403_FORBIDDEN <NEW_LINE> detail = "You do not have access to this resource." | Default exception when a user tries to access something they do not have permission for | 62598f7c6fece00bbaccb327 |
class RevokeTree(object): <NEW_LINE> <INDENT> def __init__(self, revoke_events=None): <NEW_LINE> <INDENT> self.revoke_map = dict() <NEW_LINE> self.add_events(revoke_events) <NEW_LINE> <DEDENT> def add_event(self, event): <NEW_LINE> <INDENT> revoke_map = self.revoke_map <NEW_LINE> for key in attr_keys(event): <NEW_LINE>... | Fast Revocation Checking Tree Structure
The Tree is an index to quickly match tokens against events.
Each node is a hashtable of key=value combinations from revocation events.
The | 62598f7c50485f2cf55da911 |
class HostStdErr(Transform): <NEW_LINE> <INDENT> def transform(self, **kwargs): <NEW_LINE> <INDENT> from girder_worker.docker.io import ( StdStreamWriter ) <NEW_LINE> return StdStreamWriter(sys.stderr) | Represents the standard error stream on the host machine. Can be used with
:py:class:`girder_worker.docker.transforms.Connect` to write text to stderr. | 62598f7c8da39b475be02b84 |
@register_localizer('moc') <NEW_LINE> class MocLocalizer(GeodesicLocalizer): <NEW_LINE> <INDENT> DEFAULT_RESOLUTION_M = 1e-3 <NEW_LINE> BODY = Geodesic(MARS_RADIUS_M, 0.0) <NEW_LINE> def __init__(self, metadata): <NEW_LINE> <INDENT> super(MocLocalizer, self).__init__( metadata.lines / 2.0, metadata.samples / 2.0, metad... | A localizer for the MOC observations (subclass of
:py:class:`GeodesicLocalizer`) | 62598f7c596a897236127612 |
class PCF8574: <NEW_LINE> <INDENT> def __init__(self,itf,addr=0x20): <NEW_LINE> <INDENT> self.itf = itf <NEW_LINE> self.addr = addr <NEW_LINE> <DEDENT> def read(self): <NEW_LINE> <INDENT> return self.itf.read(self.addr,None,1) <NEW_LINE> <DEDENT> def write(self,data): <NEW_LINE> <INDENT> self.itf.write(self.addr,None,d... | Operate a PCF8574 chip. PCF8574 is a Remote 8-Bit I/O
Expander for I2C BUS | 62598f7c07d97122c4216642 |
class RecordsSource(AbstractSource, MemorySourceMixin): <NEW_LINE> <INDENT> def __init__(self, records, sheet_name=DEFAULT_SHEET_NAME, **keywords): <NEW_LINE> <INDENT> self.__records = records <NEW_LINE> self._content = _FakeIO() <NEW_LINE> self.__sheet_name = sheet_name <NEW_LINE> AbstractSource.__init__(self, **keywo... | A list of dictionaries as data source
The dictionaries should have identical fields. | 62598f7ca4f1c619b294df8d |
class Target(Sprite): <NEW_LINE> <INDENT> def __init__(self, screen_rect): <NEW_LINE> <INDENT> super(Target, self).__init__() <NEW_LINE> self.rect = pygame.Rect(400, 0, 100, 100) <NEW_LINE> self.color = (255, 0, 0) <NEW_LINE> self.rect.midright = screen_rect.midright <NEW_LINE> self.speed = 1 | Target class to define target | 62598f7ccad5886f8bdc4cc4 |
class IotHubSkuInfo(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, 'tier': {'readonly': True}, 'capacity': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, 'capacity': {'key': 'capacity', 'ty... | Information about the SKU of the IoT hub.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar name: Required. The name of the SKU. Possible values include: "F1", "S1", "S2", "S3".
:vartype name: str or ~azu... | 62598f7c287bf620b6271559 |
class PurchasePlanAutoGenerated(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'publisher': {'required': True}, 'name': {'required': True}, 'product': {'required': True}, } <NEW_LINE> _attribute_map = { 'publisher': {'key': 'publisher', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'product'... | Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
All required parameters must be populated in order to send to Azure.
:ivar publisher: Required. The publisher ID.
:vartype publisher: str
:ivar name: Required. The plan ID.
:vartype name: str
:ivar product: Required. Specifies t... | 62598f7cf8510a7c17d7de49 |
class StrVector(Vector): <NEW_LINE> <INDENT> _factorconstructor = rinterface.baseenv['factor'] <NEW_LINE> def __init__(self, obj): <NEW_LINE> <INDENT> obj = rinterface.StrSexpVector(obj) <NEW_LINE> super(StrVector, self).__init__(obj) <NEW_LINE> <DEDENT> def factor(self): <NEW_LINE> <INDENT> res = self._factorconstruct... | Vector of string elements | 62598f7c23e79379d538be9a |
class ModelWithBlank(Model): <NEW_LINE> <INDENT> name = CharField(max_length=200, blank=True, null=True) <NEW_LINE> slug = AutoSlugField(populate_from='name', blank=True) | >>> a = ModelWithBlank.objects.create(name=None)
>>> a.slug is None
False
>>> a.slug == ''
True | 62598f7cd10714528d69d870 |
class DejaVu: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._lock = threading.RLock() <NEW_LINE> self._unique_items = set() <NEW_LINE> <DEDENT> def seen(self, item, auto_append=True): <NEW_LINE> <INDENT> if item in self._unique_items: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if auto_append... | class to keep track of already seen items | 62598f7c0383005118f6d0a3 |
class AddressList(object): <NEW_LINE> <INDENT> def __init__(self, newsletter, ignore_errors=False): <NEW_LINE> <INDENT> self.newsletter = newsletter <NEW_LINE> self.ignore_errors = ignore_errors <NEW_LINE> self.addresses = {} <NEW_LINE> <DEDENT> def add(self, email, name=None, location='unknown location'): <NEW_LINE> <... | List with unique addresses. | 62598f7c4e696a045264dad1 |
class FolderZipAdapter(DefaultZipAdapter): <NEW_LINE> <INDENT> export_as_folder = True <NEW_LINE> @property <NEW_LINE> def filename(self): <NEW_LINE> <INDENT> return super(FolderZipAdapter, self).filename + '/' | Export a NyFolder | 62598f7cd6c5a102081e1ae9 |
class CubicSplineSegment(object): <NEW_LINE> <INDENT> def __init__(self, x1, x2, f1, f2, g1, g2): <NEW_LINE> <INDENT> self.x1 = x1 <NEW_LINE> self.x2 = x2 <NEW_LINE> self.A = np.array([[x1**3, x1**2, x1, 1.0], [x2**3, x2**2, x2, 1.0], [3*x1**2, 2*x1, 1.0, 0.0], [3*x2**2, 2*x2, 1.0, 0.0]]) <NEW_LINE> self.b = np.array([... | cubic splines and the their derivatives with with respect to the variables and the parameters | 62598f7c0a366e3fb87dc36d |
class AbstractComponent(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def iternodes(self): <NEW_LINE> <INDENT> yield self | This is an abstract component | 62598f7c9b70327d1c57e747 |
class FlagHandler: <NEW_LINE> <INDENT> def __init__(self, aFlags): <NEW_LINE> <INDENT> self._aFlags = aFlags <NEW_LINE> self._validFlagValues = range(1, self._aFlags.itemsize()*8+1) <NEW_LINE> <DEDENT> def getFlags(self): <NEW_LINE> <INDENT> return self._aFlags <NEW_LINE> <DEDENT> def getValidFlagValues(self): <NEW_LIN... | NAM: FlagHandler (Class)
DES: Provides methods to manipulate and query flag arrays bitwise.
Here, a flag array is a Numeric.array, each element of which
represents n independent flags, with n the number of bits of
each array element. The n independent flags are enumerated with
the flag value, rangin... | 62598f7c29b78933be269dac |
class WireInstruction: <NEW_LINE> <INDENT> def __init__( self, lval: t.Union[str, int], op_name: str, rval: t.Union[str, int], out_wire: str ): <NEW_LINE> <INDENT> self.lval = lval <NEW_LINE> self.op_name = op_name <NEW_LINE> self.op = OPS[op_name] <NEW_LINE> self.rval = rval <NEW_LINE> self.out_wire = out_wire <NEW_LI... | Represent a wiring instruction for little Bobby Tables' circuit diagram.
The following instructions are supported:
* INPUT: "l -> wire"
* NOT: "NOR r -> wire"
* AND: "l AND r -> wire"
* OR: "l OR r -> wire"
* LSHIFT: "l LSHIFT r -> wire"
* RSHIFT: "l RSHIFT r -> wire"
Where l and r can either ... | 62598f7c1f5feb6acb1625d8 |
class AdGroupAudienceViewServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.GetAdGroupAudienceView = channel.unary_unary( '/google.ads.googleads.v2.services.AdGroupAudienceViewService/GetAdGroupAudienceView', request_serializer=google_dot_ads_dot_googleads__v2_dot_proto_dot_s... | Proto file describing the AdGroup Audience View service.
Service to manage ad group audience views. | 62598f7cdc8b845886d52f57 |
class NetworksService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'networks' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(ComputeAlpha.NetworksService, self).__init__(client) <NEW_LINE> self._method_configs = { 'Delete': base_api.ApiMethodInfo( http_method=u'DELETE', method_id=u'compute.n... | Service class for the networks resource. | 62598f7ca4f1c619b294df8f |
class IQBlogStarLayer(IDefaultPloneLayer): <NEW_LINE> <INDENT> pass | Marker interface that defines a Zope 3 browser layer.
| 62598f7c91af0d3eaad397ad |
class MySyntaxWarning(MySyntaxProblems) : <NEW_LINE> <INDENT> pass | Syntax warning Exceptions used by parser | 62598f7c8a43f66fc4bf1b21 |
class TransformerDecoderLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"): <NEW_LINE> <INDENT> super(TransformerDecoderLayer, self).__init__() <NEW_LINE> self.self_attn = MultiheadAttention(d_model, nhead, dropout=dropout) <NEW_LINE> self.mult... | TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network.
This standard decoder layer is based on the paper "Attention Is All You Need".
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez,
Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you... | 62598f7c287bf620b627155b |
class BayesianModel(Module, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def log_prior_density(self) -> tf.Tensor: <NEW_LINE> <INDENT> if self.trainable_parameters: <NEW_LINE> <INDENT> return tf.add_n([p.log_prior_density() for p in self.trainable_parameters]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return to_defa... | Bayesian model. | 62598f7cb5575c28eb712997 |
class TestKeyPhraseBatchResultV2(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 testKeyPhraseBatchResultV2(self): <NEW_LINE> <INDENT> pass | KeyPhraseBatchResultV2 unit test stubs | 62598f7ca17c0f6771d5bbe7 |
class Campuses(models.Model): <NEW_LINE> <INDENT> name = models.CharField(verbose_name='校区', max_length=64) <NEW_LINE> address = models.CharField(verbose_name='详细地址', max_length=512, blank=True, null=True) | 校区表 | 62598f7c94891a1f408b93c0 |
class JarLibrary(Target): <NEW_LINE> <INDENT> class WrongTargetTypeError(Exception): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> class ExpectedAddressError(Exception): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, payload=None, jars=None, **kwargs): <NEW_LINE> <INDENT> payload = payload or Payload() ... | A set of jars that may be depended upon. | 62598f7cd10714528d69d871 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.