code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class _Context(Mapping): <NEW_LINE> <INDENT> def __init__(self, element=None, parent_elements=None): <NEW_LINE> <INDENT> if parent_elements is not None: <NEW_LINE> <INDENT> self.elements = parent_elements[:] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.elements = [] <NEW_LINE> <DEDENT> if element is not None: <NE... | An inherited value context.
In FCP XML there is a concept of inheritance down the element heirarchy.
For instance, a ``clip`` element may not specify the ``rate`` locally, but
instead inherit it from the parent ``track`` element.
This object models that as a stack of elements. When a value needs to be
queried from th... | 62598fd3fbf16365ca79455a |
class Form(models.Model): <NEW_LINE> <INDENT> CONFIG_OPTIONS = [ ('save_fs', { 'title': _('Save form submission'), 'process': create_form_submission}), ('email', { 'title': _('E-mail'), 'form_fields': [ ('email', forms.EmailField(_('e-mail address')))], 'process': send_as_mail}), ] <NEW_LINE> title = models.CharField( ... | Basic form models | 62598fd3091ae356687050b9 |
class ElementReferenceType(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(self,*... | Element reference types.
enum ElementReferenceType,values: REFERENCE_TYPE_CUT_EDGE (5),REFERENCE_TYPE_FOREIGN (3),REFERENCE_TYPE_INSTANCE (4),REFERENCE_TYPE_LINEAR (1),REFERENCE_TYPE_MESH (6),REFERENCE_TYPE_NONE (0),REFERENCE_TYPE_SURFACE (2) | 62598fd3be7bc26dc92520a7 |
@dataclass(frozen=True) <NEW_LINE> class WantedResults: <NEW_LINE> <INDENT> page: int <NEW_LINE> per_page: int <NEW_LINE> total: int <NEW_LINE> sort_key: str <NEW_LINE> sort_dir: str <NEW_LINE> movies: List[Movie] <NEW_LINE> @staticmethod <NEW_LINE> def from_dict(data: dict): <NEW_LINE> <INDENT> movies = [Movie.from_di... | Object holding wanted episode results from Radarr. | 62598fd3283ffb24f3cf3d1e |
class CBBContact(BroadContact): <NEW_LINE> <INDENT> pass | Broad phase contact using circular bounding boxes. | 62598fd3a219f33f346c6ca5 |
class Sniffer: <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.done = Event() <NEW_LINE> self.success = False <NEW_LINE> self.playbin = gst.element_factory_make('playbin') <NEW_LINE> self.videosink = gst.element_factory_make("fakesink", "videosink") <NEW_LINE> self.playbin.set_property("video... | Determines whether a file is "audio", "video", or "unplayable".
| 62598fd3fbf16365ca79455c |
@spec.define_schema('SingleReportSchema') <NEW_LINE> class SingleReportSchema(ReportSchema): <NEW_LINE> <INDENT> values = ma.List(ma.Nested(ReportValuesSchema()), many=True) <NEW_LINE> outages = ma.List( ma.Nested(ReportOutageSchema()), many=True, title="Outages", description=( "List of periods for which the report wil... | For serializing a report with values and outages.
| 62598fd3d8ef3951e32c80ab |
class YumRepository(BaseRepository): <NEW_LINE> <INDENT> _type = REPO_TYPE_YUM | Custom Yum repository | 62598fd3adb09d7d5dc0aa1b |
class MobileAuthTestMixin: <NEW_LINE> <INDENT> def test_no_auth(self): <NEW_LINE> <INDENT> self.logout() <NEW_LINE> self.api_response(expected_response_code=401) | Test Mixin for testing APIs decorated with mobile_view. | 62598fd3a05bb46b3848ad0a |
class Cacher(abc.ABC): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> self.cfg = cfg <NEW_LINE> <DEDENT> async def init(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> async def get_cache(self, key): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> async def set_cache(self, key, value): <NEW_LINE> <IN... | The Cacher is the base class that other, more complex and actually used,
abstract Cacher handlers use for their base functions. | 62598fd350812a4eaa620e34 |
class Clock( EDS ): <NEW_LINE> <INDENT> def __init__( self, i2, a = 0x68 ): <NEW_LINE> <INDENT> super().__init__( i2, a ) <NEW_LINE> <DEDENT> def set( self, t=None ): <NEW_LINE> <INDENT> def bcd( x ): <NEW_LINE> <INDENT> return (x % 10) + 16 * (x // 10) <NEW_LINE> <DEDENT> self._write_reg( 0x7, 0 ) <NEW_LINE> self._wri... | CLOCK is a HT1382 I2C/3-Wire Real Time Clock with a 32 kHz crystal | 62598fd397e22403b383b3aa |
class Comment(TrelloObject): <NEW_LINE> <INDENT> def __init__(self, info={}): <NEW_LINE> <INDENT> super().__init__({ "name": info.get("memberCreator").get("fullName"), "id": info.get("id") }) <NEW_LINE> self.date = info.get("date") <NEW_LINE> self.text = info.get("data").get("text") <NEW_LINE> <DEDENT> @property <NEW_L... | Trello Comment object | 62598fd3956e5f7376df58ce |
class Post(News): <NEW_LINE> <INDENT> title = models.CharField(max_length=200) <NEW_LINE> category = models.ForeignKey(Category, blank=True, null=True, on_delete=models.CASCADE) <NEW_LINE> is_approve = models.BooleanField() <NEW_LINE> def get_content_as_markdown(self): <NEW_LINE> <INDENT> return mark_safe(markdown(self... | model that describe post | 62598fd38a349b6b436866e2 |
class Location(db.Model, CRUD): <NEW_LINE> <INDENT> __tablename__ = 'locations' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.Text) <NEW_LINE> latitude = db.Column(db.String(30)) <NEW_LINE> longitude = db.Column(db.String(30)) <NEW_LINE> website = db.Column(db.Text) <NEW_LINE> d... | Create a Location table | 62598fd39f28863672818ace |
class ChatSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Chat <NEW_LINE> fields = '__all__' | Serializing all the Chats | 62598fd3a219f33f346c6ca9 |
class NTPClient(object): <NEW_LINE> <INDENT> def request(self, host, version=2, port='ntp'): <NEW_LINE> <INDENT> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) <NEW_LINE> s.settimeout(30) <NEW_LINE> try: <NEW_LINE> <INDENT> sockaddr = socket.getaddrinfo(host, port)[0][4] <NEW_LINE> query = NTPPacket(mode=3, versi... | Client session - for now, a mere wrapper for NTP requests | 62598fd3ab23a570cc2d4fbf |
class RegistrationForm(FlaskForm): <NEW_LINE> <INDENT> email = StringField('Email', validators=[DataRequired(), Email()]) <NEW_LINE> username = StringField('Username', validators=[DataRequired()]) <NEW_LINE> first_name = StringField('First Name', validators=[DataRequired()]) <NEW_LINE> last_name = StringField('Last Nam... | Form for users to create new account | 62598fd38a349b6b436866e4 |
class Exposure(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def interaction(x,y,t): <NEW_LINE> <INDENT> X = np.sum(x) <NEW_LINE> index = np.dot(x / X, y / t) <NEW_LINE> return index <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def isolation(x,t): <NEW_LINE> <INDENT> X = np.sum(x) <NEW_LINE> index = np.dot(x / ... | “Exposure measures the degree of
potential contact, or possibility of
interaction, between minority and
majority group members” (Massey
and Denton, p. 287). | 62598fd3d8ef3951e32c80ad |
class Docstring3(Service): <NEW_LINE> <INDENT> name = '_test.docstring3' | Docstring3 Summary
Docstring3 Description
Docstring3 Description2 | 62598fd34527f215b58ea372 |
class MissingABIError(Exception): <NEW_LINE> <INDENT> pass | Raised when the debtor's ABI is not specified and cannot be inferred from
the account. | 62598fd33617ad0b5ee065eb |
class Inequality(_Equality, ABC): <NEW_LINE> <INDENT> eq_il_cmd = compare_cmds.NotEqualCmp | Expression that checks inequality of two expressions | 62598fd3bf627c535bcb1951 |
class GalaxyToken(object): <NEW_LINE> <INDENT> token_type = 'Token' <NEW_LINE> def __init__(self, token=None): <NEW_LINE> <INDENT> self.b_file = to_bytes(C.GALAXY_TOKEN_PATH, errors='surrogate_or_strict') <NEW_LINE> self._config = None <NEW_LINE> self._token = token <NEW_LINE> <DEDENT> @property <NEW_LINE> def config(s... | Class to storing and retrieving local galaxy token | 62598fd3ad47b63b2c5a7d00 |
class Server(models.Model): <NEW_LINE> <INDENT> asset = models.OneToOneField('Asset', on_delete=models.CASCADE) <NEW_LINE> sub_assset_type_choices = ( (0, 'PC服务器'), (1, '刀片机'), (2, '小型机'), ) <NEW_LINE> created_by_choices = ( ('auto', 'Auto'), ('manual', 'Manual'), ) <NEW_LINE> sub_asset_type = models.SmallIntegerField(... | 服务器设备 | 62598fd3a05bb46b3848ad0e |
class ContentSearchTestCase(UITestCase): <NEW_LINE> <INDENT> @tier2 <NEW_LINE> def test_positive_search_in_cv(self): <NEW_LINE> <INDENT> org = entities.Organization().create() <NEW_LINE> product = entities.Product( name=gen_string('alpha'), organization=org, ).create() <NEW_LINE> yum_repo = entities.Repository( name=ge... | Implement tests for content search via UI | 62598fd37cff6e4e811b5ece |
class DeviceTempFile(object): <NEW_LINE> <INDENT> def __init__(self, adb, suffix='', prefix='temp_file', dir='/data/local/tmp'): <NEW_LINE> <INDENT> if None in (dir, prefix, suffix): <NEW_LINE> <INDENT> m = 'Provided None path component. (dir: %s, prefix: %s, suffix: %s)' % ( dir, prefix, suffix) <NEW_LINE> raise Value... | A named temporary file on a device.
Behaves like tempfile.NamedTemporaryFile. | 62598fd33617ad0b5ee065ed |
class ParseSpecial: <NEW_LINE> <INDENT> RULES = [ { 'name': 'bbc_genome', 'match': 'genome.ch.bbc.co.uk', 'fields': { 'date': { 'element': lambda e: e.name == 'a' and e['href'].startswith('/schedules') and e.findChildren('span', {'class', 'time'}), 'value': lambda e: str(e.contents[0]).split(',', 1)[-1].strip(), }, 'ty... | How to write a special rule
name: Name of the rule
match: Domain(s) this rule will match
This can be a string, a list of strings, or a callable which
will be passed the Citation to do complex matching
fields:
element: Element matcher
A callable that will be passed the current element, and
s... | 62598fd3283ffb24f3cf3d26 |
class RandomWalk(): <NEW_LINE> <INDENT> def __init__(self, num_points=500): <NEW_LINE> <INDENT> self.num_points = num_points <NEW_LINE> self.x_values = [0] <NEW_LINE> self.y_values = [0] <NEW_LINE> <DEDENT> def fill_walk(self): <NEW_LINE> <INDENT> while len(self.x_values) < self.num_points: <NEW_LINE> <INDENT> x_direct... | Класс для генерирования случайных блужданий. | 62598fd38a349b6b436866e8 |
class TestUser(unittest.TestCase): <NEW_LINE> <INDENT> def test_get_account_name(self): <NEW_LINE> <INDENT> user = User() <NEW_LINE> self.assertEqual(user.get_account_name(0), "twitter") | Tests for class User. | 62598fd3283ffb24f3cf3d28 |
class Deconv(Affine): <NEW_LINE> <INDENT> def __init__(self, fshape, init, strides={}, padding={}, bias=None, batch_norm=False, activation=None, conv_name='DeconvolutionLayer', bias_name='BiasLayer', act_name='ActivationLayer'): <NEW_LINE> <INDENT> list.__init__(self) <NEW_LINE> self.append(Deconvolution(fshape=fshape,... | Same as Conv layer, but implements a composite deconvolution layer | 62598fd350812a4eaa620e38 |
class Landsat(ClassificationDataset): <NEW_LINE> <INDENT> num_classes = 6 <NEW_LINE> def __init__(self, root, split=TRAIN, validation_size=0.2): <NEW_LINE> <INDENT> dataset_path = os.path.join(root, self.name) <NEW_LINE> file_name_train = 'train.csv' <NEW_LINE> file_name_test = 'test.csv' <NEW_LINE> url_train = 'http:/... | # Parameters
root (str): Local path for storing/reading dataset files.
split (str): One of {'train', 'validation', 'test'}
validation_size (float): How large fraction in (0, 1) of the training partition to use for validation. | 62598fd30fa83653e46f5391 |
class TokenIndexer(Generic[TokenType], Registrable): <NEW_LINE> <INDENT> default_implementation = 'single_id' <NEW_LINE> def __init__(self, token_min_padding_length: int = 0) -> None: <NEW_LINE> <INDENT> self._token_min_padding_length: int = token_min_padding_length <NEW_LINE> <DEDENT> def count_vocab_items(self, token... | A ``TokenIndexer`` determines how string tokens get represented as arrays of indices in a model.
This class both converts strings into numerical values, with the help of a
:class:`~allennlp.data.vocabulary.Vocabulary`, and it produces actual arrays.
Tokens can be represented as single IDs (e.g., the word "cat" gets re... | 62598fd3ab23a570cc2d4fc2 |
class AutomationList(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'required': True}, 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[Automation]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwarg... | List of security automations response.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:param value: Required. The list of security automations under the given scope.
:type value: list[~azure.mgmt.security.mo... | 62598fd34527f215b58ea378 |
class NotAnEmailAddress(schema.ValidationError): <NEW_LINE> <INDENT> pass | This is not a valid email address | 62598fd33617ad0b5ee065f1 |
class DBTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.db = dummy_db(with_scan=True, with_fileset=True, with_file=True) <NEW_LINE> self.tmpclone = None <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.db.disconnect() <NEW_LINE> <DEDENT... | A test database.
Attributes
----------
db : plantdb.FSDB
The temporary directory.
tmpclone : TemporaryCloneDB
A local temporary copy of a test database. | 62598fd3377c676e912f6fce |
class BetchipTestMetaClass(type): <NEW_LINE> <INDENT> def __new__(cls, clsname, bases, dct): <NEW_LINE> <INDENT> if not clsname == 'BetchipTestFramework': <NEW_LINE> <INDENT> if not ('run_test' in dct and 'set_test_params' in dct): <NEW_LINE> <INDENT> raise TypeError("BetchipTestFramework subclasses must override " "'r... | Metaclass for BetchipTestFramework.
Ensures that any attempt to register a subclass of `BetchipTestFramework`
adheres to a standard whereby the subclass overrides `set_test_params` and
`run_test` but DOES NOT override either `__init__` or `main`. If any of
those standards are violated, a ``TypeError`` is raised. | 62598fd39f28863672818ad2 |
class Portforwarding(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.serverProtocol = wire.Echo() <NEW_LINE> self.clientProtocol = protocol.Protocol() <NEW_LINE> self.openPorts = [] <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.clientProtocol... | Test port forwarding. | 62598fd3ff9c53063f51aaf6 |
class PrepareCorpus(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.corpus_id = kwargs.pop('corpus_id') <NEW_LINE> self.parse = kwargs.pop('parsecls')(**kwargs) <NEW_LINE> self.store = MongoClient()['docs'][self.corpus_id] <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> l... | Prepare and inject a corpus. | 62598fd34527f215b58ea37a |
class JPPostalCodeField(RegexField): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': _('Enter a postal code in the format XXXXXXX or XXX-XXXX.'), } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(r'^\d{3}-\d{4}$|^\d{7}$', **kwargs) <NEW_LINE> <DEDENT> def clean(self, value): <NEW... | A form field that validates its input is a Japanese postcode.
Accepts 7 digits, with or without a hyphen. | 62598fd3d8ef3951e32c80b1 |
class FacebookProfileModel(models.Model): <NEW_LINE> <INDENT> about_me = models.TextField(blank=True, null=True) <NEW_LINE> facebook_id = models.IntegerField(blank=True, null=True) <NEW_LINE> facebook_name = models.CharField(max_length=255, blank=True, null=True) <NEW_LINE> facebook_profile_url = models.TextField(blank... | Abstract class to add to your profile model.
NOTE: If you don't use this this abstract class, make sure you copy/paste
the fields in. | 62598fd3dc8b845886d53a6a |
class CellAreaLocationProvider(AbstractCellLocationProvider): <NEW_LINE> <INDENT> models = (CellArea, ) <NEW_LINE> log_name = 'cell_lac' <NEW_LINE> def prepare_location(self, queried_objects): <NEW_LINE> <INDENT> lac = sorted(queried_objects, key=operator.attrgetter('range'))[0] <NEW_LINE> accuracy = float(max(LAC_MIN_... | A CellAreaLocationProvider implements a cell location search
using the CellArea model. | 62598fd33d592f4c4edbb362 |
class DNSResolver(dns.resolver.Resolver): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.reset_ipa_defaults() <NEW_LINE> self.resolve = getattr(super(), "resolve", self.query) <NEW_LINE> self.resolve_address = getattr( super(), "resolve_add... | DNS stub resolver compatible with both dnspython < 2.0.0
and dnspython >= 2.0.0.
Set `use_search_by_default` attribute to `True`, which
determines the default for whether the search list configured
in the system's resolver configuration is used for relative
names, and whether the resolver's domain may be added to rela... | 62598fd3099cdd3c63675635 |
class TestBar(unittest.TestCase): <NEW_LINE> <INDENT> def test_bar_elquals_bar(self): <NEW_LINE> <INDENT> self.assertEqual(bar.echo('foo'), 'foo') | Classe de teste bar | 62598fd3ad47b63b2c5a7d05 |
class Solution: <NEW_LINE> <INDENT> def maxAreaOfIsland(self, grid: List[List[int]]) -> int: <NEW_LINE> <INDENT> if not grid: return 0 <NEW_LINE> row, col = len(grid), len(grid[0]) <NEW_LINE> max_area = 0 <NEW_LINE> for i in range(row): <NEW_LINE> <INDENT> for j in range(col): <NEW_LINE> <INDENT> max_area = max(max_are... | O(M*N):所有节点只遍历一次。
M*N个节点;每个节点有4条边。 | 62598fd3956e5f7376df58d4 |
class Mixin(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _mixin_attr(cls, name, owner): <NEW_LINE> <INDENT> if name.startswith('__'): <NEW_LINE> <INDENT> raise AttributeError <NEW_LINE> <DEDENT> val = getattr(cls, name) <NEW_LINE> if is_hook(val): <NEW_LINE> <INDENT> raise AttributeError <NEW_LINE> <DEDENT>... | Mixins are classes that provide attributes and methods to be accessible
by instances they are associated with (at class or instance level).
Mixins are not supposed to be instanced, because their attributes are
transparently proxied to be accessible by instances that have access to
them.
Example: If you learn math, th... | 62598fd33617ad0b5ee065f5 |
class TestPUTBatchDebitMemosRequest(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 testPUTBatchDebitMemosRequest(self): <NEW_LINE> <INDENT> pass | PUTBatchDebitMemosRequest unit test stubs | 62598fd3377c676e912f6fd0 |
class OrsifrontsTable(FrontsTBase): <NEW_LINE> <INDENT> __tablename__='orsifronts' <NEW_LINE> id=Column(Integer,primary_key=True) <NEW_LINE> name=Column(String) <NEW_LINE> acronym=Column(String) <NEW_LINE> geom=Column(geoLineStrType) | Defines the Orsifonts PostgreSQL table | 62598fd3be7bc26dc92520af |
class ScipyDist(BasePairwiseTransformer): <NEW_LINE> <INDENT> _tags = { "symmetric": True, } <NEW_LINE> def __init__(self, metric="euclidean", p=2, colalign="intersect"): <NEW_LINE> <INDENT> self.metric = metric <NEW_LINE> self.p = p <NEW_LINE> self.colalign = colalign <NEW_LINE> super(ScipyDist, self).__init__() <NEW_... | Interface to scipy distances.
computes pairwise distances using scipy.spatial.distance.cdist
includes Euclidean distance and p-norm (Minkowski) distance
note: weighted distances are not supported
Parameters
----------
metric: string or function, as in cdist; default = 'euclidean'
if string, one of: 'b... | 62598fd39f28863672818ad4 |
class Schema(object, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def __init__(self, type, other_props=None): <NEW_LINE> <INDENT> if type not in VALID_TYPES: <NEW_LINE> <INDENT> raise SchemaParseException('%r is not a valid Avro type.' % type) <NEW_LINE> <DEDENT> self._props = {} <NEW_LINE> self._props['type'] = type <N... | Abstract base class for all Schema classes. | 62598fd3a05bb46b3848ad18 |
class ResearchExperimentReplicateListAPIView(ListAPIView): <NEW_LINE> <INDENT> queryset = ResearchExperimentReplicate.objects.all() <NEW_LINE> serializer_class = research_experiment_replicate_serializers['ResearchExperimentReplicateListSerializer'] <NEW_LINE> filter_backends = (DjangoFilterBackend,) <NEW_LINE> filter_c... | API list view. Gets all records API. | 62598fd3fbf16365ca79456e |
class Route53HealthCheckDefinition(nixops.resources.ResourceDefinition): <NEW_LINE> <INDENT> config: Route53HealthCheckOptions <NEW_LINE> @classmethod <NEW_LINE> def get_type(cls): <NEW_LINE> <INDENT> return "aws-route53-health-check" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_resource_type(cls): <NEW_LINE> <I... | Definition of an Route53 Health Check. | 62598fd3a219f33f346c6cb7 |
class FieldTypeInstance(InstanceResource): <NEW_LINE> <INDENT> def __init__(self, version, payload, assistant_sid, sid=None): <NEW_LINE> <INDENT> super(FieldTypeInstance, self).__init__(version) <NEW_LINE> self._properties = { 'account_sid': payload.get('account_sid'), 'date_created': deserialize.iso8601_datetime(paylo... | PLEASE NOTE that this class contains preview products that are subject
to change. Use them with caution. If you currently do not have developer
preview access, please contact help@twilio.com. | 62598fd3d8ef3951e32c80b4 |
class PathNotDirectoryError(Exception): <NEW_LINE> <INDENT> pass | Path is not a directory Error
| 62598fd3283ffb24f3cf3d32 |
class SoundPlayer(Component, IComponent, IDisposable, ISerializable): <NEW_LINE> <INDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetService(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Load(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def LoadAsync(self): <NEW_LINE>... | Controls playback of a sound from a .wav file.
SoundPlayer()
SoundPlayer(soundLocation: str)
SoundPlayer(stream: Stream) | 62598fd360cbc95b063647f0 |
class OptionParser(optparse.OptionParser): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> kwargs['option_class'] = OptionWithDefault <NEW_LINE> optparse.OptionParser.__init__(self, **kwargs) <NEW_LINE> <DEDENT> def check_values(self, values, args): <NEW_LINE> <INDENT> for option in self.option_li... | Extend optparse.OptionParser | 62598fd3ff9c53063f51aafe |
class RecordNothing: <NEW_LINE> <INDENT> def __call__(self, pop): <NEW_LINE> <INDENT> return | A temporal sampler that does nothing. | 62598fd33617ad0b5ee065fb |
class PAsshProtocol(asyncio.SubprocessProtocol): <NEW_LINE> <INDENT> def __init__(self, hostname: str, exit_future: asyncio.Future, use_stdout: bool): <NEW_LINE> <INDENT> self._hostname = hostname <NEW_LINE> self._prefix = b'[' + hostname.encode('utf-8') + b'] ' <NEW_LINE> self._exit_future = exit_future <NEW_LINE> sel... | An asyncio.SubprocessProtocol for PAssh. | 62598fd3ec188e330fdf8d49 |
class HostServiceSystem(ExtensibleManagedObject): <NEW_LINE> <INDENT> def __init__(self, core, name=None, ref=None, type=ManagedObjectTypes.HostServiceSystem): <NEW_LINE> <INDENT> super(HostServiceSystem, self).__init__(core, name=name, ref=ref, type=type) <NEW_LINE> <DEDENT> @property <NEW_LINE> def serviceInfo(self):... | The HostServiceSystem managed object describes the configuration of host
services. This managed object operates in conjunction with the
HostFirewallSystem managed object. | 62598fd39f28863672818ad7 |
class QuantityNodeType(ObjectNodeType): <NEW_LINE> <INDENT> image = ImageResource('quantity') <NEW_LINE> def allows_children(self, node): <NEW_LINE> <INDENT> return False | The resource type for quantities. | 62598fd3091ae356687050d0 |
class MOD09_ObservationsKernels(object): <NEW_LINE> <INDENT> def __init__(self, dates, filenames): <NEW_LINE> <INDENT> if not len(dates) == len(filenames): <NEW_LINE> <INDENT> raise ValueError("{} dates, {} filenames".format( len(dates), len(filenames))) <NEW_LINE> <DEDENT> self.dates = dates <NEW_LINE> self.filenames ... | A generic M*D09 data reader | 62598fd3ff9c53063f51ab00 |
class TapTrans(Transition): <NEW_LINE> <INDENT> def __init__(self,cube=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.cube = cube <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> if self.running: return <NEW_LINE> super().start() <NEW_LINE> self.robot.erouter.add_listener(self,TapEvent,self.cube)... | Transition fires when a cube is tapped. | 62598fd38a349b6b436866f6 |
class UserProfileFeedViewset(viewsets.ModelViewSet): <NEW_LINE> <INDENT> authentication_classes = (TokenAuthentication,) <NEW_LINE> serializer_class = ProfileFeedSerializer <NEW_LINE> permission_classes = (UpdateOwnStatusPermission, IsAuthenticatedOrReadOnly) <NEW_LINE> queryset = ProfileFeedModel.objects.all() <NEW_LI... | Handles creating, reading and updating profile feeds | 62598fd3ec188e330fdf8d4b |
class _LMemo(OperatorMatcher): <NEW_LINE> <INDENT> def __init__(self, matcher): <NEW_LINE> <INDENT> super(_LMemo, self).__init__() <NEW_LINE> self._arg(matcher=matcher) <NEW_LINE> self.__caches = {} <NEW_LINE> self.__state = State.singleton() <NEW_LINE> <DEDENT> def _match(self, stream): <NEW_LINE> <INDENT> key = (stre... | A memoizer for grammars that do have left recursion. | 62598fd355399d3f056269d1 |
class ProjectsManager(base.Manager): <NEW_LINE> <INDENT> resource_class = Project <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(ProjectsManager, self).__init__(client) <NEW_LINE> self.roles_manager = RolesManager(client) <NEW_LINE> self.quotas_manager = QuotasManager(client) <NEW_LINE> self.licenses_... | Manager class for manipulating project. | 62598fd3be7bc26dc92520b3 |
class TestTasks(unittest.TestCase): <NEW_LINE> <INDENT> @patch.object(tasks, 'vmware') <NEW_LINE> def test_show_ok(self, fake_vmware): <NEW_LINE> <INDENT> fake_vmware.show_jumpbox.return_value = {'worked': True} <NEW_LINE> output = tasks.show(username='bob') <NEW_LINE> expected = {'content' : {'worked': True}, 'error':... | A set of test cases for tasks.py | 62598fd3656771135c489b28 |
class MockDateTime(datetime.datetime): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def now(cls, tz=None): <NEW_LINE> <INDENT> return cls.today() <NEW_LINE> <DEDENT> def __sub__(self, other): <NEW_LINE> <INDENT> result = super(MockDateTime, self).__sub__(other) <NEW_LINE> if hasattr(result, "timetuple"): <NEW_LINE> <IND... | class for mocking datetime.datetime | 62598fd360cbc95b063647f4 |
class InstallLib(_install_lib.install_lib): <NEW_LINE> <INDENT> user_options = _install_lib.install_lib.user_options + [] <NEW_LINE> boolean_options = _install_lib.install_lib.boolean_options + [] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> _install_lib.install_lib.initialize_options(self) <NEW_LINE> i... | Extended lib installer | 62598fd3ad47b63b2c5a7d0b |
class ButtonGroup(Element): <NEW_LINE> <INDENT> def __init__(self, size=None, vertical=False, justified=False, cl=None, ident=None, style=None, attrs=None): <NEW_LINE> <INDENT> super().__init__(cl=cl, ident=ident, style=style, attrs=attrs) <NEW_LINE> self.size = size <NEW_LINE> self.vertical = vertical <NEW_LINE> self.... | Implements a button group <div class="btn-group"> | 62598fd38a349b6b436866f8 |
class LongThrower(ThrowerAnt): <NEW_LINE> <INDENT> name = 'Long' <NEW_LINE> implemented = True <NEW_LINE> food_cost = 2 <NEW_LINE> min_range = 5 <NEW_LINE> def nearest_bee(self, hive): <NEW_LINE> <INDENT> return ThrowerAnt.nearest_bee(self,hive) | A ThrowerAnt that only throws leaves at Bees at least 5 places away. | 62598fd33d592f4c4edbb36f |
class ToDo(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def load_data(): <NEW_LINE> <INDENT> read_file = open("C:\\users\\feliciam\\documents\\_PythonClass\\Module06\\Todo.txt", "r") <NEW_LINE> file_lst = [] <NEW_LINE> for line in read_file: <NEW_LINE> <INDENT> current_task, current_priority = line.split(",") ... | This class containts all functions to manage a simple To-Do list | 62598fd3ad47b63b2c5a7d0c |
@python_2_unicode_compatible <NEW_LINE> class Comment(TimeStampedModel): <NEW_LINE> <INDENT> message = models.TextField() <NEW_LINE> creator = models.ForeignKey(user_models.User, null = True,on_delete=models.CASCADE) <NEW_LINE> image = models.ForeignKey(Image, null = True,on_delete=models.CASCADE, related_name = 'comme... | Comment Model | 62598fd3ab23a570cc2d4fca |
class ProjectInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ProjectName = None <NEW_LINE> self.ProjectCreatorUin = None <NEW_LINE> self.ProjectCreateTime = None <NEW_LINE> self.ProjectResume = None <NEW_LINE> self.OwnerUin = None <NEW_LINE> self.ProjectId = None <NEW_LINE> <DEDENT... | Content of the ProjectInfo parameter. ProjectInfo is an element of Certificates array which is returned by DescribeCertificates.
| 62598fd3ec188e330fdf8d4f |
@typechecked <NEW_LINE> class Property(PropertyABC): <NEW_LINE> <INDENT> def __init__( self, name: str, value: PropertyTypes, src: PropertyTypes = None, ): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._value = value <NEW_LINE> self._src = src <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <NEW... | Immutable. | 62598fd3956e5f7376df58da |
class BagObj(object): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> self._obj = weakref.proxy(obj) <NEW_LINE> <DEDENT> def __getattribute__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return object.__getattribute__(self, '_obj')[key] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDEN... | BagObj(obj)
Convert attribute look-ups to getitems on the object passed in.
Parameters
----------
obj : class instance
Object on which attribute look-up is performed.
Examples
--------
>>> from numpy.lib.npyio import BagObj as BO
>>> class BagDemo(object):
... def __getitem__(self, key): # An instance of Bag... | 62598fd3bf627c535bcb1968 |
class LightSourceTab(BaseWidget): <NEW_LINE> <INDENT> _lightsource = None <NEW_LINE> _update_function = None <NEW_LINE> def __init__(self, update_function=None): <NEW_LINE> <INDENT> super().__init__("Light Source Tab") <NEW_LINE> self._update_function = update_function <NEW_LINE> self._device_select = ControlCombo( lab... | Tab to select the lightsource device | 62598fd3fbf16365ca794578 |
class AddExpression(SymbolExpression): <NEW_LINE> <INDENT> def __init__(self, left, right): <NEW_LINE> <INDENT> super().__init__(left, right) <NEW_LINE> <DEDENT> def interpreter(self, var): <NEW_LINE> <INDENT> return self._left.interpreter(var) + self._right.interpreter(var) | 加法解析器 | 62598fd355399d3f056269d5 |
class Test_drop_table: <NEW_LINE> <INDENT> @pytest.fixture() <NEW_LINE> def fake_entity(self): <NEW_LINE> <INDENT> class FakeEntity(Entity): <NEW_LINE> <INDENT> metas = { 'table_name': 'lolol' } <NEW_LINE> PartitionKey = KeyField() <NEW_LINE> RowKey = KeyField() <NEW_LINE> f1 = FloatField() <NEW_LINE> <DEDENT> return F... | test drop_table | 62598fd3dc8b845886d53a78 |
class Unparser(iast.NodeVisitor): <NEW_LINE> <INDENT> def process(self, tree): <NEW_LINE> <INDENT> self.tokens = [] <NEW_LINE> super().process(tree) <NEW_LINE> return ''.join(self.tokens) <NEW_LINE> <DEDENT> def visit_BinOp(self, node): <NEW_LINE> <INDENT> self.tokens.append('(') <NEW_LINE> self.visit(node.left) <NEW_L... | Turns AST back into an expression string. | 62598fd3ab23a570cc2d4fcb |
class BookInstance(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text='Unique ID for this particular book across whole library') <NEW_LINE> book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True) <NEW_LINE> imprint = models.CharField(max_length=200) <... | Model representing a specific copy of a book (i.e. that can be borrowed from the library) | 62598fd39f28863672818adb |
class FieldType(db.Model): <NEW_LINE> <INDENT> __tablename__ = "field_type" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(32), index=True) <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT>... | Model for the type of a Field | 62598fd3a219f33f346c6cc3 |
class ChannelOfCloseIndex(Index): <NEW_LINE> <INDENT> def cal(self, theKLineList, theRefDays = 0): <NEW_LINE> <INDENT> indexList = [] <NEW_LINE> for i in range(theKLineList.getLen()): <NEW_LINE> <INDENT> if i < self.getParam1(): <NEW_LINE> <INDENT> indexList.append(self.__calSlice(theKLineList.getList()[0:i + 1])) <NEW... | 过去N日通道指标类(不考虑盘中最高最低价,仅考虑收盘价),仅包含一个参数:通道日长param1, | 62598fd47cff6e4e811b5ee7 |
class NoSuchTileError(Exception): <NEW_LINE> <INDENT> def __init__(self, lat, lon): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.lat = lat <NEW_LINE> self.lon = lon <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "No SRTM tile for %d, %d available!" % (self.lat, self.lon) | Raised when there is no tile for a region. | 62598fd4ad47b63b2c5a7d0e |
class axSharer(object): <NEW_LINE> <INDENT> def map_vals(self,): <NEW_LINE> <INDENT> return set(self.map.flatten()) <NEW_LINE> <DEDENT> def __init__(self, saxes, share_map=False): <NEW_LINE> <INDENT> self.saxes = saxes <NEW_LINE> self.map = np.zeros(saxes.n, dtype=np.uint16) <NEW_LINE> self.map[:] = share_map <NEW_LINE... | A class for handling sharing of axes. | 62598fd4ad47b63b2c5a7d0f |
class CalendarUserProfile(Profile_abstract): <NEW_LINE> <INDENT> manager = models.ForeignKey(Manager, verbose_name=_("manager"), help_text=_("select manager"), related_name="manager_of_calendar_user") <NEW_LINE> calendar_setting = models.ForeignKey(CalendarSetting, verbose_name=_('calendar settings')) <NEW_LINE> class ... | This defines extra features for the AR_user
**Attributes**:
* ``calendar_setting`` - appointment reminder settings
**Name of DB table**: calendar_user_profile | 62598fd4656771135c489b30 |
class XalocMachineInfo(Equipment): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> Equipment.__init__(self, name) <NEW_LINE> self.values_dict = {} <NEW_LINE> self.values_dict["mach_current"] = None <NEW_LINE> self.values_dict["mach_status"] = "" <NEW_LINE> self.values_dict["topup_remaining"] = "" <NEW... | Descript. : Displays actual information about the machine status. | 62598fd4091ae356687050da |
class Historic(NamedTuple): <NEW_LINE> <INDENT> entity: str <NEW_LINE> name: str <NEW_LINE> time: ApproxTimeSpan | Contains information about currency withdrawal event. | 62598fd4adb09d7d5dc0aa39 |
class IsOwner(BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if isinstance(obj, Bucketlist): <NEW_LINE> <INDENT> return obj.owner == request.user <NEW_LINE> <DEDENT> return obj.owner == request.user | Custom permission class to allow only bucketlist owner to edit them | 62598fd4283ffb24f3cf3d41 |
@pyblish.api.log <NEW_LINE> class SelectFtrack(pyblish.api.Selector): <NEW_LINE> <INDENT> hosts = ['*'] <NEW_LINE> version = (0, 1, 0) <NEW_LINE> def process_context(self, context): <NEW_LINE> <INDENT> decodedEventData = json.loads( base64.b64decode( os.environ.get('FTRACK_CONNECT_EVENT') ) ) <NEW_LINE> taskid = decode... | Collects ftrack data from FTRACK_CONNECT_EVENT | 62598fd4dc8b845886d53a7e |
class QuarterEnd(QuarterOffset): <NEW_LINE> <INDENT> _outputName = 'QuarterEnd' <NEW_LINE> _default_startingMonth = 3 <NEW_LINE> _prefix = 'Q' <NEW_LINE> _day_opt = 'end' | DateOffset increments between business Quarter dates.
startingMonth = 1 corresponds to dates like 1/31/2007, 4/30/2007, ...
startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ...
startingMonth = 3 corresponds to dates like 3/31/2007, 6/30/2007, ... | 62598fd40fa83653e46f53a9 |
@attr.s <NEW_LINE> class LTEData: <NEW_LINE> <INDENT> websession = attr.ib() <NEW_LINE> modem_data = attr.ib(init=False, factory=dict) <NEW_LINE> def get_modem_data(self, config): <NEW_LINE> <INDENT> return self.modem_data.get(config[CONF_HOST]) | Shared state. | 62598fd4be7bc26dc92520b8 |
class ModelSaver(Callback): <NEW_LINE> <INDENT> def __init__(self, keep_recent=10, keep_freq=0.5, checkpoint_dir=None, var_collections=tf.GraphKeys.GLOBAL_VARIABLES): <NEW_LINE> <INDENT> self.keep_recent = keep_recent <NEW_LINE> self.keep_freq = keep_freq <NEW_LINE> if not isinstance(var_collections, list): <NEW_LINE> ... | Save the model every epoch. | 62598fd48a349b6b43686702 |
class MetreManager: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def is_fornyrdhislag(text: str) -> bool: <NEW_LINE> <INDENT> lines = [line for line in text.split("\n") if line] <NEW_LINE> return len(lines) == 8 <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def is_ljoodhhaattr(text: str) -> bool: <NEW_LINE> <INDENT> lin... | Handles different kinds of meter in Old Norse poetry.
* Fornyrðislag
* Ljóðaháttr | 62598fd4956e5f7376df58de |
class Teacher(Person): <NEW_LINE> <INDENT> def __init__(self, fName, lName, tchID, tchPIN): <NEW_LINE> <INDENT> if util.valid_name_check(lName): <NEW_LINE> <INDENT> if util.valid_name_check(fName): <NEW_LINE> <INDENT> if util.valid_id_check(tchID): <NEW_LINE> <INDENT> if util.valid_pin_check(tchPIN): <NEW_LINE> <INDENT... | Teacher class constructor | 62598fd4377c676e912f6fda |
class MakeMenuItem: <NEW_LINE> <INDENT> def __init__(self, menu, id): <NEW_LINE> <INDENT> self.menu = menu <NEW_LINE> self.id = id <NEW_LINE> <DEDENT> def checked(self, check=None): <NEW_LINE> <INDENT> return self.menu.checked(self.id, check) <NEW_LINE> <DEDENT> def toggle(self): <NEW_LINE> <INDENT> checked = not self.... | A menu item for a menu managed by MakeMenu.
| 62598fd4adb09d7d5dc0aa3d |
class spells: <NEW_LINE> <INDENT> spells_dict = { 'Expelliarmus' : 'disarms your enemy by knocking their want out of their hand.' , 'Lumos' : 'Use your wand as a light.' , 'Nox' : 'Put out the light on your wand.' , 'Protego' : 'Shield charm used whild duelling.' , 'Accio' : 'Summons whatever you say after the spell to... | This Class has a dictionary of spells that can be learned.
Also contains a method called get_all_spells that returns this dictionary. | 62598fd4099cdd3c63675640 |
class XYZTransform(AffineTransform): <NEW_LINE> <INDENT> function_range = CoordinateSystem(lps_output_coordnames, name='world') <NEW_LINE> def __init__(self, affine, axis_names, lps=True): <NEW_LINE> <INDENT> affine = np.asarray(affine) <NEW_LINE> if affine.shape != (4,4): <NEW_LINE> <INDENT> raise ValueError('affine m... | Affine transform with x, y, z being L<->R, P<->A, I<->S
That is, the X axis is left to right or right to left, the Y axis is
anterior to posterior or posterior to anterior, and the Z axis is
inferior to superior or superior to inferior. | 62598fd40fa83653e46f53ab |
class Sub(UserNotice): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"Sub(channel: {self.channel}, user: {self.display_name})" | This class is the exact same as class:UserNotice: except with a different name.
Created for specific msg_id of sub.
Should not be manually created in most cases. | 62598fd497e22403b383b3cc |
class ZonaPagosConfirmView(viewsets.GenericViewSet): <NEW_LINE> <INDENT> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> id_comercio = request.GET.get('id_comercio') <NEW_LINE> id_pago = request.GET.get('id_pago') <NEW_LINE> if id_pago and id_comercio: <NEW_LINE> <INDENT> transaction = Transaction.objects... | Zona pagos view to confirm payments | 62598fd4ab23a570cc2d4fcf |
class LangTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> DATA_DIR = os.path.dirname(data_dir) <NEW_LINE> self.langs_to_test = [] <NEW_LINE> for fn in glob(f'{DATA_DIR}/*.*sv'): <NEW_LINE> <INDENT> if fn.endswith('csv'): <NEW_LINE> <INDENT> delimiter = ',' <NEW_LINE> <DEDENT> elif fn.endswith('... | Basic Test for individual lookup tables.
Test files (in g2p/tests/public/data) are either .csv, .psv, or
.tsv files, the only difference being the delimiter used (comma,
pipe, or tab).
Each line in the test file consists of SOURCE,TARGET,INPUT,OUTPUT | 62598fd4bf627c535bcb1972 |
class LocalSecondaryIndex(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "IndexName": (str, True), "KeySchema": ([KeySchema], True), "Projection": (Projection, True), } | `LocalSecondaryIndex <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-lsi.html>`__ | 62598fd4ad47b63b2c5a7d14 |
class TestV1beta2ControllerRevision(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 testV1beta2ControllerRevision(self): <NEW_LINE> <INDENT> pass | V1beta2ControllerRevision unit test stubs | 62598fd4283ffb24f3cf3d45 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.