code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Panel(object): <NEW_LINE> <INDENT> def __init__(self, drawing, larghezza, altezza, model, struct = None): <NEW_LINE> <INDENT> self.drawing = drawing <NEW_LINE> self.l = larghezza <NEW_LINE> self.h = altezza <NEW_LINE> self.model = model <NEW_LINE> self.x = 0.0 <NEW_LINE> self.y = 0.0 <NEW_LINE> self.z = 0.0 <NEW_... | class for draw panels | 62598fa74a966d76dd5eedf2 |
class WorksetPreview(object,IDisposable): <NEW_LINE> <INDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ReleaseUnmanagedResources(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __enter__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __exit__(self,*args): <NEW_LIN... | Represents an accessor for workset data which can be obtained from an unopened document. | 62598fa766656f66f7d5a300 |
class ISYInsteonBinarySensorEntity(ISYBinarySensorEntity): <NEW_LINE> <INDENT> def __init__(self, node, force_device_class=None, unknown_state=None) -> None: <NEW_LINE> <INDENT> super().__init__(node, force_device_class) <NEW_LINE> self._negative_node = None <NEW_LINE> self._heartbeat_device = None <NEW_LINE> if self._... | Representation of an ISY994 Insteon binary sensor device.
Often times, a single device is represented by multiple nodes in the ISY,
allowing for different nuances in how those devices report their on and
off events. This class turns those multiple nodes into a single Home
Assistant entity and handles both ways that IS... | 62598fa767a9b606de545edc |
@python_2_unicode_compatible <NEW_LINE> class LogLevel(object): <NEW_LINE> <INDENT> def __init__(self, level, name, traceback=False): <NEW_LINE> <INDENT> self.level = level <NEW_LINE> self.name = name <NEW_LINE> self.traceback = traceback <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<LogLevel %s ... | A logging level
Args:
level (int): Log level
name (unicode): Level name
traceback (bool): Include traceback when logging | 62598fa799cbb53fe6830de6 |
class IndexListError(C8ServerError): <NEW_LINE> <INDENT> pass | Failed to retrieve collection indexes. | 62598fa74f6381625f199446 |
class AWSServer(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=20) <NEW_LINE> description = models.CharField(max_length=100, null=True, blank=True) <NEW_LINE> aws_access_key = models.CharField(max_length=20) <NEW_LINE> aws_secret_key = models.CharField(max_length=40) <NEW_LINE> aws_region = model... | AWSServer represents a single EC2 server at AWS | 62598fa756b00c62f0fb27c4 |
class PriceNotFound(UserError): <NEW_LINE> <INDENT> def __init__(self, msg='Price not found'): <NEW_LINE> <INDENT> super(PriceNotFound, self).__init__(msg) | Raised when a price is not found | 62598fa7fff4ab517ebcd6f5 |
class Graph(object): <NEW_LINE> <INDENT> def __init__(self, edges=None, directed=False): <NEW_LINE> <INDENT> self.directed = directed <NEW_LINE> self.original_edges = edges <NEW_LINE> self.out_mapping = defaultdict(lambda: defaultdict(float)) <NEW_LINE> self.in_mapping = defaultdict(lambda: defaultdict(float)) <NEW_LIN... | Weighted and directed graph class.
This class is intended for the graph associated to a Markov process,
since it gives easy access to the neighbors of a particular state.
Vertices can be any hashable Python object.
Initialize with a list of edges:
[[node1, node2, weights], ...]
Weights can be omitted for an undi... | 62598fa721bff66bcd722b77 |
class Colors(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._colors = {} <NEW_LINE> <DEDENT> def __setitem__(self, key_, value): <NEW_LINE> <INDENT> if isinstance(value, Color): <NEW_LINE> <INDENT> self._colors[key_] = value <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._colors[key_] = C... | Color collection and wrapper for wx.ColourDatabase. Provides
dictionary syntax access (colors[key]) and predefined colors. | 62598fa78c0ade5d55dc3619 |
class gnaf_feb_2020_gda2020: <NEW_LINE> <INDENT> ... <NEW_LINE> class CSVFormat: <NEW_LINE> <INDENT> __slots__= ('Description','Format','FilePath','PathToFiles','DownURL', 'ZipDir', 'ZipPath') <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.Description = 'gnaf_feb_2020_gda2020' <NEW_LINE> self.Format = 'CSV' <N... | ABS Australian Boundary | 62598fa756ac1b37e63020fd |
class HTTPMethods(object): <NEW_LINE> <INDENT> GET = 'get' <NEW_LINE> POST = 'post' <NEW_LINE> DELETE = 'delete' | HTTP methods that can be used with Buttercoin's API. | 62598fa71b99ca400228f4b8 |
class Genresult(ndb.Model): <NEW_LINE> <INDENT> name = ndb.StringProperty(indexed=True) <NEW_LINE> email = ndb.StringProperty(indexed=True) <NEW_LINE> date = ndb.DateTimeProperty(auto_now_add=True) <NEW_LINE> generationname = ndb.StringProperty(indexed=True) <NEW_LINE> imageurl = ndb.... | A main model for representing a gen result. | 62598fa799fddb7c1ca62d71 |
class Graph(object): <NEW_LINE> <INDENT> def __init__(self, graph_dict=None,oriented=False): <NEW_LINE> <INDENT> if oriented == True: <NEW_LINE> <INDENT> print ("Oriented graphs are not implemented yet") <NEW_LINE> <DEDENT> if graph_dict == None: <NEW_LINE> <INDENT> graph_dict = {} <NEW_LINE> <DEDENT> self.__graph_dict... | Graph represented as dict of node:edges | 62598fa785dfad0860cbf9fd |
class HyperlinkURLDestination(Element): <NEW_LINE> <INDENT> Self = StringField(required=True) <NEW_LINE> Name = StringField() <NEW_LINE> DestinationURL = StringField() <NEW_LINE> Hidden = BooleanField() <NEW_LINE> DestinationUniqueKey = IntField() <NEW_LINE> Properties = EmbeddedDocumentField(Properties) | A hyperlink page destination specifies a web address as the destination for
a hyperlink. | 62598fa7eab8aa0e5d30bc9c |
class VPCRouteTableDefinition(nixops.resources.ResourceDefinition): <NEW_LINE> <INDENT> config: VpcRouteTableOptions <NEW_LINE> @classmethod <NEW_LINE> def get_type(cls): <NEW_LINE> <INDENT> return "vpc-route-table" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_resource_type(cls): <NEW_LINE> <INDENT> return "vpcR... | Definition of a VPC route table | 62598fa7097d151d1a2c0f3a |
@dataclasses.dataclass <NEW_LINE> class Validator(amicus.base.Quirk): <NEW_LINE> <INDENT> validations: ClassVar[Sequence[str]] = [] <NEW_LINE> converters: ClassVar[amicus.base.Catalog] = amicus.base.Catalog() <NEW_LINE> """ Public Methods """ <NEW_LINE> def validate(self, validations: Sequence[str] = None) -> None: <NE... | Mixin for calling validation methods
Args:
validations (List[str]): a list of attributes that need validating.
Each item in 'validations' should have a corresponding method named
f'_validate_{name}' or match a key in 'converters'. Defaults to an
empty list.
converters (amicus.base.Ca... | 62598fa7656771135c489593 |
class BulkProcessor(log_publisher.LogPublisher): <NEW_LINE> <INDENT> def __init__(self, logs_in_counter=None, logs_rejected_counter=None): <NEW_LINE> <INDENT> super(BulkProcessor, self).__init__() <NEW_LINE> self.service_region = CONF.region <NEW_LINE> <DEDENT> def send_message(self, logs, global_dimensions=None, log_t... | BulkProcessor for effective log processing and publishing.
BulkProcessor is customized version of
:py:class:`monasca_log_api.app.base.log_publisher.LogPublisher`
that utilizes processing of bulk request inside single loop. | 62598fa7bd1bec0571e1504c |
class nDynamic(serverModel.serverModel): <NEW_LINE> <INDENT> def __init__ (self): <NEW_LINE> <INDENT> self.noServers= 1 <NEW_LINE> self.updateInterval= 0 <NEW_LINE> self.lastUpdate= 0 <NEW_LINE> <DEDENT> def parseJSON(self,js,fName): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.noServers= int (js.pop("number")) <N... | server model chooses n servers to be clustered | 62598fa738b623060ffa8fa9 |
class InternalServerError(ApiError): <NEW_LINE> <INDENT> def __init__(self, message=None, response=None): <NEW_LINE> <INDENT> status = 500 <NEW_LINE> if response is not None: <NEW_LINE> <INDENT> status = response.status_code <NEW_LINE> <DEDENT> if message is None: <NEW_LINE> <INDENT> message = 'Internal Server Error' <... | Internal server error class.
The server has encountered a situation it doesn't know how to handle. | 62598fa72ae34c7f260aaff3 |
class getSimpleChannelContacts_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'ids', (TType.STRING,None), None, ), ) <NEW_LINE> def __init__(self, ids=None,): <NEW_LINE> <INDENT> self.ids = ids <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryP... | Attributes:
- ids | 62598fa78da39b475be030f4 |
class tempal_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'userid', None, None, ), ) <NEW_LINE> def __init__(self, userid=None,): <NEW_LINE> <INDENT> self.userid = userid <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated ... | Attributes:
- userid | 62598fa745492302aabfc3e2 |
class DistributionSelectionSepc(unittest.TestCase): <NEW_LINE> <INDENT> def test_gaussian_distribution(self): <NEW_LINE> <INDENT> case = JTKCycleRun(np.ones(TEST_N), 2*np.arange(TEST_N), None, 2, distribution="normal") <NEW_LINE> self.assertTrue(isinstance(case.distribution, NormalDistribution)) <NEW_LINE> <DEDENT> def... | Describe the Null Distribution boolean selector. | 62598fa7435de62698e9bd08 |
class AssociationSet(CSDLElement): <NEW_LINE> <INDENT> XMLNAME = (EDM_NAMESPACE, 'AssociationSet') <NEW_LINE> XMLATTR_Name = ('name', validate_simple_identifier, None) <NEW_LINE> XMLATTR_Association = 'associationName' <NEW_LINE> XMLCONTENT = xml.ElementType.ElementContent <NEW_LINE> def __init__(self, parent): <NEW_LI... | Represents an association set in the metadata model.
The purpose of the association set is to bind the ends of an
association to entity sets in the container.
Contrast this with the association element which merely describes
the association between entity types.
At first sight this part of the entity data model can ... | 62598fa760cbc95b0636425e |
class SignedOffBy(CommitRule): <NEW_LINE> <INDENT> name = "body-requires-signed-off-by" <NEW_LINE> id = "CAP1" <NEW_LINE> def validate(self, commit): <NEW_LINE> <INDENT> for line in commit.message.body: <NEW_LINE> <INDENT> if line.startswith("Signed-off-by"): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> <DEDENT> msg ... | This rule will enforce that each commit contains a "Signed-off-by" line. | 62598fa75166f23b2e2432e9 |
class BST: <NEW_LINE> <INDENT> def __init__(self, root: TreeNode = None) -> None: <NEW_LINE> <INDENT> self.root = root <NEW_LINE> <DEDENT> def insert(self, key: int, value: Any) -> None: <NEW_LINE> <INDENT> if self.root is None: <NEW_LINE> <INDENT> self.root = TreeNode(key, value) <NEW_LINE> <DEDENT> else: <NEW_LINE> <... | Implementation of the Binary Search Tree ADT. Has the following methods:
__init__(TreeNode=None), insert(int, Any), size(), height(), in_order_traversal(),
pre_order_traversal(), post_order_traversal(), level_order_traversal() | 62598fa7009cb60464d01431 |
class ConvertToSensorUnits(ProcessingNode): <NEW_LINE> <INDENT> nodeClass = 'common' <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> ProcessingNode.__init__(self, name = 'convert to sensor units', mode = 'uneditable', category = 'test', tags = ['convert', 'unit', 'physical'], **kwargs ) <NEW_LINE> <DEDENT>... | Detrend a timeseries.
This node uses the detrend method of the obspy stream class to remove the
trend from a timeseries. | 62598fa74f6381625f199447 |
class StationParser(jsonparser.JSONParser): <NEW_LINE> <INDENT> def parse_JSON(self, JSON_string): <NEW_LINE> <INDENT> if JSON_string is None: <NEW_LINE> <INDENT> raise parse_response_error.ParseResponseError('JSON data is None') <NEW_LINE> <DEDENT> d = json.loads(JSON_string) <NEW_LINE> try: <NEW_LINE> <INDENT> name =... | Concrete *JSONParser* implementation building a *Station* instance
out of raw JSON data coming from OWM Weather API responses. | 62598fa791af0d3eaad39d22 |
class Joystick(): <NEW_LINE> <INDENT> def __init__(self, StepperInstance, JoystickIndex): <NEW_LINE> <INDENT> self.Stepper = StepperInstance <NEW_LINE> pygame.init() <NEW_LINE> self.PygameJoystick = pygame.joystick.Joystick(JoystickIndex) <NEW_LINE> self.PygameJoystick.init() <NEW_LINE> <DEDENT> def get_axes(self, hori... | A class that uses a joystick to control an arduino
'StepperInstance', takes an instance of Controller().Stepper() | 62598fa70a50d4780f7052f0 |
class Output(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, cfg): <NEW_LINE> <INDENT> self.cfg = cfg <NEW_LINE> self.sessions = {} <NEW_LINE> self.ips = {} <NEW_LINE> self.re_sessionlog = re.compile( '.*HoneyPotTransport,([0-9]+),[0-9.]+$') <NEW_LINE> if self.cfg.has_option('hone... | This is the abstract base class intended to be inherited by kippo output plugins
Plugins require the mandatory methods: stop, start and handleLog | 62598fa763d6d428bbee26c5 |
class FeesUpdated(WebsocketFilterMessage[FeesUpdatedMessageData]): <NEW_LINE> <INDENT> event: ClassVar[str] = 'fee_update' <NEW_LINE> schema: ClassVar[PSJSONSchema] = PSJSONSchema({ 'properties': { 'bounty_fee': { **uint256, 'srckey': 'bountyFee' }, 'assertion_fee': { **uint256, 'srckey': 'assertionFee' } }, }) | FeesUpdated
doctest:
>>> event = mkevent({'bountyFee': 5000000000000000, 'assertionFee': 5000000000000000 })
>>> decoded_msg(FeesUpdated.serialize_message(event))
{'block_number': 117,
'data': {'assertion_fee': 5000000000000000, 'bounty_fee': 5000000000000000},
'event': 'fee_update',
'txhash': '0000000000000000000... | 62598fa77047854f4633f2ed |
class Kanmusu(models.Model): <NEW_LINE> <INDENT> shipname = models.CharField('艦名', max_length=255) <NEW_LINE> shipclass = models.CharField('艦種', max_length=255, blank=True) <NEW_LINE> shiplevel = models.IntegerField('レベル', blank=True, default=1) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.shipname | 艦娘 | 62598fa73539df3088ecc1c8 |
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = UserManager... | Custom user model that suports using emiail instead of username | 62598fa78e7ae83300ee8fb6 |
class CustomTopo(Topo): <NEW_LINE> <INDENT> def __init__(self, linkopts1, linkopts2, linkopts3, fanout=2, **opts): <NEW_LINE> <INDENT> Topo.__init__(self, **opts) <NEW_LINE> self.fanout = fanout <NEW_LINE> c1 = self.addSwitch('c1') <NEW_LINE> for i in range(fanout): <NEW_LINE> <INDENT> a = self.addSwitch('a%d' % (i + 1... | Simple Data Center Topology | 62598fa73d592f4c4edbade1 |
class ServiceBusAuthentication(Model): <NEW_LINE> <INDENT> _attribute_map = { 'sas_key': {'key': 'sasKey', 'type': 'str'}, 'sas_key_name': {'key': 'sasKeyName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'ServiceBusAuthenticationType'}, } <NEW_LINE> def __init__(self, sas_key=None, sas_key_name=None, type=None): <... | ServiceBusAuthentication.
:param sas_key: Gets or sets the SAS key.
:type sas_key: str
:param sas_key_name: Gets or sets the SAS key name.
:type sas_key_name: str
:param type: Gets or sets the authentication type. Possible values
include: 'NotSpecified', 'SharedAccessKey'
:type type: str or :class:`ServiceBusAuthenti... | 62598fa76e29344779b00570 |
class PyFlaskCompress(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/libwilliam/flask-compress" <NEW_LINE> pypi = "Flask-Compress/Flask-Compress-1.4.0.tar.gz" <NEW_LINE> version('1.4.0', sha256='468693f4ddd11ac6a41bca4eb5f94b071b763256d54136f77957cfee635badb3') <NEW_LINE> depends_on('py-setuptools',... | Flask-Compress allows you to easily compress your Flask application's
responses with gzip. | 62598fa767a9b606de545ee0 |
class CachingSkyMap(BaseSkyMap): <NEW_LINE> <INDENT> def __init__(self, numTracts, config=None, version=0): <NEW_LINE> <INDENT> super(CachingSkyMap, self).__init__(config) <NEW_LINE> self._numTracts = numTracts <NEW_LINE> self._tractCache = [None] * self._numTracts <NEW_LINE> self._tractInfo = None <NEW_LINE> self._ver... | A SkyMap that generates its tracts on request and caches them.
Parameters
----------
numTracts : `int`
Number of tracts to create.
config : `lsst.skymap.BaseSkyMapConfig` (optional)
The configuration for this SkyMap; if None use the default config.
version : `int` or `tuple` of `int` (optional)
Software ve... | 62598fa792d797404e388aef |
@python_2_unicode_compatible <NEW_LINE> class ImportItem(UUIDModelMixin, TimestampedModelMixin, models.Model): <NEW_LINE> <INDENT> ct_limit = ( models.Q(app_label="alibrary", model="media") | models.Q(app_label="alibrary", model="release") | models.Q(app_label="alibrary", model="artist") | models.Q(app_label="alibrary"... | stores relations to objects created/assigned during the specific import | 62598fa75166f23b2e2432eb |
class ReadOnlyModelAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> def has_add_permission(self, request, obj=None): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def has_delete_permission(self, request, obj=None): <NEW_LINE> <INDENT> return False | 只读model admin | 62598fa7a17c0f6771d5c149 |
class TzOffset(tzinfo): <NEW_LINE> <INDENT> def __init__(self, offset): <NEW_LINE> <INDENT> self._offset = timedelta(hours=offset) <NEW_LINE> <DEDENT> def utcoffset(self, dt): <NEW_LINE> <INDENT> return self._offset <NEW_LINE> <DEDENT> def tzname(self, dt): <NEW_LINE> <INDENT> return 'TzOffset: {}'.format(self._offset.... | Minimal implementation of a timezone offset to help testing with timezone
aware datetimes. | 62598fa70c0af96317c56296 |
class VoucherForm(forms.Form): <NEW_LINE> <INDENT> amount = forms.IntegerField(label=_(u"Amount"), required=True, help_text=_(u'Number of vouchers to create')) <NEW_LINE> value = forms.FloatField(label=_(u"Value"), required=True) <NEW_LINE> start_date = forms.DateField(label=_(u"Start date"), required=True) <NEW_LINE> ... | Form to add a Voucher.
| 62598fa744b2445a339b68f9 |
class WalltimeError(AbiFWError): <NEW_LINE> <INDENT> ERROR_CODE = ErrorCode.WALLTIME | Exception raised when the calculation didn't complete within the specified walltime. | 62598fa78e71fb1e983bb9c7 |
class StringsResponse(BaseModel): <NEW_LINE> <INDENT> language: Optional[str] = Field(None, description="Language of the returned strings") <NEW_LINE> age: Optional[List[AgeString]] = Field(None, description="List of all strings and their IDs for ages") <NEW_LINE> civ: Optional[List[CivilizationString]] = Field( None, ... | An object to encapsulate the response from the strings API endpoint. | 62598fa73539df3088ecc1c9 |
class TrieTree: <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> self.children = {} <NEW_LINE> self.end = False <NEW_LINE> self.parent = parent <NEW_LINE> self._value = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return self._value <NEW_LINE> <DEDENT> @valu... | Trie tree. Also called digital, radix or prefix tree.
To create new tree just use default constructor: TrieTree() | 62598fa710dbd63aa1c70ac7 |
class FakeStream(object): <NEW_LINE> <INDENT> def __init__(self, data, size): <NEW_LINE> <INDENT> self._count = 0 <NEW_LINE> self._data = data <NEW_LINE> self._size = size <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self._data) <NEW_LINE> <DEDENT> def read(self, *args): <NEW_LINE> <INDENT> if ... | Send data and simulate a connectivity issue | 62598fa70a50d4780f7052f1 |
class HelperExceptionInner(Exception): <NEW_LINE> <INDENT> pass | Exception for tests to raise to test exception handling. | 62598fa721bff66bcd722b7b |
class StreamSummary(StreamResult): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._hook = _StreamToTestRecord(self._gather_test) <NEW_LINE> self._handle_status = { 'success': self._success, 'skip': self._skip, 'exists': self._exists, 'fail': self._fail, 'xfail': self._xfa... | A specialised StreamResult that summarises a stream.
The summary uses the same representation as the original
unittest.TestResult contract, allowing it to be consumed by any test
runner. | 62598fa74f88993c371f0494 |
class TestLoggerDevelop(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.log_level = 'WARNING' <NEW_LINE> <DEDENT> def test_logging_message(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> message = input('Enter some log message or q to exit: ') <NEW_LINE> if 'q' in message: <... | Tests for LoggerDevelop | 62598fa7627d3e7fe0e06dc1 |
class NoAuthBaseTestCase(BaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> BaseTestCase.setUp(self) <NEW_LINE> self.app.config['LOGIN_DISABLED'] = True <NEW_LINE> self.app.login_manager.init_app(self.app) | Base class for Flask unit tests without authentication.
Apart from the functionality provided by the BaseTestClass, this class disables authentication checking, so that
login_required decorators will be ignored. | 62598fa799cbb53fe6830deb |
class ThermalMap(ColorMap): <NEW_LINE> <INDENT> def __call__(self, x): <NEW_LINE> <INDENT> if x < 0.33: <NEW_LINE> <INDENT> return color.RGBColor(x/0.33, 0, 0) <NEW_LINE> <DEDENT> if x < 0.67: <NEW_LINE> <INDENT> return color.RGBColor(1, (x-0.33)/0.34, 0) <NEW_LINE> <DEDENT> return color.RGBColor(1, 1, (x-0.67)/0.33) | black->red->yellow->white | 62598fa701c39578d7f12c95 |
class FritzDevice: <NEW_LINE> <INDENT> def __init__(self, mac, name=None): <NEW_LINE> <INDENT> self._mac = mac <NEW_LINE> self._name = name <NEW_LINE> self._ip_address = None <NEW_LINE> self._last_activity = None <NEW_LINE> self._connected = False <NEW_LINE> <DEDENT> def update(self, dev_info, dev_home, consider_home):... | FritzScanner device. | 62598fa71b99ca400228f4ba |
class CarrierParcelTemplate(orm.Model): <NEW_LINE> <INDENT> _name = 'carrier.parcel.template' <NEW_LINE> _description = 'Parcel template' <NEW_LINE> _rec_name = 'name' <NEW_LINE> def _get_volumetric_weight( self, cr, uid, ids, fields=None, args=None, context=None): <NEW_LINE> <INDENT> res = {} <NEW_LINE> for template i... | Model name: Parcels template
| 62598fa799fddb7c1ca62d73 |
class Handler(object): <NEW_LINE> <INDENT> def __init__(self, app=None, request=None, settings={}): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> self.request = request <NEW_LINE> self.settings = settings <NEW_LINE> <DEDENT> def handle(self, **m): <NEW_LINE> <INDENT> method = self.request.method.lower() <NEW_LINE> if h... | a request handler which is also the base class for an application | 62598fa74428ac0f6e658438 |
class CredentialTypeAccess(BaseAccess): <NEW_LINE> <INDENT> model = CredentialType <NEW_LINE> def can_read(self, obj): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def can_use(self, obj): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def get_method_capability(self, method, obj, parent_obj): <NEW_LINE> <IND... | I can see credentials types when:
- I'm authenticated
I can create when:
- I'm a superuser:
I can change when:
- I'm a superuser and the type is not "managed by Tower" | 62598fa7eab8aa0e5d30bca0 |
class DmozSpider(Spider): <NEW_LINE> <INDENT> name = "dmoz" <NEW_LINE> allowed_domains = ['dmoztools.net'] <NEW_LINE> start_urls = [ "http://dmoztools.net/Computers/Programming/Languages/Python/Books/", "http://dmoztools.net/Arts/Design/Fashion/Magazines_and_E-zines/Women/" ] <NEW_LINE> def parse(self, response): <NEW_... | 首先,Scrapy为爬虫的 start_urls属性中的每个URL创建了一个 scrapy.http.Request 对象 ,并将爬虫的parse 方法指定为回调函数。
然后,这些 Request被调度并执行,之后通过parse()方法返回scrapy.http.Response对象,并反馈给爬虫。 | 62598fa7097d151d1a2c0f3e |
class Operator: <NEW_LINE> <INDENT> def __call__(self, target, flick, alt_ext = None): <NEW_LINE> <INDENT> raise NotImplemented | Interface example for an Operator (but can actually be any callable with the same signature). | 62598fa756ac1b37e6302102 |
class Crawler(): <NEW_LINE> <INDENT> def __init__(self, handler): <NEW_LINE> <INDENT> self.__handler = handler <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> return self.__crawl_next() <NEW_LINE> <DEDENT> def quit(self): <NEW_LINE> <INDENT> if self.is_alive(): <NEW_LINE> <INDENT> self._Thread__stop() <NEW_LINE>... | A breadth-first crawler.
:param handler: A reference to the CrawlerHandler object coordinating the crawling. | 62598fa7a8370b77170f02f0 |
class Soupy(Fs): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.content = self.get_file_contents(self.filename) <NEW_LINE> self.soup = BeautifulSoup(self.content) <NEW_LINE> <DEDENT> def get_content(self): <NEW_LINE> <INDENT> return self.content <NEW_LINE>... | beautiful soup stuff | 62598fa73317a56b869be4d5 |
class MyCustomClassifier(BaseEstimator, ClassifierMixin): <NEW_LINE> <INDENT> def __init__(self, penalty="l1"): <NEW_LINE> <INDENT> BaseEstimator.__init__(self) <NEW_LINE> ClassifierMixin.__init__(self) <NEW_LINE> self.penalty = penalty <NEW_LINE> self.estimator = LogisticRegression(penalty=self.penalty, solver="liblin... | does a simple logistic regression | 62598fa78e7ae83300ee8fb8 |
class TestChangesetTranslationsChecks(FakeCheckoutTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> changed_translation_patch = patch( "pontoon.sync.changeset.ChangeSet.changed_translations", new_callable=PropertyMock, ) <NEW_LINE> self.mock_changed_translations = changed_tr... | Semi-integration tests for translation checks during a sync. | 62598fa7e5267d203ee6b821 |
class CORSMiddleware(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.paths = getattr(settings, "CORS_PATHS", DEFAULT_CORS_PATHS) <NEW_LINE> <DEDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> content_type = response.get('content-type', '').split(";")[0].lower() <NEW_LIN... | From https://github.com/acdha/django-sugar/blob/master/sugar/middleware/cors.py
Middleware that serves up representations with a CORS header to
allow third parties to use your web api from JavaScript without
requiring them to proxy it.
See: http://www.w3.org/TR/cors/
Installation
------------
1. Add to ``settings.M... | 62598fa78da39b475be030f8 |
class URLSafeSerializerMixin(Serializer): <NEW_LINE> <INDENT> default_serializer = _CompactJSON <NEW_LINE> def load_payload( self, payload: bytes, *args: _t.Any, serializer: _t.Optional[_t.Any] = None, **kwargs: _t.Any, ) -> _t.Any: <NEW_LINE> <INDENT> decompress = False <NEW_LINE> if payload.startswith(b"."): <NEW_LIN... | Mixed in with a regular serializer it will attempt to zlib
compress the string to make it shorter if necessary. It will also
base64 encode the string so that it can safely be placed in a URL. | 62598fa7ac7a0e7691f72421 |
class geogrid: <NEW_LINE> <INDENT> def __init__(self, iface): <NEW_LINE> <INDENT> self.iface = iface <NEW_LINE> self.plugin_dir = os.path.dirname(__file__) <NEW_LINE> locale = QSettings().value('locale/userLocale')[0:2] <NEW_LINE> locale_path = os.path.join( self.plugin_dir, 'i18n', 'geogrid_{}.qm'.format(locale)) <NEW... | QGIS Plugin Implementation. | 62598fa72c8b7c6e89bd36dc |
class SKUAdmin(object): <NEW_LINE> <INDENT> model_icon = 'fa fa-gift' <NEW_LINE> list_display = ['id', 'name', 'price', 'stock','is_launched', 'sales', 'comments'] <NEW_LINE> search_fields = ['id','name','stock'] <NEW_LINE> list_filter = ['category','is_launched','stock'] <NEW_LINE> list_editable = ['price', 'stock','i... | 商品Admin管理类 | 62598fa766656f66f7d5a306 |
class ShopStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.Ping = channel.unary_unary( '/bloombox.schema.services.shop.v1.Shop/Ping', request_serializer=shop_dot_v1_dot_ShopService__v1__pb2.Ping.Request.SerializeToString, response_deserializer=shop_dot_v1_dot_ShopService__v1__pb2.... | Specifies the retail shop service, which provides functionality for pickup and delivery orders, member verification,
member enrollment, and more. | 62598fa74a966d76dd5eedf8 |
class TestWorkspace(unittest.TestCase): <NEW_LINE> <INDENT> tmp_examples_path = os.path.join(sys.prefix, 'share', 'doc', 'steelscript', 'examples', 'steelscript') <NEW_LINE> tmp_workspace_path = os.path.join(tmp_examples_path, 'test-workspace') <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT>... | Simple test class which creates a temporary workspace for testing
Before the tests are run, this class will make a workspace in the root
directory of Steelscript as well as ten dummy example files to be used for
testing. Then when all tests have finished, it will delete both the
workspace and the examples files.
The ... | 62598fa7baa26c4b54d4f1c7 |
class CourseAccessHandler(object): <NEW_LINE> <INDENT> def scope_course_instructor(self, data): <NEW_LINE> <INDENT> course_ids = self._courses_with_access_type(data, 'instructor') <NEW_LINE> return ['instructor_courses'] if course_ids else None <NEW_LINE> <DEDENT> def scope_course_staff(self, data): <NEW_LINE> <INDENT>... | Defines two new scopes: `course_instructor` and `course_staff`. Each one is
valid only if the user is instructor or staff of at least one course.
Each new scope has a corresponding claim: `instructor_courses` and
`staff_courses` that lists the course_ids for which the user as instructor
or staff privileges.
The claim... | 62598fa77b25080760ed73c3 |
class QuadBorder(object): <NEW_LINE> <INDENT> def __init__(self, source, line_width, colour=None): <NEW_LINE> <INDENT> self.quads = [Quad(source) for i in range(4)] <NEW_LINE> self.line_width = line_width <NEW_LINE> if colour: <NEW_LINE> <INDENT> self.set_colour(colour) <NEW_LINE> <DEDENT> <DEDENT> def set_vertices(sel... | Class that draws the outline of a rectangle | 62598fa766673b3332c302e1 |
class ServerStub: <NEW_LINE> <INDENT> _stubs = {} <NEW_LINE> def __init__(self, method, is_notification, callable_object): <NEW_LINE> <INDENT> self._method = method <NEW_LINE> self._is_notification = is_notification <NEW_LINE> self._callable_object = callable_object <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def rpc_f... | Server side RPC stub
This class contains server side RPC implementations.
Decorate RPC implementations by :meth:`rpc_function`.
eg::
ServerStub.rpc_function()
def hello(name):
return 'Hello %s!' % name
will define a RPC, whose method name is `hello`.
The `hello()` function will be called when `hello... | 62598fa799fddb7c1ca62d74 |
class RandomVerticalFlip(object): <NEW_LINE> <INDENT> def __init__(self, prob=0.5): <NEW_LINE> <INDENT> self.prob = prob <NEW_LINE> <DEDENT> def __call__(self, item): <NEW_LINE> <INDENT> check_image_is_numpy(item['image']) <NEW_LINE> if random.random() > self.prob: <NEW_LINE> <INDENT> return item <NEW_LINE> <DEDENT> it... | Add Class helper | 62598fa7462c4b4f79dbb924 |
@gin.configurable <NEW_LINE> class EnvironmentDynamics(tf.Module, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractproperty <NEW_LINE> def batch_size(self) -> types.Int: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractproperty <NEW_LINE> def observation_spec(self) -> types.TensorSpec: <NEW_LINE> <INDE... | Abstract class to represent a non-stationary environment dynamics.
This class is used with the NonStationaryStochasticEnvironment class below to
obtain a non-stationary environment.
To define a dynamics, derive from this class and define the abstract methods
and properties below.
To work correctly with graph and eager... | 62598fa7097d151d1a2c0f40 |
class TelescopeParameter(List): <NEW_LINE> <INDENT> klass = TelescopeParameterLookup <NEW_LINE> def __init__(self, dtype=float, default_value=None, **kwargs): <NEW_LINE> <INDENT> if not isinstance(dtype, type): <NEW_LINE> <INDENT> raise ValueError("dtype should be a type") <NEW_LINE> <DEDENT> if isinstance(default_valu... | Allow a parameter value to be specified as a simple value (of type *dtype*),
or as a list of patterns that match different telescopes.
The patterns are given as a list of 3-tuples in in the
form: `[(command, argument, value), ...]`.
Command can be one of:
- 'type': argument is then a telescope type string (e.g.
`(... | 62598fa724f1403a9268583f |
class AclObject(object): <NEW_LINE> <INDENT> swagger_types = { 'accessrights': 'list[str]', 'accesstype': 'str', 'inherit_flags': 'list[str]', 'op': 'str', 'trustee': 'MemberObject' } <NEW_LINE> attribute_map = { 'accessrights': 'accessrights', 'accesstype': 'accesstype', 'inherit_flags': 'inherit_flags', 'op': 'op', '... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fa78e7ae83300ee8fb9 |
class TestEnum(TestBase): <NEW_LINE> <INDENT> a = auto() <NEW_LINE> b = auto() | Tests the false positive for enums. | 62598fa7a8ecb03325871127 |
class WCCSVProduct(WCProduct): <NEW_LINE> <INDENT> sku_key = 'meta:MYOB SKU' <NEW_LINE> second_sku_key = 'sku' <NEW_LINE> stock_level_key = 'stock' <NEW_LINE> stock_status_key = 'stock_status' <NEW_LINE> managing_stock_key = 'manage_stock' <NEW_LINE> title_key = 'post_title' <NEW_LINE> id_key = 'ID' <NEW_LINE> @propert... | Interfact for a WooCommerce CSV Product. | 62598fa77047854f4633f2f1 |
class LoopEnv(discrete.DiscreteEnv): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.state = 0 <NEW_LINE> self.action_space = spaces.Discrete(2) <NEW_LINE> self.observation_space = spaces.Discrete(9) <NEW_LINE> nA = 2 <NEW_LINE> nS = 9 <NEW_LINE> isd = np.zeros(nS) <NEW_LINE> isd[0] = 1. <NEW_LINE> P =... | Loop environment
Loop This domain consists of two loops, as shown inFigure
3(b). Actions are deterministic. The problem here is that a
learning algorithm may have already converged on action @ forstate 0 before the largerreward available in state 8 has
been backed up. Here the optimal policy is to do action å
everywher... | 62598fa7656771135c489599 |
class LRUCache(BaseCaching): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.indexes = Counter() <NEW_LINE> <DEDENT> def put(self, key, item): <NEW_LINE> <INDENT> if key is not None and item is not None: <NEW_LINE> <INDENT> if self.cache_data.get(key) is None: <NEW_LINE> <... | lru caching system | 62598fa7d486a94d0ba2bee5 |
class ColorBackgroundSettings(BackgroundSettings,IDisposable): <NEW_LINE> <INDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ReleaseUnmanagedResources(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __enter__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __exit__(... | Represents the rendering color background settings. | 62598fa7bd1bec0571e1504f |
class repeat(object): <NEW_LINE> <INDENT> def next(self): <NEW_LINE> <INDENT> return None | repeat(object [,times]) -> create an iterator which returns the object
for the specified number of times. If not specified, returns the object
endlessly. | 62598fa77d43ff248742738e |
class Price(models.Model): <NEW_LINE> <INDENT> product = models.ForeignKey(Product, on_delete=models.CASCADE, related_name='prices') <NEW_LINE> unit = models.CharField(_('Unit of measurement'), max_length=5, choices=MEASURING_UNIT_CHOICES, default=KILOGRAM) <NEW_LINE> price = models.IntegerField(_('Price per unit')) <N... | product unit price | 62598fa72c8b7c6e89bd36dd |
class DocumentNotFoundError(Error): <NEW_LINE> <INDENT> pass | Raised when document is not found in db. | 62598fa73d592f4c4edbade5 |
class Orc(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://orc.apache.org/" <NEW_LINE> url = "https://github.com/apache/orc/archive/rel/release-1.6.5.tar.gz" <NEW_LINE> version('1.6.5', sha256='df5885db8fa2e4435db8d486c6c7fc4e2c565d6197eee27729cf9cbdf36353c0') <NEW_LINE> depends_on('maven') <NEW_LINE> depen... | the smallest, fastest columnar storage for Hadoop
workloads. | 62598fa72ae34c7f260aaffa |
class MyMutEmbedding(gluon.nn.Block): <NEW_LINE> <INDENT> def __init__(self, dims, out_put_dim, is_reshape=False, **kwargs): <NEW_LINE> <INDENT> super(MyMutEmbedding, self).__init__(**kwargs) <NEW_LINE> self.is_reshape = is_reshape <NEW_LINE> self.dims = list(dims) <NEW_LINE> self.out_put_dim = out_put_dim <NEW_LINE> w... | 自己的embedding层 | 62598fa745492302aabfc3e8 |
class InferHeaderFields(beam.PTransform): <NEW_LINE> <INDENT> def __init__(self, defined_headers, allow_incompatible_records=False): <NEW_LINE> <INDENT> self._defined_headers = defined_headers <NEW_LINE> self._allow_incompatible_records = allow_incompatible_records <NEW_LINE> <DEDENT> def expand(self, pcoll): <NEW_LINE... | Extracts inferred header fields from `Variant` records. | 62598fa7be383301e0253710 |
class StorageExplorer(AmazonS3Handler, GoogleStorageHandler, AzureStorageHandler): <NEW_LINE> <INDENT> def __init__(self, host, logger): <NEW_LINE> <INDENT> super().__init__(host, logger) <NEW_LINE> self.host = host <NEW_LINE> self.logger = logger <NEW_LINE> self.buckets_found = set() <NEW_LINE> <DEDENT> @staticmethod ... | Find and test privileges of target cloud storage and look for sensitive files in it.
Can lead to finding .git/.DS_Store/etc files with tokens, passwords and more. | 62598fa7435de62698e9bd0e |
class SettingsError(Exception): <NEW_LINE> <INDENT> pass | Error in game settings | 62598fa74e4d56256637233d |
class CreateTokenView(ObtainAuthToken): <NEW_LINE> <INDENT> serializer_class = AuthTokenSerialiezr <NEW_LINE> renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES | Create new auth token for user | 62598fa73617ad0b5ee0606b |
class ErrorMessageWidget(QLabel): <NEW_LINE> <INDENT> pass | class represinting line with error message shown
to user | 62598fa767a9b606de545ee4 |
class RestClient(Client): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(RestClient, self).__init__(None) <NEW_LINE> <DEDENT> def call(self, session, cmd, action, options, args, method): <NEW_LINE> <INDENT> pass | Class handles REST call for cli | 62598fa744b2445a339b68fb |
class HierarchicalConcurrent(SimpleSequential): <NEW_LINE> <INDENT> def __init__(self, data_format="channels_last", **kwargs): <NEW_LINE> <INDENT> super(HierarchicalConcurrent, self).__init__(**kwargs) <NEW_LINE> self.axis = get_channel_axis(data_format) <NEW_LINE> <DEDENT> def call(self, x, training=None): <NEW_LINE> ... | A container for hierarchical concatenation of blocks with parameters.
Parameters:
----------
data_format : str, default 'channels_last'
The ordering of the dimensions in tensors. | 62598fa74f6381625f19944a |
class trace(AffAtom): <NEW_LINE> <INDENT> def __init__(self, expr) -> None: <NEW_LINE> <INDENT> super(trace, self).__init__(expr) <NEW_LINE> <DEDENT> @AffAtom.numpy_numeric <NEW_LINE> def numeric(self, values): <NEW_LINE> <INDENT> return np.trace(values[0]) <NEW_LINE> <DEDENT> def validate_arguments(self) -> None: <NEW... | The sum of the diagonal entries of a matrix.
Parameters
----------
expr : Expression
The expression to sum the diagonal of. | 62598fa7cc0a2c111447af28 |
class QStageDisplay(QOffsetDisplay): <NEW_LINE> <INDENT> def __init__(self, jump_signal = None, q_label = None, **kwds): <NEW_LINE> <INDENT> super().__init__(**kwds) <NEW_LINE> self.jump_signal = jump_signal <NEW_LINE> self.jump_size = None <NEW_LINE> self.q_label = q_label <NEW_LINE> self.adjust_mode = False <NEW_LINE... | Z stage position. | 62598fa74f88993c371f0496 |
class ResponseProxy(AttributeExposer): <NEW_LINE> <INDENT> __moya_exposed_attributes__ = ["url", "text", "status_code", "headers", "cookies", "history", "content", "json", "encoding"] <NEW_LINE> def __init__(self, req, url, method): <NEW_LINE> <INDENT> self._req = req <NEW_LINE> self._url = url <NEW_LINE> self._method ... | Proxy for a request object | 62598fa7a219f33f346c6730 |
class OriginTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_creationInfo(self): <NEW_LINE> <INDENT> orig = Origin() <NEW_LINE> self.assertEqual(orig.creation_info, None) <NEW_LINE> orig = Origin(creation_info={}) <NEW_LINE> self.assertTrue(isinstance(orig.creation_info, CreationInfo)) <NEW_LINE> orig = Origin... | Test suite for obspy.core.event.Origin | 62598fa756ac1b37e6302105 |
class TestModuleAnalyzer(TestCaseAnalyzer): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.tmp_path = tempfile.mkdtemp(prefix='coqua_') <NEW_LINE> data_path = os.path.dirname(os.path.abspath(__file__)) <NEW_LINE> data_path = os.path.join(data_path, 'data') <NEW_LINE> repo_name ... | ModuleAnalyzer tests | 62598fa7498bea3a75a57a36 |
class Packages(object): <NEW_LINE> <INDENT> @handlers.json_or_html_action <NEW_LINE> def index(self, page=1, format='html'): <NEW_LINE> <INDENT> if format == 'json': <NEW_LINE> <INDENT> pager = Pager(int(page), "/packages.json?page=%d", Package.all().order('-updated'), per_page=50) <NEW_LINE> return json.dumps({ "packa... | The handler for /packages/*.
This handler is in charge of packages (but not package versions, which are
the responsibility of the PackageVersions class). | 62598fa73cc13d1c6d465685 |
class GridCell(object): <NEW_LINE> <INDENT> def __init__(self, xmin, ymin, xmax, ymax, number, index): <NEW_LINE> <INDENT> self.xmin = xmin <NEW_LINE> self.ymin = ymin <NEW_LINE> self.xmax = xmax <NEW_LINE> self.ymax = ymax <NEW_LINE> self.cell_number = number <NEW_LINE> self.index = index | A simple class for determining data values over a grid. | 62598fa74428ac0f6e65843c |
class ssd1325(greyscale_device): <NEW_LINE> <INDENT> def __init__(self, serial_interface=None, width=128, height=64, rotate=0, mode="RGB", framebuffer=None, **kwargs): <NEW_LINE> <INDENT> super(ssd1325, self).__init__(luma.core.const.common, serial_interface, width, height, rotate, mode, framebuffer, nibble_order=1, **... | Serial interface to a 4-bit greyscale SSD1325 OLED display.
On creation, an initialization sequence is pumped to the
display to properly configure it. Further control commands can then be
called to affect the brightness and other settings. | 62598fa7eab8aa0e5d30bca4 |
class AddToCartForm(forms.Form): <NEW_LINE> <INDENT> product_type = forms.ModelChoiceField( queryset=product_type_queryset, widget=forms.widgets.HiddenInput() ) <NEW_LINE> product_id = forms.IntegerField( min_value=1, widget=forms.widgets.HiddenInput() ) <NEW_LINE> quantity = forms.IntegerField(min_value=1, initial=1) ... | A generic form for adding a product to a cart - should post to
cart.views.add | 62598fa7462c4b4f79dbb926 |
class NFSessionBase(object): <NEW_LINE> <INDENT> slots = None <NEW_LINE> session = None <NEW_LINE> verify_ssl = True <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.verify_ssl = bool(g.ADDON.getSettingBool('ssl_verification')) <NEW_LINE> self.is_prefetch_login = False <NEW_LINE> self._init_session() <NEW_LINE> ... | Initialize the netflix session | 62598fa74e4d56256637233e |
class MedicalFile(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> patient = models.ForeignKey(PatientInfo, on_delete=models.CASCADE, related_name='medical_file_of') <NEW_LINE> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> updated = models.DateTimeField(auto_now=True) | 病理档案表 | 62598fa7379a373c97d98f2b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.