code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Linear3d(Camera): <NEW_LINE> <INDENT> def __init__(self, data=None): <NEW_LINE> <INDENT> Camera.__init__(self, data) <NEW_LINE> self.model = 'Linear3d' <NEW_LINE> <DEDENT> def set_calibration(self, calib): <NEW_LINE> <INDENT> assert calib.shape == (3,4) <NEW_LINE> self.calib = calib <NEW_LINE> <DEDENT> def read_c... | Camera model using Direct Linear Transform (DFT) | 62598fc8f548e778e596b8e4 |
class salesContract(View): <NEW_LINE> <INDENT> template_name = 'sales_contract.html' <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> return render(request, self.template_name) | docstring for 销售合同管理. | 62598fc83346ee7daa3377ec |
class PyTerminado(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://pypi.python.org/pypi/terminado" <NEW_LINE> url = "https://pypi.io/packages/source/t/terminado/terminado-0.6.tar.gz" <NEW_LINE> version('0.6', '5b6c65da27fe1ed07a9f80f0588cdaba') <NEW_LINE> depends_on('py-tornado@4:', type=('build', 'run')) <... | Terminals served to term.js using Tornado websockets | 62598fc8be7bc26dc9251fff |
class TestMeasurementPeriod(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 testMeasurementPeriod(self): <NEW_LINE> <INDENT> model = swagger_client.models.measurement_period.MeasurementPeriod() | MeasurementPeriod unit test stubs | 62598fc863b5f9789fe854bd |
class TimelapseSettings(models.Model): <NEW_LINE> <INDENT> camera = models.ForeignKey( 'Camera', related_name='+', blank=True, null=True, default=None ) <NEW_LINE> name = models.CharField( max_length=30, blank=False ) <NEW_LINE> enabled = models.BooleanField( default=False ) <NEW_LINE> interval = models.IntegerField( d... | Model for Timelapse Settings.
- camera (FK)
- name
- enabled
- interval
- duration | 62598fc8a05bb46b3848abb5 |
class Solution: <NEW_LINE> <INDENT> def getAnswer(self, A, B): <NEW_LINE> <INDENT> union=len(set(A).union(set(B))) <NEW_LINE> intersection=len(set(A).intersection(set(B))) <NEW_LINE> difference=len(set(A).difference(set(B))) <NEW_LINE> return [union,intersection,difference] | @param A: The set A
@param B: The set B
@return: Return the size of three sets | 62598fc85fc7496912d4841e |
class WelcomePage(MainHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> user_id, user = self.get_user() <NEW_LINE> if not user: <NEW_LINE> <INDENT> self.redirect('/blog/login') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> template = 'blog-welcome-page.html' <NEW_LINE> params = {'user': user} <NEW_LINE> ... | Landing page after successful signup/login | 62598fc84c3428357761a607 |
class itkImageToVTKImageFilterIUS2(ITKCommonBasePython.itkProcessObject): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <NEW_LINE> __repr__ = _swig... | Proxy of C++ itkImageToVTKImageFilterIUS2 class | 62598fc8656771135c4899ba |
class IPFS_API: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ipfslist = ['Addresses', 'ID', 'AgentVersion', "ProtocolVersion", "PublicKey" ] <NEW_LINE> self.ipfsapi_ip = '127.0.0.1' <NEW_LINE> self.ipfsapi_port = 5001 <NEW_LINE> self.ipfsapi_port2 = 5002 <NEW_LINE> self.debug = False <NEW_LINE> self... | USE:
# first initialize the connection
ipfsnode = Ipfs_API() | 62598fc8adb09d7d5dc0a8c5 |
class DeleteDocxTableRowRangeResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'successful': 'bool', 'edited_document_url': 'str' } <NEW_LINE> attribute_map = { 'successful': 'Successful', 'edited_document_url': 'EditedDocumentURL' } <NEW_LINE> def __init__(self, successful=None, edited_document_url=None): <NEW_L... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fc863b5f9789fe854bf |
class FilterAccessLogger(AccessLogger): <NEW_LINE> <INDENT> def log(self, request, response, time): <NEW_LINE> <INDENT> if self.logger.level != logging.DEBUG and response.status == 200 and request.path in ['/health','/metrics']: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> super().log(request, r... | /health and /metrics filter
Hidding those requests if we have a 200 OK when we are not in DEBUG | 62598fc87b180e01f3e491f5 |
class BaseFeaturedFeedTriggerView(BaseTriggerView): <NEW_LINE> <INDENT> _base_url = 'https://{0.wiki}/w/api.php?action=featuredfeed&feed={0.feed}' <NEW_LINE> def get_feed(self): <NEW_LINE> <INDENT> url = self._base_url.format(self) <NEW_LINE> feed = cache.get(url) <NEW_LINE> if not feed: <NEW_LINE> <INDENT> feed = feed... | Generic view for IFTT Triggers based on FeaturedFeeds. | 62598fc8ec188e330fdf8be0 |
class Act(object): <NEW_LINE> <INDENT> def __init__(self, id, name, proctime, start, end, is_fixed, is_opt): <NEW_LINE> <INDENT> self._id = id <NEW_LINE> self._name = name <NEW_LINE> self._proctime = proctime <NEW_LINE> self._start = start[:-3] <NEW_LINE> self._end = end[:-3] <NEW_LINE> self._fixed = is_fixed <NEW_LINE... | hold one activity | 62598fc850812a4eaa620d8a |
class SqlRelation(nodes.ExpressionNode): <NEW_LINE> <INDENT> __slots__ = ('incarnation', 'sqlCode') <NEW_LINE> def __init__(self, incarnation, sqlCode): <NEW_LINE> <INDENT> super(SqlRelation, self).__init__() <NEW_LINE> self.incarnation = incarnation <NEW_LINE> self.sqlCode = sqlCode <NEW_LINE> <DEDENT> def attributesR... | An expression node corresponding to an SQL expression producing
a relation, with incarnation. | 62598fc871ff763f4b5e7acb |
class ComfoConnectFan(FanEntity): <NEW_LINE> <INDENT> current_speed = None <NEW_LINE> def __init__(self, ccb: ComfoConnectBridge) -> None: <NEW_LINE> <INDENT> self._ccb = ccb <NEW_LINE> <DEDENT> async def async_added_to_hass(self) -> None: <NEW_LINE> <INDENT> _LOGGER.debug("Registering for fan speed") <NEW_LINE> self.a... | Representation of the ComfoConnect fan platform. | 62598fc8adb09d7d5dc0a8c7 |
class _WeightedMeanLossMetric(keras_metrics.Metric): <NEW_LINE> <INDENT> def __init__(self, name='loss', dtype=tf.float32): <NEW_LINE> <INDENT> super(_WeightedMeanLossMetric, self).__init__(name, dtype) <NEW_LINE> self._total_loss = self.add_weight('total_loss', initializer='zeros') <NEW_LINE> self._total_weight = self... | A `tf.keras.metrics.Metric` wrapper for the loss function. | 62598fc89f28863672818a22 |
@attr.s <NEW_LINE> class Transform(Operation): <NEW_LINE> <INDENT> def apply_to(self, group): <NEW_LINE> <INDENT> return [ group[i] for i in self.a ] | Not a real instruction, but maybe useful for optimizing?
a is expected to be a list(length=len(group)) with transformation positions
ex:
a = [4, 1, 2, 0, 3] | 62598fc83346ee7daa3377ee |
class RedisSessionHandler(SessionHandler): <NEW_LINE> <INDENT> def __init__(self, engine): <NEW_LINE> <INDENT> SessionHandler.__init__(self, engine) <NEW_LINE> self.data_source = None <NEW_LINE> <DEDENT> def configure(self): <NEW_LINE> <INDENT> self.life_time = firenado.conf.session['life_time'] <NEW_LINE> self.data_so... | Session handler that deals with file data stored in a redis database. | 62598fc87b180e01f3e491f6 |
class TopicCategoryResource(TypeFilteredResource): <NEW_LINE> <INDENT> def dehydrate_count(self, bundle): <NEW_LINE> <INDENT> resources = bundle.obj.resourcebase_set.all() <NEW_LINE> if settings.RESOURCE_PUBLISHING: <NEW_LINE> <INDENT> resources = resources.filter(is_published=True) <NEW_LINE> <DEDENT> if self.type_fil... | Category api | 62598fc8cc40096d6161a37e |
class PyMemprof(PythonPackage): <NEW_LINE> <INDENT> homepage = "http://jmdana.github.io/memprof/" <NEW_LINE> pypi = "memprof/memprof-0.3.6.tar.gz" <NEW_LINE> version('0.3.6', sha256='a8376ce476bf82a5eb465d1a30b8ffc86cc55b0b6de7aa4cdeccb4c99586d967') <NEW_LINE> depends_on('py-setuptools', type='build') <NEW_LINE> depend... | memprof logs and plots the memory usage of all the
variables during the execution of the decorated methods. | 62598fc8956e5f7376df5824 |
class TestAlerts(object): <NEW_LINE> <INDENT> def test_not_implemented(self, api_client): <NEW_LINE> <INDENT> runner = CliRunner() <NEW_LINE> expected_output = "Error: 'alerts' subcommand is not implemented yet.\n" <NEW_LINE> api_client.not_implemented.side_effect = RequestFailure(501) <NEW_LINE> result = runner.invoke... | Alerts subcommand test cases. | 62598fc8bf627c535bcb17f6 |
@ddt.ddt <NEW_LINE> class Message_detail(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.client = Client(url=self.url, method=Method.POST, type=Type.URL_ENCODE) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.client.result() <NEW_LINE> <DEDENT... | 冒烟-02-消息列表 | 62598fc897e22403b383b252 |
class SameValuesBank(BaseBank): <NEW_LINE> <INDENT> def setup(self, value, purities): <NEW_LINE> <INDENT> self.values = value * np.ones_like(purities) <NEW_LINE> self.weights = self.values / np.array(purities) | The values of all the pieces in the bank are equal (egalitarian bank).
But they might have different purities. Weights adapt accordingly. | 62598fc83617ad0b5ee06495 |
class UnitTetrahedronMesh(Mesh): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = "unittetra" <NEW_LINE> coords = [[0., 0., 0.], [1., 0., 0.], [0., 1., 0.], [0., 0., 1.]] <NEW_LINE> cells = [[1, 0, 3, 2]] <NEW_LINE> plex = dmplex._from_cell_list(3, cells, coords) <NEW_LINE> super(UnitTetrahedronM... | Class that represents a tetrahedron mesh that is composed of one
element. | 62598fc87cff6e4e811b5d75 |
class Parser(argparse.ArgumentParser): <NEW_LINE> <INDENT> def error(self, message): <NEW_LINE> <INDENT> sys.stderr.write('error: %s\n' % message) <NEW_LINE> self.print_help() <NEW_LINE> sys.exit(2) | override the default behavior of the error method of argument parser
| 62598fc84a966d76dd5ef224 |
class Arc: <NEW_LINE> <INDENT> def __init__( self, *, routes: Optional[Sequence[Route]] = None, middleware: Optional[Sequence[tuple[Type[T], dict]]] = None, ): <NEW_LINE> <INDENT> self.router = Router(self, routes) <NEW_LINE> self.middleware = ( self.router ) <NEW_LINE> if middleware is not None: <NEW_LINE> <INDENT> fo... | The main ASGI application
An ASGI application.
Args:
routes: A sequence of routes that the Arc application will
use.
middleware: A sequence of objects that are used as the middleware
for the ASGI app.
Attributes:
router: The router for the ASGI app.
middleware: The middleware for the ASGI... | 62598fc8adb09d7d5dc0a8c9 |
class TestListMaintenanceResponse(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 testListMaintenanceResponse(self): <NEW_LINE> <INDENT> pass | ListMaintenanceResponse unit test stubs | 62598fc8283ffb24f3cf3bd4 |
class GuestUsagesResourceList(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[GuestUsagesResource]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(GuestUsagesResourceList, self).__... | The collection of guest usages resources.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of guest usages resources.
:vartype value: list[~$(python-base-namespace).v2020_05_01_preview.models.GuestUsagesResource] | 62598fc8ec188e330fdf8be4 |
class ClearCustomDescriptorsHandler(BaseStackdriverCommandHandler): <NEW_LINE> <INDENT> def __do_clear(self, options): <NEW_LINE> <INDENT> project = options.get('project', None) <NEW_LINE> stackdriver = stackdriver_service.make_service(options) <NEW_LINE> type_map = stackdriver.fetch_all_custom_descriptors(project) <NE... | Administrative handler to clear all the known descriptors.
This clears all the TimeSeries history as well. | 62598fc8167d2b6e312b72c6 |
class Error(Exception): <NEW_LINE> <INDENT> pass | Base class to be used for other module's exceptions. | 62598fc826068e7796d4ccab |
class Producer: <NEW_LINE> <INDENT> def produce(self): <NEW_LINE> <INDENT> print("Producer is working hard!") <NEW_LINE> <DEDENT> def meet(self): <NEW_LINE> <INDENT> print("Produce has time to meet you now!") | Define the 'resourse-intensive objects to instantiate' | 62598fc88a349b6b4368658e |
class MEMM(_StationaryModel): <NEW_LINE> <INDENT> def __init__(self, models, f_therm, pi=None, f=None, label='ground state'): <NEW_LINE> <INDENT> self.set_model_params(models=models, f_therm=f_therm, pi=pi, f=f, label=label) <NEW_LINE> <DEDENT> @property <NEW_LINE> def unbiased_state(self): <NEW_LINE> <INDENT> try: <NE... | Coupled set of Models at multiple thermodynamic states
Parameters
----------
models : list of Model objects
List of Model objects, e.g. StationaryModel or MSM objects, at the
different thermodynamic states. This list may include the ground
state, such that self.pi = self.models[0].pi holds. An example for
... | 62598fc850812a4eaa620d8c |
class ellipse(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def centerRadius(parent, centerPoint, radiusX, radiusY, offset=[0, 0], label='circle', lineStyle=lineStyle.setSimpleBlack()): <NEW_LINE> <INDENT> arcStringA = ' a %f,%f 0 1 1 %f,%f' % (radiusX, radiusY, -2 * radiusX, 0) <NEW_LINE> arcStringB = ' a %f,%f 0 1 ... | This is a class with different methods for drawing ellipses.
This class contains only static methods so that you don't have to inherit this in your class | 62598fc8f548e778e596b8ec |
class Language(models.Model): <NEW_LINE> <INDENT> name = models.CharField( max_length=100, help_text='Enter language book is written in') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Model representing the book language | 62598fc8f9cc0f698b1c547a |
class ProportionalValveSymbolIcon(BaseSymbolIcon): <NEW_LINE> <INDENT> def __init__(self, parent=None, **kwargs): <NEW_LINE> <INDENT> super(ProportionalValveSymbolIcon, self).__init__(parent, **kwargs) <NEW_LINE> self._interlock_brush = QBrush(QColor(0, 255, 0), Qt.SolidPattern) <NEW_LINE> <DEDENT> @Property(QBrush) <N... | A widget with a proportional valve symbol drawn in it.
Parameters
----------
parent : QWidget
The parent widget for the icon | 62598fc866673b3332c30726 |
class CategorySerializer(serializers.Serializer): <NEW_LINE> <INDENT> pk = serializers.IntegerField(read_only=True) <NEW_LINE> name = serializers.CharField(required=True, max_length=100) <NEW_LINE> def create(self, validated_data): <NEW_LINE> <INDENT> return Category.objects.create(**validated_data) | Serializer for category model | 62598fc863b5f9789fe854c5 |
class Config: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.gmaps_key = os.getenv('GMAPKEY', 'XXXXXXXXXXXXXXXXXXXXXXXX') <NEW_LINE> self.pstack_key = os.getenv('PSTACKEY', 'XXXXXXXXXXXXXXXXXXXXXXXX') <NEW_LINE> self.opencage_key = os.getenv('OPCAGEKEY', 'XXXXXXXXXXXXXXXXXXXXXXXX') <NEW_LINE> self.es_... | Configuration class to store all the env vars | 62598fc8d486a94d0ba2c322 |
class ParameterizedForEach(ForEachBase): <NEW_LINE> <INDENT> def on_failure(self, values, history, *args, **kwargs): <NEW_LINE> <INDENT> return self._on_failure(values, history) <NEW_LINE> <DEDENT> def execute(self, values, history, *args, **kwargs): <NEW_LINE> <INDENT> return self._get_next_value(values, history) | Applies a dynamically provided collection of strategies.
Accepts a collection of decision strategies from a predecessor (or from
storage) as a parameter and returns the next element of that collection on
each try. | 62598fc8be7bc26dc9252003 |
class ReadDataFromKinesis(ExternalTransform): <NEW_LINE> <INDENT> URN = 'beam:external:java:kinesis:read_data:v1' <NEW_LINE> def __init__( self, stream_name, aws_access_key, aws_secret_key, region, service_endpoint=None, verify_certificate=None, max_num_records=None, max_read_time=None, initial_position_in_stream=None,... | An external PTransform which reads byte array stream from Amazon Kinesis.
Experimental; no backwards compatibility guarantees. | 62598fc80fa83653e46f5237 |
class Twitt_listener(StreamListener): <NEW_LINE> <INDENT> def __init__(self, twitt_list, twitt_num): <NEW_LINE> <INDENT> self.invocation_count = 0 <NEW_LINE> self.twitt_list = twitt_list <NEW_LINE> self.twitt_num = twitt_num <NEW_LINE> <DEDENT> def on_data(self, data): <NEW_LINE> <INDENT> self.invocation_count += 1 <NE... | A listener that handles twitts that are the received from the twitter streaming API.
Receives twitt_num number of twitts and appends them to twitt_list | 62598fc897e22403b383b256 |
class SetIdentityProvider(command.Command): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + '.SetIdentityProvider') <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(SetIdentityProvider, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'identity_provider', metavar='<identi... | Set identity provider properties | 62598fc823849d37ff851403 |
class String(Serializer): <NEW_LINE> <INDENT> def __init__(self, min_length=None, max_length=None, *args, **kwargs): <NEW_LINE> <INDENT> self._min = min_length <NEW_LINE> self._max = max_length <NEW_LINE> super(String, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def validate(self, key, value): <NEW_LINE> <INDEN... | Serializer for string data.
:param min_length: This parameter specify the minimum length of the string.
:param max_length: This parameter specify the maximum length of the string. | 62598fc8f9cc0f698b1c547b |
class Command(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument('args', nargs='*') <NEW_LINE> <DEDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> if args: <NEW_LINE> <INDENT> users = [User.objects.get(username=arg) for arg in args] <NEW_LINE> <DEDENT... | Command to print out basic stats on some or all projects. Optionally takes a list of project_ids. | 62598fc871ff763f4b5e7ad1 |
class ImuHw(object): <NEW_LINE> <INDENT> def __init__(self, driver=None, callback=None, logger=None): <NEW_LINE> <INDENT> self._driver = driver <NEW_LINE> self._callback = callback <NEW_LINE> self._logger = logger or Logger() <NEW_LINE> <DEDENT> def _imu_callback(self, msg): <NEW_LINE> <INDENT> self._callback(msg) <NEW... | The ImuHw wraps the IMU driver which can be implemented using various physical IMU hardware devices
and translates IMU data into messages delivered to the HAL node. | 62598fc84c3428357761a60f |
class MeetmeJoin(_Message): <NEW_LINE> <INDENT> pass | Indicates that a user has joined a Meetme bridge.
- 'Channel' : The channel that was bridged
- 'Meetme' : The ID of the Meetme bridge, typically a number formatted as a string
- 'Uniqueid' : An Asterisk unique value
- 'Usernum' : The bridge-specific participant ID assigned to the channel | 62598fc87c178a314d78d7f1 |
class DeclarativeColumnsMetaclass(type): <NEW_LINE> <INDENT> def __new__(mcs, name, bases, attrs): <NEW_LINE> <INDENT> attrs['_meta'] = opts = TableOptions(attrs.get('Meta', None)) <NEW_LINE> cols, remainder = [], {} <NEW_LINE> for attr_name, attr in attrs.items(): <NEW_LINE> <INDENT> if isinstance(attr, columns.Column... | Metaclass that converts `.Column` objects defined on a class to the
dictionary `.Table.base_columns`, taking into account parent class
`base_columns` as well. | 62598fc8ad47b63b2c5a7bac |
class TestCreateValidationFailureMessage(cros_test_lib.TestCase): <NEW_LINE> <INDENT> def GetPatches(self, how_many=1): <NEW_LINE> <INDENT> patches = [SimplePatch() for _ in xrange(how_many)] <NEW_LINE> if how_many == 1: <NEW_LINE> <INDENT> return patches[0] <NEW_LINE> <DEDENT> return patches <NEW_LINE> <DEDENT> def _A... | Tests validation_pool.ValidationPool._CreateValidationFailureMessage | 62598fc87b180e01f3e491f9 |
class Triangle: <NEW_LINE> <INDENT> def __init__(self, lenght): <NEW_LINE> <INDENT> self.lenght = lenght <NEW_LINE> <DEDENT> def get_triangle(self): <NEW_LINE> <INDENT> triangle = "" <NEW_LINE> down_triangle = "" <NEW_LINE> for i in range(self.lenght + 1): <NEW_LINE> <INDENT> triangle += "*" * i <NEW_LINE> triangle += ... | Class that returns a triangle. | 62598fc84527f215b58ea222 |
class InsertPatternException(KnittingError): <NEW_LINE> <INDENT> pass | Exception raised for errors in the insert of the pattern.
Attributes:
expression -- insert pattern expression in which
the error occurred
message -- explanation of the error | 62598fc8377c676e912f6f1f |
class NiftiGeneratorBase(BaseInterface): <NEW_LINE> <INDENT> def _get_out_path(self, meta): <NEW_LINE> <INDENT> if self.inputs.out_format: <NEW_LINE> <INDENT> out_fmt = self.inputs.out_format <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> out_fmt = [] <NEW_LINE> if 'SeriesNumber' in meta: <NEW_LINE> <INDENT> out_fmt.app... | Base class for interfaces that produce Nifti files, potentially with
embeded meta data. | 62598fc826068e7796d4ccaf |
class Embedding(): <NEW_LINE> <INDENT> def __init__(self, size=None, ngram=1): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.ngram = ngram <NEW_LINE> self.vocabulary = dict() <NEW_LINE> self.vocab_size = 0 <NEW_LINE> self.embedding_matrix = None <NEW_LINE> <DEDENT> def load(self, load_path): <NEW_LINE> <INDENT> ... | Class wrapping Embedding initialization, loading, lookup and
saving operations. | 62598fc823849d37ff851405 |
class VersionInfo(Persistent): <NEW_LINE> <INDENT> __allow_access_to_unprotected_subobjects__ = 1 <NEW_LINE> def __init__(self, history_id, version_id, status): <NEW_LINE> <INDENT> self.timestamp = time.time() <NEW_LINE> self.history_id = history_id <NEW_LINE> self.version_id = version_id <NEW_LINE> self.status = statu... | A VersionInfo object contains bookkeeping information for version
controlled objects. The bookkeeping information can be read (but
not changed) by restricted code. | 62598fc8a05bb46b3848abbf |
class Route(ContainerAware): <NEW_LINE> <INDENT> def __call__(self, event): <NEW_LINE> <INDENT> auth_config = self.container.get('application').config['auth'] <NEW_LINE> request = event.params['context']['request'] <NEW_LINE> for provider in auth_config['providers']: <NEW_LINE> <INDENT> provider = self.container.get(pr... | Listens for a route event and attempts to inject the user into the
request if one has been authenticated. | 62598fc8a219f33f346c6b5d |
class RunFile(FileObject): <NEW_LINE> <INDENT> __tablename__ = 'run_file' <NEW_LINE> run_id = Column( String(32), ForeignKey('workflow_run.run_id') ) <NEW_LINE> UniqueConstraint('run_id', 'name') <NEW_LINE> run = relationship('RunObject', back_populates='files') | File resources that are created by successful workflow runs. | 62598fc8ab23a570cc2d4f18 |
class TestKeyReset(SimTestCase): <NEW_LINE> <INDENT> _MENU = ["--propagate", "key", "reset"] <NEW_LINE> _KEYNAME = "testkey" <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self._key_file = RandomKeyTmpFile() <NEW_LINE> RUNNER( ["key", "set", self._KEYNAME, "--keyfile", self._key_file.tmpfile... | Test resetting a key in the keyring. | 62598fc8bf627c535bcb17fe |
class TextPost(Entry): <NEW_LINE> <INDENT> _TYPE = ENTRY_TYPE_TEXT <NEW_LINE> _MIMETYPE = 'text/html' <NEW_LINE> post = db.TextProperty() <NEW_LINE> def toHTML(self): <NEW_LINE> <INDENT> return self.post <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return self.post | Text post. | 62598fc897e22403b383b25a |
class StatusMonitor(cherrypy.Tool): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._point = 'on_start_resource' <NEW_LINE> self._name = 'status' <NEW_LINE> self._priority = 50 <NEW_LINE> self.seenThreads = {} <NEW_LINE> <DEDENT> def callable(self): <NEW_LINE> <INDENT> threadId = threading.current_thre... | Register the status of each thread. | 62598fc85fc7496912d48424 |
class Hashed(Expiring): <NEW_LINE> <INDENT> prefix_length = 4 <NEW_LINE> algorithm = "sha512" <NEW_LINE> rounds = 16384 <NEW_LINE> salt_bytes = 8 <NEW_LINE> min_length = 8 <NEW_LINE> generated = True <NEW_LINE> generated_salt_bytes = 8 <NEW_LINE> generated_rounds = 1 <NEW_LINE> @property <NEW_LINE> def token(self): <NE... | Mixin for tables with hashed tokens | 62598fc9aad79263cf42eb24 |
class Trainer(object): <NEW_LINE> <INDENT> min_count = 10 <NEW_LINE> size = 200 <NEW_LINE> window = 10 <NEW_LINE> model = None <NEW_LINE> def __init__(self, corpus_iterator=None, result_name=None, retrain=True): <NEW_LINE> <INDENT> self.corpus_iterator = corpus_iterator <NEW_LINE> self.result_name = os.path.join('..', ... | 模型训练器 | 62598fc9283ffb24f3cf3bdb |
class ObjectappApphook(CMSApp): <NEW_LINE> <INDENT> name = _('Objectapp App Hook') <NEW_LINE> urls = ['objectapp.urls'] <NEW_LINE> menus = APP_MENUS | Objectapp's Apphook | 62598fc9ad47b63b2c5a7bb0 |
class SearchTestMixin(DBTestMixin): <NEW_LINE> <INDENT> _used_search = False <NEW_LINE> def init_search(self): <NEW_LINE> <INDENT> self._used_search = True <NEW_LINE> self.app.config['AUTO_INDEX'] = True <NEW_LINE> es.initialize() <NEW_LINE> es.cluster.health(wait_for_status='yellow', request_timeout=10) <NEW_LINE> <DE... | A mixin allowing to optionnaly enable indexation and cleanup after | 62598fc9dc8b845886d53912 |
class Pr(object): <NEW_LINE> <INDENT> def __init__(self, P0=0.2, f=1.769, tau_F=67.351, d=0.878, tau_D=92.918, dt=0.01): <NEW_LINE> <INDENT> self.P0 = P0 <NEW_LINE> self.f = f <NEW_LINE> self.tau_F = tau_F <NEW_LINE> self.d = d <NEW_LINE> self.tau_D = tau_D <NEW_LINE> self.P = P0 <NEW_LINE> self.dt = dt <NEW_LINE> self... | This object contains internal variables to track the evolution in time of parameters governing synaptic release
probability, used during optimization, and then exported to pr.mod for use during patterned input simulations. | 62598fc9be7bc26dc9252006 |
class ImageCreateView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Image.objects.all() <NEW_LINE> serializer_class = ImageSerializer <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save() | This class defines the create behavior of our rest api. | 62598fc93346ee7daa3377f3 |
class Post(): <NEW_LINE> <INDENT> author = None <NEW_LINE> time = None <NEW_LINE> device = None <NEW_LINE> content = None <NEW_LINE> post_id = None <NEW_LINE> thread_id = None <NEW_LINE> REPR = "{} wirte; {} on {} at {}" <NEW_LINE> INSERT_SQL = "insert into vclub_post_info (post_no, thread_no, content, author , pos... | 用来表示一个post类型 | 62598fc94428ac0f6e65887e |
class Suspend(base.HandlerPluginBase): <NEW_LINE> <INDENT> DESCRIPTION = "Suspend/Resume VM" <NEW_LINE> NAME = "suspend" <NEW_LINE> def start(self, ctx, action, block=False): <NEW_LINE> <INDENT> if not self.can_execute(action): <NEW_LINE> <INDENT> self.register_action(action, discard=True) <NEW_LINE> raise exceptions.A... | Suspend VM
| 62598fc95fcc89381b2662f9 |
class SolutionRemoveDuplicatesfromSortedList: <NEW_LINE> <INDENT> def deleteDuplicates(self, head): <NEW_LINE> <INDENT> p = head <NEW_LINE> while (p != None): <NEW_LINE> <INDENT> while ((p.next != None) and (p.val == p.next.val)): <NEW_LINE> <INDENT> p.next = p.next.next <NEW_LINE> <DEDENT> p = p.next <NEW_LINE> <DEDEN... | @param head: A ListNode
@return: A ListNode | 62598fc9ec188e330fdf8bee |
@six.python_2_unicode_compatible <NEW_LINE> class SolumException(Exception): <NEW_LINE> <INDENT> message = _("An unknown exception occurred.") <NEW_LINE> code = 500 <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> if CONF.fatal_exception_format_errors: <NEW_LINE> <INDENT> ass... | Base Solum Exception
To correctly use this class, inherit from it and define
a 'msg_fmt' property. That msg_fmt will get printf'd
with the keyword arguments provided to the constructor. | 62598fc9adb09d7d5dc0a8d3 |
class V1GcsType(BaseTypeConfig, polyaxon_sdk.V1GcsType): <NEW_LINE> <INDENT> IDENTIFIER = "gcs" <NEW_LINE> SCHEMA = GcsTypeSchema <NEW_LINE> REDUCED_ATTRIBUTES = ["bucket", "blob"] <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> path = "gs://{}".format(self.bucket) <NEW_LINE> if self.blob: <NEW_LINE> <INDENT> path = ... | GCS type.
Args:
bucket: str
blob: str
### YAML usage
The inputs definition
```yaml
>>> inputs:
>>> - name: test1
>>> type: gcs
>>> - name: test2
>>> type: gcs
```
The params usage
```yaml
>>> params:
>>> test1: {value: {bucket: "gs://bucket1"}}
>>> test1: {value: {bucket: "gs://bucket2", b... | 62598fc94a966d76dd5ef230 |
class TestUniqueIdentity(TestCaseBase): <NEW_LINE> <INDENT> def test_unique_uuid(self): <NEW_LINE> <INDENT> with self.assertRaisesRegexp(IntegrityError, DUP_CHECK_ERROR): <NEW_LINE> <INDENT> uid1 = UniqueIdentity(uuid='John Smith') <NEW_LINE> uid2 = UniqueIdentity(uuid='John Smith') <NEW_LINE> self.session.add(uid1) <N... | Unit tests for UniqueIdentity class | 62598fc99f28863672818a29 |
class _StructField(AbstractProtoWrapper): <NEW_LINE> <INDENT> def __init__(self, proto): <NEW_LINE> <INDENT> assert proto <NEW_LINE> self._proto = proto <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._proto.field_name <NEW_LINE> <DEDENT> @property <NEW_LINE> def type(self): <NE... | A field in a struct.
| 62598fc9fbf16365ca794413 |
class ClasseFonction(Fonction): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def init_types(cls): <NEW_LINE> <INDENT> cls.ajouter_types(cls.entre_salle, "Salle", "Salle") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def entre_salle(origine, destination): <NEW_LINE> <INDENT> if origine is destination: <NEW_LINE> <INDENT>... | Retourne les salles entre deux autres salles. | 62598fc9ad47b63b2c5a7bb4 |
class GeventServer(ServerAdapter): <NEW_LINE> <INDENT> def run(self, handler): <NEW_LINE> <INDENT> from gevent import wsgi as wsgi_fast, pywsgi as wsgi, monkey <NEW_LINE> if self.options.get('monkey', True): <NEW_LINE> <INDENT> monkey.patch_all() <NEW_LINE> <DEDENT> if self.options.get('fast', False): <NEW_LINE> <INDEN... | Untested. Options:
* `monkey` (default: True) fixes the stdlib to use greenthreads.
* `fast` (default: False) uses libevent's http server, but has some
issues: No streaming, no pipelining, no SSL. | 62598fc9a8370b77170f0735 |
class SupervisedDataset(Dataset): <NEW_LINE> <INDENT> @drop_unused_kws <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> def split_names(self) -> Dict[Split, str]: <NEW_LINE> <INDENT> return SplitIndexer.default_split_names <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstrac... | Supervised Dataset is comprised of separate Splits | 62598fc97b180e01f3e491fd |
class ParallelInstruction(messages.Message): <NEW_LINE> <INDENT> flatten = messages.MessageField('FlattenInstruction', 1) <NEW_LINE> name = messages.StringField(2) <NEW_LINE> outputs = messages.MessageField('InstructionOutput', 3, repeated=True) <NEW_LINE> parDo = messages.MessageField('ParDoInstruction', 4) <NEW_LINE>... | A ParallelInstruction object.
Fields:
flatten: A FlattenInstruction attribute.
name: A string attribute.
outputs: A InstructionOutput attribute.
parDo: A ParDoInstruction attribute.
partialGroupByKey: A PartialGroupByKeyInstruction attribute.
read: A ReadInstruction attribute.
systemName: A string attrib... | 62598fc9ab23a570cc2d4f1b |
class RedisStorage(DataStorage): <NEW_LINE> <INDENT> def __init__(self, host="localhost", port=6379, db=0, password=None, socket_timeout=None, connection_pool=None, charset='utf-8', errors='strict', unix_socket_path=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.conn = None <NEW_LINE> self.host = host <N... | Selinon adapter for Redis database. | 62598fc9bf627c535bcb1804 |
class HybridVirtualInterfacesNegativeTestJSON(test_virtual_interfaces_negative.VirtualInterfacesNegativeTestJSON): <NEW_LINE> <INDENT> pass | Test virtual interfaces negative | 62598fc926068e7796d4ccb7 |
class bone_bake_locations(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.bone_bake_locations" <NEW_LINE> bl_label = "bone_bake_locations" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.active_object != None <NEW_LINE> <DEDENT> def execute(self, context): <NEW... | Bake rotation for selected bones | 62598fc923849d37ff85140d |
@registry.add('classical_damage') <NEW_LINE> class ClassicalDamage(Damage): <NEW_LINE> <INDENT> def __init__(self, imt, taxonomy, fragility_functions, hazard_imtls, investigation_time, risk_investigation_time): <NEW_LINE> <INDENT> self.imt = imt <NEW_LINE> self.taxonomy = taxonomy <NEW_LINE> self.risk_functions = fragi... | Implements the ClassicalDamage workflow | 62598fc9851cf427c66b860f |
class Response(ResponseBase, swob.Response): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> swob.Response.__init__(self, *args, **kwargs) <NEW_LINE> if self.etag: <NEW_LINE> <INDENT> self.etag = self.etag <NEW_LINE> <DEDENT> sw_sysmeta_headers = swob.HeaderKeyDict() <NEW_LINE> sw_headers =... | Similar to the Response class in Swift, but uses our HeaderKeyDict for
headers instead of Swift's HeaderKeyDict. This also translates Swift
specific headers to S3 headers. | 62598fc9ff9c53063f51a9a8 |
class DeltaEvent(DeltaObject): <NEW_LINE> <INDENT> def __init__(self, name, function): <NEW_LINE> <INDENT> DeltaObject.__init__(self) <NEW_LINE> self._set_name_(name) <NEW_LINE> self._enabled = True <NEW_LINE> self._handlers = [] <NEW_LINE> self._function = function <NEW_LINE> <DEDENT> def set_enable(self, enable): <NE... | Delta event class. | 62598fc95fc7496912d48427 |
class Comment(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='Пользователь', related_name='band_commentator') <NEW_LINE> band = models.ForeignKey(Band, on_delete=models.CASCADE, verbose_name='Запись') <NEW_LINE> content = models.CharField(max_length=250, verbose... | Events comment model. | 62598fc9d8ef3951e32c8009 |
class CCDistrMoeModel(models.BaseModel): <NEW_LINE> <INDENT> def create_model(self, model_input, vocab_size, num_mixtures=None, l2_penalty=1e-8, is_training=True, **unused_params): <NEW_LINE> <INDENT> reduced_distr_size = 1024 <NEW_LINE> batch_size = tf.shape(model_input)[0] <NEW_LINE> part_size = 393 <NEW_LINE> time_s... | Classifiers Chain Moe | 62598fc94a966d76dd5ef232 |
class BlogSectionForm(FlaskForm): <NEW_LINE> <INDENT> name = StringField('Blog Section', validators=[DataRequired()]) <NEW_LINE> submit = SubmitField('Submit') | Form for admin to add, edit, delete blog section | 62598fc9fbf16365ca794415 |
class TestStochRSIIndicator(unittest.TestCase): <NEW_LINE> <INDENT> _filename = "test/data/cs-stochrsi.csv" <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls._df = pd.read_csv(cls._filename, sep=",") <NEW_LINE> cls._params = dict( close=cls._df["Close"], window=14, smooth1=3, smooth2=3, fi... | https://school.stockcharts.com/doku.php?id=technical_indicators:stochrsi | 62598fc9dc8b845886d53918 |
class Animal(): <NEW_LINE> <INDENT> def __init__(self, species, animal_noise): <NEW_LINE> <INDENT> self.species = species <NEW_LINE> self.animal_noise = animal_noise <NEW_LINE> <DEDENT> def speak(self): <NEW_LINE> <INDENT> return print(f'I am a {self.species} and I say {self.animal_noise}') | This represents an animal | 62598fc9ab23a570cc2d4f1c |
class Number: <NEW_LINE> <INDENT> comparisons = 0 <NEW_LINE> def __init__(self, value): <NEW_LINE> <INDENT> self._value = value <NEW_LINE> return <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self._value) <NEW_LINE> <DEDENT> def __eq__(self, target): <NEW_LINE> <INDENT> Number.comparisons += 1 <... | -------------------------------------------------------
Wraps a class definition around integers.
Uses class attribute comparisons to determine how many times
comparison functions are called on the class.
Use: print(Number.comparisons)
Use: Number.comparisons = 0
------------------------------------------------------- | 62598fc9be7bc26dc9252009 |
class LoadRowFileAction(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, filename, option_string=None): <NEW_LINE> <INDENT> ret = [] <NEW_LINE> logging.debug(f"opening {filename} as CSV") <NEW_LINE> with open(filename) as f: <NEW_LINE> <INDENT> for row in f: <NEW_LINE> <INDENT> s = row.rstrip... | load a file line by line into an opt | 62598fc9ec188e330fdf8bf2 |
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL <NEW_LINE> @staticmethod <NEW_LINE> @callback <NEW_LINE> def async_get_options_flow(config_entry): <NEW_LINE> <INDENT> return OptionsFlowHandler(config_entry) <N... | Handle a config flow for NOAA Aurora Integration. | 62598fc94527f215b58ea22c |
class ProfilePhoto(Entity): <NEW_LINE> <INDENT> @property <NEW_LINE> def height(self): <NEW_LINE> <INDENT> return self.properties.get('height', None) <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT> return self.properties.get('width', None) | A profile photo of a user, group or an Outlook contact accessed from Exchange Online.
It's binary data not encoded in base-64.
The supported sizes of HD photos on Exchange Online are as follows: '48x48', '64x64', '96x96', '120x120',
'240x240', '360x360','432x432', '504x504', and '648x648'. | 62598fc9cc40096d6161a386 |
class Row(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __init__(self, row, conv_bool=False): <NEW_LINE> <INDENT> if self.__class__ == Row: <NEW_LINE> <INDENT> raise TypeError("Can't instantiate a non-subclassed row") <NEW_LINE> <DEDENT> for index in range(len(self.__slots__)): <NEW_LINE> <I... | Conceptually, a Row in a SQL database. Subclass to define a table, __slots__ is used to define
the columns in order. Can be saved and loaded from a database | 62598fc926068e7796d4ccb9 |
class _nxm_ip (object): <NEW_LINE> <INDENT> @property <NEW_LINE> def value (self): <NEW_LINE> <INDENT> return self._unpack_value(self._value) <NEW_LINE> <DEDENT> @value.setter <NEW_LINE> def value (self, value): <NEW_LINE> <INDENT> if isinstance(value, tuple) or isinstance(value, list): <NEW_LINE> <INDENT> assert len(v... | Allows setting of IP address in many formats
The value can be any format known by IPAddr. If it's a string, it can
also have a trailing /netmask or /cidr-bits. If it's a tuple, the
first is assumed to be any kind of IP address and the second is either
a netmask or the number of network bits. | 62598fc9851cf427c66b8611 |
class uninstantiated_subprogram_name(parser.name): <NEW_LINE> <INDENT> def __init__(self, sString): <NEW_LINE> <INDENT> parser.name.__init__(self, sString) | unique_id = subprogram_instantiation_declaration : uninstantiated_subprogram_name | 62598fc9d8ef3951e32c800a |
class TuyaDevice(Entity): <NEW_LINE> <INDENT> def __init__(self, tuya): <NEW_LINE> <INDENT> self.tuya = tuya <NEW_LINE> <DEDENT> async def async_added_to_hass(self): <NEW_LINE> <INDENT> dev_id = self.tuya.object_id() <NEW_LINE> self.hass.data[DOMAIN]['entities'][dev_id] = self.entity_id <NEW_LINE> async_dispatcher_conn... | Tuya base device. | 62598fc9091ae35668704f87 |
class SubmissionJSONFeedGenerator(SyndicationFeed): <NEW_LINE> <INDENT> mime_type = 'application/json' <NEW_LINE> def _encode_complex(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, datetime.datetime): <NEW_LINE> <INDENT> return obj.isoformat() <NEW_LINE> <DEDENT> <DEDENT> def write(self, outfile, encoding): <NEW_LI... | JSON feed generator for Submissions
TODO: Someday maybe make this into a JSON Activity Stream? | 62598fc97cff6e4e811b5d85 |
class IndexView(ListView): <NEW_LINE> <INDENT> queryset = CosplayPost.objects.all().order_by('-created') <NEW_LINE> template_name = 'core/index.html' <NEW_LINE> context_object_name = 'posts' <NEW_LINE> paginate_by = 6 | Вью для главной страницы, все посты | 62598fc99f28863672818a2b |
class NoDataReturnedError(InvalidDataReturnedError): <NEW_LINE> <INDENT> pass | An empty JSON file was downloaded from 4chan. This usually means that the thread
is dead/deleted. | 62598fc97c178a314d78d7fd |
class GradsOfGradsTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.left_input = torch.tensor([[1., 1.]], requires_grad=True) <NEW_LINE> self.right_input = torch.tensor([[0.32], [0.72]], requires_grad=True) <NEW_LINE> self.expected_grad = torch.tensor([[0.3972, 0.6762], [0.2869, 0.4... | Perform tests for taking gradients of gradients. Specifically, this uses a
quadratic layer as a test example since it yields non-trivial results (unlike a
linear layer) and enables manually calculated expected values. | 62598fc9a219f33f346c6b67 |
class PDT_OT_ModalDrawOperator(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "pdt.modaldraw" <NEW_LINE> bl_label = "PDT Modal Draw" <NEW_LINE> bl_options = {"REGISTER", "UNDO"} <NEW_LINE> _handle = None <NEW_LINE> @staticmethod <NEW_LINE> def handle_add(self, context): <NEW_LINE> <INDENT> if PDT_OT_ModalDrawOper... | Show/Hide Pivot Point | 62598fc997e22403b383b264 |
class CfgReader: <NEW_LINE> <INDENT> def __init__(self, default_settings_path: AnyStr): <NEW_LINE> <INDENT> self.config = ConfigParser(interpolation=ExtendedInterpolation()) <NEW_LINE> self.config.read([get_config_path(default_settings_path)]) <NEW_LINE> <DEDENT> def get_opt(self, s: AnyStr, v: AnyStr, default: Any = N... | Config reader.
There are 3 way of getting an option. In priority order:
1. From system env.
2. From config.
3. From default values.
For using the option from system env you can build an option name as
MM__ + [SECTION_NAME] + _ + [VALUE_NAME]. | 62598fc960cbc95b0636469c |
class OrderedBase: <NEW_LINE> <INDENT> CREATION_COUNTER_FIELD = '_creation_counter' <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> if type(self) is not OrderedBase: <NEW_LINE> <INDENT> self.touch_creation_counter() <NEW_LINE> <DEDENT> <DEDENT> def touch_creation_count... | Marks a class as being ordered.
Each instance (even from subclasses) will share a global creation counter. | 62598fc94527f215b58ea22e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.