code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class MuscleGroupSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = MuscleGroup <NEW_LINE> fields = ('id', 'muscle_group_name') <NEW_LINE> read_only_fields = ('created', 'modified') | Also may not be needed in the REST API | 62598f8de76e3b2f99fd85ff |
class CoreEntry(models.Model): <NEW_LINE> <INDENT> STATUS_CHOICES = ((DRAFT, _('draft')), (HIDDEN, _('hidden')), (PUBLISHED, _('published'))) <NEW_LINE> title = models.CharField( _('title'), max_length=255) <NEW_LINE> slug = models.SlugField( _('slug'), max_length=255, unique_for_date='creation_date', help_text=_("Used... | Abstract core entry model class providing
the fields and methods required for publishing
content over time. | 62598f8d8e71fb1e983bb67f |
class BBaroloWrapper(object): <NEW_LINE> <INDENT> def __init__(self,params=None,**kwargs): <NEW_LINE> <INDENT> if params is None and not kwargs: <NEW_LINE> <INDENT> raise ValueError("BBaroloWrapper must be initialised with a list of BBarolo's parameters") <NEW_LINE> <DEDENT> self.opts = {} <NEW_LINE> if params: <NEW_LI... | A class to directly call BBarolo given some parameters
Attributes
----------
opts: (dict)
A dictionary {param : value} with stored BBarolo's parameters.
Methods
-------
add_options(**kwargs):
Add new options to the opts attribute
remove_option(toremove):
Remove a previously added option from opts list
run(ex... | 62598f8d30dc7b766599f427 |
class Message(dpkt.Packet): <NEW_LINE> <INDENT> __metaclass__ = type <NEW_LINE> __hdr_defaults__ = {} <NEW_LINE> headers = None <NEW_LINE> body = None <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if args: <NEW_LINE> <INDENT> self.unpack(args[0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.... | Hypertext Transfer Protocol headers + body.
TODO: Longer class information....
Attributes:
__hdr__: Header fields of HTTP.
TODO. | 62598f8dd4950a0f3b110c1d |
class CreateMigrateCheckJobResponse(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") | CreateMigrateCheckJob response structure.
| 62598f8d96565a6dacd2cd5f |
class IsInvoicedFilterSpec(SimpleListFilter): <NEW_LINE> <INDENT> def __init__(self, f, request, params, model, *args, **kwargs): <NEW_LINE> <INDENT> super(IsInvoicedFilterSpec, self).__init__(f, request, params, model, *args, **kwargs) <NEW_LINE> self.links = ( (_('Any'), {}), (_('Not Invoiced'), {'%s__exact' % self.f... | Adds filtering by future and previous values in the admin
filter sidebar. Set the is_live_filter filter in the model field attribute
'is\_live\_filter'. my\_model\_field.is\_live\_filter = True | 62598f8d3539df3088ecbe8a |
class bdist_egg_disabled(bdist_egg): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> sys.exit("Aborting implicit building of eggs. Use `pip install .` " " to install from source.") | Disabled version of bdist_egg
Prevents setup.py install performing setuptools' default easy_install,
which it should never ever do. | 62598f8d10dbd63aa1c70787 |
class ListVirtualHubsResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[VirtualHub]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["VirtualHub"]] = None, next_link: Optional[str] = None, **kwargs ):... | Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set of results.
:param value: List of VirtualHubs.
:type value: list[~azure.mgmt.network.v2018_06_01.models.VirtualHub]
:param next_link: URL to get the next set of operation list results if there are any.
:... | 62598f8d596a897236127846 |
class Results(object): <NEW_LINE> <INDENT> pass | placeholder object to store results | 62598f8d99cbb53fe6830aa1 |
class DeleteJobsTestCase(base.JbutlerTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(DeleteJobsTestCase, self).setUp() <NEW_LINE> self.foo_filename = os.path.join(self.work_dir, 'jobs', 'foo.xml') <NEW_LINE> Jenkins_patcher = mock.patch( 'jbutler.utils.jenkins_utils.Jenkins') <NEW_LINE> self.a... | Tests for jobs delete | 62598f8d07f4c71912baf014 |
class TestAuth(ApiTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestAuth, self).setUp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> super(TestAuth, self).tearDown() <NEW_LINE> <DEDENT> def test_login_logout(self): <NEW_LINE> <INDENT> url = '/users/token' <NEW_LINE> data = sel... | Test user authentication. | 62598f8d45492302aabfc0a5 |
class TestGeneratePdfContentCenterBook(TestGeneratePdfBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestGeneratePdfContentCenterBook, self).setUp() <NEW_LINE> self.center_book = True <NEW_LINE> self.n_pages = generate_pdf(self.filename, self.center, self.voter_roll, FEMALE) | Invoke GeneratePdfContentTestMixin for center books.
Center books are only used during the exhibitions phase. | 62598f8d5f7d997b871f91c0 |
class PeriodAverage(Forecast): <NEW_LINE> <INDENT> def __init__(self, asset_factory, time_point, period, calendar): <NEW_LINE> <INDENT> super(PeriodAverage, self).__init__(asset_factory) <NEW_LINE> assert time_point in calendar <NEW_LINE> self._time_point = time_point <NEW_LINE> self._period = period <NEW_LINE> self._c... | Forecast that uses last period's average of any asset.
We forecast from period's trading days ago to today, for a total of period + 1 days
of *value* to consider, but period days of performance since performance is judged
off of pct_changes | 62598f8d63b5f9789fe84d41 |
class PhoneCodeEmpty(BadRequest): <NEW_LINE> <INDENT> ID = "PHONE_CODE_EMPTY" <NEW_LINE> MESSAGE = __doc__ | phone_code is missing | 62598f8d0c0af96317c55f55 |
class LinkedinAuth(ConsumerBasedOAuth): <NEW_LINE> <INDENT> AUTHORIZATION_URL = LINKEDIN_AUTHORIZATION_URL <NEW_LINE> REQUEST_TOKEN_URL = LINKEDIN_REQUEST_TOKEN_URL <NEW_LINE> ACCESS_TOKEN_URL = LINKEDIN_ACCESS_TOKEN_URL <NEW_LINE> SERVER_URL = 'api.%s' % LINKEDIN_SERVER <NEW_LINE> AUTH_BACKEND = LinkedinBackend <NEW_L... | Linkedin OAuth authentication mechanism | 62598f8d23e79379d538c0cf |
class QualityCode(Object): <NEW_LINE> <INDENT> Bad = None <NEW_LINE> Bad_AccessDenied = None <NEW_LINE> Bad_AggregateNotFound = None <NEW_LINE> Bad_DatabaseNotConnected = None <NEW_LINE> Bad_Disabled = None <NEW_LINE> Bad_Failure = None <NEW_LINE> Bad_GatewayCommOff = None <NEW_LINE> Bad_LicenseExceeded = None <NEW_LIN... | QualityCode contains a 32-bit integer code and optionally a
diagnostic string. | 62598f8d63d6d428bbee2389 |
class DeleteTablesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ClusterId = None <NEW_LINE> self.SelectedTables = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ClusterId = params.get("ClusterId") <NEW_LINE> if params.get("SelectedTables") is... | DeleteTables请求参数结构体
| 62598f8d07f4c71912baf015 |
class Binomial(J): <NEW_LINE> <INDENT> def __init__(self, size, prob): <NEW_LINE> <INDENT> dist = binomial(size, prob) <NEW_LINE> super(Binomial, self).__init__(dist) <NEW_LINE> self._repr_args = [size, prob] | Binomial probability distribution.
Point density:
comb(N, x) p^x (1-p)^{N-x} x in {0, 1, ..., N}
Examples:
>>> distribution = chaospy.Binomial(3, 0.5)
>>> distribution
Binomial(3, 0.5)
>>> xloc = numpy.arange(4)
>>> distribution.pdf(xloc).round(4)
array([0.125, 0.375, 0.375, 0.125])
... | 62598f8d66656f66f7d59fc8 |
class acquire(Command): <NEW_LINE> <INDENT> args = [number.IntegerArgument('resource_count', min=0)] <NEW_LINE> options = [ optparse.Option( "--source", "-s", help="What source to acquire from.", default="local"), ] <NEW_LINE> def run(self): <NEW_LINE> <INDENT> conf = config.Config() <NEW_LINE> source = conf.get_source... | Obtain one or more resources from a source for use.
Each resource will be reserved for exclusive use until
released by crcache release. | 62598f8d76d4e153a661c7e7 |
class PairedNote: <NEW_LINE> <INDENT> def __init__(self, debit_note, credit_note): <NEW_LINE> <INDENT> from Acquire.Accounting import CreditNote as _CreditNote <NEW_LINE> from Acquire.Accounting import DebitNote as _DebitNote <NEW_LINE> if not isinstance(debit_note, _DebitNote): <NEW_LINE> <INDENT> raise TypeError("The... | This class holds a DebitNote together with its matching
CreditNote(s) | 62598f8ddd821e528d6d8b01 |
class PacketPokerDealCards(PacketPokerId): <NEW_LINE> <INDENT> type = PACKET_POKER_DEAL_CARDS <NEW_LINE> numberOfCards = 0 <NEW_LINE> serials = [] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.numberOfCards = kwargs.get("numberOfCards", 2) <NEW_LINE> self.serials = kwargs.get("serials", []) <... | Semantics: deal "numberOfCards" down cards for each player listed
in "serials" in game "game_id".
Direction: client <=> client
Context: inferred after the beginning of a betting round (i.e.
after the PACKET_POKER_STATE packet is received) and after
the chips involved in the previous betting round have been
sorted (i.... | 62598f8db57a9660fecd164d |
class VersionControlSystemInterface(CDMPluginBase): <NEW_LINE> <INDENT> NOT_UNDER_VCS = -1 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> CDMPluginBase.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def isIDEVersionCompatible(ideVersion): <NEW_LINE> <INDENT> raise Exception("isIDEVersionCompatible() mu... | Version control system plugin interface | 62598f8d009cb60464d010fc |
class CfdiUsesCatalog(Catalogs): <NEW_LINE> <INDENT> prefix = 'catalogs' <NEW_LINE> catalog = 'CfdiUses' | Opr with CfdiUses catalog of Facturama API | 62598f8d287bf620b6271788 |
class Bullet(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, ship): <NEW_LINE> <INDENT> import pdb <NEW_LINE> super(Bullet, self).__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.rect = pygame.Rect(0, 0, ai_settings.bullet_width, ai_settings.bullet_height) <NEW_LINE> self.rect.centerx = s... | A class to manage bullets fired from the ship | 62598f8d50485f2cf55dab42 |
class xep_0203(base_plugin): <NEW_LINE> <INDENT> def plugin_init(self): <NEW_LINE> <INDENT> self.xep = '0203' <NEW_LINE> self.description = 'Delayed Delivery' <NEW_LINE> self.stanza = stanza <NEW_LINE> register_stanza_plugin(Message, stanza.Delay) <NEW_LINE> register_stanza_plugin(Presence, stanza.Delay) | XEP-0203: Delayed Delivery
XMPP stanzas are sometimes withheld for delivery due to the recipient
being offline, or are resent in order to establish recent history as
is the case with MUCS. In any case, it is important to know when the
stanza was originally sent, not just when it was last received.
Also see <http://ww... | 62598f8d23e79379d538c0d0 |
class AAVarNameToFileName(NcoDataFix): <NEW_LINE> <INDENT> def __init__(self, filename, directory): <NEW_LINE> <INDENT> super().__init__(filename, directory) <NEW_LINE> <DEDENT> def apply_fix(self): <NEW_LINE> <INDENT> var_name = self.filename.split('_')[0] <NEW_LINE> existing_name = self._get_existing_name() <NEW_LINE... | Rename the variable itself and variable_id global attribute to the first
component of the filename. | 62598f8ddc8b845886d5318a |
class KeyVaultProperties(Model): <NEW_LINE> <INDENT> _attribute_map = { 'key_name': {'key': 'keyname', 'type': 'str'}, 'key_version': {'key': 'keyversion', 'type': 'str'}, 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, } <NEW_LINE> def __init__(self, key_name=None, key_version=None, key_vault_uri=None): <NEW_L... | Properties of key vault.
:param key_name: The name of KeyVault key.
:type key_name: str
:param key_version: The version of KeyVault key.
:type key_version: str
:param key_vault_uri: The Uri of KeyVault.
:type key_vault_uri: str | 62598f8d85dfad0860cbf859 |
class InvalidPassError(Exception): <NEW_LINE> <INDENT> pass | Exception raised when a pass is swiped and user shall not be allowed further | 62598f8da17c0f6771d5be13 |
class InlineQueryResultCachedVoice(InlineQueryResult): <NEW_LINE> <INDENT> def __init__(self, id, voice_file_id, title, caption=None, reply_markup=None, input_message_content=None, **kwargs): <NEW_LINE> <INDENT> super(InlineQueryResultCachedVoice, self).__init__('voice', id) <NEW_LINE> self.voice_file_id = voice_file_i... | Represents a link to a voice message stored on the Telegram servers. By default, this voice
message will be sent by the user. Alternatively, you can use :attr:`input_message_content` to
send a message with the specified content instead of the voice message.
Attributes:
type (:obj:`str`): 'voice'.
id (:obj:`str... | 62598f8d07f4c71912baf016 |
class TasksError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg, exit_code=1): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> self.exit_code = exit_code | Base class for exceptions in this module. | 62598f8d45492302aabfc0a7 |
class HostWithPrivateDirs( Host ): <NEW_LINE> <INDENT> def __init__( self, name, *args, **kwargs ): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.privateDirs = kwargs.pop( 'privateDirs', [] ) <NEW_LINE> Host.__init__( self, name, *args, **kwargs ) <NEW_LINE> self.mountPrivateDirs() <NEW_LINE> <DEDENT> def mountP... | Host with private directories | 62598f8d63b5f9789fe84d43 |
@base.ReleaseTracks(base.ReleaseTrack.GA) <NEW_LINE> class DescribeGa(base.DescribeCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> _AddDescribeArgs(parser) <NEW_LINE> <DEDENT> def Run(self, args): <NEW_LINE> <INDENT> job = jobs_util.Describe(jobs.JobsClient('v1'), args.job) ... | Describe a Cloud ML Engine job. | 62598f8d0c0af96317c55f56 |
class Flight: <NEW_LINE> <INDENT> def __init__(self, number, aircraft): <NEW_LINE> <INDENT> if not number[:2].isalpha(): <NEW_LINE> <INDENT> raise ValueError("No airline code in '{}'".format(number)) <NEW_LINE> <DEDENT> if not number[:2].isupper(): <NEW_LINE> <INDENT> raise ValueError("Invalid airline code in '{}'".for... | A flight with a particular passengar aircraft. | 62598f8d63d6d428bbee238b |
class UpConv(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels): <NEW_LINE> <INDENT> super(UpConv, self).__init__() <NEW_LINE> self.up_conv = upconv2x2(in_channels, out_channels) <NEW_LINE> self.down_conv = DownConv(2*out_channels, out_channels, is_pooling=False) <NEW_LINE> <DEDENT> def forwa... | Convolution block: upconv2x2 => DownConv | 62598f8dec188e330fdf8470 |
class ProjectTopicCommentSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> project = fields.CustomPrimaryKeyRelatedField(read_only=True) <NEW_LINE> topic = fields.CustomPrimaryKeyRelatedField(read_only=True) <NEW_LINE> user = fields.CustomPrimaryKeyRelatedField(read_only=True) <NEW_LINE> content = fields.Cus... | 项目主题评论序列化 | 62598f8d596a897236127849 |
class OSFileException(ResponseException): <NEW_LINE> <INDENT> def __init__(self, message: str) -> None: <NEW_LINE> <INDENT> super().__init__(72, message) | Critical operating system file missing. | 62598f8dd6c5a102081e1d15 |
class Wheel(bdist_wheel): <NEW_LINE> <INDENT> PLAT_NAME = "manylinux2014_x86_64" <NEW_LINE> PYI_PLAT_NAME = "Linux-64bit" <NEW_LINE> def finalize_options(self): <NEW_LINE> <INDENT> self.plat_name = self.PLAT_NAME <NEW_LINE> self.plat_name_supplied = True <NEW_LINE> if not self.has_bootloaders(): <NEW_LINE> <INDENT> rai... | Base class for building a wheel for one platform, collecting only the
relevant bootloaders for that platform. | 62598f8d07d97122c421687b |
class CsTestDataGenerator(): <NEW_LINE> <INDENT> def __init__(self,fid,procpar,reduction=4): <NEW_LINE> <INDENT> p = vj.io.ProcparReader(procpar).read() <NEW_LINE> gen = vj.util.SkipintGenerator(procpar=procpar,reduction=reduction) <NEW_LINE> self.kspace_mask = gen.generate_kspace_mask() <NEW_LINE> fid_data, fid_header... | Makes .cs bundle for testing
Makes a directory of [seqname].cs, containing:
imgspace_sum.nii.gz
kspace_mask.nii.gz
kspace_imag_ch[n].nii.gz
kspace_real_ch[n].nii.gz | 62598f8d91af0d3eaad399d2 |
class RemotePowerSocket: <NEW_LINE> <INDENT> def __init__(self, name: str, system_code: str, unit_code: str): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.system_code = system_code <NEW_LINE> self.unit_code = unit_code <NEW_LINE> self.is_on = None <NEW_LINE> <DEDENT> def on(self): <NEW_LINE> <INDENT> self.switc... | Allows to control a remote power socket via a 433Mhz sender. | 62598f8d8e71fb1e983bb683 |
class EstimatorMembersOverrideTest(tu.AdanetTestCase): <NEW_LINE> <INDENT> def test_assert_members_are_not_overridden(self): <NEW_LINE> <INDENT> config = tf.estimator.RunConfig() <NEW_LINE> subnetwork_generator = SimpleGenerator([_DNNBuilder("dnn")]) <NEW_LINE> report_materializer = ReportMaterializer( input_fn=tu.dumm... | Tests b/77494544 fix. | 62598f8d15baa72349461b4d |
class BibleVerse(SurrogatePK, Model): <NEW_LINE> <INDENT> __tablename__ = 't_kjv' <NEW_LINE> b = Column(db.ForeignKey('{0}.{1}'.format('key_english', 'b')), nullable=False) <NEW_LINE> c = Column(db.Integer, unique=True, nullable=False) <NEW_LINE> v = Column(db.Integer, unique=True, nullable=False) <NEW_LINE> t = Column... | Verse of the Bible | 62598f8dd4950a0f3b110c1f |
class _classproperty: <NEW_LINE> <INDENT> def __init__(self, fget): <NEW_LINE> <INDENT> self._fget = fget <NEW_LINE> <DEDENT> def __get__(self, instance, owner): <NEW_LINE> <INDENT> return self._fget(owner) | Like `property`, but also triggers on access via the class, and it is the
*class* that's passed as argument.
Examples
--------
::
class C:
@classproperty
def foo(cls):
return cls.__name__
assert C.foo == "C" | 62598f8d82261d6c5272fcbe |
class IterationSpace(StencilCompilerNode): <NEW_LINE> <INDENT> _fields = ['space', 'body'] <NEW_LINE> def __deepcopy__(self, memo): <NEW_LINE> <INDENT> return type(self)( copy.deepcopy(self.space, memo=memo), copy.deepcopy(self.body, memo=memo) ) | Semantic node for the space over which a snowflake is applied. | 62598f8d004d5f362081ede3 |
class Message(BytesIO): <NEW_LINE> <INDENT> seqno: int = 0 <NEW_LINE> def get_remainder(self) -> bytes: <NEW_LINE> <INDENT> position = self.tell() <NEW_LINE> remainder = self.read() <NEW_LINE> self.seek(position) <NEW_LINE> return remainder <NEW_LINE> <DEDENT> def get_so_far(self) -> bytes: <NEW_LINE> <INDENT> position... | Message in protocol. | 62598f8d23e79379d538c0d3 |
class Test_plotting_plot_states(unittest.TestCase): <NEW_LINE> <INDENT> pass | Tests the plotting.plot_states function with the following cases:
TBD | 62598f8d07d97122c421687c |
class _SegWrap(list): <NEW_LINE> <INDENT> def __init__(self, gpx_file=None, metadata=None): <NEW_LINE> <INDENT> super(_SegWrap, self).__init__() <NEW_LINE> self.metadata = metadata if metadata else _GpxMeta() <NEW_LINE> self._gpx_file = gpx_file <NEW_LINE> if gpx_file: <NEW_LINE> <INDENT> self.import_locations(gpx_file... | Abstract class for representing segmented elements from GPX data files.
.. versionadded:: 0.12.0 | 62598f8da79ad16197769c39 |
class KeywordArg(object): <NEW_LINE> <INDENT> _fields = ['arg', 'value'] <NEW_LINE> def __init__(self, arg, value): <NEW_LINE> <INDENT> self.arg = arg <NEW_LINE> self.value = value | A x=3 keyword argument in a function definition. | 62598f8d24f1403a92685698 |
class UnknownPlatform(NotImplementedError): <NEW_LINE> <INDENT> def __init__(self, platform): <NEW_LINE> <INDENT> self.platform = platform <NEW_LINE> msg = 'Unknown platform "%s"' % platform <NEW_LINE> NotImplementedError.__init__(self, msg) | An unknown platform is found, either converting from platform naming conventions or obtaining
the current platform.
:ivar unicode platform:
The unknown platform string. | 62598f8d94891a1f408b94d8 |
class Hook(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> project_id = db.Column(db.Integer, db.ForeignKey('project.id'), nullable=False) <NEW_LINE> gh_id = db.Column(db.Integer, nullable=False) <NEW_LINE> title = db.Column(db.String(200), nullable=False) <NEW_LINE> install_scrip... | Reflects a GitHub hook. | 62598f8dec188e330fdf8472 |
class SampleReader: <NEW_LINE> <INDENT> def read_sample(self): <NEW_LINE> <INDENT> raise NotImplementedError() | Responsible for reading samples from different sources | 62598f8d07f4c71912baf019 |
class Builder(models.Model): <NEW_LINE> <INDENT> offering = models.ForeignKey(Offering) <NEW_LINE> profile = models.ForeignKey(Profile) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.offering.display_name() | ScheduleBuilder can't be showing real enrolments - needs to track *intentions*.
This is a simple FK to Offering for ScheduleBuilder purposes. | 62598f8dcad5886f8bdc4e76 |
class App(InvokeProgram): <NEW_LINE> <INDENT> def __init__(self, version=None, namespace=None, extra_arguments=None): <NEW_LINE> <INDENT> if extra_arguments is None: <NEW_LINE> <INDENT> self.extra_args = [] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.extra_args = extra_arguments <NEW_LINE> <DEDENT> self.extra_ar... | The invoke modified class:
for a command line program/application in Python;
To be included in a cookiecutter template in the future. | 62598f8d66656f66f7d59fcc |
class InvalidDateList(BaseError): <NEW_LINE> <INDENT> pass | "Base class for exceptions related to the invalid date list | 62598f8d07d97122c421687d |
class _NumpyParamDictInit(mx.init.Initializer): <NEW_LINE> <INDENT> def __init__(self, np_params): <NEW_LINE> <INDENT> super(_NumpyParamDictInit, self).__init__() <NEW_LINE> self._np_params = np_params <NEW_LINE> <DEDENT> def _init_weight(self, name, arr): <NEW_LINE> <INDENT> arr[()] = self._np_params[name] | Initializes parameters with the cached numpy ndarrays dictionary
| 62598f8dd6c5a102081e1d17 |
class JointModel(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_dim, num_layers, num_classes, encoder_dim=None, bert_pretrained=True, bert_pretrained_model_name='bert-base-cased'): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.bert = get_bert(bert_pretrained, bert_pretrained_model_name) <NEW_LINE> se... | JointModel which combines both modalities | 62598f8dac7a0e7691f720dd |
class _POOL_HEADER(obj.Struct): <NEW_LINE> <INDENT> def get_rounded_size(self, object_name): <NEW_LINE> <INDENT> size_of_obj = self.obj_profile.get_obj_size(object_name) <NEW_LINE> pool_align = self.obj_profile.get_constant("PoolAlignment") <NEW_LINE> extra = size_of_obj % pool_align <NEW_LINE> if extra: <NEW_LINE> <IN... | Extension to support retrieving allocations inside the pool.
Ref for windows memory management:
http://illmatics.com/Windows%208%20Heap%20Internals.pdf | 62598f8d29b78933be269ec5 |
class TestApiV2Groups: <NEW_LINE> <INDENT> def test_groups_list(self, flask_app, groups_list_v2, prefetch_groups): <NEW_LINE> <INDENT> with flask_app.test_client() as client: <NEW_LINE> <INDENT> with flask_app.app_context(): <NEW_LINE> <INDENT> prefetch_groups() <NEW_LINE> <DEDENT> response = client.get('/api/v2/groups... | Be attentive! This test case may wipe out data in your database.
Please ensure that you run test case with database for testing,
not for production. | 62598f8d8e7ae83300ee8c75 |
class RegistroD160(Registro): <NEW_LINE> <INDENT> campos = [ CampoFixo(1, 'REG', 'D160'), Campo(2, 'DESPACHO'), Campo(3, 'CNPJ_CPF_REM'), Campo(4, 'IE_REM'), Campo(5, 'COD_MUN_ORI'), Campo(6, 'CNPJ_CPF_DEST'), Campo(7, 'IE_DEST'), Campo(8, 'COD_MUN_DEST'), ] | CARGA TRANSPORTADA (CÓDIGO 08, 8B, 09, 10, 11, 26 E 27) | 62598f8d01c39578d7f12957 |
class Test_DetectNotation(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.TestFunc = staticmethod(TestModule.DetectNotation) <NEW_LINE> cls.Notations = [ [['a', '1', '12.03E3', '100,000'], 0], [['a', '1', '12,03E3', '100.000'], 1], [['a', '1', '12,100,100', '... | Test cases for the function DetectNotation of the module locale_fsio.
Test ID - TEST-T-402. Covers requirement REQ-FUN-401. | 62598f8d73bcbd0ca4bc9e25 |
class TLSSecurityLayer(SecurityLayer): <NEW_LINE> <INDENT> def __init__(self, parser = BasicSecurityParser()): <NEW_LINE> <INDENT> SecurityLayer.__init__(self, parser) <NEW_LINE> self.securityHeaderExpected = False <NEW_LINE> <DEDENT> def recv(self, data): <NEW_LINE> <INDENT> if not self.securityHeaderExpected: <NEW_LI... | Security layer used when the connection uses TLS.
If securityHeadExpected is True, then the layer expects to receive a basic security header.
Otherwise, the layer just forwards all the data it receives to the next layer. | 62598f8d23849d37ff850c94 |
class MaxHomeAutomationDeviceHandler: <NEW_LINE> <INDENT> def __init__(self, gateway_base_url, cube_hex_address, device_hex_address, scan_interval): <NEW_LINE> <INDENT> self._gateway_base_url = gateway_base_url <NEW_LINE> self._cube_hex_address = cube_hex_address <NEW_LINE> self._device_hex_address = device_hex_addres... | Keep the cube instance in one place and centralize the update. | 62598f8d0a50d4780f704fa4 |
class Debouncer(object): <NEW_LINE> <INDENT> _log_level = 5 <NEW_LINE> delay = 500 <NEW_LINE> def __init__(self, delay=None): <NEW_LINE> <INDENT> self.delay = delay or self.delay <NEW_LINE> self._last_submission_time = 0 <NEW_LINE> self.is_waiting = False <NEW_LINE> self.pending_functions = {} <NEW_LINE> self._timer = ... | Debouncer to work in a Qt application.
Jobs are submitted at given times. They are executed immediately if the
delay since the last submission is greater than some threshold. Otherwise, execution
is delayed until the delay since the last submission is greater than the threshold.
During the waiting time, all submitted ... | 62598f8d82261d6c5272fcbf |
class NumberEntry(gtk.Entry): <NEW_LINE> <INDENT> def __init__(self, Max=0): <NEW_LINE> <INDENT> gtk.Entry.__init__(self, Max) <NEW_LINE> self.insert_sig = self.connect("insert-text", self.insert_cb) <NEW_LINE> <DEDENT> def insert(self, widget, text, pos): <NEW_LINE> <INDENT> orig_text = unicode(widget.get_text()) <NEW... | Creates a text entry widget that just accepts number keys. no dots, spaces or commas.
Please consider this class usage in other classes before changing this behaviour. | 62598f8dd4950a0f3b110c20 |
class StaffAPITests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client1 = APIClient() <NEW_LINE> self.client2 = APIClient() <NEW_LINE> self.staff_user = get_user_model().objects.create_staff( email='staff@twysolutions.com', password='staff@password' ) <NEW_LINE> self.teacher_user = get_user... | Test private available API | 62598f8d96565a6dacd2cd62 |
class OrchestratorException(Exception): <NEW_LINE> <INDENT> message = _("An unknown exception occurred.") <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> super(OrchestratorException, self).__init__(self.message % kwargs) <NEW_LINE> self.msg = self.message % kwargs <NEW_LINE> <DEDEN... | Base Orchestrator Exception.
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd
with the keyword arguments provided to the constructor. | 62598f8d8a43f66fc4bf1d5a |
class QRouter(object): <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model.__name__.lower() in [mdb.lower() for mdb in MONGO_DB_MODELS]: <NEW_LINE> <INDENT> return "documents" <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> <DEDENT> def db_for_write(self... | A router to control all database operations for CIM Documents
(these are stored in MongoDB) | 62598f8dc432627299fa2ba1 |
class ProductTemplateWithDataSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> template_data_text = ProductTemplateTextDataSerializer(many=True) <NEW_LINE> template_data_image = ProductTemplateImageDataSerializer(many=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = ProductTemplate <NEW_LINE> fields ... | serializer for Products | 62598f8d15fb5d323ce7e902 |
class TestModel(BaseModel): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def modify_commandline_options(parser, is_train=True): <NEW_LINE> <INDENT> assert not is_train, 'TestModel cannot be used during training time' <NEW_LINE> parser.set_defaults(dataset_mode='single') <NEW_LINE> parser.add_argument('--model_suffix', ... | This TesteModel can be used to generate CycleGAN results for only one direction.
This model will automatically set '--dataset_mode single', which only loads the images from one collection.
See the test instruction for more details. | 62598f8d10dbd63aa1c7078d |
class Account(InstanceResource): <NEW_LINE> <INDENT> ACTIVE = "active" <NEW_LINE> SUSPENDED = "suspended" <NEW_LINE> CLOSED = "closed" <NEW_LINE> subresources = [ Applications, Notifications, Transcriptions, Recordings, Calls, Sms, CallerIds, PhoneNumbers, Conferences, ] <NEW_LINE> def update(self, **kwargs): <NEW_LINE... | An Account resource | 62598f8d99cbb53fe6830aa7 |
class CbSSHLazyResult(object): <NEW_LINE> <INDENT> _hostname = '' <NEW_LINE> _return_code = None <NEW_LINE> _iteration_flag = False <NEW_LINE> _next_flag = False <NEW_LINE> _libssh = None <NEW_LINE> _session = None <NEW_LINE> _channel = None <NEW_LINE> def __init__(self, hostname, session, command): <NEW_LINE> <INDENT>... | Class acting as lazy, iterable command execution result wrapper.
When the first iteration starts, the command will actually be executed on the remote system.
With each iteration, a further chunk of output data is read from the connection to the remote
host and returned as byte sequence.
.. note::
For the iteratio... | 62598f8deab8aa0e5d30b94f |
class EnrolmentInterrogateEvent(flow.EventListener): <NEW_LINE> <INDENT> EVENTS = ["ClientEnrollment"] <NEW_LINE> well_known_session_id = rdfvalue.SessionID("aff4:/flows/CA:Interrogate") <NEW_LINE> sourcecheck = lambda source: source.Basename().startswith("CA:") <NEW_LINE> @flow.EventHandler(source_restriction=sourcech... | An event handler which will schedule interrogation on client enrollment. | 62598f8dfbf16365ca793c84 |
class MathFx(BFX): <NEW_LINE> <INDENT> cast = float <NEW_LINE> return_cast = float | Default math function : Do not use directly | 62598f8dec188e330fdf8474 |
class TSInfo: <NEW_LINE> <INDENT> rules = [] <NEW_LINE> labels = [] <NEW_LINE> sourceKey = None <NEW_LINE> chunk_count = None <NEW_LINE> memory_usage = None <NEW_LINE> total_samples = None <NEW_LINE> retention_msecs = None <NEW_LINE> last_time_stamp = None <NEW_LINE> first_time_stamp = None <NEW_LINE> max_samples_per_c... | Hold information and statistics on the time-series.
Can be created using ``tsinfo`` command
https://oss.redis.com/redistimeseries/commands/#tsinfo. | 62598f8d07f4c71912baf01b |
class InlineResponse2001(ModelNormal): <NEW_LINE> <INDENT> allowed_values = { } <NEW_LINE> validations = { } <NEW_LINE> additional_properties_type = None <NEW_LINE> _nullable = False <NEW_LINE> @cached_property <NEW_LINE> def openapi_types(): <NEW_LINE> <INDENT> return { 'content': (str,), } <NEW_LINE> <DEDENT> @cached... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the a... | 62598f8d66656f66f7d59fce |
class AnalyzeBatchInput(JobDescriptor, AnalysisInput, JobManifest): <NEW_LINE> <INDENT> _validation = { 'tasks': {'required': True}, 'analysis_input': {'required': True}, } <NEW_LINE> _attribute_map = { 'tasks': {'key': 'tasks', 'type': 'JobManifestTasks'}, 'analysis_input': {'key': 'analysisInput', 'type': 'MultiLangu... | AnalyzeBatchInput.
All required parameters must be populated in order to send to Azure.
:ivar tasks: Required. The set of tasks to execute on the input documents. Cannot specify the
same task more than once.
:vartype tasks: ~azure.ai.textanalytics.v3_2_preview_2.models.JobManifestTasks
:ivar analysis_input: Required... | 62598f8d0fa83653e46f4abb |
class IsADirectory(PortageException): <NEW_LINE> <INDENT> from errno import EISDIR as errno | A directory was found when it was expected to be a file | 62598f8dd6c5a102081e1d19 |
class CharFeat(object): <NEW_LINE> <INDENT> def __init__(self, vocab_size, embed_dim, unit_dim, window_size, hidden_activation, pooling_type, dropout, num_gpus=1, default_gpu_id=0, regularizer=None, random_seed=0, trainable=True, scope="char_feat"): <NEW_LINE> <INDENT> self.vocab_size = vocab_size <NEW_LINE> self.embed... | char-level featurization layer | 62598f8d29b78933be269ec6 |
class UserClient(ClientBase): <NEW_LINE> <INDENT> _instance = None <NEW_LINE> @classmethod <NEW_LINE> def getInstance(cls, userAPIUrl = None, username = None, password = None): <NEW_LINE> <INDENT> if cls._instance is None or (userAPIUrl is not None or username is not None or password is not None): <NEW_LINE> <INDENT> i... | Singleton for the client for Vidyo's user API
| 62598f8dd53ae8145f918061 |
class TestConfigurationManager(unittest.TestCase): <NEW_LINE> <INDENT> joe_in_qa = {"environment": "qa", "user": "joe"} <NEW_LINE> joe_in_prod = {"environment": "prod", "user": "joe"} <NEW_LINE> def test_set_contexts(self): <NEW_LINE> <INDENT> configuration = Configuration( "enable-welcome", Context(False, Modifiers( '... | Unit tests for configuration manager. | 62598f8d3eb6a72ae038a20b |
class ServiceHelper(object): <NEW_LINE> <INDENT> LOCAL_SR = System.get_my_storagerouter() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_services(): <NEW_LINE> <INDENT> return ServiceList.get_services() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_se... | A service helper class | 62598f8d4428ac0f6e6580fb |
class MewloAssetManager(manager.MewloManager): <NEW_LINE> <INDENT> description = "The asset manager handles static files that are served to user" <NEW_LINE> typestr = "core" <NEW_LINE> def __init__(self, mewlosite, debugmode): <NEW_LINE> <INDENT> super(MewloAssetManager,self).__init__(mewlosite, debugmode) <NEW_LINE> s... | The derived signal dispatcher. | 62598f8dbaa26c4b54d4ee8a |
class CFM_630: <NEW_LINE> <INDENT> play = ManaThisTurn(CONTROLLER, 1) | Counterfeit Coin | 62598f8df7d966606f747bb5 |
class ButtonWidget(Widget, BaseList): <NEW_LINE> <INDENT> CHILD_ATTRIBUTE = 'buttons' | Class to represent a widget containing one or more buttons.
Find an existing one:
.. code-block:: python
button_widget = None
widgets = reddit.subreddit('redditdev').widgets
for widget in widgets.sidebar:
if isinstance(widget, praw.models.ButtonWidget):
button_widget = widget
br... | 62598f8d16aa5153ce4000dc |
class NotImplementedXrcObject(XrcObject): <NEW_LINE> <INDENT> def __init__(self, code_obj): <NEW_LINE> <INDENT> XRCCodeWriter.XrcObject.__init__(self) <NEW_LINE> self.code_obj = code_obj <NEW_LINE> <DEDENT> def write(self, outfile, ntabs): <NEW_LINE> <INDENT> m = 'code generator for %s objects not available' % ... | XrcObject used when no code for the widget can be generated (for
example, because XRC does not currently handle such widget) | 62598f8d8e71fb1e983bb688 |
class ancEndpoint(object): <NEW_LINE> <INDENT> def get_ById(self,id1): <NEW_LINE> <INDENT> return "ers/config/ancendpoint/" + id1; <NEW_LINE> <DEDENT> def getBulk_ById(self,id1): <NEW_LINE> <INDENT> return "ers/config/ancendpoint/bulk/" + id1; <NEW_LINE> <DEDENT> putClear = "ers/config/ancendpoint/clear" <NEW_LINE> put... | Adaptive Network Control (ANC) provides the ability to create network endpoint authorization controls based on ANC policies. | 62598f8d85dfad0860cbf85c |
class Meta: <NEW_LINE> <INDENT> verbose_name = 'Category' <NEW_LINE> verbose_name_plural = 'Categories' | Attributes:
verbose_name - A human-readable name for the object, singular;
verbose_name_plural - The plural name for the object. | 62598f8d7cff6e4e811b55ec |
class UnionSerializer(object): <NEW_LINE> <INDENT> def __init__(self, fields): <NEW_LINE> <INDENT> self._fields = {field.index: field for field in fields} <NEW_LINE> <DEDENT> def SerializeInline(self, union, handle_offset): <NEW_LINE> <INDENT> data = bytearray() <NEW_LINE> field = self._fields[union.tag] <NEW_LINE> (en... | Helper class to serialize/deserialize a union. | 62598f8de76e3b2f99fd8608 |
@ddt.ddt <NEW_LINE> @skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') <NEW_LINE> class TestSupplementProgramData(ProgramsApiConfigMixin, ModuleStoreTestCase): <NEW_LINE> <INDENT> password = 'test' <NEW_LINE> human_friendly_format = '%x' <NEW_LINE> maxDiff = None <NEW_LINE> def setUp(self): <NEW... | Tests of the utility function used to supplement program data. | 62598f8d8da39b475be02db5 |
@implementer(IGrantedRoleEvent) <NEW_LINE> class GrantedRoleEvent(RoleEvent): <NEW_LINE> <INDENT> pass | Granted role event | 62598f8d23e79379d538c0d7 |
class UserViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all().order_by('date_joined') <NEW_LINE> serializer_class = UserSerializer | This viewset automatically provides `list` and `detail` actions. | 62598f8d63d6d428bbee2391 |
class DetailAPITestCaseMixin(object): <NEW_LINE> <INDENT> attributes_to_check = ['id'] <NEW_LINE> def get_detail_url(self): <NEW_LINE> <INDENT> object_id = getattr(self.object, self.lookup_field) <NEW_LINE> return reverse(self.base_name + self.DETAIL_SUFFIX, args=[text_type(object_id)]) <NEW_LINE> <DEDENT> def get_deta... | Adds a detail view test to the test case. | 62598f8d2ae34c7f260aacbd |
class Solution: <NEW_LINE> <INDENT> def insertionSortList(self, head): <NEW_LINE> <INDENT> if not head: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> new_head = ListNode(0) <NEW_LINE> while head: <NEW_LINE> <INDENT> tmp = new_head <NEW_LINE> next = head.next <NEW_LINE> while tmp.next and tmp.next.val < head.val: ... | @param head: The first node of linked list.
@return: The head of linked list. | 62598f8d596a89723612784f |
class IEC104_IO_P_ME_NB_1_IOA(IEC104_IO_P_ME_NB_1): <NEW_LINE> <INDENT> name = 'P_ME_NB_1 (+ioa)' <NEW_LINE> fields_desc = [LEThreeBytesField('information_object_address', 0)] + IEC104_IO_P_ME_NB_1.fields_desc | extended version of IEC104_IO_P_ME_NB_1 containing an individual
information object address | 62598f8d7b25080760ed7083 |
class TestTransactionExtra(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 testTransactionExtra(self): <NEW_LINE> <INDENT> pass | TransactionExtra unit test stubs | 62598f8d29b78933be269ec7 |
class SolrIndex: <NEW_LINE> <INDENT> def __init__(self, index): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> <DEDENT> def _request(self, command): <NEW_LINE> <INDENT> params = { 'wt': 'json', 'json.nl': 'map', 'command': command } <NEW_LINE> url = os.path.join(self.index, 'dataimport') <NEW_LINE> r = requests.get(... | Class for handling solr indexes
Public api:
full_import - run full-import command
status - get status of full-import command | 62598f8d462c4b4f79dbb5db |
class SkillSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> body = BodySerializerMin(many=False, read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Skill <NEW_LINE> fields = ('title', 'body') | Serializer for Skill. | 62598f8d009cb60464d01104 |
class AstVector(Z3PPObject): <NEW_LINE> <INDENT> def __init__(self, v=None, ctx=None): <NEW_LINE> <INDENT> self.vector = None <NEW_LINE> if v == None: <NEW_LINE> <INDENT> self.ctx = _get_ctx(ctx) <NEW_LINE> self.vector = Z3_mk_ast_vector(self.ctx.ref()) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.vector = v <NEW... | A collection (vector) of ASTs. | 62598f8db57a9660fecd1655 |
class Scalars(ArrayData): <NEW_LINE> <INDENT> def __init__(self, *fields, **kwargs): <NEW_LINE> <INDENT> if len(fields) > 4: <NEW_LINE> <INDENT> raise ValueError('Vtk supports up to 4 Scalars in one DataSet') <NEW_LINE> <DEDENT> super(Scalars, self).__init__(*fields, **kwargs) <NEW_LINE> <DEDENT> def tofile(self, vtk):... | Class to represent a collection of Scalars | 62598f8d23849d37ff850c98 |
class Command(ElasticIndexFilterMixin, BaseCommand): <NEW_LINE> <INDENT> help = "Purge ElasticSearch indexes." <NEW_LINE> def add_arguments(self, parser): <NEW_LINE> <INDENT> super().add_arguments(parser) <NEW_LINE> parser.add_argument( '--skip-mapping', dest='skip_mapping', action='store_true', help="Don't push fresh ... | Purge ElasticSearch indexes. | 62598f8d1f037a2d8b9e3cb3 |
class NaturalKeyRelatedField(serializers.SlugRelatedField): <NEW_LINE> <INDENT> def to_representation(self, value): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> def to_internal_value(self, value): <NEW_LINE> <INDENT> if isinstance(value, int): <NEW_LINE> <INDENT> value = str(value) <NEW_LINE> <DEDENT> if value.... | Field that takes either a primary key or a natural key. | 62598f8d23e79379d538c0d8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.