code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class EmptyStmt(Statement): <NEW_LINE> <INDENT> def is_empty_stmt(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<{}>'.format(self.__class__.__name__) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '' | A representation of an empty statement. | 62598f9760cbc95b0636404a |
class Major: <NEW_LINE> <INDENT> def __init__(self, dept, flag, course): <NEW_LINE> <INDENT> self.dept = dept <NEW_LINE> self.flag = flag <NEW_LINE> self.course = course | class that stores all information about a major
including the name of the major, the required courses and electives | 62598f97adb09d7d5dc0a28a |
class TestPack(BaseTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> super(TestPack, self).afterSetUp() <NEW_LINE> self.socket = Mock() <NEW_LINE> self.socket.recv.return_value = RESULT <NEW_LINE> self.plugin = Plugin('TEST') <NEW_LINE> <DEDENT> @patch('sys.exit', return_value='') <NEW_LINE> @pat... | Tests for objects loaded from ZP.
Checks for templates and graph definitions. | 62598f97d99f1b3c44d053b2 |
class Segment(object): <NEW_LINE> <INDENT> def __init__(self, name=None, date=None, comment=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.date = date <NEW_LINE> self.comment = comment <NEW_LINE> self.xmin = self.xmax = self.ymin = self.ymax = self.zmin = self.zmax = None <NEW_LINE> self.commands = [] <NEW... | Compass .PLT segment. A segment is a container for :class:`Command` objects. | 62598f97cc0a2c111447ad18 |
class BaseHandler: <NEW_LINE> <INDENT> handler_name = 'nop' <NEW_LINE> def __init__(self, table_name, args, log): <NEW_LINE> <INDENT> self.table_name = table_name <NEW_LINE> self.args = args <NEW_LINE> self.log = log <NEW_LINE> <DEDENT> def add(self, trigger_arg_list): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def r... | Defines base API, does nothing.
| 62598f97e76e3b2f99fd8736 |
class OciLoggingHandler(logging.Handler): <NEW_LINE> <INDENT> _oci_config = None <NEW_LINE> _loggroup_name = None <NEW_LINE> _customlog_name = None <NEW_LINE> _log_id = None <NEW_LINE> def __init__(self, oci_config, loggroup_name, customlog_name): <NEW_LINE> <INDENT> super(OciLoggingHandler, self).__init__() <NEW_LINE>... | Custom class for OCI Logging Service.
| 62598f979b70327d1c57eaa4 |
class CourseShiftSettingsView(views.APIView): <NEW_LINE> <INDENT> permission_classes = CourseShiftsPermission, <NEW_LINE> def get(self, request, course_id): <NEW_LINE> <INDENT> course_key = CourseKey.from_string(course_id) <NEW_LINE> shift_settings = CourseShiftSettings.get_course_settings(course_key) <NEW_LINE> if shi... | Allows instructor to edit course shift settings | 62598f978da39b475be02ee6 |
class Animal(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def talk(self): <NEW_LINE> <INDENT> raise NotImplementedError("Subclass must implement abstract method") | Animal "interface".
.. item:: SW_REQ_001 The software shall provide an abstract animal interface.
:validated_by: SW_TEST_001
:impacts_on: SW_REQ_003 SW_REQ_005 | 62598f97a17c0f6771d5bf3e |
class Worker(QRunnable): <NEW_LINE> <INDENT> def __init__(self, pool, callback, *callbackArgv): <NEW_LINE> <INDENT> super(Worker, self).__init__() <NEW_LINE> self.__pool = pool <NEW_LINE> self.__callback = callback <NEW_LINE> self.__callbackArgv = callbackArgv <NEW_LINE> self.signals = WorkerSignals() <NEW_LINE> <DEDEN... | "A worker designed to process data from WorkerPool
Not aimed to be instancied directly, jsut use WorkerPool | 62598f9730bbd722464697f7 |
class Bunch(dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Bunch, self).__init__(*args, **kwargs) <NEW_LINE> self.__dict__ = self | 使用`.`运算符获取字典的键值; | 62598f9791af0d3eaad39b0b |
class UserSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('first_name', 'last_name', 'username', 'email', 'password', 'is_superuser', 'last_login',) | Explixitly creates a User serializer | 62598f976aa9bd52df0d4bd0 |
class ConfigurationError(Exception): <NEW_LINE> <INDENT> pass | Exception signifies a programmers error in setting up the reports | 62598f9723849d37ff850dc9 |
class ApiTargetKeyDetails(_messages.Message): <NEW_LINE> <INDENT> @encoding.MapUnrecognizedFields('additionalProperties') <NEW_LINE> class ApiTargetsValue(_messages.Message): <NEW_LINE> <INDENT> class AdditionalProperty(_messages.Message): <NEW_LINE> <INDENT> key = _messages.StringField(1) <NEW_LINE> value = _messages.... | Key details that specify which APIs a key is allowed to be used on.
Messages:
ApiTargetsValue: A restriction for a specific service and optionally one
or multiple specific methods. Requests will be allowed if they match any
of these restrictions. If no restrictions are specified, all targets are
allowed.... | 62598f97a8ecb03325870f0d |
class Connector(GenericConnector): <NEW_LINE> <INDENT> def connect(self): <NEW_LINE> <INDENT> self.initConnection() <NEW_LINE> try: <NEW_LINE> <INDENT> self.connector = psycopg2.connect(host=self.hostname, user=self.user, password=self.password, database=self.db, port=self.port) <NEW_LINE> <DEDENT> except psycopg2.Oper... | Homepage: http://initd.org/psycopg/
User guide: http://initd.org/psycopg/docs/
API: http://initd.org/psycopg/docs/genindex.html
Debian package: python-psycopg2
License: GPL
Possible connectors: http://wiki.python.org/moin/PostgreSQL | 62598f97009cb60464d01228 |
class XcbException(Exception): <NEW_LINE> <INDENT> pass | The basic exception class, suitable for many errors :) | 62598f97ac7a0e7691f7220f |
class DryRunRESTClient(CURLRESTClient): <NEW_LINE> <INDENT> def _exec(self, method, extra_args=None, expect_json=None): <NEW_LINE> <INDENT> url = self.make_service_url() <NEW_LINE> cmd = self.make_curl_cmd(method, url, extra_args) <NEW_LINE> self.logger.info("[DryRun] {0}".format(CURLRESTClient.debug_curl_cmd(cmd))) | Neutered IRESTClient impl; only logs. | 62598f97097d151d1a2c0d26 |
class GIL_681: <NEW_LINE> <INDENT> pass | Nightmare Amalgam | 62598f977047854f4633f0e4 |
class ActionIssued: <NEW_LINE> <INDENT> def __init__(self, ai: BotAI, unit_tag: int) -> None: <NEW_LINE> <INDENT> self.ai = ai <NEW_LINE> self.delay = 1 <NEW_LINE> if ai.realtime: <NEW_LINE> <INDENT> self.delay = 10 <NEW_LINE> <DEDENT> self.frame: int = ai.state.game_loop <NEW_LINE> self.tag: int = unit_tag <NEW_LINE> ... | Individual action that is assigned to a unit. Used for preventing duplicate build orders. | 62598f973539df3088ecbfc5 |
class Version(): <NEW_LINE> <INDENT> def __init__(self, master): <NEW_LINE> <INDENT> self.master = master <NEW_LINE> self.window = tk.Toplevel(master) <NEW_LINE> self.window.wm_attributes('-topmost', 1) <NEW_LINE> sw = self.window.winfo_screenwidth() <NEW_LINE> sh = self.window.winfo_screenheight() <NEW_LINE> ww = 400 ... | 软件版本说明介绍界面 | 62598f974e4d562566372126 |
class THREADLIST(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> count = _swig_property(_x64dbgapi64.THREADLIST_count_get, _x64dbgapi64.THREADLIST_count_set) <NEW_LINE> list = _swig_property(... | Proxy of C++ THREADLIST class | 62598f9799cbb53fe6830bd4 |
class ApiBlock(models.Model): <NEW_LINE> <INDENT> contributor = models.ForeignKey( 'Contributor', null=False, on_delete=models.CASCADE, help_text='The contributor to whom the block applies.' ) <NEW_LINE> until = models.DateTimeField( null=False, help_text='The time until which the block is enforced.' ) <NEW_LINE> activ... | Stores information regarding api blocks incurred by users. | 62598f972ae34c7f260aade4 |
class IPluginInterface(object): <NEW_LINE> <INDENT> def __new__(cls, *arg, **kw): <NEW_LINE> <INDENT> raise TypeError("IPluginInterface class cannot be instantiated, it " "is for documentation and API verification only") <NEW_LINE> <DEDENT> def options(self, parser, env): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> de... | IPluginInterface describes the plugin API.
Do not subclass or use this class directly. | 62598f97b7558d5895463332 |
class ConnectionFromController(SchemaAMP): <NEW_LINE> <INDENT> implements(IQueuer) <NEW_LINE> def __init__(self, transactionFactory, schema, whenConnected, boxReceiver=None, locator=None): <NEW_LINE> <INDENT> super(ConnectionFromController, self).__init__(schema, boxReceiver, locator) <NEW_LINE> self.transactionFactory... | A L{ConnectionFromController} is the connection to a node-controller
process, in a worker process. It processes requests from its own
controller to do work. It is the opposite end of the connection from
L{ConnectionFromWorker}. | 62598f9738b623060ffa8d91 |
class AaveHistory(NamedTuple): <NEW_LINE> <INDENT> events: List[AaveEvent] <NEW_LINE> total_earned_interest: Dict[Asset, Balance] <NEW_LINE> total_lost: Dict[Asset, Balance] <NEW_LINE> total_earned_liquidations: Dict[Asset, Balance] | All events and total interest accrued for all Atoken of an address
| 62598f970a50d4780f7050db |
class DoubleType(CassandraType): <NEW_LINE> <INDENT> pass | Stores data as an 8 byte double.
.. versionadded:: 1.2.0 | 62598f973eb6a72ae038a341 |
class Sunspider(test.Test): <NEW_LINE> <INDENT> test = _SunspiderMeasurement <NEW_LINE> def CreatePageSet(self, options): <NEW_LINE> <INDENT> return page_set.PageSet.FromDict( { 'archive_data_file': '../page_sets/data/sunspider.json', 'make_javascript_deterministic': False, 'pages': [{ 'url': _URL }], }, os.path.abspat... | Apple's SunSpider JavaScript benchmark. | 62598f97a05bb46b3848a583 |
class Bootstrap4GridContainer(CMSPlugin): <NEW_LINE> <INDENT> container_type = models.CharField( verbose_name=_('Container type'), choices=GRID_CONTAINER_CHOICES, default=GRID_CONTAINER_CHOICES[0][0], max_length=255, help_text=mark_safe_lazy(_( 'Defines if the grid should use fixed width (<code>.container</code>) ' 'or... | Layout > Grid: "Container" Plugin
https://getbootstrap.com/docs/4.0/layout/grid/ | 62598f97498bea3a75a57824 |
class Sgfmill_SimpleTestCase(Sgfmill_testcase_mixin, test_framework.SimpleTestCase): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.init_sgfmill_testcase_mixin() | SimpleTestCase with the Sgfmill mixin. | 62598f9767a9b606de545cd8 |
class GenreSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Genre <NEW_LINE> url = serializers.HyperlinkedIdentityField( view_name="genre", lookup_field="id" ) <NEW_LINE> fields = ('id', 'url', 'genre_name') | JSON Serializer for MixUp genres | 62598f97be383301e0253500 |
class PictureFullSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> url = serializers.HyperlinkedIdentityField( view_name='picture-detail', lookup_field='sha1', ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Picture <NEW_LINE> fields = ( 'url', 'id', 'sha1', 'source_file', 'user', 'description' ) <NEW_L... | A serializer with all pictures data. | 62598f978e7ae83300ee8da1 |
class ReactWrap(object): <NEW_LINE> <INDENT> client_cache = None <NEW_LINE> event_user = 'Reactor' <NEW_LINE> def __init__(self, opts): <NEW_LINE> <INDENT> self.opts = opts <NEW_LINE> if ReactWrap.client_cache is None: <NEW_LINE> <INDENT> ReactWrap.client_cache = salt.utils.cache.CacheDict(opts['reactor_refresh_interva... | Create a wrapper that executes low data for the reaction system | 62598f9715baa72349461c86 |
class Autographer: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.check_config() <NEW_LINE> <DEDENT> @cached_property <NEW_LINE> def session(self): <NEW_LINE> <INDENT> session = requests.Session() <NEW_LINE> session.auth = HawkAuth( id=str(settings.AUTOGRAPH_HAWK_ID), key=str(settings.AUTOGRAPH_HAWK_S... | Interacts with an Autograph service.
If Autograph signing is not configured using `settings.AUTOGRAPH`,
raises `ImproperlyConfigured`. If the Autograph server can't be reached
or returns an HTTP error, an error will be thrown by `requests`. | 62598f971b99ca400228f3af |
class DataGenerator(keras.utils.Sequence): <NEW_LINE> <INDENT> def __init__(self, sess, list_images, labels, num_classes, image_dir, jpeg_data_tensor, decoded_image_tensor, batch_size, shuffle=False): <NEW_LINE> <INDENT> self.sess = sess <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.labels = labels <NEW_LINE... | Generates data for Keras | 62598f97d6c5a102081e1e48 |
class Synset: <NEW_LINE> <INDENT> def __init__(self, name, definition): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.definition = definition <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '{} - {}'.format(self.name, self.definition) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> ... | Wordnet Synsets.
name string
definition string | 62598f9799cbb53fe6830bd5 |
class Downloader(object): <NEW_LINE> <INDENT> def __init__(self, file_date=None): <NEW_LINE> <INDENT> if file_date is None: <NEW_LINE> <INDENT> file_date = date.today() <NEW_LINE> <DEDENT> self.url = BHAVCOPY_URL + self._get_file_name(file_date) <NEW_LINE> self.serialized_file = None <NEW_LINE> <DEDENT> def _get_file_n... | Downloader Class -> To Download Extract and Parse Bhavcopy from URL. | 62598f977b25080760ed71a7 |
class Order(models.Model): <NEW_LINE> <INDENT> account = models.ForeignKey(Account) <NEW_LINE> datum = models.ForeignKey(Datum) <NEW_LINE> timestamp = models.DateTimeField('Time created') <NEW_LINE> is_successful = models.BooleanField(default=False) <NEW_LINE> @staticmethod <NEW_LINE> def reset(ev): <NEW_LINE> <INDENT>... | A pending or already processed order from a user for some market | 62598f9785dfad0860cbf8f6 |
class TestYamlConfig(TestCase): <NEW_LINE> <INDENT> def test_load_config(self): <NEW_LINE> <INDENT> config = YamlConfig('./tests/resources/yaml/simple.yml') <NEW_LINE> assert 'hello' in config.load().keys() <NEW_LINE> <DEDENT> def test_yamlconfig_method(self): <NEW_LINE> <INDENT> eager = yamlconfig('./tests/resources/y... | Test the YamlConfig class.
This test doesn't need much as almost everything
is covered in 'test_importconfig.py'. | 62598f9763b5f9789fe84e7b |
class Error(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[ErrorDetails]'}, 'inner_error': {'key': 'innerError', 'type': 'str'}, ... | Error.
:param code:
:type code: str
:param message:
:type message: str
:param target:
:type target: str
:param details:
:type details: list[~azure.mgmt.network.v2017_10_01.models.ErrorDetails]
:param inner_error:
:type inner_error: str | 62598f97fff4ab517ebcd4f2 |
class MemoryStorage (Storage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.records = {} <NEW_LINE> self.transaction = None <NEW_LINE> self.oid = 0 <NEW_LINE> <DEDENT> def new_oid(self): <NEW_LINE> <INDENT> self.oid += 1 <NEW_LINE> return p64(self.oid) <NEW_LINE> <DEDENT> def load(self, oid): <NEW_L... | A concrete Storage that keeps everything in memory.
This may be useful for testing purposes. | 62598f97097d151d1a2c0d28 |
class HistoryIdentifyModel(HistoryBaseModel, CommonModel): <NEW_LINE> <INDENT> id = models.UUIDField( primary_key=True, default=uuid.uuid4, editable=False ) <NEW_LINE> history = models.ManyToManyField( UserModel, related_name='identify_users_histories' ) <NEW_LINE> favorite = models.ManyToManyField( UserModel, related_... | History identify model. | 62598f977047854f4633f0e6 |
class TestTransactionHash(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return TransactionHash... | TransactionHash unit test stubs | 62598f97851cf427c66b7fcc |
class TaskDetailSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> project_title = serializers.CharField(source='project.projectTitle') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Task <NEW_LINE> fields = ['taskName', 'email', 'website', 'taskBody', 'project_title', 'is_displayed', 'published_on'] | DRF Serializer For The Detail Of A Task | 62598f973539df3088ecbfc7 |
class CRTPPort: <NEW_LINE> <INDENT> CONSOLE = 0x00 <NEW_LINE> PARAM = 0x02 <NEW_LINE> COMMANDER = 0x03 <NEW_LINE> MEM = 0x04 <NEW_LINE> LOGGING = 0x05 <NEW_LINE> LOCALIZATION = 0x06 <NEW_LINE> COMMANDER_GENERIC = 0x07 <NEW_LINE> SETPOINT_HL = 0x08 <NEW_LINE> PLATFORM = 0x0D <NEW_LINE> LINKCTRL = 0x0F <NEW_LINE> ALL = 0... | Lists the available ports for the CRTP. | 62598f97bde94217f37074ec |
class OptQEDMolecule(mol_env.Molecule): <NEW_LINE> <INDENT> def __init__(self, discount_factor, **kwargs): <NEW_LINE> <INDENT> super(OptQEDMolecule, self).__init__(**kwargs) <NEW_LINE> self.discount_factor = discount_factor <NEW_LINE> <DEDENT> def _reward(self): <NEW_LINE> <INDENT> molecule = Chem.MolFromSmiles(self._s... | The molecule whose reward is the QED. | 62598f974a966d76dd5eebe7 |
class HTTPError(Exception): <NEW_LINE> <INDENT> __slots__ = ("_status", "detail") <NEW_LINE> def __init__( self, status: typing.Union[int, HTTPStatus], detail: typing.Any = "" ): <NEW_LINE> <INDENT> if isinstance(status, int): <NEW_LINE> <INDENT> status = HTTPStatus( status ) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDEN... | Raised when an HTTP error occurs.
You can raise this within a view or an error handler to interrupt
request processing.
# Parameters
status (int or HTTPStatus):
the status code of the error.
detail (any):
extra detail information about the error. The exact rendering is
determined by the configured error h... | 62598f978a43f66fc4bf1e81 |
class IsAuthenticatedAndAdminUserOrReadOnly(BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> if not request.user.is_authenticated(): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> is_admin = (request.user and request.user.is_staff) <NEW_LINE> return is_admin or req... | Full permissions for admin and read-only for others, must be authenticated
SAFE_METHODS includes (GET, HEAD, OPTIONS), see:
https://github.com/tomchristie/django-rest-framework/blob/2.3.13/rest_framework/permissions.py | 62598f970a50d4780f7050dd |
class IncorrectLanguageError(ValueError): <NEW_LINE> <INDENT> pass | If source language is not english or russian. | 62598f9756b00c62f0fb25b5 |
class OpenStack(object): <NEW_LINE> <INDENT> def __init__(self, username, apikey, auth_url='https://auth.api.rackspacecloud.com/v1.0'): <NEW_LINE> <INDENT> self.backup_schedules = BackupScheduleManager(self) <NEW_LINE> self.client = OpenStackClient(username, apikey, auth_url) <NEW_LINE> self.flavors = FlavorManager(sel... | Top-level object to access the OpenStack Nova API.
Create an instance with your creds::
>>> os = OpenStack(USERNAME, API_KEY, AUTH_URL)
Then call methods on its managers::
>>> os.servers.list()
...
>>> os.flavors.list()
...
&c. | 62598f97cc0a2c111447ad1a |
class TargetTransToTagMethod(TransToJsonMethod): <NEW_LINE> <INDENT> def trans(self): <NEW_LINE> <INDENT> df = load("info") <NEW_LINE> df = df.groupby(["brand", "model", "tag"]).apply(self.trans_func) <NEW_LINE> del df["target"] <NEW_LINE> df = df.drop_duplicates(["brand", "model", "tag"]) <NEW_LINE> dump(df, "info") <... | Transform Target Information To Tag | 62598f97c432627299fa2cdb |
class LoadTrackError(LavalinkException): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> exception = data["exception"] <NEW_LINE> self.severity: ErrorSeverity <NEW_LINE> super().__init__(exception["message"]) | Exception raised when an error occurred when loading a track. | 62598f970a50d4780f7050de |
class CreateUnblockIpResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Ip = None <NEW_LINE> self.ActionType = None <NEW_LINE> self.UnblockTime = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Ip = params.get("Ip"... | CreateUnblockIp返回参数结构体
| 62598f97d58c6744b42dc153 |
class Fighter(object,metaclass = ABCMeta): <NEW_LINE> <INDENT> __slots__ = ('_name','_hp') <NEW_LINE> def __init__(self, name,hp): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._hp = hp <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> @property <... | 战斗者 | 62598f97be383301e0253502 |
class ClosedPoolError(MysockpoolError): <NEW_LINE> <INDENT> pass | Raised when a request enters a pool after the pool has been closed. | 62598f97baa26c4b54d4efb6 |
class IEnumFORMATETC: <NEW_LINE> <INDENT> def Clone(self, newEnum): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Next(self, celt, rgelt, pceltFetched): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Reset(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Skip(self, celt): <NEW_LINE> <INDENT> pass <NEW_LINE>... | Provides the managed definition of the IEnumFORMATETC interface. | 62598f979b70327d1c57eaa8 |
class ContaineranalysisProjectsOccurrencesListRequest(_messages.Message): <NEW_LINE> <INDENT> class KindValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> KIND_UNSPECIFIED = 0 <NEW_LINE> PACKAGE_VULNERABILITY = 1 <NEW_LINE> BUILD_DETAILS = 2 <NEW_LINE> IMAGE_BASIS = 3 <NEW_LINE> PACKAGE_MANAGER = 4 <NEW_LINE> DEPLOYA... | A ContaineranalysisProjectsOccurrencesListRequest object.
Enums:
KindValueValuesEnum: The kind of occurrences to filter on.
Fields:
filter: The filter expression.
kind: The kind of occurrences to filter on.
name: The name field contains the project Id. For example:
"projects/{project_id} @Deprecated
pag... | 62598f977d847024c075c0d9 |
class AMUpNextNotifier(ActionManager): <NEW_LINE> <INDENT> SETTING_ID = 'UpNextNotifier_enabled' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.upnext_info = None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'enabled={}'.format(self.enabled) <NEW_LINE> <DEDENT... | Prepare the data and trigger the AddonSignal for Up Next add-on integration.
The signal must be sent after playback started. | 62598f97d486a94d0ba2bcdb |
class _TestConnectionReverseFailed(ServerTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> async def start_server(cls): <NEW_LINE> <INDENT> def err_handler(conn, _exc): <NEW_LINE> <INDENT> conn.logger.info('Error handler called') <NEW_LINE> <DEDENT> return (await cls.listen_reverse(username='user', error_handler=e... | Unit test for reverse direction connection failure | 62598f97507cdc57c63a4a9b |
class BessifSpider(Spider): <NEW_LINE> <INDENT> def callBack(self, mtd): <NEW_LINE> <INDENT> dispatcher.connect(mtd, signal=signals.spider_closed) <NEW_LINE> <DEDENT> def setItemPipe( self, mtd ): <NEW_LINE> <INDENT> self.pipe = mtd <NEW_LINE> dispatcher.connect(self.item_scraped_handler, signal=signals.item_scraped) <... | Custom Spider with embedded callback and simple item json output | 62598f97379a373c97d98d1a |
class EventTopicDetail(ResourceDetail): <NEW_LINE> <INDENT> def before_get_object(self, view_kwargs): <NEW_LINE> <INDENT> if view_kwargs.get('event_identifier'): <NEW_LINE> <INDENT> event = safe_query_kwargs( Event, view_kwargs, 'event_identifier', 'identifier' ) <NEW_LINE> view_kwargs['event_id'] = event.id <NEW_LINE>... | Event topic detail by id | 62598f978e7ae83300ee8da4 |
class ShowIpInterfaceVrfAllSchema(MetaParser): <NEW_LINE> <INDENT> schema = { Any(): {'vrf': str, 'interface_status': str, 'iod': int, Optional('ipv4'): {Any(): {Optional('ip'): str, Optional('prefix_length'): str, Optional('secondary'): bool, Optional('route_tag'): str, Optional('ip_subnet'): str, Optional('broadcast_... | Schema for show ip interface vrf all | 62598f97462c4b4f79dbb710 |
class Solution: <NEW_LINE> <INDENT> def generateTrees(self, n: int) -> List[TreeNode]: <NEW_LINE> <INDENT> def generateTrees(start, end): <NEW_LINE> <INDENT> if start > end: <NEW_LINE> <INDENT> return [None] <NEW_LINE> <DEDENT> all_trees = [] <NEW_LINE> for i in range(start, end + 1): <NEW_LINE> <INDENT> left = generat... | 二叉搜索树的特性:
右边的数大于当前根节点
左边的数小于当前根节点
没有重复的值 | 62598f9723849d37ff850dcd |
class CrfForwardRnnCell(RNNCell): <NEW_LINE> <INDENT> def __init__(self, transition_params): <NEW_LINE> <INDENT> self._transition_params = array_ops.expand_dims(transition_params, 0) <NEW_LINE> self._num_tags = transition_params.get_shape()[0].value <NEW_LINE> <DEDENT> @property <NEW_LINE> def state_size(self): <NEW_LI... | Computes the alpha values in a linear-chain CRF.
See http://www.cs.columbia.edu/~mcollins/fb.pdf for reference. | 62598f97f8510a7c17d7dffb |
class DocumentRevisionsTests(TestCaseBase): <NEW_LINE> <INDENT> fixtures = ['users.json'] <NEW_LINE> def test_document_revisions_list(self): <NEW_LINE> <INDENT> d = _create_document() <NEW_LINE> user_ = User.objects.get(pk=118533) <NEW_LINE> r1 = revision(summary="a tweak", content='lorem ipsum dolor', keywords='kw1 kw... | Tests for the Document Revisions template | 62598f974e4d562566372129 |
class Client(object): <NEW_LINE> <INDENT> def __init__(self, transport, validate_request=True, validate_response=True, id_gen=idgen_uuid): <NEW_LINE> <INDENT> logging.basicConfig() <NEW_LINE> self.log = logging.getLogger("common.barrister") <NEW_LINE> self.transport = transport <NEW_LINE> self.validate_req = validate_r... | Main class for consuming a server implementation. Given a transport it loads the IDL from
the server and creates proxy objects that can be called like local classes from your
application code.
With the exception of start_batch, you generally never need to use the methods provided by this
class directly.
For example:... | 62598f97851cf427c66b7fce |
class ValueRange(Exception): <NEW_LINE> <INDENT> r <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> super(ValueRange, self).__init__(*args) | Errors resulted from computations over unauthorized regions. | 62598f9721a7993f00c65c87 |
class TestFunctions(unittest.TestCase): <NEW_LINE> <INDENT> @patch('os.listdir', Mock(return_value=['.git'])) <NEW_LINE> def test_find_root(self): <NEW_LINE> <INDENT> path = vcs.find_root('fake/path') <NEW_LINE> self.assertEqual('fake/path', path) <NEW_LINE> <DEDENT> @patch('os.listdir', Mock(return_value=[])) <NEW_LIN... | Unit tests for top-level VCS functions. | 62598f9723e79379d538c209 |
class CompilePandoc(PageCompiler): <NEW_LINE> <INDENT> name = "pandoc" <NEW_LINE> friendly_name = "pandoc" <NEW_LINE> def set_site(self, site): <NEW_LINE> <INDENT> self.config_dependencies = [str(site.config['PANDOC_OPTIONS'])] <NEW_LINE> super(CompilePandoc, self).set_site(site) <NEW_LINE> <DEDENT> def compile(self, s... | Compile markups into HTML using pandoc. | 62598f974a966d76dd5eebe9 |
class valueRequiredProp(SchemaProperty): <NEW_LINE> <INDENT> _prop_schema = 'valueRequired' <NEW_LINE> _expected_schema = 'Boolean' <NEW_LINE> _enum = False <NEW_LINE> _format_as = "ForeignKey" | SchemaField for valueRequired
Usage: Include in SchemaObject SchemaFields as your_django_field = valueRequiredProp()
schema.org description:Whether the property must be filled in to complete the action. Default is false.
prop_schema returns just the property without url#
format_as is used by app templatetags based u... | 62598f970fa83653e46f4bf2 |
class OgrError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.msg) | Exception raised for errors in the whole module.
Attributes:
msg -- explanation of the error | 62598f97dd821e528d6d8c3c |
class PrimitiveSchema(Schema): <NEW_LINE> <INDENT> def __init__(self, atype: str, other_props: Optional[PropsType] = None) -> None: <NEW_LINE> <INDENT> if atype not in PRIMITIVE_TYPES: <NEW_LINE> <INDENT> raise AvroException(f"{atype} is not a valid primitive type.") <NEW_LINE> <DEDENT> Schema.__init__(self, atype, oth... | Valid primitive types are in PRIMITIVE_TYPES. | 62598f97925a0f43d25e7d43 |
class FunctionLoader(BaseLoader): <NEW_LINE> <INDENT> def __init__(self, load_func): <NEW_LINE> <INDENT> self.load_func = load_func <NEW_LINE> <DEDENT> def get_source(self, environment, template): <NEW_LINE> <INDENT> rv = self.load_func(template) <NEW_LINE> if rv is None: <NEW_LINE> <INDENT> raise TemplateNotFound(temp... | A loader that is passed a function which does the loading. The
function receives the name of the template and has to return either
an unicode string with the template source, a tuple in the form ``(source,
filename, uptodatefunc)`` or `None` if the template does not exist.
>>> def load_template(name):
... if name... | 62598f97d99f1b3c44d053b8 |
class SimpleQueue(SimpleBase): <NEW_LINE> <INDENT> no_ack = False <NEW_LINE> queue_opts = {} <NEW_LINE> queue_args = {} <NEW_LINE> exchange_opts = {'type': 'direct'} <NEW_LINE> def __init__(self, channel, name, no_ack=None, queue_opts=None, queue_args=None, exchange_opts=None, serializer=None, compression=None, **kwarg... | Simple API for persistent queues. | 62598f9707f4c71912baf154 |
class Command(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = None <NEW_LINE> self.data = [] <NEW_LINE> self.crc = [] <NEW_LINE> self._IsCrcComputed = False <NEW_LINE> self.rx_timestamp = None <NEW_LINE> <DEDENT> def get_CRC(self): <NEW_LINE> <INDENT> if not self._IsCrcComputed: <NEW_LINE... | Command object. Fully represents a command
in the "framework". | 62598f972c8b7c6e89bd34d7 |
class _LowerBounds(abc.Mapping): <NEW_LINE> <INDENT> def __init__(self, cqm: ConstrainedQuadraticModel): <NEW_LINE> <INDENT> self.cqm: ConstrainedQuadraticModel = cqm <NEW_LINE> <DEDENT> def __getitem__(self, key: Variable) -> float: <NEW_LINE> <INDENT> warnings.warn( "cqm.variables.lower_bounds[v] is deprecated and wi... | Support deprecated attribute on ``CQM.variables`` | 62598f978e7ae83300ee8da5 |
class SGD(object): <NEW_LINE> <INDENT> def train(self, network, training_examples, learning_rate, reg_lambda=0, batch_size=1, passes=1): <NEW_LINE> <INDENT> for _ in range(passes): <NEW_LINE> <INDENT> random.shuffle(training_examples) <NEW_LINE> for i, example in enumerate(training_examples): <NEW_LINE> <INDENT> x = ex... | Class for the Stochastic Gradient Descent (backpropagation) trainer | 62598f97d486a94d0ba2bcdd |
class DeleteRowsTest(JavaTest): <NEW_LINE> <INDENT> order = 91 <NEW_LINE> testClass="org.apache.accumulo.server.test.functional.DeleteRowsTest" | Test Delete Rows | 62598f97379a373c97d98d1b |
class SciWhy(ZM): <NEW_LINE> <INDENT> def check_ahead(self, message, index, count, distance, wordNo, search): <NEW_LINE> <INDENT> if wordNo >= len(search): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> elif (count > distance) or (index + count >= len(message)): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT>... | SciWhy checks incoming messages for the titles of science fiction novels,
then links the wikipedia page for those novels or their authors. | 62598f97fbf16365ca793dbf |
class RESTService(): <NEW_LINE> <INDENT> exposed = True <NEW_LINE> def __init__(self, core): <NEW_LINE> <INDENT> self.base_folder = core.base_folder <NEW_LINE> self.kbmanager = core.getManager("kb") <NEW_LINE> self.kb = KBHandler(core) <NEW_LINE> self.figa = FigaHandler(core) <NEW_LINE> self.ner = NERHandler(core) <NEW... | Core class for handling http request and building substructure of REST API. | 62598f9799cbb53fe6830bd9 |
class HostRescan(Model): <NEW_LINE> <INDENT> ip = IPv4Type(required=True, serialized_name='IP') | Host rescan model structure
| 62598f971f037a2d8b9e3dec |
class DOSFromFunction(DOS): <NEW_LINE> <INDENT> def __init__(self, function, x_min, x_max, n_pts=100, name=''): <NEW_LINE> <INDENT> assert callable(function), "function is not callable" <NEW_LINE> self.function,self.x_min,self.x_max = function,x_min,x_max <NEW_LINE> try : <NEW_LINE> <INDENT> e = function(0.001) <NEW_LI... | * A DOS class, but constructed from a function.
* The number of points can be variable and self-adjusted in the Hilbert transform to adapt precision. | 62598f972ae34c7f260aade9 |
class DgmTypeEffect(caching.base.CachingMixin, models.Model): <NEW_LINE> <INDENT> type = models.ForeignKey(InvType) <NEW_LINE> effect = models.ForeignKey(DgmEffect) <NEW_LINE> is_default = models.BooleanField(default=False) <NEW_LINE> objects = caching.base.CachingManager() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> ap... | Effects related to items. Effects are like boolean flags - if an item has
an effect listed, it's subject to this effect with the specified
parameters, listed as per the DgmEffect.
CCP Table: dgmTypeEffects
CCP Primary key: ("typeID" smallint(6), "effectID" smallint(6)) | 62598f97fff4ab517ebcd4f6 |
class Meta(object): <NEW_LINE> <INDENT> db_table = 'benchmark_model' | db_table | 62598f9710dbd63aa1c708bf |
class ProfileModelSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Profile <NEW_LINE> fields = ( 'picture', 'birth_date', 'classes_buyed', 'is_teacher', 'language', 'country' ) <NEW_LINE> read_only_fields = ( 'classes_buyed', ) | Profile model serializer. | 62598f97ac7a0e7691f72215 |
class ExtensionOrder(models.Model): <NEW_LINE> <INDENT> extension = models.ForeignKey(Extension, on_delete=models.CASCADE) <NEW_LINE> application = models.ForeignKey(Application, on_delete=models.CASCADE) <NEW_LINE> rank = models.IntegerField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> ordering = ('rank',) | The object that determines whether a project is viewable to the public. | 62598f9799cbb53fe6830bda |
class LoginForm(forms.Form): <NEW_LINE> <INDENT> username = forms.CharField(required=True) <NEW_LINE> password = forms.CharField(required=True, min_length=6) | 登录form表单验证 | 62598f97dd821e528d6d8c3e |
@ddt.ddt <NEW_LINE> class DefaultFillTestMixin: <NEW_LINE> <INDENT> model = None <NEW_LINE> def destroy_data(self): <NEW_LINE> <INDENT> self.model.objects.all().delete() <NEW_LINE> <DEDENT> @ddt.data(*CourseSamples.course_ids) <NEW_LINE> def test_default_fill(self, course_id): <NEW_LINE> <INDENT> raise NotImplementedEr... | Test that the view fills in missing data with a default value. | 62598f9710dbd63aa1c708c0 |
class SchoolMember: <NEW_LINE> <INDENT> def __init__(self, name, age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> print ('(Initialized SchooolMember:${0})'.format(self.name)) <NEW_LINE> <DEDENT> def tell(self): <NEW_LINE> <INDENT> print('Name: {0} Age: ${1:d}'.format(self.name, self.age),... | Represents any school member. | 62598f97a79ad16197769d6c |
class Plugin(AirflowPlugin): <NEW_LINE> <INDENT> name = "Plugin" <NEW_LINE> operators = [MsSqlToMsSql, MsSqlToMsSqlWithLookup, MsSqlToMsSqlUsingCTDS, MsSqlToCSV, CSVToMsSql, ExcelToMsSql, ZipOperator, UnzipOperator, CryptographyOperator] <NEW_LINE> hooks = [] <NEW_LINE> executors = [] <NEW_LINE> macros = [] <NEW_LINE> ... | Defines custom airflow plugins. | 62598f978da39b475be02eed |
class DescribeImportMachineInfoRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.MachineList = None <NEW_LINE> self.ImportType = None <NEW_LINE> self.IsQueryProMachine = None <NEW_LINE> self.Filters = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> sel... | DescribeImportMachineInfo请求参数结构体
| 62598f97b57a9660fecd1786 |
class TournamentSelection(AbstractSelection): <NEW_LINE> <INDENT> def __init__(self, mutator, crossover, repairer, num_competitors = 2): <NEW_LINE> <INDENT> AbstractSelection.__init__(self, mutator, crossover, repairer) <NEW_LINE> if num_competitors < 2: <NEW_LINE> <INDENT> raise ValueError("Must have at least 2 compet... | Implement tournament style selection.
| 62598f9707f4c71912baf155 |
class Dragons: <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.url = f'{url}/dragons' <NEW_LINE> <DEDENT> def _get_data(self, params): <NEW_LINE> <INDENT> if params is not None: <NEW_LINE> <INDENT> response = requests.get(self.url + f"/{params}") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> respo... | Represents SpaceX Dragons Object | 62598f970a50d4780f7050e2 |
class IcoLoadOptions(ImageLoadOptions): <NEW_LINE> <INDENT> swagger_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> base = super(IcoLoadOptions, self) <NEW_LINE> base.__init__(**kwargs) <NEW_LINE> self.swagger_types.update(base.swagger_types) <NEW_LINE> self.attri... | Ico load options | 62598f975f7d997b871f9262 |
class DeleteCommentHandler(BlogHandler): <NEW_LINE> <INDENT> def get(self, comment_id, post_id): <NEW_LINE> <INDENT> post = PostHelper.get_post_by_id(post_id) <NEW_LINE> comment = CommentHelper.get_comment_by_id(comment_id) <NEW_LINE> if not post and comment: <NEW_LINE> <INDENT> self.redirect('/') <NEW_LINE> return <NE... | Handle delete comment | 62598f979c8ee8231303fff4 |
@dataclass <NEW_LINE> class WebhookResponse: <NEW_LINE> <INDENT> message: str <NEW_LINE> message_code: int | Response data from a webhook. | 62598f972c8b7c6e89bd34d9 |
class Version(object): <NEW_LINE> <INDENT> def __init__(self, d): <NEW_LINE> <INDENT> self.object_id = int(d['id']) <NEW_LINE> self.name = d['name'] <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Component(%d, '%s')" % (self.object_id, self.name) | Bugzilla product's version representation | 62598f979b70327d1c57eaac |
class MembershipResource(ModelResource): <NEW_LINE> <INDENT> user = fields.ToOneField('freeform_data.api.UserResource', 'user') <NEW_LINE> organization = fields.ToOneField('freeform_data.api.OrganizationResource', 'organization') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> queryset = Membership.objects.all() <NEW_LINE> ... | Encapsulates the Membership Model | 62598f9771ff763f4b5e7483 |
class TerminologyImageDisplayer(ImageDisplayer, FileManagerAware): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.display_protocol = "\033" <NEW_LINE> self.close_protocol = "\000" <NEW_LINE> <DEDENT> def draw(self, path, start_x, start_y, width, height): <NEW_LINE> <INDENT> with temporarily_moved_curs... | Implementation of ImageDisplayer using terminology image display support
(https://github.com/billiob/terminology).
Ranger must be running in terminology for this to work.
Doesn't work with TMUX :/ | 62598f97379a373c97d98d1d |
class UserViewSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> serializer_class = UserRegSerializer <NEW_LINE> queryset = User.objects.all() <NEW_LINE> authentication_classes = (authentication.BasicAuthentication, authentication.SessionAuthen... | 用户 | 62598f97f7d966606f747cf0 |
class Singleton(type): <NEW_LINE> <INDENT> _instance = {} <NEW_LINE> def __call__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if cls not in Singleton._instance: <NEW_LINE> <INDENT> Singleton._instance[cls] = type.__call__(cls, *args, **kwargs) <NEW_LINE> <DEDENT> return Singleton._instance[cls] | 单例模式之 ``__metaclass__`` 方式实现
- 保证程序同一次运行生命周期, 只有一个实例
- 使用方法: 在需要保证单例运行的class 里面添加
``__metaclass__ = Singleton``
.. code:: python
class A(object):
__metaclass__ = Singleton | 62598f978da39b475be02eee |
class _Unset(object): <NEW_LINE> <INDENT> def __bool__(self): <NEW_LINE> <INDENT> return False | Represents an unset value.
Used to differentiate between an explicit ``None`` and an unset value. | 62598f971b99ca400228f3b2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.