code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Softmax(Algorithm): <NEW_LINE> <INDENT> def __init__(self, arms, tau, label=None, mixture_expected=False): <NEW_LINE> <INDENT> Algorithm.__init__(self, arms, label=label, mixture_expected=mixture_expected) <NEW_LINE> self.tau = tau <NEW_LINE> if self.label is None: <NEW_LINE> <INDENT> self.label = 'Softmax(t=%s)'... | Softmax(Boltzmann Exploration) Algorithm
:param tau: decides randomness of the exploration. larger tau means more randomness. | 62598edb8c0ade5d55dc2918 |
class MatrixAdditionError(MatrixError): <NEW_LINE> <INDENT> def __init__(self, m1, m2): <NEW_LINE> <INDENT> self.m1 = m1.m <NEW_LINE> self.n1 = m1.n <NEW_LINE> self.m2 = m2.m <NEW_LINE> self.n2 = m2.n <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f"Can't add {self.m1}x{self.n1} matrix with {self.m2}... | An exception for matrix additions. | 62598edba79ad16197768545 |
class Card(PayFortObject): <NEW_LINE> <INDENT> url = api_base + "/customers" <NEW_LINE> def create(self, customer_id, data): <NEW_LINE> <INDENT> return self.handle_response(requests.post( "%s/%s/cards" % (self.url, customer_id), data=data, auth=self.auth )) <NEW_LINE> <DEDENT> def retrieve(self, customer_id, card_id): ... | When you create a new Card, you must specify a Customer to create it on.
If the customer has no default card, then the new card will
become the default.
However, if the customer already has a default then it will not change.
To change the default, you should update the customer and pass the new
default_card_id. | 62598edb3c8af77a43b671c6 |
class SSConfigurationError(Exception): <NEW_LINE> <INDENT> pass | Raised when configuration fails to validate | 62598edb30dc7b766599ddb2 |
class WindowBase(EventDispatcher): <NEW_LINE> <INDENT> _resolution = None <NEW_LINE> _fullscreen = False <NEW_LINE> _caption = None <NEW_LINE> _resizable = False <NEW_LINE> _borderless = False <NEW_LINE> _minimized = False <NEW_LINE> _maximized = False <NEW_LINE> _visible = True <NEW_LINE> _vsync = True <NEW_LINE> _scr... | Platform independent window
| 62598edb16aa5153ce3fea24 |
class ReplayExceptionScheduler(object): <NEW_LINE> <INDENT> def __init__(self, scheduler): <NEW_LINE> <INDENT> self.scheduler = scheduler <NEW_LINE> self.scheduler.handlers['cause_of_failure'] = self.cause_of_failure <NEW_LINE> self.scheduler.extensions['exceptions'] = self <NEW_LINE> <DEDENT> def cause_of_failure(self... | A plugin for the scheduler to recreate exceptions locally
This adds the following routes to the scheduler
* cause_of_failure | 62598edb004d5f362081e294 |
class BasicsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.app = create_app('testing') <NEW_LINE> self.app_context = self.app.app_context() <NEW_LINE> self.app_context.push() <NEW_LINE> db.create_all() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> db.session.rem... | 基本测试用例 | 62598edb85dfad0860cbed00 |
class Hand(Graphic_object): <NEW_LINE> <INDENT> def __init__(self, controller, width, x, display_card_y): <NEW_LINE> <INDENT> Graphic_object.__init__(self, controller, PATH_IMAGE_HAND, x, display_card_y) <NEW_LINE> self.group = pygame.sprite.LayeredUpdates() <NEW_LINE> self.gridx = width/MAX_CARD_IN_HAND <NEW_LINE> sel... | classdocs | 62598edb4527f215b58e842e |
class RATING(object): <NEW_LINE> <INDENT> age = None <NEW_LINE> name = None <NEW_LINE> label = None <NEW_LINE> description = None <NEW_LINE> adult = False | Content rating.
iarc_name -- how IARC names the rating, to talk with IARC.
age -- minimum age of the rating's age recommendation.
name -- how we name the rating, for translated display on all pages.
label -- for CSS classes, to create icons.
description -- for general translated display on consumer pages. | 62598edb4428ac0f6e656a86 |
class HttpRequestContext(_messages.Message): <NEW_LINE> <INDENT> method = _messages.StringField(1) <NEW_LINE> referrer = _messages.StringField(2) <NEW_LINE> remoteIp = _messages.StringField(3) <NEW_LINE> responseStatusCode = _messages.IntegerField(4, variant=_messages.Variant.INT32) <NEW_LINE> url = _messages.StringFie... | HTTP request data that is related to a reported error. This data should
be provided by the application when reporting an error, unless the error
report has been generated automatically from Google App Engine logs. All
fields are optional.
Fields:
method: The type of HTTP request, such as `GET`, `POST`, etc.
referr... | 62598edb435de62698e9a301 |
class Rectangle: <NEW_LINE> <INDENT> pass | Represents a Rectangle.
attributes:width, height, corner. | 62598edb99cbb53fe682f3dc |
class Mask(object): <NEW_LINE> <INDENT> def __init__(self, slc, array): <NEW_LINE> <INDENT> if slc < 1: <NEW_LINE> <INDENT> raise ValueError('Invalid slice: {}'.format(slc)) <NEW_LINE> <DEDENT> self.slice = slc <NEW_LINE> self.array = array.astype(np.bool) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> ret... | Single-slice mask for a 3D image. Deprecated, use Mask3D instead.
Variables
---------
slc : integer
Slice index, one-based.
array : ndarray, shape = [height, width], dtype = bool
Two-dimensional array with selected voxels set to True. | 62598edb3eb6a72ae0388b6a |
class ResourceRelationshipsDirectFileData(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'int', 'type': 'str' } <NEW_LINE> attribute_map = { 'id': 'id', 'type': 'type' } <NEW_LINE> def __init__(self, id=None, type=None): <NEW_LINE> <INDENT> self._id = None <NEW_LINE> self._type = None <NEW_LINE> self.discriminato... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598edb009cb60464cffa7f |
class Convertible(Typed): <NEW_LINE> <INDENT> def __set__(self, instance, value): <NEW_LINE> <INDENT> if ((self.allow_none and value is not None) or not self.allow_none): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> value = self.expected_type(value) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> raise TypeError('expec... | Values must be convertible to a particular type | 62598edba219f33f346c4d63 |
class CBase58Data(bytes): <NEW_LINE> <INDENT> def __new__(cls, s): <NEW_LINE> <INDENT> k = decode(s) <NEW_LINE> addrbyte, data, check0 = k[0:1], k[1:-4], k[-4:] <NEW_LINE> check1 = bitcoin.core.Hash(addrbyte + data)[:4] <NEW_LINE> if check0 != check1: <NEW_LINE> <INDENT> raise Base58ChecksumError('Checksum mismatch: ex... | Base58-encoded data | 62598edb7cff6e4e811b3f19 |
@keras_export("keras.optimizers.schedules.InverseTimeDecay") <NEW_LINE> class InverseTimeDecay(LearningRateSchedule): <NEW_LINE> <INDENT> def __init__( self, initial_learning_rate, decay_steps, decay_rate, staircase=False, name=None): <NEW_LINE> <INDENT> super(InverseTimeDecay, self).__init__() <NEW_LINE> self.initial_... | A LearningRateSchedule that uses an inverse time decay schedule.
When training a model, it is often useful to lower the learning rate as
the training progresses. This schedule applies the inverse decay function
to an optimizer step, given a provided initial learning rate.
It requires a `step` value to compute the deca... | 62598edbd486a94d0ba2a501 |
class TestDepending(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestDepending, self).setUp() <NEW_LINE> <DEDENT> def test_get_dependencies(self): <NEW_LINE> <INDENT> connection = psycopg2.connect("dbname=test") <NEW_LINE> country, _ = depending.add_related_tables(connection, ['res... | Tests | 62598edb925a0f43d25e6559 |
class Production(object): <NEW_LINE> <INDENT> def __init__(self, name, rule, precedences, handler=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.rule = rule <NEW_LINE> self.precedences = precedences <NEW_LINE> self.handler = handler <NEW_LINE> <DEDENT> def handle(self, t): <NEW_LINE> <INDENT> if self.handl... | Production in grammar-definition. | 62598edb796e427e5384ccc4 |
class ConvolutionApproximator(nn.Module): <NEW_LINE> <INDENT> def __init__(self, action_space_size: int): <NEW_LINE> <INDENT> super(ConvolutionApproximator, self).__init__() <NEW_LINE> self.conv0 = nn.Conv2d(4, 16, kernel_size=8, stride=4) <NEW_LINE> self.conv1 = nn.Conv2d(16, 32, kernel_size=4, stride=2) <NEW_LINE> se... | Model architecture from Playing Atari with Deep Reinforcement Learning.
The input is an 84 x 84 x 4 tensor.
The first hidden layer convolves 16 8x8 filters with stride 4 and applies ReLU.
The second hidden layer convolves 32 4x4 filters with stride 2 and applies ReLU.
The final hidden layer is fully connected, and cons... | 62598edb2c8b7c6e89bd1cf5 |
class StorageAccountRegenerateKeyParameters(Model): <NEW_LINE> <INDENT> _validation = { 'key_name': {'required': True}, } <NEW_LINE> _attribute_map = { 'key_name': {'key': 'keyName', 'type': 'str'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(StorageAccountRegenerateKeyParameters, self).__init_... | The parameters used to regenerate the storage account key.
All required parameters must be populated in order to send to Azure.
:param key_name: Required. The name of storage keys that want to be
regenerated, possible vaules are key1, key2.
:type key_name: str | 62598edbdd821e528d6d7472 |
class EmailFactory(factory.django.DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Email <NEW_LINE> <DEDENT> owner = factory.Faker('name') <NEW_LINE> address = factory.Faker('email') | Client email factory. | 62598edbd99f1b3c44d03be2 |
class Bishop: <NEW_LINE> <INDENT> def move(self): <NEW_LINE> <INDENT> return "I move any number of spaces diagonally." | A simple Bishop class | 62598edb460517430c4309b4 |
class OperationsManagementClientConfiguration(Configuration): <NEW_LINE> <INDENT> def __init__( self, credential, subscription_id, provider_name, resource_type, resource_name, **kwargs ): <NEW_LINE> <INDENT> if credential is None: <NEW_LINE> <INDENT> raise ValueError("Parameter 'credential' must not be None.") <NEW_LIN... | Configuration for OperationsManagementClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials... | 62598edb91f36d47f223013a |
class AdminPermission(permissions.BasePermission): <NEW_LINE> <INDENT> message = '需要拥有管理员身份才能访问。' <NEW_LINE> def has_permission(self, request, view): <NEW_LINE> <INDENT> return ( request.user.is_authenticated and (request.user.is_department_admin or request.user.is_school_admin) ) | Department admin and school admin have access to resources. | 62598edbd58c6744b42db54c |
class V1Secret(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'api_version': 'str', 'data': 'object', 'kind': 'str', 'metadata': 'V1ObjectMeta', 'string_data': 'object', 'type': 'str' } <NEW_LINE> self.attribute_map = { 'api_version': 'apiVersion', 'data': 'data', 'kind': 'k... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598edb379a373c97d97526 |
class CLGError(Exception): <NEW_LINE> <INDENT> pass | Exception raised when there are errors. | 62598edb507cdc57c63a32df |
class SnelheidsIntervalViewSet(DatapuntViewSet): <NEW_LINE> <INDENT> queryset = models.SnelheidsInterval.objects.all().order_by("pk") <NEW_LINE> serializer_class = serializers.SnelheidsIntervalSerializer <NEW_LINE> serializer_detail_class = serializers.SnelheidsIntervalSerializer | Returns all `SnelheidsInterval instances`, ordered by id | 62598edbe5267d203ee69e2e |
class InvalidPlugin(object): <NEW_LINE> <INDENT> def __init__(self, name, description, version=u'', url=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.version = version if version is not None else u'' <NEW_LINE> self.url = url | Class with the information about plugin with errors | 62598edbd268445f26638e24 |
class GenParticle(Candidate): <NEW_LINE> <INDENT> def __init__(self,tree,entry=-1,collName='GenPart',shift=None): <NEW_LINE> <INDENT> super(GenParticle, self).__init__(tree,entry=entry,collName=collName) <NEW_LINE> self.shift = shift | Gen particle object access. | 62598edb6e29344779afeb57 |
class DescribeMountPointsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.FileSystemId = None <NEW_LINE> self.AccessGroupId = None <NEW_LINE> self.OwnerUin = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.FileSystemId = params.get("FileSystemId"... | DescribeMountPoints请求参数结构体
| 62598edba79ad16197768546 |
class Loglogistic(TPPDistribution): <NEW_LINE> <INDENT> is_reparametrizable = True <NEW_LINE> @validated() <NEW_LINE> def __init__(self, mu: Tensor, sigma: Tensor) -> None: <NEW_LINE> <INDENT> self.mu = mu <NEW_LINE> self.sigma = sigma <NEW_LINE> <DEDENT> @property <NEW_LINE> def batch_shape(self) -> Tuple: <NEW_LINE> ... | Log-logistic distribution.
A very heavy-tailed distribution over positive real numbers.
https://en.wikipedia.org/wiki/Log-logistic_distribution
Drawing :math:`x \sim \operatorname{Loglogistic}(\mu, \sigma)` is equivalent
to:
.. math::
y &\sim \operatorname{Logistic}(\mu, \sigma)\\
x &= \exp(y) | 62598edba79ad16197768547 |
class ArtistViewSet(ModelViewSet): <NEW_LINE> <INDENT> queryset = Artist.objects.all() <NEW_LINE> serializer_class = ArtistSerializer <NEW_LINE> lookup_field = u'pk' | 创建,删除,更新,获取艺术家 | 62598edb442bda511e95a994 |
class StepFormatter(GraphFormatter): <NEW_LINE> <INDENT> blueprint_prefix = '⧉' <NEW_LINE> conditional_prefix = '∘' <NEW_LINE> blueprint_scheme = { 'shape': 'parallelogram', 'color': 'slategray4', 'fillcolor': 'slategray3', } <NEW_LINE> def label(self, step): <NEW_LINE> <INDENT> return step and '{}{}'.format( self._get... | Graph formatter for :class:`Blueprint`. | 62598edb30dc7b766599ddb4 |
class pause_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.TBinaryProtocolAccelerated and ... | Attributes:
- success | 62598edb4428ac0f6e656a88 |
class RSpeedglm(RPackage): <NEW_LINE> <INDENT> homepage = "https://cran.r-project.org/package=speedglm" <NEW_LINE> url = "https://cran.rstudio.com/src/contrib/speedglm_0.3-2.tar.gz" <NEW_LINE> list_url = "https://cran.rstudio.com/src/contrib/Archive/speedglm" <NEW_LINE> version('0.3-2', 'c4874d4c2a677d657a335186eb... | Fitting linear models and generalized linear models to
large data sets by updating algorithms. | 62598edb99cbb53fe682f3de |
class set_default(object): <NEW_LINE> <INDENT> __slots__ = ("value", "name") <NEW_LINE> name: Optional[str] <NEW_LINE> value: Any <NEW_LINE> def __init__(self, value: Any) -> None: <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.name = None <NEW_LINE> <DEDENT> def clone(self) -> "set_default": <NEW_LINE> <INDENT... | An object used to set the default value of a base class member. | 62598edb3eb6a72ae0388b6c |
class MoveBattleStyleResource(utility.UtilityResource): <NEW_LINE> <INDENT> yaml_tag = '!MoveBattleStyleResource' <NEW_LINE> class Meta: <NEW_LINE> <INDENT> name = "MoveBattleStyle" <NEW_LINE> resource_name = "move-battle-style" <NEW_LINE> cache_folder = 'moves/battle-style/' <NEW_LINE> identifier = 'id' <NEW_LINE> att... | A resource describing a move's battle style.
Styles of moves when used in the Battle Palace. See Bulbapedia for greater
detail.
Fields:
id (int)
The identifier for this move battle style resource
name (str)
The name for this move battle style resource
names (list of... | 62598edba05bb46b38488da9 |
class WPToolsBadTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_redirect(self): <NEW_LINE> <INDENT> b = wptools.page('Ben Franklin').get_query(False) <NEW_LINE> self.assertEqual(b.title, 'Benjamin_Franklin') <NEW_LINE> <DEDENT> def test_missing(self): <NEW_LINE> <INDENT> b = wptools.page('_____').get_query(False)... | BAD API REQUEST TESTS | 62598edbac7a0e7691f70a3f |
class Decoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, n_latent_units, drop_ratio): <NEW_LINE> <INDENT> super(Decoder, self).__init__() <NEW_LINE> self.linear1 = nn.Linear(n_latent_units, 24) <NEW_LINE> self.linear2 = nn.Linear(24, 49) <NEW_LINE> self.conv1 = nn.ConvTranspose2d(1, 64, 4, stride=2, padding=1) ... | Convolution based decoder | 62598edb99cbb53fe682f3df |
class File(db.Model): <NEW_LINE> <INDENT> __tablename__ = "files" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> file_name = db.Column(db.String(255)) <NEW_LINE> author_id = db.Column(db.Integer, db.ForeignKey('users.id')) <NEW_LINE> organization_id = db.Column(db.Integer, db.ForeignKey('organizatio... | Represents a file for an organization | 62598edba219f33f346c4d65 |
class XBlockEditorTestCase(TestBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(XBlockEditorTestCase, self).setUp() <NEW_LINE> self.base = '/test' <NEW_LINE> sites.setup_courses('course:/test::ns_test, course:/:/') <NEW_LINE> self.old_namespace = namespace_manager.get_namespace() <NEW_LINE> namespa... | Functional tests for the XBlock editor in the dashboard. | 62598edb32920d7e50bc455a |
class RestroomReviewAPI(Resource): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> lat = request.json.pop('lat') <NEW_LINE> lng = request.json.pop('lng') <NEW_LINE> address = request.json.pop('address') <NEW_LINE> name = request.json.pop('name') <NEW_LINE> try: <NEW_LINE> <INDENT> rr = Restroom.query.filter(and... | Post a review or create a new restroom and review | 62598edb8e7ae83300ee75bd |
class DescribeInternetAddressQuotaResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Ipv6PrefixLen = None <NEW_LINE> self.Ipv4BgpQuota = None <NEW_LINE> self.Ipv4OtherQuota = None <NEW_LINE> self.Ipv4BgpNum = None <NEW_LINE> self.Ipv4OtherNum = None <NEW_LINE> self.RequestId = Non... | DescribeInternetAddressQuota返回参数结构体
| 62598edbfbf16365ca7925d0 |
class DialerCampaignView(BaseAuthenticatedClient): <NEW_LINE> <INDENT> def test_admin_campaign_view_list(self): <NEW_LINE> <INDENT> response = self.client.get('/admin/dialer_campaign/campaign/') <NEW_LINE> self.failUnlessEqual(response.status_code, 200) <NEW_LINE> <DEDENT> def test_admin_campaign_view_add(self): <NEW_L... | Test cases for Campaign, Subscriber Admin Interface. | 62598edbb7558d5895461b7a |
class DataSender(): <NEW_LINE> <INDENT> def __init__(self, host, port): <NEW_LINE> <INDENT> self.__host = host <NEW_LINE> self.__port = port <NEW_LINE> self.__closed_socket = False <NEW_LINE> self.__socket = socket.socket() <NEW_LINE> self.__socket.settimeout(60) <NEW_LINE> self.__socket.connect((self.__host, int(self.... | Class that handles communication with server, on initialisation will attempt to connect to server | 62598edbd6c5a102081e065e |
class CTD_ANON_ (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/tmp/tmpiTHi4x... | The set of filters defined here apply to the resident data set. Should DataSet subsets be created out of this parent DataSet, each sub-DataSet may contain its own filters. | 62598edb379a373c97d97529 |
class Solution: <NEW_LINE> <INDENT> def searchMatrix(self, matrix, target): <NEW_LINE> <INDENT> if matrix is None or matrix == []: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> n = len(matrix) <NEW_LINE> m = len(matrix[0]) <NEW_LINE> start = 0 <NEW_LINE> end = m * n - 1 <NEW_LINE> mid = (start + end) / 2 <NEW_LI... | @param matrix, a list of lists of integers
@param target, an integer
@return a boolean, indicate whether matrix contains target | 62598edb090684286d592975 |
class ApplicationGatewaySslPolicy(Model): <NEW_LINE> <INDENT> _attribute_map = { 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, 'policy_type': {'key': 'policyType', 'type': 'str'}, 'policy_name': {'key': 'policyName', 'type': 'str'}, 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}... | Application Gateway Ssl policy.
:param disabled_ssl_protocols: Ssl protocols to be disabled on application
gateway.
:type disabled_ssl_protocols: list of str or
:class:`ApplicationGatewaySslProtocol
<azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslProtocol>`
:param policy_type: Type of Ssl Policy. Possib... | 62598edb2ae34c7f260a9615 |
class ContactListViewTest(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> number_of_contacts = 13 <NEW_LINE> for contact_num in range(number_of_contacts): <NEW_LINE> <INDENT> Contact.objects.create(first_name='Anuoluwapo %s' % contact_num, last_name = 'Surname %s' % co... | Test case for the ContactListView | 62598edb507cdc57c63a32e1 |
class RegistrationForm(forms.ModelForm): <NEW_LINE> <INDENT> username = forms.CharField(max_length=50) <NEW_LINE> name = forms.CharField(max_length=50) <NEW_LINE> surname = forms.CharField(max_length=50) <NEW_LINE> password = forms.CharField(widget=forms.PasswordInput()) <NEW_LINE> password2 = forms.CharField(widget=fo... | form for user registration | 62598edb0a50d4780f7038d5 |
class ActionStoreDeprecated(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> _log(f"Warning: use of {'|'.join(self.option_strings)} is deprecated.") <NEW_LINE> setattr(namespace, self.dest, values) | Used with argparse as a deprecation action. | 62598edb0c0af96317c548cc |
class AuthTokenSerializer(serializers.Serializer): <NEW_LINE> <INDENT> email = serializers.CharField() <NEW_LINE> password = serializers.CharField( style={'input-type': 'password'}, trim_whitespace=False ) <NEW_LINE> def validate(self, attrs): <NEW_LINE> <INDENT> email = attrs.get('email') <NEW_LINE> password = attrs.g... | Serializer for the user authentication object. | 62598edbb5575c28eb711f68 |
class MapOptions(dict): <NEW_LINE> <INDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return super(MapOptions, self).__getitem__(key) <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> return se... | Container for the options of mappings.
Options can be accessed using attributes of the instance. When an
option is accessed and does not exist, it returns None. | 62598edb85dfad0860cbed02 |
class _User_01(crud.ResourceBase): <NEW_LINE> <INDENT> orm_meta = models.User <NEW_LINE> orm_pool = pool.POOLS.db01 <NEW_LINE> _default_order = ['id'] | use dbs.db01 as default | 62598edb2ae34c7f260a9616 |
class Event: <NEW_LINE> <INDENT> def __init__(self, sse_event): <NEW_LINE> <INDENT> self._sse_event = sse_event <NEW_LINE> self._data = json.loads(sse_event.data) <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return self._data['data'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def path(self... | Represents a realtime update event received from the database. | 62598edb0fa83653e46f341b |
class CouldNotFindHandleError(IOTileException): <NEW_LINE> <INDENT> pass | Raised when we could not find a BLE attribute handle | 62598edb4a966d76dd5ed412 |
class CommonBullets: <NEW_LINE> <INDENT> def __init__(self, x, y, screen, bulletType): <NEW_LINE> <INDENT> self.type = bulletType <NEW_LINE> self.screen = screen <NEW_LINE> if self.type == "hero": <NEW_LINE> <INDENT> self.x = x+20 <NEW_LINE> self.y = y-10 <NEW_LINE> self.imagePath = "./img/子弹3.png" <NEW_LINE> pass <NEW... | 公共的子弹类 | 62598edb0a50d4780f7038d6 |
class AtomicConsumer(fedmsg.consumers.FedmsgConsumer): <NEW_LINE> <INDENT> config_key = 'atomic_composer' <NEW_LINE> def __init__(self, hub, *args, **kw): <NEW_LINE> <INDENT> for key, item in hub.config.items(): <NEW_LINE> <INDENT> setattr(self, key, item) <NEW_LINE> <DEDENT> self.topic = getattr(self, 'fedmsg_atomic_t... | A fedmsg-driven atomic ostree composer.
This consumer runs in the fedmsg-hub and reacts to whenever repositories
sync to the master mirror. | 62598edbbaa26c4b54d4d806 |
class Key(object): <NEW_LINE> <INDENT> kty = '_' <NEW_LINE> ALLOWED_PARAMS = [ 'use', 'key_ops', 'alg', 'kid', 'x5u', 'x5c', 'x5t', 'x5t#S256' ] <NEW_LINE> PRIVATE_KEY_OPS = [ 'sign', 'decrypt', 'unwrapKey', ] <NEW_LINE> PUBLIC_KEY_OPS = [ 'verify', 'encrypt', 'wrapKey', ] <NEW_LINE> REQUIRED_JSON_FIELDS = [] <NEW_LINE... | This is the base class for a JSON Web Key. | 62598edb009cb60464cffa83 |
class MainTest(TestImageTest): <NEW_LINE> <INDENT> def testChdir(self): <NEW_LINE> <INDENT> class CwdTest(image_test.NonForgivingImageTestCase): <NEW_LINE> <INDENT> _expected_dir = None <NEW_LINE> def SetCwd(self, cwd): <NEW_LINE> <INDENT> self._expected_dir = cwd <NEW_LINE> <DEDENT> def testExpectedCwd(self): <NEW_LIN... | Test the main invocation of the script. | 62598edbac7a0e7691f70a41 |
class MultipleChoiceFieldGenerator(ChoiceFieldGenerator): <NEW_LINE> <INDENT> field_class = forms.MultipleChoiceField <NEW_LINE> def get_field_kwargs(self, instance): <NEW_LINE> <INDENT> kwargs = super().get_field_kwargs(instance) <NEW_LINE> kwargs['widget'] = forms.CheckboxSelectMultiple <NEW_LINE> return kwargs | A class for generating a MultipleChoiceField. | 62598edb9c8ee8231303f3ef |
class MethodDispatcher(Dispatcher): <NEW_LINE> <INDENT> def __call__(self, path_info): <NEW_LINE> <INDENT> request = cherrypy.request <NEW_LINE> resource, vpath = self.find_handler(path_info) <NEW_LINE> if resource: <NEW_LINE> <INDENT> avail = [m for m in dir(resource) if m.isupper()] <NEW_LINE> if "GET" in avail and "... | Additional dispatch based on cherrypy.request.method.upper().
Methods named GET, POST, etc will be called on an exposed class.
The method names must be all caps; the appropriate Allow header
will be output showing all capitalized method names as allowable
HTTP verbs.
Note that the containing class must be exposed, no... | 62598edba219f33f346c4d67 |
class Grub2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): <NEW_LINE> <INDENT> plugin_name = 'grub2' <NEW_LINE> profiles = ('boot',) <NEW_LINE> packages = ('grub2',) <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> self.add_copy_spec([ "/boot/efi/EFI/*/grub.cfg", "/boot/grub2/grub.cfg", "/boot/grub2/grubenv", "/boot... | GRUB2 bootloader
| 62598edb7d43ff2487426693 |
class AccountSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Account <NEW_LINE> field = ('picture_url', 'location', 'about_me', 'wormie_color', 'fb_id', 'submission_likes', 'wormhole_likes') | Account model | 62598edb7d847024c075a900 |
class export_dsf_geom (bpy.types.Operator): <NEW_LINE> <INDENT> bl_label = 'export dsf-geom' <NEW_LINE> bl_idname = 'mesh.dsf_exp' <NEW_LINE> filepath = StringProperty (name = 'file path', description = 'file path for exporting dsf-file.', maxlen = 1000, default = '') <NEW_LINE> filter_glob = StringProperty (defau... | Export a mesh as a dsf-geometry | 62598edb63d6d428bbee0d01 |
class JsonFormat(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.object_format = _JsonObjectFormat() <NEW_LINE> <DEDENT> def read(self, s, descriptor): <NEW_LINE> <INDENT> if s is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> value = _json.loads(s) <NEW_LINE> parsed = self.object_f... | JsonFormat parses/serializes Pdef types from/to JSON. | 62598edb8da39b475be016db |
class Player: <NEW_LINE> <INDENT> def __init__(self, name, cards): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.cards = cards <NEW_LINE> self.checks = False <NEW_LINE> <DEDENT> def attack(self, cards): <NEW_LINE> <INDENT> for card in cards: <NEW_LINE> <INDENT> assert card in self.cards, 'Cannot attack with a ca... | A player in the game with his own cards. | 62598edb96565a6dacd2bc6a |
class City(Base): <NEW_LINE> <INDENT> __tablename__ = 'city' <NEW_LINE> nid = Column(Integer, primary_key=True) <NEW_LINE> caption = Column(VARCHAR(16), index=True) <NEW_LINE> province_id = Column(Integer, ForeignKey('province.nid')) | 市 | 62598edbbd1bec0571e14363 |
class Keyboard: <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> ________________ <NEW_LINE> for _________ in ________________: <NEW_LINE> <INDENT> ________________ <NEW_LINE> <DEDENT> <DEDENT> def press(self, info): <NEW_LINE> <INDENT> if ____________________: <NEW_LINE> <INDENT> ________________ <NE... | A Keyboard takes in an arbitrary amount of buttons, and has a
dictionary of positions as keys, and values as Buttons.
>>> b1 = Button(0, "H")
>>> b2 = Button(1, "I")
>>> k = Keyboard(b1, b2)
>>> k.buttons[0].key
'H'
>>> k.press(1)
'I'
>>> k.press(2) #No button at this position
''
>>> k.typing([0, 1])
'HI'
>>> k.typing... | 62598edbd7e4931a7ef3a5cb |
class SystemGroup(NamedGroupContainer): <NEW_LINE> <INDENT> def __init__(self, record, name=None): <NEW_LINE> <INDENT> super(SystemGroup, self).__init__(record, name) <NEW_LINE> self._cache = OrderedDict.fromkeys(self._data.keys()) <NEW_LINE> <DEDENT> def create(self, key): <NEW_LINE> <INDENT> if key in self: <NEW_LINE... | Container class for :class:`RasterN` elements. | 62598edb596a897236126196 |
class HDFSDirectoryNotDeletedException(HDFSException): <NEW_LINE> <INDENT> def __init__(self, message, file_path): <NEW_LINE> <INDENT> self.error_msg = 'Directory with the following path could not be deleted: {}\n{}'.format(file_path, message) <NEW_LINE> super(HDFSDirectoryNotDeletedException, self).__init__(self.error... | Failed to delete an HDFS directory.
| 62598edbdd821e528d6d7477 |
class DisableAllRecords(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> Record.objects.all().update(is_active=False) <NEW_LINE> return Response({"status": "ok"}, status=status.HTTP_200_OK) | Sets all active records as not active | 62598edbb7558d5895461b7b |
class DocPara(DocAssign): <NEW_LINE> <INDENT> def __init__(self,expr,format=None,style=None,klass=None,escape=True): <NEW_LINE> <INDENT> Flowable.__init__(self) <NEW_LINE> self.expr=expr <NEW_LINE> self.format=format <NEW_LINE> self.style=style <NEW_LINE> self.klass=klass <NEW_LINE> self.escape=escape <NEW_LINE> <DEDEN... | at wrap time create a paragraph with the value of expr as text
if format is specified it should use %(__expr__)s for string interpolation
of the expression expr (if any). It may also use %(name)s interpolations
for other variables in the namespace.
suitable defaults will be used if style and klass are None | 62598edb379a373c97d9752a |
class Connection: <NEW_LINE> <INDENT> def __init__(self, sock): <NEW_LINE> <INDENT> self._socket = sock <NEW_LINE> self._socket.setblocking(0) <NEW_LINE> self._raw_data = '' <NEW_LINE> <DEDENT> def get_peer_name(self): <NEW_LINE> <INDENT> return self._socket.getpeername() <NEW_LINE> <DEDENT> def receive(self): <NEW_LIN... | Manages a socket and other data specific to a connection.
Holds any data received that does not yet form a complete message. | 62598edb507cdc57c63a32e3 |
@actions.register('retention') <NEW_LINE> class RetentionWindow(BaseAction): <NEW_LINE> <INDENT> date_attribute = "BackupRetentionPeriod" <NEW_LINE> schema = type_schema( 'retention', **{'days': {'type': 'number'}, 'enforce': {'type': 'string', 'enum': [ 'min', 'max', 'exact']}}) <NEW_LINE> permissions = ('rds:ModifyDB... | Action to set the retention period on rds cluster snapshots,
enforce (min, max, exact) sets retention days occordingly.
:example:
.. code-block: yaml
policies:
- name: rds-cluster-backup-retention
resource: rds-cluster
filters:
- type: value
... | 62598edb01c39578d7f112d7 |
class PyVisaInstrument: <NEW_LINE> <INDENT> def __init__(self, resource, *args, **kwargs): <NEW_LINE> <INDENT> if type(resource) is str: <NEW_LINE> <INDENT> self.instrument = visa.instrument(resource, *args, **kwargs) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.instrument = resource <NEW_LINE> <DEDENT> self.buff... | PyVisa wrapper instrument interface client | 62598edb2eb69b55b15a0620 |
class CreateRemoteWithInvalidProjectSpecifiersTestCase(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.cfg = config.get_config() <NEW_LINE> cls.client = api.Client(cls.cfg, api.json_handler) <NEW_LINE> <DEDENT> def test_includes_with_no_name(self): <NEW_LINE>... | Test that creating a remote with an invalid project specifier fails. | 62598edb30bbd72246468168 |
class Transformation(Mirror, TextObjectTransformation): <NEW_LINE> <INDENT> def __init__(self, parent, ts, token): <NEW_LINE> <INDENT> Mirror.__init__(self, parent, ts, token) <NEW_LINE> TextObjectTransformation.__init__(self, token) <NEW_LINE> <DEDENT> def _get_text(self): <NEW_LINE> <INDENT> return self._transform(se... | See module docstring. | 62598edb60cbc95b0636286b |
class ContractSigException(PopBaseException): <NEW_LINE> <INDENT> pass | Exception raised when a function signature is not compatible with the
coresponding function signature found in the contract. | 62598edb1f037a2d8b9e2635 |
class ACMEClient(client.ClientV2): <NEW_LINE> <INDENT> def only_finalize_order(self, orderr): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> super().finalize_order(orderr, deadline=datetime.fromtimestamp(0)) <NEW_LINE> <DEDENT> except errors.TimeoutError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> <DEDENT> def fetch_ce... | Subclass of client.ClientV2 that splits the finalize order and fetch certificate operations | 62598edbcad5886f8bdc382e |
class UtilisateurChangeViewSet(ReadUpdateSingleModelViewSet): <NEW_LINE> <INDENT> queryset = Utilisateur.objects.all().order_by('-date_joined') <NEW_LINE> serializer_class = UtilisateurChangeSerializer <NEW_LINE> permission_classes = [perm.IsAdminOrSelf] | Vue permettant à un Utilisateur d'accéder à ses informations personnelles et de les modifier | 62598edb0c0af96317c548ce |
class DistillKL(nn.Module): <NEW_LINE> <INDENT> def __init__(self, T): <NEW_LINE> <INDENT> super(DistillKL, self).__init__() <NEW_LINE> self.T = T <NEW_LINE> <DEDENT> def forward(self, y_s, y_t): <NEW_LINE> <INDENT> p_s = F.log_softmax(y_s/self.T, dim=1) <NEW_LINE> p_t = F.softmax(y_t/self.T, dim=1) <NEW_LINE> loss = F... | Distilling the Knowledge in a Neural Network | 62598edb442bda511e95a998 |
class SkullSkin(Surface): <NEW_LINE> <INDENT> _ui_name = "Outer-skull - scalp interface surface" <NEW_LINE> surface_type = Final(OUTER_SKULL) <NEW_LINE> @classmethod <NEW_LINE> def from_file(cls, source_file="outer_skull_4096.zip"): <NEW_LINE> <INDENT> return super(SkullSkin, cls).from_file(source_file) | Outer-skull - scalp interface surface. | 62598edbe76e3b2f99fd6f6b |
class ObserverSchemaError(Exception): <NEW_LINE> <INDENT> pass | Custom exception raised if the validation of the observer_schema fails | 62598edbe1aae11d1e7cdad6 |
class PyNNTextIO(BasePyNNIO): <NEW_LINE> <INDENT> name = "PyNN StandardTextFile" <NEW_LINE> extensions = ['v', 'ras', 'gsyn'] <NEW_LINE> def _read_metadata(self): <NEW_LINE> <INDENT> metadata = {} <NEW_LINE> with open(self.filename) as f: <NEW_LINE> <INDENT> for line in f: <NEW_LINE> <INDENT> if line[0] == "#": <NEW_LI... | Reads/writes data from/to PyNN StandardTextFile format | 62598edb07f4c71912bad990 |
class bm_mt_get_entries_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT,(BmMtEntry, BmMtEntry.thrift_spec)), None, ), (1, TType.STRUCT, 'ouch', (InvalidTableOperation, InvalidTableOperation.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, ouch=None,): <NEW_LINE> ... | Attributes:
- success
- ouch | 62598edb4a966d76dd5ed414 |
class Price(models.Model): <NEW_LINE> <INDENT> item = models.ForeignKey(Item, related_name='prices') <NEW_LINE> region = models.ForeignKey(Region, null=True, related_name='prices') <NEW_LINE> solar_system = models.ForeignKey(SolarSystem, null=True, related_name='prices') <NEW_LINE> station = models.ForeignKey(Station, ... | A model to represent a price point on a single Item | 62598edb435de62698e9a307 |
class Trie: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root = self.get_node() <NEW_LINE> <DEDENT> def get_node(self): <NEW_LINE> <INDENT> return TrieNode() <NEW_LINE> <DEDENT> def char_to_index(self, ch): <NEW_LINE> <INDENT> return ord(ch)-ord('A') <NEW_LINE> <DEDENT> def insert(self, key): <NEW_L... | Trie to store text and searches text in it | 62598edb3539df3088eca7e3 |
class Integration(GitHub): <NEW_LINE> <INDENT> def _rpc_connection(self): <NEW_LINE> <INDENT> installations = utils.find_installations(self.request) <NEW_LINE> if installations.count() != 1: <NEW_LINE> <INDENT> raise Exception( f'Cannot find GitHub App installation for tenant "{self.request.tenant.name}"') <NEW_LINE> <... | A Kiwi TCMS external bug tracker integration for GitHub which
authenticates as an installed GitHub App instead of with a personal
token!
Requires:
:base_url: - URL to a GitHub repository for which we're going to report issues
.. note::
The ``api_password`` field is determined at runtime! | 62598edbbaa26c4b54d4d808 |
class ResPartnerAddress(osv.osv): <NEW_LINE> <INDENT> _inherit = "res.partner.address" <NEW_LINE> def address_to_ups_dict(self, cursor, user, id, context=None): <NEW_LINE> <INDENT> if type(id)==list: <NEW_LINE> <INDENT> id = id[0] <NEW_LINE> <DEDENT> address = self.browse(cursor, user, id, context) <NEW_LINE> phone = a... | Add method to return address in UPS format | 62598edb94891a1f408b8101 |
class TestInstall(IntegrationTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> self.installer = api.portal.get_tool('portal_quickinstaller') <NEW_LINE> <DEDENT> def test_product_installed(self): <NEW_LINE> <INDENT> self.assertTrue(self.installer.isProductI... | Test installation of paragon.site into Plone. | 62598edbd486a94d0ba2a507 |
class DynamicPercentileCounter(TabHandler): <NEW_LINE> <INDENT> CURRENT_VERSION = 0 <NEW_LINE> def NewState(self, client_id, name, num_samples): <NEW_LINE> <INDENT> return dynamic_percentile_counter_native.NewState(num_samples) <NEW_LINE> <DEDENT> def FoldEvents(self, state_buffer, events): <NEW_LINE> <INDENT> return d... | Tab Handler that accepts numeric input, and tracks the count and total,
and samples the values to generate cumulative distribution percentiles. This
is mostly a proxy to the Cython implementation 'percentile_counter_native'. | 62598edb26068e7796d4ae9e |
class Triggers: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.triggers = Trigger.query.outerjoin(Tag) .filter(Trigger.active==True) .all() <NEW_LINE> <DEDENT> def check_post_type(self, trigger, thread, post_data): <NEW_LINE> <IND... | Class handling triggers. It analyzes the post, prepares the actions and
executes them. | 62598edb8e71fb1e983b9fa3 |
class FetchResourceTestMixin(FetchingTestMixinBase): <NEW_LINE> <INDENT> def test_subclass_at_subclass(self): <NEW_LINE> <INDENT> response = self.app.get('/api/employee/1') <NEW_LINE> assert response.status_code == 200 <NEW_LINE> document = loads(response.data) <NEW_LINE> resource = document['data'] <NEW_LINE> assert r... | Tests for fetching a single resource defined using single table
inheritance. | 62598edb796e427e5384ccca |
class RegexAutomatonFilter(CallDecorator): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.patterns = {} <NEW_LINE> for stream, desc in kwargs.items(): <NEW_LINE> <INDENT> self.patterns[stream] = [RegexAutomaton.split_pattern(p) for p in as_list(desc)] <NEW_LINE> <DEDENT> <DEDENT> def call(se... | Decorator filter for SUT calls to recognise patterns in the returned issue
dictionaries and process them according to user-defined automaton-like
instructions.
**Optional parameters of the decorator:**
- key: array of patterns to match against the lines of ``issue[key]``
(note that 'key' can be arbitrary, and m... | 62598edb2c8b7c6e89bd1cfb |
class TenantThrottle(BaseThrottle): <NEW_LINE> <INDENT> def allow_request(self, request, view): <NEW_LINE> <INDENT> now = datetime.datetime.now() <NEW_LINE> api_key = request.META.get('HTTP_API_KEY') <NEW_LINE> tenant = Tenant.objects.get(api_key=api_key) <NEW_LINE> todays_requests = ThrottleRequest.objects.filter(tena... | TenantThrottle class | 62598edbd99f1b3c44d03be7 |
class SingleDataIterator(object): <NEW_LINE> <INDENT> def __init__(self, mu, sigma, batch_size): <NEW_LINE> <INDENT> self.data_helper = GuasssianDataHelper(mu, sigma) <NEW_LINE> n = len(self.data_helper) <NEW_LINE> self.batch_index_iterator = BatchIndexIterator(n, batch_size) <NEW_LINE> <DEDENT> def __iter__(self): <NE... | Iterator of a single-side dataset of encoded representation.
Args:
mu: Mean of data points.
sigma: Variance of data points. If it is None, it is treated as zeros.
batch_size: An integer indictating size of batch. | 62598edb3539df3088eca7e4 |
class ChoicesMC3(BasicName): <NEW_LINE> <INDENT> pass | Represents MoV Source options | 62598edbb7558d5895461b7d |
class CompaniesViewset(viewsets.ModelViewSet): <NEW_LINE> <INDENT> parser_classes = (MultiPartParser, FormParser) <NEW_LINE> queryset = Companies.objects.all() <NEW_LINE> permission_classes = [ permissions.AllowAny ] <NEW_LINE> serializer_class = CompaniesSerializer <NEW_LINE> pagination_class = None | This viewset provides all the basic functionality like get, put and
post for the Company model. | 62598edbf8510a7c17d7d415 |
class UserManager(BaseUserManager): <NEW_LINE> <INDENT> use_in_migrations = True <NEW_LINE> def _create_user(self, email, password, **extra_fields): <NEW_LINE> <INDENT> if email: <NEW_LINE> <INDENT> email = self.normalize_email(email) <NEW_LINE> <DEDENT> user = self.model(email=email, **extra_fields) <NEW_LINE> user.se... | Define a model manager for User model with no username field. | 62598edb01c39578d7f112d9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.