code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class reference: <NEW_LINE> <INDENT> shape = None <NEW_LINE> samples = None <NEW_LINE> C = None <NEW_LINE> mean = None <NEW_LINE> def set_from_JSON_load(self): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def set(self, scd, thresh): <NEW_LINE> <INDENT> self._set_reference_samples(scd, thresh) <NEW_LINE> self._set_r...
Organize reference samples Properties ---------- shape: tuple (Nref cells, M observables) samples : ndarray (Nref cells, M observables) single cell measurements C : ndarray (M observables, M observables) Covariance matrix mean : ndarray (M observables, ) un-normalized observable means, Methods ------...
62598f453cc13d1c6d464a15
class UserProfile(ndb.Model): <NEW_LINE> <INDENT> email = ndb.StringProperty() <NEW_LINE> imageUrl = ndb.StringProperty(indexed=False)
User Profile class model.
62598f45eab8aa0e5d30b01b
class _BackgroundColorAttr(_ColorAttr): <NEW_LINE> <INDENT> def __init__(self, color): <NEW_LINE> <INDENT> _ColorAttr.__init__(self, color, 'background')
Background color attribute.
62598f45bf627c535bcb071f
class PrmReplier(Parametre): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Parametre.__init__(self, "replier", "in") <NEW_LINE> self.aide_courte = "replie la passerelle présente" <NEW_LINE> self.aide_longue = "Cette commande replie la passerelle présente dans la salle où " "vous vous...
Commande 'passerelle replier'.
62598f4515fb5d323ce7dfcf
class LoginHandler(Handler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.render('login-form.html') <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> username = self.request.get('username') <NEW_LINE> password = self.request.get('password') <NEW_LINE> u = User.login(username, password) <NEW_LINE> i...
Handles the login page (/login).
62598f45462c4b4f79dbaca6
class TowerTensorHandle(object): <NEW_LINE> <INDENT> @HIDE_DOC <NEW_LINE> def __init__(self, ctx, input, output, inputs_desc=None): <NEW_LINE> <INDENT> self._ctx = ctx <NEW_LINE> self._extra_tensor_names = {} <NEW_LINE> if inputs_desc is not None: <NEW_LINE> <INDENT> assert len(inputs_desc) == len(input) <NEW_LINE> sel...
When a function is called multiple times under each tower, it becomes hard to keep track of the scope and access those tensors in each tower. This class provides easy access to the tensors as well as the inputs/outputs created in each tower.
62598f45bf627c535bcb0723
class FeatureNet(object): <NEW_LINE> <INDENT> def __init__(self, name, is_train): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.is_train = is_train <NEW_LINE> self.reuse = False <NEW_LINE> <DEDENT> def __call__(self, inputs): <NEW_LINE> <INDENT> with tf.variable_scope(self.name, reuse=self.reuse): <NEW_LINE> <IN...
Create an image-to-feature mapping function.
62598f4515fb5d323ce7dfd3
class DecimalFieldAnonymizer(NumericFieldAnonymizer): <NEW_LINE> <INDENT> def get_encrypted_value(self, value, encryption_key: str): <NEW_LINE> <INDENT> return translate_number(str(self.get_numeric_encryption_key(encryption_key)), value) <NEW_LINE> <DEDENT> def get_decrypted_value(self, value, encryption_key: str): <NE...
Anonymization for CharField.
62598f450a366e3fb87dbc7a
class Factory(IFactory): <NEW_LINE> <INDENT> def __init__(self, factory_container: IContainer): <NEW_LINE> <INDENT> self.__container = factory_container <NEW_LINE> <DEDENT> def create(self, from_cls, key=''): <NEW_LINE> <INDENT> return self.__container.resolve(from_cls, key) <NEW_LINE> <DEDENT> def create_all(self, fro...
factory
62598f453cc13d1c6d464a1d
class StartTaskAction(TaskAction): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> job = self.state.get_job(self.task) <NEW_LINE> if not job: <NEW_LINE> <INDENT> logger.error("%s: job does not exist" % self) <NEW_LINE> <DEDENT> elif not self.machine.start_task(job): <NEW_LINE> <INDENT> logger.error("%s: failed t...
Start a task.
62598f4521a7993f00c65223
class Calc(CLI.MultiMode): <NEW_LINE> <INDENT> def __init__(self, argv): <NEW_LINE> <INDENT> super(Calc, self).__init__(argv) <NEW_LINE> self.SubCommands['add'] = Add <NEW_LINE> self.SubCommands['sub'] = Sub <NEW_LINE> self.SubCommands['mul'] = Mul <NEW_LINE> self.SubCommands['div'] = Div
A simple calculator application to showcase the CLI.MultiMode API. Pass the -h | --help flag for more information, or one of the subcommands likewise.
62598f45d164cc617582022b
class Component(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> component_name = db.Column(db.String(100), unique=True, nullable=False, index=True) <NEW_LINE> product_id = db.Column(db.Integer, db.ForeignKey(Product.id)) <NEW_LINE> product = db.relationship("Pr...
Components model for tracking product components. The model is used to keep a record of the components for which the bugs can be filed. This provides a more targeted approach to classifying the busg inside the system.
62598f45627d3e7fe0e0613a
class BucketlistSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> owner = serializers.ReadOnlyField(source = 'owner.username') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Bucketlist <NEW_LINE> fields = ('id', 'name', 'owner','date_created', 'date_modified') <NEW_LINE> read_only_fields = ('date_created...
map model into json
62598f450a366e3fb87dbc80
class set_success(FeedbackResponse): <NEW_LINE> <INDENT> title = "Complete" <NEW_LINE> message_template = "Great work!" <NEW_LINE> score = 1 <NEW_LINE> correct = True <NEW_LINE> category = FeedbackCategory.COMPLETE <NEW_LINE> kind = FeedbackKind.RESULT <NEW_LINE> valence = Feedback.POSITIVE_VALENCE
**(Feedback Function)** Creates Successful feedback for the user, indicating that the entire assignment is done.
62598f45bf627c535bcb072f
class OptimizationException(Exception): <NEW_LINE> <INDENT> pass
Exception class related to failed optimization.
62598f4521a7993f00c6522b
class ClassInputter(inputters.TextInputter): <NEW_LINE> <INDENT> def __init__(self, vocabulary_file_key): <NEW_LINE> <INDENT> super(ClassInputter, self).__init__( vocabulary_file_key=vocabulary_file_key, num_oov_buckets=0) <NEW_LINE> <DEDENT> def make_features(self, element=None, features=None, training=None): <NEW_LIN...
Reading class from a text file.
62598f45eab8aa0e5d30b02d
class vn59_t847(rose.upgrade.MacroUpgrade): <NEW_LINE> <INDENT> BEFORE_TAG = "vn5.9_t1033" <NEW_LINE> AFTER_TAG = "vn5.9_t847" <NEW_LINE> def upgrade(self, config, meta_config=None): <NEW_LINE> <INDENT> self.add_setting(config, ["namelist:jules_soil_biogeochem", "l_ch4_microbe"], ".false.") <NEW_LINE> self.add_setting(...
Upgrade macro from JULES by Sarah Chadburn
62598f45eab8aa0e5d30b02f
class EmbeddedField(BaseField): <NEW_LINE> <INDENT> def __init__(self, name, doc, **kwargs): <NEW_LINE> <INDENT> super(EmbeddedField, self).__init__(name, **kwargs) <NEW_LINE> doc_instance = doc() <NEW_LINE> if not isinstance(doc_instance, EmbeddedDocument): <NEW_LINE> <INDENT> raise TaviTypeError( "expected %s to be a...
Represents an embedded Mongo document. Raises a TaviTypeError if *doc* is not a tavi.document.EmbeddedDocument.
62598f4515fb5d323ce7dfe3
class DBService: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.engine = self.get_db_engine() <NEW_LINE> <DEDENT> def get_db_connection_str(self): <NEW_LINE> <INDENT> return '{engine}://{user}:{pass}@{host}:{port}/{db}'.format( **Config['db'] ) <NEW_LINE> <DEDENT> def get_db_engine(self): <NEW_LINE> <...
Service encapsulating logic and instantiation of the database backend.
62598f45d164cc6175820237
class _SparseMatrix: <NEW_LINE> <INDENT> def __init__(self, size=None, bandwidth=0, matrix=None, sizeHint=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> __array_priority__ = 100.0 <NEW_LINE> def _getMatrix(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __array_wrap(self, arr, context=None): <NEW_LINE> <IN...
.. attention:: This class is abstract. Always create one of its subclasses.
62598f4521a7993f00c65233
class SentencePieceEncoder(object): <NEW_LINE> <INDENT> def __init__(self, sentencepiece_model_file: str, shift_reserved_tokens: int = _SHIFT_RESERVED_TOKENS, newline_symbol: str = ""): <NEW_LINE> <INDENT> self._tokenizer = sentencepiece_processor.SentencePieceProcessor() <NEW_LINE> self._sp_model = tf.io.gfile.GFile(s...
SentencePieceEncoder. First two ids are pad=0, eos=1, rest ids are being shifted up by shift_reserved_tokens. If newline_symbol is provided, will replace newline in the text with that token.
62598f46627d3e7fe0e06149
class Error(Exception): <NEW_LINE> <INDENT> def __init__(self, reason="OSRFramework Generic Error.", steps = "No more information here. Just have a look at the code :(."): <NEW_LINE> <INDENT> self.reason = reason <NEW_LINE> self.steps = steps <NEW_LINE> self.post = "If you need more information on how to solve this, co...
Base class for exceptions in this module. Attributes: reason -- Defines what has just happened steps -- Defines what the user can do to solve this post -- Additional information on how to report the bug
62598f4615fb5d323ce7dfe7
class GetBootSoftwareVersion(OptionalParameterTestFixture): <NEW_LINE> <INDENT> CATEGORY = TestCategory.PRODUCT_INFORMATION <NEW_LINE> PID = 'BOOT_SOFTWARE_VERSION_ID' <NEW_LINE> def Test(self): <NEW_LINE> <INDENT> self.AddIfGetSupported(self.AckGetResult(field_names=['version'])) <NEW_LINE> self.SendGet(ROOT_DEVICE, s...
GET the boot software version.
62598f46462c4b4f79dbacbc
class NothingToDoError(BugXC): <NEW_LINE> <INDENT> oneline = "Nothing to do"
Raised when an empty action is invoked
62598f46627d3e7fe0e0614b
class LanguageModule(CollectionNodeModule): <NEW_LINE> <INDENT> NODE_TYPE = 'language' <NEW_LINE> COLLECTION_LABEL = gettext("Languages") <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.min_ver = None <NEW_LINE> self.max_ver = None <NEW_LINE> super(LanguageModule, self).__init__(*args, **kwargs...
class LanguageModule(CollectionNodeModule) A module class for Language node derived from CollectionNodeModule. Methods: ------- * __init__(*args, **kwargs) - Method is used to initialize the LanguageModule and it's base module. * get_nodes(gid, sid, did) - Method is used to generate the browser collection no...
62598f46d164cc617582023d
class HandlerDecoratorsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_handler_decorator(self): <NEW_LINE> <INDENT> container = {} <NEW_LINE> key = 'test' <NEW_LINE> def empty_function(): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> decorator = _decorate(key, container) <NEW_LINE> decorator(empty_function)() ...
Test that the _decorate function registers the decorated function in the given container
62598f4615fb5d323ce7dfed
class SchemaItem(events.SchemaEventTarget, visitors.Visitable): <NEW_LINE> <INDENT> __visit_name__ = 'schema_item' <NEW_LINE> quote = None <NEW_LINE> def _init_items(self, *args): <NEW_LINE> <INDENT> for item in args: <NEW_LINE> <INDENT> if item is not None: <NEW_LINE> <INDENT> item._set_parent_with_dispatch(self) <NEW...
Base class for items that define a database schema.
62598f460a366e3fb87dbc94
class PoolUpdate(PoolParent, task.Task): <NEW_LINE> <INDENT> @axapi_client_decorator <NEW_LINE> def execute(self, pool, vthunder, update_dict={}, flavor=None): <NEW_LINE> <INDENT> pool.__dict__.update(update_dict) <NEW_LINE> try: <NEW_LINE> <INDENT> service_group = self.axapi_client.slb.service_group.get( pool.id)['ser...
Task to update pool
62598f4621a7993f00c6523e
class ArchiveRunMethod(methods.BaseMethod): <NEW_LINE> <INDENT> def __init__(self, job_args): <NEW_LINE> <INDENT> super(ArchiveRunMethod, self).__init__(job_args) <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> LOG.info('Archiving...') <NEW_LINE> with indicator.Spinner(**self.indicator_options): <NEW_LINE> <IN...
Setup and run the list Method.
62598f46462c4b4f79dbacc6
class PreDeployMigrationStepSerializer(MigrationStepSerializer): <NEW_LINE> <INDENT> class Meta(MigrationStepSerializer.Meta): <NEW_LINE> <INDENT> model = PreDeployMigrationStep
Pre-deploy phase migration step serializer.
62598f463cc13d1c6d464a3b
class YamlCpp(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://github.com/jbeder/yaml-cpp" <NEW_LINE> url = "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.5.3.tar.gz" <NEW_LINE> version('0.5.3', '4e47733d98266e46a1a73ae0a72954eb') <NEW_LINE> variant('shared', default=True, description='Enable build o...
A YAML parser and emitter in C++
62598f4615fb5d323ce7dff3
class EducationInstitution(Base): <NEW_LINE> <INDENT> __tablename__ = 'institutions' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> code = Column(String(20)) <NEW_LINE> name = Column(String(250)) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "{id=%s, code='%s', name='%s'}" % (self.id, self.cod...
Навчальні заклади підтягнуті з бази 1с
62598f46bf627c535bcb0748
class CommunityViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class=serializers.CommunityCreationSerializer <NEW_LINE> queryset = models.CommunityProfile.objects.all()
Handles creating, reading and updating community.
62598f46627d3e7fe0e06159
class Sysbench(Benchmark): <NEW_LINE> <INDENT> FEATURE_CPU = 'cpu' <NEW_LINE> MAX_PRIMES = [30] <NEW_LINE> THREADS = [1, 4, 16] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(Sysbench, self).__init__( attributes=dict( features=[Sysbench.FEATURE_CPU], max_primes=Sysbench.MAX_PRIMES, threads=Sysbench.THREADS, )...
Cross-platform and multi-threaded benchmark tool Current features allow to test the following system parameters: * file I/O performance * scheduler performance * memory allocation and transfer speed * POSIX threads implementation performance * database server performance (OLTP benchmark)
62598f4621a7993f00c65244
class jaccard(Parent): <NEW_LINE> <INDENT> def results_jack(self, num_best = 5): <NEW_LINE> <INDENT> corpus, BOW_user_queries = self.get_corpus() <NEW_LINE> accuracy_array = self.Jaccard_similiarity(corpus, BOW_user_queries, num_best) <NEW_LINE> count = self.get_overall_accuracy(accuracy_array, num_best) <NEW_LINE> len...
simple model that uses the jaccard coefficient on the bag of words
62598f460a366e3fb87dbc9e
class HasPrinterDescription(HasDescription): <NEW_LINE> <INDENT> def __init__(self, argument): <NEW_LINE> <INDENT> super().__init__(argument) <NEW_LINE> self._namespace = "http://www.knora.org/ontology/publishing" <NEW_LINE> self._name = "hasPrinterDescription"
Relating a publication to its printer's description (as object).
62598f46462c4b4f79dbacce
class DummyStorageBackend(BaseStorageBackend): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._data = DummyStorageData._data <NEW_LINE> <DEDENT> def acquire(self, context): <NEW_LINE> <INDENT> if get_dummy_id(context) not in self._data: <NEW_LINE> <INDENT> raise StorageNotFoundError( "context does not...
Dummy backend based on data in a dictionary in memory.
62598f4615fb5d323ce7dff9
class GetImageStackEventsResponseContent(Model): <NEW_LINE> <INDENT> def __init__(self, next_token=None, events=None): <NEW_LINE> <INDENT> self.openapi_types = {"next_token": str, "events": List[StackEvent]} <NEW_LINE> self.attribute_map = {"next_token": "nextToken", "events": "events"} <NEW_LINE> self._next_token = ne...
NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
62598f460a366e3fb87dbca0
@pytest.mark.usefixtures("new_dir") <NEW_LINE> class TestBuildStatePersist: <NEW_LINE> <INDENT> def test_write(self, properties): <NEW_LINE> <INDENT> state = BuildState( assets={"build-packages": ["foo"]}, part_properties=properties, project_options={ "target_arch": "amd64", }, files={"a"}, directories={"b"}, ) <NEW_LI...
Verify writing StepState to file.
62598f46bf627c535bcb0750
class Settings(RequestHandler): <NEW_LINE> <INDENT> @tornado.web.authenticated <NEW_LINE> def get(self): <NEW_LINE> <INDENT> self.check_admin() <NEW_LINE> mod_settings = settings.copy() <NEW_LINE> mod_settings['ROOT'] = constants.ROOT <NEW_LINE> url = settings['DATABASE_SERVER'] <NEW_LINE> match = re.search(r':([^/].+)...
Page displaying settings info.
62598f460a366e3fb87dbca4
class DBHook(hooks.PecanHook): <NEW_LINE> <INDENT> def before(self, state): <NEW_LINE> <INDENT> state.request.dbapi = db.get_api() <NEW_LINE> state.request.dbapi.setup_db_env()
Attach the dbapi object to the request so controllers can get to it.
62598f46627d3e7fe0e06161
class XthemeEnvironment(Environment): <NEW_LINE> <INDENT> template_class = XthemeTemplate <NEW_LINE> def get_template(self, name, parent=None, globals=None): <NEW_LINE> <INDENT> return self.get_or_select_template(self._get_themed_template_names(name), parent=parent, globals=globals) <NEW_LINE> <DEDENT> @internalcode <N...
Overrides the usual template class and allows dynamic switching of Xthemes. Enable by adding ``"environment": "wshop.xtheme.engine.XthemeEnvironment"`` in your ``TEMPLATES`` settings.
62598f46d164cc6175820255
class PolarTransform(mtransforms.Transform): <NEW_LINE> <INDENT> input_dims = 2 <NEW_LINE> output_dims = 2 <NEW_LINE> is_separable = False <NEW_LINE> def __init__(self, axis=None, use_rmin=True, _apply_theta_transforms=True): <NEW_LINE> <INDENT> mtransforms.Transform.__init__(self) <NEW_LINE> self._axis = axis <NEW_LIN...
The base polar transform. This handles projection *theta* and *r* into Cartesian coordinate space *x* and *y*, but does not perform the ultimate affine transformation into the correct position.
62598f46ff9c53063f519928
class PositionBidListView(FieldLimitableSerializerMixin, mixins.ListModelMixin, GenericViewSet): <NEW_LINE> <INDENT> serializer_class = BidSerializer <NEW_LINE> filter_class = BidFilter <NEW_LINE> permission_classes = (IsAuthenticated, isDjangoGroupMember('bureau_ao')) <NEW_LINE> def get_queryset(self): <NEW_LINE> <IND...
list: Return a list of all of the position's bids.
62598f46d164cc617582025b
class SwitchBot(SwitchDevice): <NEW_LINE> <INDENT> def __init__(self, mac, name) -> None: <NEW_LINE> <INDENT> import switchbot <NEW_LINE> self._state = False <NEW_LINE> self._name = name <NEW_LINE> self._mac = mac <NEW_LINE> self._device = switchbot.Switchbot(mac=mac) <NEW_LINE> <DEDENT> def turn_on(self, **kwargs) -> ...
Representation of a Switchbot.
62598f4715fb5d323ce7e007
class OverExtendsNode(ExtendsNode): <NEW_LINE> <INDENT> def find_template(self, name, context, peeking=False): <NEW_LINE> <INDENT> from django.template.loaders.app_directories import app_template_dirs <NEW_LINE> from mezzanine.conf import settings <NEW_LINE> context_name = "OVEREXTENDS_DIRS" <NEW_LINE> if context_name ...
Allows the template ``foo/bar.html`` to extend ``foo/bar.html``, given that there is another version of it that can be loaded. This allows templates to be created in a project that extend their app template counterparts, or even app templates that extend other app templates with the same relative name/path. We use our...
62598f47ff9c53063f51992c
class ArrayHasOffsetError(ValueError): <NEW_LINE> <INDENT> def __init__(self, val="The operation you are attempting does not yet " "support arrays that start at an offset from the beginning " "of their buffer."): <NEW_LINE> <INDENT> ValueError.__init__(self, val)
.. versionadded:: 2013.1
62598f47462c4b4f79dbace0
class FlowUserNotificationOption(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) <NEW_LINE> flow_case = models.ForeignKey( "FlowCase", on_delete=models.PROTECT, db_column='flow_case', related_name='user_notification_option_set') <NEW_LINE> performer = model...
classdocs
62598f47627d3e7fe0e0616f
class CreateUpdateDataRequest(idempierewsc.base.ModelCRUDRequest): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CreateUpdateDataRequest, self).__init__() <NEW_LINE> <DEDENT> def web_service_response_model(self): <NEW_LINE> <INDENT> return idempierewsc.enums.WebServiceResponseModel.StandardResponse ...
iDempiere Web Service CreateUpdateData
62598f4715fb5d323ce7e00f
class Language: <NEW_LINE> <INDENT> prompt_in = 'In [{:d}]: ' <NEW_LINE> prompt_out = 'Out[{:d}]: ' <NEW_LINE> print_string = 'print("{}")' <NEW_LINE> run_file = '-1' <NEW_LINE> cd = 'cd "{}"' <NEW_LINE> pid = '-1' <NEW_LINE> cwd = '-1' <NEW_LINE> hostname = '-1'
Language Base
62598f473cc13d1c6d464a59
@admin.register(models.League) <NEW_LINE> class LeagueAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> def _schedulers(obj): <NEW_LINE> <INDENT> return ', '.join([u.display_name for u in obj.schedulers.all()]) <NEW_LINE> <DEDENT> list_display = ('name', _schedulers) <NEW_LINE> fieldsets = ( (None, { 'fields': ( 'name', 'ab...
Admin for leagues.
62598f47bf627c535bcb0762
class Exam(models.Model): <NEW_LINE> <INDENT> subject = models.CharField( max_length=256, blank=False, verbose_name=u"Предмет") <NEW_LINE> examdate = models.DateTimeField( blank=False, verbose_name=u"Дата і час проведення") <NEW_LINE> teacher = models.CharField( max_length=256, blank=False, verbose_name=u"Викладач") <N...
Exam model
62598f4721a7993f00c6525e
class TemplateContextMiddleware(MiddlewareMixin): <NEW_LINE> <INDENT> def process_template_response(self, request, response): <NEW_LINE> <INDENT> if response.context_data: <NEW_LINE> <INDENT> response.context_data['page_system_name'] = settings.SITE_NAME <NEW_LINE> <DEDENT> return response
common template context
62598f47ff9c53063f519936
class MyApp(object): <NEW_LINE> <INDENT> def __init__(self, slaves): <NEW_LINE> <INDENT> self.master = Master(slaves) <NEW_LINE> self.work_queue = WorkQueue(self.master) <NEW_LINE> <DEDENT> def terminate_slaves(self): <NEW_LINE> <INDENT> self.master.terminate_slaves() <NEW_LINE> <DEDENT> def run(self, tasks=100): <NEW_...
This is my application that has a lot of work to do so it gives work to do to its slaves until all the work is done
62598f47627d3e7fe0e06177
class IAddDraftWizardButtons(interface.Interface): <NEW_LINE> <INDENT> previous = button.Button( title = _(u'Previous'), condition = lambda form: not form.isFirstStep()) <NEW_LINE> interface.alsoProvides(previous, IPreviousAction) <NEW_LINE> savenext = button.Button( title = _(u'Next'), condition = lambda form: not for...
Add wizard buttons
62598f47eab8aa0e5d30b063
class Packet: <NEW_LINE> <INDENT> def __init__(self, ctype: int, flow: int, user_id: int, device_id: int, sequence: int, opcode: int, payload: bytes): <NEW_LINE> <INDENT> self.ctype = ctype <NEW_LINE> self.flow = flow <NEW_LINE> self.user_id = user_id <NEW_LINE> self.device_id = device_id <NEW_LINE> self.sequence = seq...
Packet
62598f470a366e3fb87dbcbd
class IsCasePatientOrDoctor(permissions.BasePermission): <NEW_LINE> <INDENT> def __init__(self, case_id): <NEW_LINE> <INDENT> self.case_id = case_id <NEW_LINE> <DEDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> case = get_object_or_404(Case, id=self.case_id) <NEW_LINE> if request.user.is_authenticate...
Checks that the current user is tied somehow to the given case tied somehow means: surgeon or oncologist or radiotherapist or observer or patient
62598f4715fb5d323ce7e019
class ReceivingAddress(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, verbose_name='用户', on_delete=models.CASCADE) <NEW_LINE> people = models.CharField('收货人', max_length=50) <NEW_LINE> telephone = models.CharField('收货人电话', max_length=50) <NEW_LINE> region = models.CharField('所在地区', max_length=50) <NE...
收货地址
62598f47627d3e7fe0e0617d
class Compiler: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def compile(cls, source_net, compiled_net): <NEW_LINE> <INDENT> raise NotImplementedError
Base class for Compilers.
62598f47bf627c535bcb076e
class InstanceGroupManagersSetAutoHealingPolicyRequest(_messages.Message): <NEW_LINE> <INDENT> autoHealingPolicies = _messages.MessageField('ReplicaPoolAutoHealingPolicy', 1, repeated=True)
A InstanceGroupManagersSetAutoHealingPolicyRequest object. Fields: autoHealingPolicies: The autohealing policy for this managed instance group. You can specify only one value.
62598f4721a7993f00c6526c
class ClientContributionNode(Model): <NEW_LINE> <INDENT> _attribute_map = { 'children': {'key': 'children', 'type': '[str]'}, 'contribution': {'key': 'contribution', 'type': 'ClientContribution'}, 'parents': {'key': 'parents', 'type': '[str]'} } <NEW_LINE> def __init__(self, children=None, contribution=None, parents=No...
ClientContributionNode. :param children: List of ids for contributions which are children to the current contribution. :type children: list of str :param contribution: Contribution associated with this node. :type contribution: :class:`ClientContribution <contributions.v4_1.models.ClientContribution>` :param parents: ...
62598f47eab8aa0e5d30b06d
class AbstractOperation(object): <NEW_LINE> <INDENT> def __init__(self, name, input_message=None, output_message=None, fault_messages=None, parameter_order=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.input_message = input_message <NEW_LINE> self.output_message = output_message <NEW_LINE> self.fault_mess...
Abstract operations are defined in the wsdl's portType elements.
62598f47eab8aa0e5d30b06f
class BaseCommand(object): <NEW_LINE> <INDENT> __slots__ = ["cwd", "env", "encoding"] <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return " ".join(self.formulate()) <NEW_LINE> <DEDENT> def __or__(self, other): <NEW_LINE> <INDENT> return Pipeline(self, other) <NEW_LINE> <DEDENT> def __gt__(self, file): <NEW_LINE> <...
Base of all command objects
62598f47d164cc6175820277
class Bookmark(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> url = db.Column(db.Text, unique=True, nullable=False) <NEW_LINE> desc = db.Column(db.String(80), nullable=False) <NEW_LINE> favicon = db.Column(db.Text, unique=False, nullable=True) <NEW_LINE> def __repr__(self): <NEW_...
A single Bookmark element to be stored in the database.
62598f473cc13d1c6d464a6d
class MongoLogCursor(MongoLogBasePatch, Cursor): <NEW_LINE> <INDENT> def _Cursor__send_message(self, *args, **kwargs): <NEW_LINE> <INDENT> start = time.time() <NEW_LINE> super(MongoLogCursor, self)._Cursor__send_message(*args, **kwargs) <NEW_LINE> run_time = time.time() - start <NEW_LINE> callback_obj = MongoLogEvent(o...
Patched pymongo.cursor.Cursor
62598f47ff9c53063f519946
class NUIngressAuditACLEntryTemplatesFetcher(NURESTFetcher): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def managed_class(cls): <NEW_LINE> <INDENT> from .. import NUIngressAuditACLEntryTemplate <NEW_LINE> return NUIngressAuditACLEntryTemplate
Represents a NUIngressAuditACLEntryTemplates fetcher Notes: This fetcher enables to fetch NUIngressAuditACLEntryTemplate objects. See: bambou.NURESTFetcher
62598f47d164cc6175820279
class K2A(PureUGen): <NEW_LINE> <INDENT> __documentation_section__ = 'Utility UGens' <NEW_LINE> __slots__ = () <NEW_LINE> _ordered_input_names = ( 'source', ) <NEW_LINE> def __init__( self, source=None, calculation_rate=None, ): <NEW_LINE> <INDENT> PureUGen.__init__( self, source=source, calculation_rate=calculation_ra...
A control-rate to audio-rate converter unit generator. :: >>> source = ugentools.SinOsc.kr() >>> k_2_a = ugentools.K2A.ar( ... source=source, ... ) >>> k_2_a K2A.ar()
62598f48462c4b4f79dbacfe
class TypeFailAnnotationInvalid(TypeFail): <NEW_LINE> <INDENT> def __init__(self, src_node: NodeNG) -> None: <NEW_LINE> <INDENT> self.src_node = src_node <NEW_LINE> super().__init__(str(self)) <NEW_LINE> <DEDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> return f'TypeFail: Annotation must be a type'
TypeFailAnnotationInvalid occurs when a variable is annotated as something other than a type :param src_node: astroid node where annotation is set
62598f48eab8aa0e5d30b077
class County(db.Entity): <NEW_LINE> <INDENT> id = PrimaryKey(int, auto=True) <NEW_LINE> subcounties = Set('Subcounty') <NEW_LINE> constituencies = Set('Constituency')
RefTypeMixin
62598f483cc13d1c6d464a73
class Red(float): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Red(%s)" % self
Represents the red component of a :class:`Color` for use in transformations. Instances of this class can be constructed directly with a float value, or by querying the :attr:`Color.red` attribute. Addition, subtraction, and multiplication are supported with :class:`Color` instances. For example:: >>> Color.from_rg...
62598f48462c4b4f79dbad02
class BinaryExpression(Expression): <NEW_LINE> <INDENT> def __init__(self, left, operator, right, lua_operator): <NEW_LINE> <INDENT> assert isinstance(left, Expression) <NEW_LINE> assert isinstance(operator, str) <NEW_LINE> assert isinstance(right, Expression) <NEW_LINE> assert isinstance(lua_operator, str) <NEW_LINE> ...
Binary expressions represent any two expressions that contain an operator between them. A simple example is "1 + 2".
62598f48d164cc6175820282
class LCHColor(_Color): <NEW_LINE> <INDENT> color_space = "LCH" <NEW_LINE> components_sizes = [3, 4] <NEW_LINE> default_components = [0, 0, 0, 1]
<dl> <dt>'LCHColor[$l$, $c$, $h$]' <dd>represents a color with the specified lightness, chroma and hue components in the CIELCh CIELab cube color space. </dl>
62598f48ff9c53063f519950
class ListError(BaseError, TypeError): <NEW_LINE> <INDENT> pass
The argument(s) must be list type.
62598f4815fb5d323ce7e02f
class _TagException(Exception): <NEW_LINE> <INDENT> def __init__(self, tag, data, message): <NEW_LINE> <INDENT> self.tag = tag <NEW_LINE> self.data = data <NEW_LINE> super().__init__(tag, data, message)
Base class for exceptions that are related to issues with tags.
62598f48eab8aa0e5d30b07d
class itkBinaryMask3DMeshSourceIUC3MD3Q(itkImageToMeshFilterPython.itkImageToMeshFilterIUC3MD3Q): <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") <NE...
Proxy of C++ itkBinaryMask3DMeshSourceIUC3MD3Q class
62598f48d164cc6175820286
class GlobalAveragePooling1D(_GlobalPooling1D): <NEW_LINE> <INDENT> def call(self, inputs): <NEW_LINE> <INDENT> return K.mean(inputs, axis=1)
Global average pooling operation for temporal data. Input shape: 3D tensor with shape: `(batch_size, steps, features)`. Output shape: 2D tensor with shape: `(batch_size, features)`
62598f483cc13d1c6d464a7b
class Twist(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def options(argv): <NEW_LINE> <INDENT> options = TwistOptions() <NEW_LINE> try: <NEW_LINE> <INDENT> options.parseOptions(argv[1:]) <NEW_LINE> <DEDENT> except UsageError as e: <NEW_LINE> <INDENT> exit(ExitStatus.EX_USAGE, "Error: {}\n\n{}".format(e, optio...
Run a Twisted application.
62598f4815fb5d323ce7e033
class ReduceResult(Enum): <NEW_LINE> <INDENT> ok = 1 <NEW_LINE> no_crash = 2 <NEW_LINE> dumb = 3
A reduce result.
62598f48d164cc6175820288
class MixedBlock(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_channel, output_channel, stride, split_block=4, kernels=[3, 5, 7, 9], axis=1, group=1, activation="relu"): <NEW_LINE> <INDENT> super(MixedBlock, self).__init__() <NEW_LINE> self.blocks = nn.ModuleList() <NEW_LINE> self.skip_index = None <NEW_LINE...
Mixed Convolution block
62598f48ff9c53063f519956
class HostBaseError(ZkBaseError): <NEW_LINE> <INDENT> pass
Base zookeeper_monitor host exception
62598f48eab8aa0e5d30b083
class EnrollmentTestCase(ModuleStoreTestCase): <NEW_LINE> <INDENT> @patch.dict("django.conf.settings.FEATURES", {"ENABLE_DISCUSSION_SERVICE": True}) <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(EnrollmentTestCase, self).setUp() <NEW_LINE> self.course = CourseFactory.create() <NEW_LINE> self.student = UserFacto...
Tests for the behavior of views depending on if the student is enrolled in the course
62598f4821a7993f00c65284
class NoteBooksTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_option_quotes(self): <NEW_LINE> <INDENT> option_data_frame = pandas.read_pickle( 'test/data/df_SPX_24jan2011.pkl' ) <NEW_LINE> df_final = Compute_IV( option_data_frame, tMin=0.5/12, nMin=6, QDMin=.2, QDMax=.8 ) <NEW_LINE> print('Number of rows: %d...
Test some functions used in notebooks. Mostly useful to test stability of pandas API
62598f48d164cc617582028c
class AbstractUser( DjangoIntegrationMixin, FullNameMixin, ShortNameMixin, EmailAuthMixin, PermissionsMixin, AbstractBaseUser, ): <NEW_LINE> <INDENT> objects = UserManager() <NEW_LINE> REQUIRED_FIELDS = ["full_name", "short_name"] <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> verbose_name = _("u...
Abstract User base class to be inherited. Do not instantiate this class directly. The class provides a fully featured User model with admin-compliant permissions. Differs from Django's :class:`~django.contrib.auth.models.AbstractUser`: 1. Login occurs with an email and password instead of username. 2. Provides short_...
62598f483cc13d1c6d464a81
class TestErrPrint(TestCase): <NEW_LINE> <INDENT> def test_errprint(self): <NEW_LINE> <INDENT> tests = [ (['first', 'second'], 'first second\n'), (['first'], 'first\n'), ([1, 2, 3], '1 2 3\n'), ([], '\n') ] <NEW_LINE> for args, expected in tests: <NEW_LINE> <INDENT> with self.subTest(arguments=args, expected=expected):...
Testing `tabnanny.errprint()`.
62598f48462c4b4f79dbad0e
class Clone(Visitor): <NEW_LINE> <INDENT> def __init__(self, clone_=clone): <NEW_LINE> <INDENT> super(Clone, self).__init__() <NEW_LINE> self._clone = clone_ <NEW_LINE> self._proxies = {} <NEW_LINE> self._node = None <NEW_LINE> <DEDENT> def loop(self, node): <NEW_LINE> <INDENT> if node not in self._proxies: <NEW_LINE> ...
Clone the graph, applying a particular clone function.
62598f480a366e3fb87dbce2
class Gravity(Framework): <NEW_LINE> <INDENT> name = "Gravity controller" <NEW_LINE> description="" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Framework.__init__(self) <NEW_LINE> world = self.world <NEW_LINE> world.gravity = (0, 0) <NEW_LINE> ground = world.create_static_body(shapes=b2.Edge((-20, 0),( 20, 0))) ...
A test of the gravity controller
62598f4821a7993f00c6528a
class CWRStar(SupervisedTemplate): <NEW_LINE> <INDENT> def __init__( self, model: Module, optimizer: Optimizer, criterion, cwr_layer_name: str, train_mb_size: int = 1, train_epochs: int = 1, eval_mb_size: int = None, device=None, plugins: Optional[List[SupervisedPlugin]] = None, evaluator: EvaluationPlugin = default_ev...
CWR* Strategy.
62598f483cc13d1c6d464a87
class Video(Media): <NEW_LINE> <INDENT> type = 'video' <NEW_LINE> def __init__(self, filename, path, settings): <NEW_LINE> <INDENT> super(Video, self).__init__(filename, path, settings) <NEW_LINE> base, ext = splitext(filename) <NEW_LINE> self.src_filename = filename <NEW_LINE> self.date = self._get_file_date() <NEW_LI...
Gather all informations on a video file.
62598f48d164cc6175820296
class ModifyCustomImageAttributeResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId")
ModifyCustomImageAttribute返回参数结构体
62598f4821a7993f00c65290
class MMatrix(object): <NEW_LINE> <INDENT> def __add__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __delitem__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __eq__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(*args, **kwargs): <NEW_LINE> <INDENT> ...
4x4 matrix with double-precision elements.
62598f4821a7993f00c65294
class UnauthorizedError(ApiError): <NEW_LINE> <INDENT> pass
Your request is not authorized to do this action
62598f49eab8aa0e5d30b097
class MirroredFunctionStrategy(distribute_lib.Strategy): <NEW_LINE> <INDENT> def __init__(self, devices=None): <NEW_LINE> <INDENT> extended = MirroredFunctionExtended(self, devices) <NEW_LINE> super(MirroredFunctionStrategy, self).__init__(extended)
Mirrors vars to distribute across multiple devices and machines. This strategy uses one replica per device and sync replication for its multi-GPU version. Unlike `tf.distribute.MirroredStrategy`, it creates a function for a single replica, and calls that function repeatedly instead of recording the operations for each...
62598f493cc13d1c6d464a93
class Lion(Animal): <NEW_LINE> <INDENT> def __init__(self, n): <NEW_LINE> <INDENT> self.name = n <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Hi im a lion named {}".format(self.name) <NEW_LINE> <DEDENT> def feed(self): <NEW_LINE> <INDENT> print('yummy') <NEW_LINE> <DEDENT> def move(self,x,y): <NEW...
A lion in the zoo. [NOT NEEDED] === Attributes === @type name: str ...
62598f4915fb5d323ce7e04b
class AzureCommandLine: <NEW_LINE> <INDENT> HOME = os.path.dirname(os.path.abspath(__file__)) <NEW_LINE> VERSION = 0.1 <NEW_LINE> @classmethod <NEW_LINE> def add_arguments(cls, subparsers, dirs): <NEW_LINE> <INDENT> parser = subparsers.add_parser( 'azure', help='Microsoft Azure', formatter_class=lambda prog: argparse.A...
Sub command-line interface for the Microsoft Azure provider.
62598f49eab8aa0e5d30b099
class CTD_ANON_13 (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = pyxb.binding.datatypes.string <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Loc...
One custom, possibly non-unique, key-value pair.
62598f49bf627c535bcb079d
class SparseCountsMatrix(CountsMatrix): <NEW_LINE> <INDENT> def __init__(self, counts, lengths, ploidy, multiscale_factor=1, beta=1., fullres_torm=None, weight=1.): <NEW_LINE> <INDENT> lengths_lowres = decrease_lengths_res(lengths, multiscale_factor) <NEW_LINE> counts = counts.copy() <NEW_LINE> if sparse.issparse(count...
Stores data for non-zero counts bins.
62598f4956b00c62f0fb1bdc
class AmiEvent(BaseEvent): <NEW_LINE> <INDENT> name="AMIEVENT" <NEW_LINE> def __init__(self, voip_action_name, eventtype, caller, called, context, variable): <NEW_LINE> <INDENT> self.rawdata = [voip_action_name, eventtype, caller, called, context, variable] <NEW_LINE> self.voip_action_name = voip_action_name <NEW_LINE>...
AmiEvent
62598f49627d3e7fe0e061b1
class MixtureDriver(object): <NEW_LINE> <INDENT> def __init__(self, driver1, driver2, mix = 0.5, run_len = 10**5, name = "Mix(%s+%s; %.0e; %f)"): <NEW_LINE> <INDENT> self.d1 = driver1 <NEW_LINE> self.d2 = driver2 <NEW_LINE> self.mix = mix <NEW_LINE> self.run_len = run_len <NEW_LINE> self.name = name % (driver1.name, dr...
driver that mixes requests from two different drivers
62598f49462c4b4f79dbad24
class MemberManager(models.Manager): <NEW_LINE> <INDENT> def create_inactive_user(self, locality, username, email, password): <NEW_LINE> <INDENT> new_user = User.objects.create_user(username, email, password) <NEW_LINE> new_user.is_active = False <NEW_LINE> new_user.save() <NEW_LINE> profile = self.create_profile(new_u...
Custom manager for the MemberProfile model.
62598f49eab8aa0e5d30b09d
class AlgorithmGlasgow(AlgorithmInterface): <NEW_LINE> <INDENT> name = 'Glasgow' <NEW_LINE> required_fields = ['age', 'wbc', 'glucose', 'bun', 'paO2', 'calcium', 'albumin', 'ldh'] <NEW_LINE> score_range = { 'min': 0, 'max': 9, 'threshold': 2 } <NEW_LINE> def evaluate(self): <NEW_LINE> <INDENT> _ = self.request <NEW_LIN...
Computes Glasgow-Imrie Criteria for severity of acute pancreatitis. This is the modified 1984 8-factor criteria, as opposed to the 9 factor criteria. Range(Glasgow-Imrie) = [0,8]. Severe disease if >= 3. Args: age: int wbc: white blood cell count (10^3/mm^3 or 10^9/L) glucose: blood glucose in mg/dL bun: blo...
62598f49bf627c535bcb07a1