code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class EntityId(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'str', 'entity_type': 'str' } <NEW_LINE> attribute_map = { 'id': 'id', 'entity_type': 'entityType' } <NEW_LINE> def __init__(self, id=None, entity_type=None): <NEW_LINE> <INDENT> self._id = None <NEW_LINE> self._entity_type = None <NEW_LINE> self.discr... | NOTE: This class is auto generated by the swagger code generator program.
from tb_rest_client.api_client import ApiClient
Do not edit the class manually.
| 62598fa897e22403b383ae53 |
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = UserManager... | custom user model that supports using email insteadof username | 62598fa88c0ade5d55dc3634 |
class XslTransformation(Document): <NEW_LINE> <INDENT> name = fields.StringField( blank=False, unique=True, validation=not_empty_or_whitespaces ) <NEW_LINE> filename = fields.StringField(blank=False, validation=not_empty_or_whitespaces) <NEW_LINE> content = fields.StringField(blank=False) <NEW_LINE> meta = {"allow_inhe... | XslTransformation object | 62598fa856b00c62f0fb27fa |
class adjustVerticalMetrics(hDialog): <NEW_LINE> <INDENT> ascender_min = 1 <NEW_LINE> capheight_min = 1 <NEW_LINE> xheight_min = 1 <NEW_LINE> descender_min = 1 <NEW_LINE> column_1 = 80 <NEW_LINE> column_2 = 200 <NEW_LINE> column_3 = 45 <NEW_LINE> moveX = 0 <NEW_LINE> moveY = 0 <NEW_LINE> def __init__(self): <NEW_LINE> ... | A dialog to adjust the vertical metrics of the font.
.. image:: imgs/font/adjust-vmetrics.png | 62598fa832920d7e50bc5f9b |
class ToggleDisplayMode(gui_base.GuiCommandNeedsSelection): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ToggleDisplayMode, self).__init__(name=_tr("Toggle display mode")) <NEW_LINE> <DEDENT> def GetResources(self): <NEW_LINE> <INDENT> _menu = "Toggle normal/wireframe display" <NEW_LINE> _tip = ("S... | GuiCommand for the Draft_ToggleDisplayMode tool.
Switches the display mode of selected objects from flatlines
to wireframe and back.
It inherits `GuiCommandNeedsSelection` to only be available
when there is a document and a selection.
See this class for more information. | 62598fa9cc0a2c111447af57 |
class Dict(dict): <NEW_LINE> <INDENT> def __init__(self, names=(), values=(), **kw): <NEW_LINE> <INDENT> super(Dict, self).__init__(**kw) <NEW_LINE> for k, v in zip(names, values): <NEW_LINE> <INDENT> self[k] = v <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> retur... | Simple dict but support access as x.y style | 62598fa967a9b606de545f12 |
class ProjectDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = models.Project.objects.all() <NEW_LINE> serializer_class = serializers.ProjectDetailSerializer <NEW_LINE> permission_classes = (rest_permissions.IsAuthenticated, permissions.IsRepOrSecyAndClubMemberReadOnlyProject) | View to allow retrieval, updation and deletion of a project based on appropriate permissions | 62598fa9167d2b6e312b6eb7 |
class PDAQRun(object): <NEW_LINE> <INDENT> TSTRSRC = None <NEW_LINE> MAX_TIMEOUTS = 6 <NEW_LINE> def __init__(self, run_cfg_name, duration, num_runs=1, flasher_data=None, has_doms=False): <NEW_LINE> <INDENT> self.__run_cfg_name = run_cfg_name <NEW_LINE> self.__duration = duration <NEW_LINE> self.__num_runs = num_runs <... | Description of a pDAQ run | 62598fa91b99ca400228f4d3 |
class Spectrum(object): <NEW_LINE> <INDENT> def __init__(self, wave, flux, wave_unit=u.AA, unit=(u.erg / u.s / u.cm**2 / u.AA)): <NEW_LINE> <INDENT> self.wave = np.asarray(wave, dtype=np.float64) <NEW_LINE> self.flux = np.asarray(flux, dtype=np.float64) <NEW_LINE> if self.wave.shape != self.flux.shape: <NEW_LINE> <INDE... | A spectrum, representing wavelength and spectral density values.
Parameters
----------
wave : list_like
Wavelength values.
flux : list_like
Spectral flux density values.
wave_unit : `~astropy.units.Unit`
Unit on wavelength.
unit : `~astropy.units.BaseUnit`
For now, only units with flux density in energ... | 62598fa966673b3332c30311 |
class RedactedRecordStatusType(EnumBase): <NEW_LINE> <INDENT> WITHHELD = "Withheld" | Enumeration of the redacted-record-status types. | 62598fa96aa9bd52df0d4e0f |
class ReadOnlySpooledTemporaryFile(MinioStorageFile, ReadOnlyMixin): <NEW_LINE> <INDENT> max_memory_size: int = 1024 * 1024 * 10 <NEW_LINE> def __init__( self, name: str, mode: str, storage: "Storage", max_memory_size: T.Optional[int] = None, **kwargs, ): <NEW_LINE> <INDENT> if mode.find("w") > -1: <NEW_LINE> <INDENT> ... | A django File class which buffers the minio object into a local
SpooledTemporaryFile. | 62598fa9498bea3a75a57a64 |
class CreateReferralPromoCode(Endpoint): <NEW_LINE> <INDENT> ENDPOINTS = [(Verbs.POST, 'resources/referral_promocode')] <NEW_LINE> ALL_DATA = {'referralPromoCode'} <NEW_LINE> REQUIRED_DATA = {'referralPromoCode'} <NEW_LINE> OPTIONAL_DATA = set() <NEW_LINE> DATA_TYPES = {'referralPromoCode': cobjects.ReferralPromoCode} ... | FCO REST API createReferralPromoCode endpoint.
This function will return a the newly created Referral promocode
Object.
Remarks:
On an exception, the referral promocode is not created.
Data (type name (required): description):
cobjects.ReferralPromoCode referralPromoCode (T):
The ReferralPromoCode object... | 62598fa9090684286d59367f |
class NotEnoughError(Error): <NEW_LINE> <INDENT> code = 400 <NEW_LINE> @property <NEW_LINE> def title(self): <NEW_LINE> <INDENT> return _('Resource NotEnough') <NEW_LINE> <DEDENT> @property <NEW_LINE> def message_format(self): <NEW_LINE> <INDENT> return _('detail: %(resource)s not enough') | 资源不足异常 | 62598fa932920d7e50bc5f9c |
class PoolAdder(object): <NEW_LINE> <INDENT> def __init__(self, upper_threshold): <NEW_LINE> <INDENT> self._upper_threshold = upper_threshold <NEW_LINE> self._conn = RedisClient() <NEW_LINE> self._checker = ValidityChecker() <NEW_LINE> self._crawler = ProxyCrawl() <NEW_LINE> <DEDENT> def is_upper_threshold(self): <NEW_... | 代理添加器 | 62598fa9097d151d1a2c0f70 |
class Network(_messages.Message): <NEW_LINE> <INDENT> forwardedPorts = _messages.StringField(1, repeated=True) <NEW_LINE> instanceTag = _messages.StringField(2) <NEW_LINE> name = _messages.StringField(3) <NEW_LINE> subnetworkName = _messages.StringField(4) | Extra network settings. Only applicable in the App Engine flexible
environment.
Fields:
forwardedPorts: List of ports, or port pairs, to forward from the virtual
machine to the application container. Only applicable in the App Engine
flexible environment.
instanceTag: Tag to apply to the VM instance during... | 62598fa9d58c6744b42dc279 |
class getVmcInfoListByRoomIds_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'roomIdList', (TType.I32,None), None, ), ) <NEW_LINE> def __init__(self, roomIdList=None,): <NEW_LINE> <INDENT> self.roomIdList = roomIdList <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == ... | Attributes:
- roomIdList | 62598fa956ac1b37e6302133 |
class PatternMatchingProblem(Problem): <NEW_LINE> <INDENT> def successors(self, node): <NEW_LINE> <INDENT> sub = dict(node.state) <NEW_LINE> terms, f_terms, index = node.extra <NEW_LINE> p_terms = [(len(index[subst(sub, t)]) if t in index else 0, len(necessary), random(), t) for necessary in terms if meets_requirements... | Used to unify a complex first-order pattern. Supports negations in
patterns using negation-as-failure. | 62598fa93617ad0b5ee0609b |
class TypeError(StandardError): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __new__(S, *more): <NEW_LINE> <INDENT> pass | Inappropriate argument type. | 62598fa9a219f33f346c675e |
class CmptIncrMoveRad(Cmpt): <NEW_LINE> <INDENT> def __init__( self, name, annuli, defval=0., defouter=0., minval=-5., maxval=5., nradbins=5, log=False): <NEW_LINE> <INDENT> Cmpt.__init__(self, name, annuli) <NEW_LINE> self.defval = defval <NEW_LINE> self.defouter = defouter <NEW_LINE> self.minval = minval <NEW_LINE> s... | A profile with control points, using interpolation to find the
values in between.
The radii of the control points are model parameters XX_r_YYY (in
log kpc), where YYY is the index of the annulus 000...999. The y
values (XX_YYY) are gradients in log (cm^-3 log kpc^-1).
This model forces the density profile to increa... | 62598fa92ae34c7f260ab029 |
class SimTypeLength(SimTypeInt): <NEW_LINE> <INDENT> _fields = SimTypeInt._fields + ('addr', 'length') <NEW_LINE> def __init__(self, arch, addr=None, length=None, label=None): <NEW_LINE> <INDENT> SimTypeInt.__init__(self, arch.bits, False, label=label) <NEW_LINE> self.addr = addr <NEW_LINE> self.length = length <NEW_LI... | SimTypeLength is a type that specifies the length of some buffer in memory. | 62598fa90c0af96317c562ca |
class ContributorsIndexer(ValueIndexer): <NEW_LINE> <INDENT> indexName = 'workitem-contributors' <NEW_LINE> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> contributors = getattr(self.context, 'contributor', None) <NEW_LINE> if contributors: <NEW_LINE> <INDENT> return (contributors,) | Indexer for work items with standard parameters. | 62598fa967a9b606de545f13 |
class Spline(Annotation): <NEW_LINE> <INDENT> group = param.String(default='Spline', constant=True) <NEW_LINE> def __init__(self, spline_points, **params): <NEW_LINE> <INDENT> super().__init__(spline_points, **params) <NEW_LINE> <DEDENT> def clone(self, data=None, shared_data=True, new_type=None, *args, **overrides): <... | Draw a spline using the given handle coordinates and handle
codes. The constructor accepts a tuple in format (coords, codes).
Follows format of matplotlib spline definitions as used in
matplotlib.path.Path with the following codes:
Path.STOP : 0
Path.MOVETO : 1
Path.LINETO : 2
Path.CURVE3 : 3
Path.CURVE4 ... | 62598fa976e4537e8c3ef4f5 |
class SourceCatalogATNF(SourceCatalog): <NEW_LINE> <INDENT> name = 'ATNF' <NEW_LINE> description = 'ATNF pulsar catalog' <NEW_LINE> source_object_class = SourceCatalogObjectATNF <NEW_LINE> def __init__(self, filename=None): <NEW_LINE> <INDENT> if not filename: <NEW_LINE> <INDENT> filename = gammapy_extra.filename('data... | ATNF pulsar catalog.
The `ATNF pulsar catalog <http://www.atnf.csiro.au/people/pulsar/psrcat/>`__
is **the** collection of information on all pulsars.
Unfortunately it's only available in a database format that can only
be read with their software.
This function loads a FITS copy of version 1.54 of the ATNF catalog:... | 62598fa97047854f4633f321 |
class Note(models.Model): <NEW_LINE> <INDENT> note_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) <NEW_LINE> name = models.CharField(max_length=50) <NEW_LINE> description = models.TextField() <NEW_LINE> privacy_state = models.CharField(max_length=20) <NEW_LINE> creation_date = models.DateTi... | Représentation d'une note comme un ensemble de page.
La plus part des infos sont stocké de manière physique dans les
dossiers le stockage en BDD sert à faciliter la recherche.
Sur le disque une note est stocké dans le dossier settings.NOTE_DIR,
à l'intérieur d'un dossier portant le nom de l'utilisateur.
Une note est ... | 62598fa9b7558d5895463577 |
class VideoAnalyzerOperationResultsOperations(object): <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = con... | VideoAnalyzerOperationResultsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~video_analyzer.models
:param ... | 62598fa9eab8aa0e5d30bcd2 |
@delegate_names(delegate=PeriodArray, accessors=PeriodArray._datetimelike_ops, typ="property") <NEW_LINE> @delegate_names(delegate=PeriodArray, accessors=PeriodArray._datetimelike_methods, typ="method") <NEW_LINE> class PeriodProperties(Properties): <NEW_LINE> <INDENT> pass | Accessor object for datetimelike properties of the Series values.
Examples
--------
>>> s.dt.hour
>>> s.dt.second
>>> s.dt.quarter
Returns a Series indexed like the original Series.
Raises TypeError if the Series does not contain datetimelike values. | 62598fa9f548e778e596b4ed |
class InfinitePaginator(Paginator): <NEW_LINE> <INDENT> def __init__(self, object_list, per_page, allow_empty_first_page=True, link_template='/page/%d/', orphans=0): <NEW_LINE> <INDENT> orphans = 0 <NEW_LINE> super(InfinitePaginator, self).__init__(object_list, per_page, orphans, allow_empty_first_page) <NEW_LINE> del ... | Paginator designed for cases when it's not important to know how many
total pages. This is useful for any object_list that has no count()
method or can be used to improve performance for MySQL by removing counts.
The orphans parameter has been removed for simplicity and there's a link
template string for creating the... | 62598fa9dd821e528d6d8e7d |
class RestoreRunner(Strategy): <NEW_LINE> <INDENT> __strategy_type__ = 'restore_runner' <NEW_LINE> __strategy_ns__ = 'trove.guestagent.strategies.restore' <NEW_LINE> restore_cmd = None <NEW_LINE> restore_type = None <NEW_LINE> is_zipped = BACKUP_USE_GZIP <NEW_LINE> is_encrypted = BACKUP_USE_OPENSSL <NEW_LINE> decrypt_k... | Base class for Restore Strategy implementations | 62598fa9e5267d203ee6b853 |
class TextTests(InvenioTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.bad_xml = ( '<record><datafield tag="245" ind1="" ind2="">' '<subfield code="a">\xc3\x81xions, m\xc3\xa1jorons e neutrinos' ' em extens\xc3\xb5es do modelo padr\xc3\xa3o</subfield></datafield>' '<datafield tag="520" ind1="" ... | Test the text functions. | 62598fa985dfad0860cbfa18 |
class CreateOfficeV2(Resource): <NEW_LINE> <INDENT> parser = reqparse.RequestParser() <NEW_LINE> parser.add_argument( 'name', type=str, required=True, help="Name of the office should be filled" ) <NEW_LINE> parser.add_argument( 'type', type=str, required=True, help="Type of the office should be filled" ) <NEW_LINE> @jw... | docstring for CreateOfficeV2. | 62598fa926068e7796d4c8a2 |
class ExpectShellSession(Action): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ExpectShellSession, self).__init__() <NEW_LINE> self.name = "expect-shell-connection" <NEW_LINE> self.summary = "Expect a shell prompt" <NEW_LINE> self.description = "Wait for a shell" <NEW_LINE> self.prompts = [] <NEW_L... | Waits for a shell connection to the device for the current job.
The shell connection can be over any particular connection,
all that is needed is a prompt. | 62598fa9aad79263cf42e71d |
class StubAggregatorXBlock(XBlock): <NEW_LINE> <INDENT> completion_mode = XBlockCompletionMode.AGGREGATOR | XBlock to test behaviour of BlockCompletionTransformer
when transforming aggregator XBlock. | 62598fa94a966d76dd5eee2b |
class BaseParser(object): <NEW_LINE> <INDENT> def __init__(self, path, **kwargs): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.data = [] <NEW_LINE> self.fields = set([]) <NEW_LINE> for k, v in list(kwargs.items()): <NEW_LINE> <INDENT> setattr(self, k, v) <NEW_LINE> <DEDENT> self.open() <NEW_LINE> <DEDENT> def n... | Base class for all data parsers. Do not instantiate directly. | 62598fa966673b3332c30313 |
class UpperLimitCalc(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def lim_range(self, workspace_name): <NEW_LINE> <INDENT> from scharmfit import utils <NEW_LINE> utils.load_susyfit() <NEW_LINE> from ROOT import Util <NEW_LINE> from ROOT import RooStats <NEW_LINE> if not ... | Calculates the upper limit min, mean, and max values | 62598fa9090684286d593680 |
@attrs(**ATTRSCONFIG) <NEW_LINE> class PushTemplate(Resource): <NEW_LINE> <INDENT> RESOURCE_TYPE = "AWS::Pinpoint::PushTemplate" <NEW_LINE> Properties: PushTemplateProperties = attrib( factory=PushTemplateProperties, converter=create_object_converter(PushTemplateProperties), ) | A Push Template for Pinpoint.
See Also:
`AWS Cloud Formation documentation for PushTemplate
<http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-pinpoint-pushtemplate.html>`_ | 62598fa94527f215b58e9e2b |
class OrganisationMembersView(generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = OrganisationMembersSerializer <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> organisation = get_object_or_404(Organisation, slug=self.kwargs['slug'], members=self.reques... | List all the members for an organisation. User should be a member of that organisation. | 62598fa932920d7e50bc5f9e |
class TestCase(testtools.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestCase, self).setUp() <NEW_LINE> self.context = ironic_context.get_admin_context() <NEW_LINE> test_timeout = os.environ.get('OS_TEST_TIMEOUT', 0) <NEW_LINE> try: <NEW_LINE> <INDENT> test_timeout = int(test_timeout) <NEW... | Test case base class for all unit tests. | 62598fa991f36d47f2230e49 |
class RemainingTimeUntil(RemainingTime): <NEW_LINE> <INDENT> def __init__(self, deadline: float) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._deadline = deadline <NEW_LINE> <DEDENT> def get(self) -> float: <NEW_LINE> <INDENT> return max(0.0, self._deadline - time.time()) | The remaining wall clock time up to a given absolute deadline in terms of time.time() | 62598fa93617ad0b5ee0609d |
class _compound_list_select_acid(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._compound_type = 'acid' <NEW_LINE> options = get_compound_list('H', 'acid') <NEW_LINE> self._compound = widgets.Select(options=options, layout=widgets.Layout(flex='0 0 auto', width='120px', height=_element_height)... | selector for acid with weight frac of water | 62598fa9aad79263cf42e71e |
class IFacetedGlobalSettingsChangedEvent(IFacetedEvent): <NEW_LINE> <INDENT> pass | Faceted global settings updated
| 62598fa94e4d56256637236e |
class CommandLineException(Exception): <NEW_LINE> <INDENT> pass | convenience exception to make it easy to not print traceback when
run from the command line | 62598fa901c39578d7f12cc9 |
class ManageInternalEndpointRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RegistryId = None <NEW_LINE> self.Operation = None <NEW_LINE> self.VpcId = None <NEW_LINE> self.SubnetId = None <NEW_LINE> self.RegionId = None <NEW_LINE> self.RegionName = None <NEW_LINE> <DEDENT> def _... | ManageInternalEndpoint请求参数结构体
| 62598fa9fff4ab517ebcd72e |
class LabelSmoothing(nn.Module): <NEW_LINE> <INDENT> def __init__(self, size, padding_idx, smoothing=0.0): <NEW_LINE> <INDENT> super(LabelSmoothing, self).__init__() <NEW_LINE> self.criterion = nn.KLDivLoss(reduction='sum') <NEW_LINE> self.padding_idx = padding_idx <NEW_LINE> self.confidence = 1.0 - smoothing <NEW_LINE... | Implement label smoothing. | 62598fa9d6c5a102081e2091 |
class NoSection(LogState): <NEW_LINE> <INDENT> def transition(self, sTag, _dAttr): <NEW_LINE> <INDENT> if sTag == 'p': <NEW_LINE> <INDENT> return InSection(RuleDict(self.oLogger), self.oLogger) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return self | Not in any ruling section. | 62598fa999fddb7c1ca62d8d |
class DeploymentOutputStream(View): <NEW_LINE> <INDENT> def output_stream_generator(self): <NEW_LINE> <INDENT> if get_task_details(self.object.stage.project, self.object.task.name) is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> preyield = True <NEW_LINE> try: <NEW_LINE> <INDENT> process = subprocess.Popen( bui... | Deployment view does the heavy lifting of calling Fabric Task for a Project Stage | 62598fa9e76e3b2f99fd897f |
class WwwcConfig: <NEW_LINE> <INDENT> def __init__(self, filename, section): <NEW_LINE> <INDENT> self.config = {} <NEW_LINE> self._parse_cfg(filename, section) <NEW_LINE> <DEDENT> def _parse_cfg(self, filename, section): <NEW_LINE> <INDENT> config = ConfigParser.ConfigParser() <NEW_LINE> config.read(filename) <NEW_LINE... | config class | 62598fa9d486a94d0ba2bf17 |
class Len(Function, PyccelAstNode): <NEW_LINE> <INDENT> _rank = 0 <NEW_LINE> _shape = () <NEW_LINE> _precision = default_precision['int'] <NEW_LINE> _dtype = NativeInteger() <NEW_LINE> def __new__(cls, arg): <NEW_LINE> <INDENT> return Basic.__new__(cls, arg) <NEW_LINE> <DEDENT> @property <NEW_LINE> def arg... | Represents a 'len' expression in the code. | 62598fa99c8ee82313040115 |
class WorksheetOrderSubmitView(LoginRequiredMixin, WorksheetMixin, UpdateView): <NEW_LINE> <INDENT> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> section = Section.objects.get(slug=kwargs.get('section_slug')) <NEW_LINE> worksheets = Worksheet.objects.filter(section=section) <NEW_LINE> return re_order_fe... | Update order view for Worksheet. | 62598fa930dc7b766599f797 |
class TestKYCDataResponse(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 testKYCDataResponse(self): <NEW_LINE> <INDENT> model = swagger_client.models.kyc_data_response.KYCDataResponse() | KYCDataResponse unit test stubs | 62598fa945492302aabfc41a |
class ControllerGUI(Ui_MainWindow): <NEW_LINE> <INDENT> def __init__(self, window): <NEW_LINE> <INDENT> Ui_MainWindow.__init__(self) <NEW_LINE> self.setupUi(window) <NEW_LINE> self.but_headerfile.clicked.connect(self.read_header) <NEW_LINE> self.timer = QtCore.QTimer() <NEW_LINE> self.timer.setSingleShot(False) <NEW_LI... | docstring for TCUPulseParamsGUILogic. | 62598fa9656771135c4895cb |
class ROPhoneNumberField(RegexField): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': _('Phone numbers must be in XXXX-XXXXXX format.'), } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ROPhoneNumberField, self).__init__(r'^[0-9\-\(\)\s]{10,20}$', max_length=20, min_length=10, *args... | Romanian phone number field | 62598fa9cb5e8a47e493c11d |
class TestUserCreateRole(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 testUserCreateRole(self): <NEW_LINE> <INDENT> pass | UserCreateRole unit test stubs | 62598fa956ac1b37e6302136 |
class Query(CommentableMixin, Model): <NEW_LINE> <INDENT> title = models.CharField( max_length=127, ) <NEW_LINE> uploader = models.ForeignKey( to=swapper.get_model_name('kernel', 'Person'), on_delete=models.CASCADE, ) <NEW_LINE> app_name = models.CharField( max_length=63, ) <NEW_LINE> query = models.TextField() <NEW_LI... | This model holds the information about a query asked by a user of Omniport | 62598fa9a17c0f6771d5c17f |
@zope.interface.implementer(interfaces.IValidator) <NEW_LINE> class Validator(object): <NEW_LINE> <INDENT> def certificate(self, cert, name, alt_host=None, port=443): <NEW_LINE> <INDENT> if alt_host is None: <NEW_LINE> <INDENT> host = socket.gethostbyname(name) <NEW_LINE> <DEDENT> elif isinstance(alt_host, six.binary_t... | Collection of functions to test a live webserver's configuration | 62598fa9f548e778e596b4ee |
class CombDirectionType(Enum): <NEW_LINE> <INDENT> Comb = 48 <NEW_LINE> UnComb = 49 <NEW_LINE> def __int__(self): <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> def __char__(self): <NEW_LINE> <INDENT> return chr(self.value) | 组合指令方向类型 | 62598fa967a9b606de545f16 |
class Lowest(OperationN): <NEW_LINE> <INDENT> alias = ('MinN',) <NEW_LINE> lines = ('lowest',) <NEW_LINE> func = min | Calculates the lowest value for the data in a given period
Uses the built-in ``min`` for the calculation
Formula:
- lowest = min(data, period) | 62598fa90c0af96317c562cd |
class TestOrderFulfillment(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 testOrderFulfillment(self): <NEW_LINE> <INDENT> model = squareconnect.models.order_fulfillment.OrderFulfillment() | OrderFulfillment unit test stubs | 62598fa98e7ae83300ee8fec |
class ComputerStrategy(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def algorithm_execution(self, computer): <NEW_LINE> <INDENT> pass | Declare an interface common to all supported algorithms. Context
uses this interface to call the algorithm defined by a
ConcreteStrategy. | 62598fa9dd821e528d6d8e80 |
class DBSourceForgeBackend(DBBackend): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.MYSQL_EXT = [DBSourceForgeIssueExtMySQL] <NEW_LINE> <DEDENT> def insert_issue_ext(self, store, issue, issue_id): <NEW_LINE> <INDENT> newIssue = False; <NEW_LINE> try: <NEW_LINE> <INDENT> db_issue_ext = store.find(DBS... | Adapter for SourceForge backend. | 62598fa97d847024c075c30e |
class uranium_decay: <NEW_LINE> <INDENT> def __init__(self,number_of_A=100,number_of_B=0,time_constant=1,time_of_duration=5,time_step=0.05): <NEW_LINE> <INDENT> self.na = [number_of_A] <NEW_LINE> self.nb = [number_of_B] <NEW_LINE> self.t=[0] <NEW_LINE> self.tau = time_constant <NEW_LINE> self.dt=time_step <NEW_LINE> se... | Simulation of radioactive decay
Nuclei of type A decay into ones of type B,while nuclei of type B decay
into ones of type A
Program to accompany 'Computation Physics' by Cai Hao | 62598fa9090684286d593681 |
class Embargoed(_SimpleAttr): <NEW_LINE> <INDENT> def __init__(self, is_embargoed: bool): <NEW_LINE> <INDENT> super().__init__(bool(is_embargoed)) | Current embargo status of a dataset.
Parameters
----------
is_embargoed: `bool`
A boolean determining if a dataset currently under embargo. | 62598fa93539df3088ecc1ff |
class TCPClient(Actor): <NEW_LINE> <INDENT> @manage(['address', 'port', 'mode', 'delimiter']) <NEW_LINE> def init(self, mode="delimiter", delimiter="\r\n"): <NEW_LINE> <INDENT> self.address = None <NEW_LINE> self.port = None <NEW_LINE> self.EOST_token_received = False <NEW_LINE> self.cc = None <NEW_LINE> self.mode = mo... | Etablish a TCP connection and forward all tokens.
Any recevied data on the TCP connection is forwarded according to protocol.
Input:
data_in : Each received token will be sent out through the TCP connection.
control_in : Each received token will be sent out through the TCP connection.
Output:
data_out : Data rec... | 62598fa932920d7e50bc5fa0 |
class PermissionVideoUploadError(OAuthException): <NEW_LINE> <INDENT> error_code = 261 <NEW_LINE> error_id = "PERMISSION_VIDEO_UPLOAD" <NEW_LINE> error_description = 'Modifying existing photos requires the extended permission photo_upload' | Autogenerated exception class for API error code 261 | 62598fa90a50d4780f705328 |
class Square(): <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> if type(size) is not int: <NEW_LINE> <INDENT> raise TypeError("size must be an integer") <NEW_LINE> <DEDENT> if size < 0: <NEW_LINE> <INDENT> raise ValueError("size must be >= 0") <NEW_LINE> <DEDENT> self.__size = size | Class that defines a Square | 62598fa9d6c5a102081e2093 |
class LogDriver(notifier._Driver): <NEW_LINE> <INDENT> LOGGER_BASE = 'oslo.messaging.notification' <NEW_LINE> def notify(self, ctxt, message, priority): <NEW_LINE> <INDENT> logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) <NEW_LINE> getattr(logger, priority.lower())(jsonutils.dumps(messag... | Publish notifications via Python logging infrastructure. | 62598fa938b623060ffa8fe3 |
class V1alpha1ClusterRoleBindingList(object): <NEW_LINE> <INDENT> swagger_types = { 'api_version': 'str', 'items': 'list[V1alpha1ClusterRoleBinding]', 'kind': 'str', 'metadata': 'V1ListMeta' } <NEW_LINE> attribute_map = { 'api_version': 'apiVersion', 'items': 'items', 'kind': 'kind', 'metadata': 'metadata' } <NEW_LINE>... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fa944b2445a339b6915 |
class HADES_RADIUS_ACCOUNTING_PORT(Option): <NEW_LINE> <INDENT> type = int <NEW_LINE> default = 1813 | RADIUS accounting port | 62598fa916aa5153ce40044e |
class Config(object): <NEW_LINE> <INDENT> DEBUG = False <NEW_LINE> CSRF_ENABLED = True <NEW_LINE> JWT_SECRET_KEY = "fiona" | docstring for Config. | 62598fa901c39578d7f12ccb |
class Ganalytics(object): <NEW_LINE> <INDENT> def __init__(self, enable=None, utm_source=None, utm_medium=None, utm_term=None, utm_content=None, utm_campaign=None): <NEW_LINE> <INDENT> self._enable = None <NEW_LINE> self._utm_source = None <NEW_LINE> self._utm_medium = None <NEW_LINE> self._utm_term = None <NEW_LINE> s... | Allows you to enable tracking provided by Google Analytics. | 62598fa98da39b475be0312f |
class whoswho(base.ATCTContent): <NEW_LINE> <INDENT> implements(Iwhoswho) <NEW_LINE> security = ClassSecurityInfo() <NEW_LINE> portal_type = "whoswho" <NEW_LINE> schema = whoswhoSchema <NEW_LINE> title = ATFieldProperty('title') <NEW_LINE> description = ATFieldProperty('description') <NEW_LINE> security.declarePublic('... | Description of the Example Type | 62598fa99c8ee82313040116 |
class StatsQtWidgetsQMainWindow(QtWidgets.QMainWindow): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> from ..utils.analytics import AnalyticsClient <NEW_LINE> name = self.__class__.__name__ <NEW_LINE> name = re.sub(r"([A-Z])", r" \1", name).strip() <NEW_LINE> Anal... | Send stats from all the QMainWindow | 62598fa9925a0f43d25e7f8a |
class StackListResource(ListMongoResource): <NEW_LINE> <INDENT> method_decorators = [requires_auth_api] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(ListMongoResource, self).__init__(Stack) <NEW_LINE> self.document = Stack <NEW_LINE> <DEDENT> @catch_all <NEW_LINE> def post(self): <NEW_LINE> <INDENT> try: <N... | GET MULTIPLE, POST
I overwrite these classes to filter by owner and hide owner from client | 62598fa967a9b606de545f17 |
class UserFeedbackCheckFailure(commands.CheckFailure): <NEW_LINE> <INDENT> def __init__(self, message=None, *args): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> super().__init__(message, *args) | A version of CheckFailure which isn't suppressed. | 62598fa9442bda511e95c3a1 |
class PulpTaskGroupError(Exception): <NEW_LINE> <INDENT> def __init__(self, task_group): <NEW_LINE> <INDENT> super().__init__(self, f"Pulp task group failed ({task_group})") <NEW_LINE> self.task_group = task_group | Exception to describe task group errors. | 62598fa9851cf427c66b8214 |
class PasswordChange(GenericAPIView): <NEW_LINE> <INDENT> serializer_class = PasswordChangeSerializer <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> serializer = self.get_serializer(data=request.data) <NEW_LINE> if not serializer.is_valid(): <NEW_LINE> <INDENT... | Calls Django Auth SetPasswordForm save method.
Accepts the following POST parameters: new_password1, new_password2
Returns the success/fail message. | 62598fa921bff66bcd722bb2 |
class CaseInsensitiveDict(MutableMapping): <NEW_LINE> <INDENT> def __init__(self, data=None, **kwargs): <NEW_LINE> <INDENT> self._store = OrderedDict() <NEW_LINE> if data is None: <NEW_LINE> <INDENT> data = {} <NEW_LINE> <DEDENT> self.update(data, **kwargs) <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LI... | A case-insensitive ``dict``-like object.
Implements all methods and operations of
``MutableMapping`` as well as dict's ``copy``. Also
provides ``lower_items``.
All keys are expected to be strings. The structure remembers the
case of the last key to be set, and ``iter(instance)``,
``keys()``, ``items()``, ``iterkeys()``... | 62598fa9b7558d589546357b |
class Mgm2GainMessage(Message): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> super().__init__("gain", None) <NEW_LINE> self._value = value <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return self._value <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_... | Class to send to neighbors what best gain can be achieved by the agent if
it moves alone | 62598fa93539df3088ecc200 |
class InfrastructureType(StructureOrNoneRelated, OptionalPictogramMixin): <NEW_LINE> <INDENT> label = models.CharField(max_length=128) <NEW_LINE> type = models.CharField(max_length=1, choices=INFRASTRUCTURE_TYPES) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _("Infrastructure Type") <NEW_LINE> verbose_name... | Types of infrastructures (bridge, WC, stairs, ...) | 62598fa945492302aabfc41d |
@Producer(UberCar, host = 'http://ucigridb.nacs.uci.edu:12000') <NEW_LINE> @GetterSetter(InactiveUberCar, ActiveUberCar, CarAndCarInfront, Vehicle, host = 'http://ucigridb.nacs.uci.edu:12000') <NEW_LINE> class TrafficSimulation(IApplication): <NEW_LINE> <INDENT> frame = None <NEW_LINE> ticks = 0 <NEW_LINE> cars = [] <N... | classdocs | 62598fa9be383301e0253744 |
class IRCReplyBot(irc.IRCClient): <NEW_LINE> <INDENT> def connectionMade(self): <NEW_LINE> <INDENT> self.nickname = self.factory.nickname <NEW_LINE> self.password = self.factory.password <NEW_LINE> irc.IRCClient.connectionMade(self) <NEW_LINE> <DEDENT> def signedOn(self): <NEW_LINE> <INDENT> channel = self.factory.chan... | IRC Bot, have fun! | 62598fa94e4d562566372371 |
class IpPatchInput(object): <NEW_LINE> <INDENT> openapi_types = { 'data': 'IpPatchIn', 'operations': 'list[JsonPatchOperation]', 'q': 'QuerybuilderRuleGroupSchema' } <NEW_LINE> attribute_map = { 'data': 'data', 'operations': 'operations', 'q': 'q' } <NEW_LINE> def __init__(self, data=None, operations=None, q=None, loca... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598fa999cbb53fe6830e22 |
class Listing(object): <NEW_LINE> <INDENT> def __init__(self, fname): <NEW_LINE> <INDENT> self.listing = [(0, [])] <NEW_LINE> self.filename = fname <NEW_LINE> <DEDENT> def listInstruction(self, inst): <NEW_LINE> <INDENT> self.listing.append(inst) <NEW_LINE> <DEDENT> def listDivider(self, newpc): <NEW_LINE> <INDENT> sel... | Encapsulates the program listing. Accepts fully formatted
instruction strings, or batches of data bytes. Batches of data
bytes are assumed to be contiguous unless a divider is explicitly
requested. | 62598fa97d43ff24874273a8 |
class RatedItem(models.Model): <NEW_LINE> <INDENT> rating_average = models.DecimalField(max_digits=7, decimal_places=2) <NEW_LINE> rating_count = models.PositiveIntegerField() <NEW_LINE> date_last_rated = models.DateTimeField(editable=False, null=True) <NEW_LINE> content_type = models.ForeignKey(ContentType) <NEW_LINE>... | Rate info for an object. | 62598fa98e7ae83300ee8fed |
class CliListScripts(BaseScriptCli): <NEW_LINE> <INDENT> def take_action(self, parsed_args): <NEW_LINE> <INDENT> resp = utils.get_client_from_osc(self).rating.pyscripts.list_scripts( **vars(parsed_args)) <NEW_LINE> resp = resp.get('scripts') or [] <NEW_LINE> values = utils.list_to_cols(resp, self.columns) <NEW_LINE> re... | List existing PyScripts. | 62598fa910dbd63aa1c70aff |
class TooManyRequests(object): <NEW_LINE> <INDENT> swagger_types = { 'errors': 'list[TooManyRequestsErrors]' } <NEW_LINE> attribute_map = { 'errors': 'errors' } <NEW_LINE> def __init__(self, errors=None): <NEW_LINE> <INDENT> self._errors = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.errors = errors <NEW_L... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fa9dd821e528d6d8e82 |
class TimeSeriesName(object): <NEW_LINE> <INDENT> def __init__(self, metric, tags): <NEW_LINE> <INDENT> self.metric = metric <NEW_LINE> self.tags = tags <NEW_LINE> <DEDENT> @property <NEW_LINE> def tags(self): <NEW_LINE> <INDENT> return self._tags <NEW_LINE> <DEDENT> @tags.setter <NEW_LINE> def tags(self, tags): <NEW_L... | Encapsulates a timeseries name representation by using the metric name and tags | 62598fa9627d3e7fe0e06df9 |
class Canvas: <NEW_LINE> <INDENT> def __init__(self, width, height, window_title: str): <NEW_LINE> <INDENT> glutInit(sys.argv) <NEW_LINE> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) <NEW_LINE> glutInitWindowSize(width, height) <NEW_LINE> glutInitWindowPosition(0, 0) <NEW_LINE> glutCreateWindow(window_title.encode('asci... | viewport and window are lists (left, right, bottom, top)
color is used for drawing (red, green, blue) | 62598fa91b99ca400228f4d6 |
class itkShotNoiseImageFilterIUC3IUC3(itkInPlaceImageFilterAPython.itkInPlaceImageFilterIUC3IUC3): <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") <N... | Proxy of C++ itkShotNoiseImageFilterIUC3IUC3 class | 62598fa95fc7496912d48229 |
class ClassName: <NEW_LINE> <INDENT> class_variable = 'Class variable' <NEW_LINE> def class_method(self): <NEW_LINE> <INDENT> print('You called the class method') <NEW_LINE> <DEDENT> def print_class_variable(self): <NEW_LINE> <INDENT> print('This is the class variable', self.class_variable) | class-documentation-string | 62598fa9462c4b4f79dbb95a |
class ConstType(Const): <NEW_LINE> <INDENT> pass | -------------------------------------------------------------------------*
Flags for setting to white or black *
-------------------------------------------------------------------------*/
enum {
L_SET_WHITE = 1, /* set pixels to white */
... | 62598fa960cbc95b0636429a |
class AesEnable(Structure): <NEW_LINE> <INDENT> _fields_ = [('Enable', c_uint8, 1), ('Reserved', c_uint8, 6)] <NEW_LINE> _pack_ = 1 | AES Enable (608) Field Definition | 62598fa9ac7a0e7691f72458 |
class GenShellCompletions(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> path = os.path.split(sys.argv[0])[1] <NEW_LINE> c = genzshcomp.CompletionGenerator(path, parser, parser_type='argparse', output_format=values) <NEW_LINE> print(c.get()) ... | Class to generate arguments and exit | 62598fa9e76e3b2f99fd8983 |
class _FileReaderRows: <NEW_LINE> <INDENT> def __init__(self, csvreader): <NEW_LINE> <INDENT> self.data = [] <NEW_LINE> self.maxlength = 0 <NEW_LINE> lineno = 1 <NEW_LINE> try: <NEW_LINE> <INDENT> for line in csvreader: <NEW_LINE> <INDENT> self.maxlength = max(self.maxlength, len(line)) <NEW_LINE> self.data.append(line... | Read a CSV file in columns. This acts as an iterator.
This means we have to read the whole file in, then return cols :-( | 62598fa98da39b475be03131 |
class Change(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 { 'parameter': (str,), 'current_value': (str,), 'requested_val... | 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... | 62598fa97047854f4633f327 |
class TwoLineListItem(BaseListItem): <NEW_LINE> <INDENT> _txt_top_pad = NumericProperty("20dp") <NEW_LINE> _txt_bot_pad = NumericProperty("15dp") <NEW_LINE> _height = NumericProperty() <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.height = dp(72) if not self._he... | A two line list item. | 62598fa9cb5e8a47e493c11f |
class UnknownTrackType(Error): <NEW_LINE> <INDENT> pass | A subclass of `Error` raised if a file is of an unsupported type. | 62598fa9cc0a2c111447af5e |
class SnapshotCreateError(ProminenceError): <NEW_LINE> <INDENT> pass | Raised when there is an error creating a snapshot | 62598fa9435de62698e9bd44 |
class TextSegmentWithTwoTargetsAdmin(BaseMetadataAdmin): <NEW_LINE> <INDENT> list_display = [ '__str__', 'itemID', 'itemType', 'segmentID', 'segmentText', 'target1ID', 'target1Text', 'target2ID', 'target2Text' ] + BaseMetadataAdmin.list_display <NEW_LINE> list_filter = [ 'metadata__corpusName', 'metadata__versionInfo',... | Model admin for TextPair instances. | 62598fa92c8b7c6e89bd3713 |
class TestCollatz(TestCase): <NEW_LINE> <INDENT> def test_read_1(self): <NEW_LINE> <INDENT> temp1 = "70 70000\n" <NEW_LINE> temp2, temp3 = collatz_read(temp1) <NEW_LINE> self.assertEqual(temp2, 70) <NEW_LINE> self.assertEqual(temp3, 70000) <NEW_LINE> <DEDENT> def test_read_2(self): <NEW_LINE> <INDENT> temp1 = "1234 956... | docstring | 62598fa92c8b7c6e89bd3714 |
class AvailabilityHomeView(MonthCalendarMixin, WeekWithAvailabilityMixin, generic.TemplateView): <NEW_LINE> <INDENT> template_name = 'shifts/availability.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwargs) <NEW_LINE> week = self.get_week_calendar() <NE... | home view for availability input | 62598fa966673b3332c30319 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.