code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class SolutionV5(object): <NEW_LINE> <INDENT> def isValidBST(self, root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> stack = [] <NEW_LINE> prev = None <NEW_LINE> while root or stack: <NEW_LINE> <INDENT> while root: <NEW_LINE> <INDENT> stack.append(root) <NEW_LINE> root = ro... | Binary Tree, in-order traversal, use Stack, but O(2N) | 6259904b8a349b6b43687644 |
class CategoryFilter(): <NEW_LINE> <INDENT> def __init__(self, *, include: bool = None, filter: 'FilterTerms' = None) -> None: <NEW_LINE> <INDENT> self.include = include <NEW_LINE> self.filter = filter <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'CategoryFilter': <NEW_LINE> <INDENT> a... | Filter on a category. The filter will match against the values of the given category
with include or exclude.
:attr bool include: (optional) -> true - This is an include filter, false - this
is an exclude filter.
:attr FilterTerms filter: (optional) Offering filter terms. | 6259904b10dbd63aa1c71fd1 |
class TestParseCoords(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 test_parse_coords_whitespace_dot(self): <NEW_LINE> <INDENT> coords_txt = '55.455555 61.25847' <NEW_LINE> coords = cadastron.par... | Тест функции parse_coords(text) | 6259904bd6c5a102081e3512 |
class HeadersDict(collections.MutableMapping): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._dict = {} <NEW_LINE> self.update(*args, **kwargs) <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> self._dict[_HeaderKey(key)] = value <NEW_LINE> <DEDENT> def __get... | A case-insenseitive dictionary to represent HTTP headers. | 6259904b63b5f9789fe86563 |
class GithubUserViewSet(mixins.UpdateModelMixin, mixins.RetrieveModelMixin, mixins.ListModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = GithubUser.objects.prefetch_related('organization', 'repository', 'language').all() <NEW_LINE> serializer_class = GithubUserListSerializer <NEW_LINE> pagination_cla... | endpoint : githubs/users/:username | 6259904b7cff6e4e811b6e30 |
class AddGroupParser(BaseParser): <NEW_LINE> <INDENT> command = COMMANDS.ADD_GROUP <NEW_LINE> def _add_arguments(self): <NEW_LINE> <INDENT> self.parser.add_argument("name", action="store", help="the new group's name") | usage: td add-group [name]
td ag [name]
add group
positional arguments:
name the new group's name
optional arguments:
-h, --help show this help message and exit | 6259904b96565a6dacd2d984 |
class Floating_ips_bulk(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> name = "FloatingIpsBulk" <NEW_LINE> alias = "os-floating-ips-bulk" <NEW_LINE> namespace = ("http://docs.openstack.org/compute/ext/" "floating_ips_bulk/api/v2") <NEW_LINE> updated = "2012-10-29T13:25:27-06:00" <NEW_LINE> def get_resources(self)... | Bulk handling of Floating IPs. | 6259904b82261d6c527308c1 |
class BayesianNetwork: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.edges = defaultdict(lambda: []) <NEW_LINE> self.variables = {} <NEW_LINE> <DEDENT> def add_variable(self, variable): <NEW_LINE> <INDENT> if not isinstance(variable, Variable): <NEW_LINE> <INDENT> raise TypeError(f"Expected {Variable... | Class representing a Bayesian network.
Nodes can be accessed through self.variables['variable_name'].
Each node is a Variable.
Edges are stored in a dictionary. A node's children can be accessed by
self.edges[variable]. Both the key and value in this dictionary is a Variable. | 6259904ba8ecb03325872608 |
class MultitaskDataloader: <NEW_LINE> <INDENT> def __init__(self, dataloader_dict): <NEW_LINE> <INDENT> self.dataloader_dict = dataloader_dict <NEW_LINE> self.num_batches_dict = { task_name: len(dataloader) for task_name, dataloader in self.dataloader_dict.items() } <NEW_LINE> self.task_name_list = list(self.dataloader... | Data loader that combines and samples from multiple single-task
data loaders. | 6259904bd4950a0f3b11183e |
class OneLine: <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value | Wrap any value in this class to print it on one line in the JSON file | 6259904b6e29344779b01a38 |
class ObjectIdReferenceAttribute(Attribute): <NEW_LINE> <INDENT> def __init__( self, possible_types, pk_getter, name, pk_setter=None, force_display=False, searcher=None, ): <NEW_LINE> <INDENT> self.possible_types = possible_types <NEW_LINE> self.pk_getter = pk_getter <NEW_LINE> self.setter = pk_setter <NEW_LINE> self.n... | A Reference to some other Resource of one or
more possible types that may be contained.
Native pymodm references must explicitly specify the related model type,
which doesn't work for us since we accept several possible types. This is
why we use ObjectIds to store references. | 6259904b23e79379d538d8f5 |
class EbayScraper(BaseSpider): <NEW_LINE> <INDENT> name = "ebay" <NEW_LINE> endpoint = "http://svcs.ebay.com/services/search/FindingService/v1" <NEW_LINE> parameters = { 'OPERATION-NAME':'findItemsAdvanced', 'SERVICE-VERSION':'1.11.0', 'SECURITY-APPNAME':'Moomersda-68ea-4fc0-88f7-a53b23426ae', 'RESPONSE-DATA-FORMAT':'J... | Scraper that finds BM tickets on eBay using the eBay API | 6259904be76e3b2f99fd9e03 |
class Config(dict): <NEW_LINE> <INDENT> def __init__(self, defaults = {}): <NEW_LINE> <INDENT> dict.__init__(self, defaults) <NEW_LINE> <DEDENT> def __getattr__(self, attrname): <NEW_LINE> <INDENT> return self[attrname] <NEW_LINE> <DEDENT> def __setattr__(self, attrname, value): <NEW_LINE> <INDENT> self[attrname] = val... | Works like dict but provides methods to get attribute by '.',
such as:
config = Config({'foo': foo, 'bar': bar})
print config.foo
config.bar = bar2 | 6259904b596a897236128faa |
class SearchPackage6Test(BaseTest): <NEW_LINE> <INDENT> fixtureDB = True <NEW_LINE> runCmd = "aptly package search" | search package: no query | 6259904b07f4c71912bb082c |
class Message(models.Model): <NEW_LINE> <INDENT> uuid_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) <NEW_LINE> sender = models.ForeignKey( settings.AUTH_USER_MODEL, related_name="sent_messages", verbose_name=_("Sender"), null=True, on_delete=models.SET_NULL, ) <NEW_LINE> recipient = models... | A private message sent between users. | 6259904b07f4c71912bb082d |
class ThicknessSlice(Slice, ROIManagerMixin): <NEW_LINE> <INDENT> roi_names = ['Left', 'Top', 'Right', 'Bottom'] <NEW_LINE> roi_nominal_angles = [180, 90, 0, -90] <NEW_LINE> roi_widths_mm = [8, 40, 8, 40] <NEW_LINE> roi_heights_mm = [40, 8, 40, 8] <NEW_LINE> dist2rois_mm = 38 <NEW_LINE> def __init__(self, dicom_stack, ... | This class analyzes the angled wire on the HU slice to determine the slice thickness.
Attributes
----------
roi_widths_mm : list
The widths of the rectangular ROIs in mm. Follows the order of ``roi_names``.
roi_heights_mm : list
The heights of the rectangular ROIs in mm. Follows the order of ``roi_names``. | 6259904bb57a9660fecd2e76 |
class BaseHandler(RequestHandler): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BaseHandler, self).__init__(*args, **kwargs) <NEW_LINE> self.json_args = {} <NEW_LINE> self.session = {} <NEW_LINE> <DEDENT> @property <NEW_LINE> def db(self): <NEW_LINE> <INDENT> return self.applicatio... | Handler基类 | 6259904b45492302aabfd8cd |
class SCN_INVALIDATE_RECT(Structure): <NEW_LINE> <INDENT> _fields_ = [ ("code", c_uint), ("hwnd", HWINDOW), ("invalidRect", RECT) ] | . | 6259904b23e79379d538d8f7 |
class BadCrsError(Exception): <NEW_LINE> <INDENT> def __init__(self, message: str = 'A required CRS was not valid for the operation'): <NEW_LINE> <INDENT> super().__init__(message) | Exception for cases where a CRS is invalid.
Thrown in cases such as building a converter with only one CoordinateReferenceSystem. | 6259904b16aa5153ce4018e6 |
class DevelopmentConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> WTF_CSRF_ENABLED = False <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'dev.sqlite') <NEW_LINE> DEBUG_TB_ENABLED = False | Development configuration. | 6259904b8e05c05ec3f6f857 |
class StorageLinkBackend(backend.KindBackend): <NEW_LINE> <INDENT> def create(self, link, extras): <NEW_LINE> <INDENT> context = extras['nova_ctx'] <NEW_LINE> instance_id = link.source.attributes['occi.core.id'] <NEW_LINE> volume_id = link.target.attributes['occi.core.id'] <NEW_LINE> mount_point = link.attributes['occi... | A backend for the storage links. | 6259904b8da39b475be045e9 |
class Close(Element) : <NEW_LINE> <INDENT> def __init__(self) : <NEW_LINE> <INDENT> super().__init__(CAIRO.PATH_CLOSE_PATH, False, (), Context.close_path) | represents a closing of the current path. | 6259904bd6c5a102081e3516 |
class Movement: <NEW_LINE> <INDENT> def __init__( self, max_velocity=100, min_velocity=1, stagnant_velocity=0, max_angle=100, min_angle=1, stagnant_angle=0, ) -> None: <NEW_LINE> <INDENT> self.max_velocity = max_velocity <NEW_LINE> self.min_velocity = min_velocity <NEW_LINE> self.stagnant_velocity = stagnant_velocity <... | Handles Misty's movement. All angles are in degrees as integers. | 6259904b94891a1f408ba0f2 |
class NominalStem(Stem): <NEW_LINE> <INDENT> __tablename__ = None <NEW_LINE> __mapper_args__ = {'polymorphic_identity': Tag.NOMINAL} | Stem of a :class:`Nominal`. | 6259904b23849d37ff8524b7 |
class Channel(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100, default='ninguno') <NEW_LINE> api_key = models.CharField(max_length=100) <NEW_LINE> api_secret = models.CharField(max_length=100) <NEW_LINE> token = models.CharField(max_length=100, blank=True, null=True) <NEW_LINE> token_secret = ... | stores channel Api credentials | 6259904b7cff6e4e811b6e34 |
class LowerYield(object): <NEW_LINE> <INDENT> def __init__(self, lower, yield_point, live_vars): <NEW_LINE> <INDENT> self.lower = lower <NEW_LINE> self.context = lower.context <NEW_LINE> self.builder = lower.builder <NEW_LINE> self.genlower = lower.genlower <NEW_LINE> self.gentype = self.genlower.gentype <NEW_LINE> sel... | Support class for lowering a particular yield point. | 6259904b097d151d1a2c2468 |
class IRuleConditionDirective(IRuleElementDirective): <NEW_LINE> <INDENT> pass | An element directive describing what is logically a condition element.
| 6259904b462c4b4f79dbcdf9 |
class NotInitialized(Exception): <NEW_LINE> <INDENT> pass | Raise when an entity is not initialized but accessed as if it were. | 6259904b1f037a2d8b9e5269 |
class DevelopmentConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> TESTING = True <NEW_LINE> SQLALCHEMY_DATABASE_URI = DATABASE_URL | Development configuration | 6259904b4428ac0f6e65992b |
class Cells: <NEW_LINE> <INDENT> def __init__(self, x, sim): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> return <NEW_LINE> <DEDENT> def correct_for_pbc(self, sim): <NEW_LINE> <INDENT> self.xi = np.zeros((sim.nsteps, 2, sim.ncells), dtype=np.float32) <NEW_LINE> self.xi[0, :, :] = self.x[0, :, :] <NEW_LINE> for tstep in ra... | data structure for storing cell information | 6259904b30dc7b76659a0c2e |
class PersistentArray(object): <NEW_LINE> <INDENT> search = None <NEW_LINE> def __init__(self, ID, *url, **kw): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.ID = hash(ID) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> raise TypeError("Item IDs must be hashable") <NEW_LINE> <DEDENT> if kw.pop('search', False): <NE... | I am a three-dimensional array of Python objects, addressable by any
three-way combination of hashable Python objects. You can use me as a
two-dimensional array by simply using some constant, e.g., C{None} when
supplying an address for my third dimension.
B{IMPORTANT}: Make sure you call my L{shutdown} method for an i... | 6259904b82261d6c527308c3 |
class VideoBatchSampler(Sampler): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def __iter__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def __len__(self): <NEW_LINE> <INDENT> pass | Base class for all video samplers.
Every `VideoBatchSampler` subclass has to provide an `__iter__()` method,
providing a way to iterate over indices of dataset elements, and
a `__len__()` method that returns the length of the returned iterators. | 6259904b07d97122c421809d |
class Tester(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.B = combfuncs.createLookup(['a','b','c','d','e']) <NEW_LINE> self.k = 3 <NEW_LINE> <DEDENT> def testall(self): <NEW_LINE> <INDENT> v = (self.B if type(self.B) == int else len(self.B[1])) <NEW_LINE> rk = 0 <NEW_LINE> for K in ... | Unit testing class for this module.
We perform all operations over a given base set and check their
interactions for correctness. | 6259904b07f4c71912bb082e |
class Db_gz_group(object): <NEW_LINE> <INDENT> def __init__(self, conn, cur, session): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.member_pat = re.compile('\d+') <NEW_LINE> self.name_pat = re.compile(r'(推荐.+)') <NEW_LINE> self.conn = conn <NEW_LINE> self.cur = cur <NEW_LINE> <DEDENT> def get_all_page(sel... | 单线程版
本程序用于提取豆瓣中所有包含“广州”的小组
提取其名称、成员数量、链接 | 6259904b0c0af96317c5775e |
class DateCoder(DeterministicCoder): <NEW_LINE> <INDENT> def _create_impl(self): <NEW_LINE> <INDENT> return coder_impl.DateCoderImpl() <NEW_LINE> <DEDENT> def to_type_hint(self): <NEW_LINE> <INDENT> return datetime.date | Coder for Date | 6259904bcad5886f8bdc5a7b |
class add_partitions_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'new_parts', (TType.STRUCT,(Partition, Partition.thrift_spec)), None, ), ) <NEW_LINE> def __init__(self, new_parts=None,): <NEW_LINE> <INDENT> self.new_parts = new_parts <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if... | Attributes:
- new_parts | 6259904b21a7993f00c67364 |
class OptimalPlaceEngine(BaseDiskPlacementEngine): <NEW_LINE> <INDENT> def __init__(self, datastore_manager, option): <NEW_LINE> <INDENT> super(OptimalPlaceEngine, self).__init__(datastore_manager, option) <NEW_LINE> <DEDENT> @log_duration <NEW_LINE> def place(self, disks_placement, constraints): <NEW_LINE> <INDENT> di... | Optimal place engine tries to put all disks into one datastore. This
engine doesn't look into constraints so far. | 6259904bec188e330fdf9c99 |
class GitCache(object): <NEW_LINE> <INDENT> def __init__(self, cache_time=900): <NEW_LINE> <INDENT> self.cache_time = int(cache_time) <NEW_LINE> self.cache = dict() <NEW_LINE> <DEDENT> def store(self, key, object, type='object'): <NEW_LINE> <INDENT> self.cache[key + '_' + type] = dict(object=object, time=datetime.now()... | Internal caching system, created to avoid parse the same files multiple
times. | 6259904bd4950a0f3b111840 |
class Screen(object): <NEW_LINE> <INDENT> def __init__(self, name, cocktails=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.cocktails = cocktails if cocktails is not None else [] <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.cocktails) <NEW_LINE> <DEDENT> def add_cocktail(self,... | This class represents a macromolecular crystallization screen.
A screen is made of of one or more cocktails. | 6259904b0a366e3fb87ddde1 |
class fields(SymbolDef): <NEW_LINE> <INDENT> os_id = 'os-id' <NEW_LINE> os_version_id = 'os-version-id' | Symbols for each field of a packaging meta-data unit. | 6259904b8e05c05ec3f6f858 |
class MetaResultFlatComplete(FlatFileExporter): <NEW_LINE> <INDENT> def _get_header_row(self): <NEW_LINE> <INDENT> header = [] <NEW_LINE> header.extend(Study.flat_complete_header_row()) <NEW_LINE> header.extend(models.MetaProtocol.flat_complete_header_row()) <NEW_LINE> header.extend(models.MetaResult.flat_complete_head... | Returns a complete export of all data required to rebuild the the
epidemiological meta-result study type from scratch. | 6259904b596a897236128fac |
class Moisture_Event(object): <NEW_LINE> <INDENT> def __init__(self, area_id, moisture, min, max, date): <NEW_LINE> <INDENT> super(Moisture_Event, self).__init__() <NEW_LINE> self.area_id = area_id <NEW_LINE> self.moisture = moisture <NEW_LINE> self.min = min <NEW_LINE> self.max = max <NEW_LINE> self.date = date <NEW_L... | Object that represents the data acquired from the sensors. on V1 this
data comes from a CSV file with the following structure
area_id, moisture, min, max, date | 6259904bbe383301e0254c16 |
class WrappedIterableDataset(torch.utils.data.IterableDataset): <NEW_LINE> <INDENT> def __init__(self, hf_iterable, verbose: bool = True): <NEW_LINE> <INDENT> self.hf_iterable = hf_iterable <NEW_LINE> self.verbose = verbose <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> started = False <NEW_LINE> logger.in... | Wraps huggingface IterableDataset as pytorch IterableDataset, implement default methods for DataLoader | 6259904b1f037a2d8b9e526a |
class UpdateOrderApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> config = Configuration() <NEW_LINE> if api_client: <NEW_LINE> <INDENT> self.api_client = api_client <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if not config.api_client: <NEW_LINE> <INDENT> config.api_client = A... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen | 6259904b4428ac0f6e65992d |
class TestEmpty: <NEW_LINE> <INDENT> def test_empty_class_is_not_none(self): <NEW_LINE> <INDENT> assert Empty is not None <NEW_LINE> assert Empty != None <NEW_LINE> <DEDENT> def test_empty_class_evaluates_to_false(self): <NEW_LINE> <INDENT> assert not Empty <NEW_LINE> <DEDENT> def test_empty_class_is_empty(self): <NEW_... | Empty tests. | 6259904bf7d966606f7492b7 |
class WrapFormSpawner(FormMixin, WrapSpawner): <NEW_LINE> <INDENT> def set_class(self, data): <NEW_LINE> <INDENT> raise NotImplementedError('Must set_class based on form or saved cfg') <NEW_LINE> <DEDENT> def construct_child(self): <NEW_LINE> <INDENT> self.log.info("construct_child") <NEW_LINE> self.set_class(self.user... | WrapSpawner modification to select the child class based on the
form information generated by a form-class above. Subclasses must
implement a set_class method that gets the formdata and must use that
to return a Spawner class to use | 6259904b07d97122c421809f |
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = "user" <NEW_LINE> user_id = db.Column(db.Integer, primary_key=True) <NEW_LINE> username = db.Column(db.String(50), unique=True) <NEW_LINE> email = db.Column(db.String(100), unique=True) <NEW_LINE> password_hash = db.Column(db.String(128)) <NEW_LINE> profile_pic ... | User db model.
Table of user information.
Args:
pass
Attributes:
user_id (int): Integer representation/primary key
username (str): Unique username
email (str): Unique email
profile_pic (str): path to profile picture | 6259904be64d504609df9dce |
class DescribeRecordDatesByChannelRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.DeviceId = None <NEW_LINE> self.ChannelId = None <NEW_LINE> self.Type = None <NEW_LINE> self.Limit = None <NEW_LINE> self.Offset = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE... | DescribeRecordDatesByChannel请求参数结构体
| 6259904b8e71fb1e983bcec2 |
class HttpParserUpgrade(ParseError): <NEW_LINE> <INDENT> pass | 当协议请求升级时抛出错误 | 6259904b21a7993f00c67366 |
class Entity(): <NEW_LINE> <INDENT> _velocity = Vec2.zeros() <NEW_LINE> _acceleration = Vec2.zeros() <NEW_LINE> def __init__(self, position=Vec2.zeros(), material=Material(mass=0), color=(255, 0, 0)) -> None: <NEW_LINE> <INDENT> assert isinstance(position, Vec2) and isinstance(material, Material) <NEW_LINE> assert isin... | Basic backbone of all game interactive elements. It stores its position or velocity or acceleration as vector (Vec2) and additional information as 'Material',
which is for computing 'Marble' velocity, speed and bouncness. | 6259904bd7e4931a7ef3d474 |
class OrgJobDescription(GDataBase): <NEW_LINE> <INDENT> _tag = 'orgJobDescription' | The Google Contacts OrgJobDescription element. | 6259904b23e79379d538d8fb |
class CharDatabase(SQLObject): <NEW_LINE> <INDENT> name = StringCol(length=255, unique=True) <NEW_LINE> stat_survival = IntCol() <NEW_LINE> stat_movement = IntCol() <NEW_LINE> stat_accuracy = IntCol() <NEW_LINE> stat_strength = IntCol() <NEW_LINE> stat_evasion = IntCol() <NEW_LINE> stat_luck = IntCol() <NEW_LINE> stat_... | connect to mysql database | 6259904b63d6d428bbee3bc8 |
class WorkflowTestificationError(Error): <NEW_LINE> <INDENT> pass | You provided an invalid test/stub definition. | 6259904b8e05c05ec3f6f859 |
class Meta: <NEW_LINE> <INDENT> unique_together = ('category', 'order',) | Defines composite unique key of category and order | 6259904bb830903b9686ee79 |
class Address(namedtuple("Address", "name route mailbox host")): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return formataddr(( to_unicode(self.name), to_unicode(self.mailbox) + '@' + to_unicode(self.host))) | Represents electronic mail addresses. Used to store addresses in
:py:class:`Envelope`.
:ivar name: The address "personal name".
:ivar route: SMTP source route (rarely used).
:ivar mailbox: Mailbox name (what comes just before the @ sign).
:ivar host: The host/domain name.
As an example, an address header that looks l... | 6259904b7cff6e4e811b6e38 |
class LNKGenerator(Generator): <NEW_LINE> <INDENT> def check(self): <NEW_LINE> <INDENT> if sys.platform != "win32": <NEW_LINE> <INDENT> logging.error(" [!] You have to run on Windows OS to build this file format.") <NEW_LINE> return False <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> <D... | Module used to generate malicious Explorer Command File | 6259904b3c8af77a43b6893c |
class LibSass(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.clib = None <NEW_LINE> <DEDENT> def _load(self): <NEW_LINE> <INDENT> if self.clib is None: <NEW_LINE> <INDENT> root_path = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__ )), '..')) <NEW_LINE> path1 = os.path... | Wrapper class around libsass.
The class provides methods that mimic the functions in sass_interface.h | 6259904bb5575c28eb7136c8 |
class on_keyword(parser.keyword): <NEW_LINE> <INDENT> def __init__(self, sString): <NEW_LINE> <INDENT> parser.keyword.__init__(self, sString) | unique_id = sensitivity_clause : on_keyword | 6259904b30dc7b76659a0c32 |
class Libogg(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "https://www.xiph.org/ogg/" <NEW_LINE> url = "http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz" <NEW_LINE> version('1.3.2', 'b72e1a1dbadff3248e4ed62a4177e937') | Ogg is a multimedia container format, and the native file and stream
format for the Xiph.org multimedia codecs. | 6259904b009cb60464d02934 |
class PomXmlTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.o = untangle.parse('tests/res/pom.xml') <NEW_LINE> <DEDENT> def test_parent(self): <NEW_LINE> <INDENT> project = self.o.project <NEW_LINE> self.assert_(project) <NEW_LINE> parent = project.parent <NEW_LINE> self.asser... | Tests parsing a Maven pom.xml | 6259904bcb5e8a47e493cb86 |
class MXResolver: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_mx_records(domain): <NEW_LINE> <INDENT> return [] | Gets an array of MXRecords associated to the domain specified.
:param domain:
:return: [MXRecord] | 6259904b07f4c71912bb0832 |
class MissingScopes(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create(**kwargs): <NEW_LINE> <INDENT> return MissingScopes(**kwargs) <NEW_LINE> <DEDENT> def __init__(self, json=None, **kwargs): <NEW_LINE> <INDENT> if json is None and not kwargs: <NEW_LINE> <INDENT> raise ValueError('No data or kwargs pres... | auto-generated. don't touch. | 6259904b0c0af96317c57760 |
@createsPerformedReactionSetBool <NEW_LINE> class WekaKNNKFTest(ModelTest): <NEW_LINE> <INDENT> modelLibrary = "weka" <NEW_LINE> modelTool = "KNN" <NEW_LINE> splitter = "KFoldSplitter" | Tests Weka KNN. | 6259904bac7a0e7691f738da |
class DbtOutput: <NEW_LINE> <INDENT> def __init__(self, result: Dict[str, Any]): <NEW_LINE> <INDENT> self._result = check.dict_param(result, "result", key_type=str) <NEW_LINE> <DEDENT> @property <NEW_LINE> def result(self) -> Dict[str, Any]: <NEW_LINE> <INDENT> return self._result <NEW_LINE> <DEDENT> @property <NEW_LIN... | Base class for both DbtCliOutput and DbtRPCOutput. Contains a single field, `result`, which
represents the dbt-formatted result of the command that was run (if any).
Used internally, should not be instantiated directly by the user. | 6259904b26068e7796d4dd43 |
class TextPlugin(NitpickPlugin): <NEW_LINE> <INDENT> identify_tags = {"text"} <NEW_LINE> validation_schema = TextSchema <NEW_LINE> skip_empty_suggestion = True <NEW_LINE> violation_base_code = 350 <NEW_LINE> def _expected_lines(self): <NEW_LINE> <INDENT> return [obj.get("line") for obj in self.expected_config.get(KEY_C... | Enforce configuration on text files.
To check if ``some.txt`` file contains the lines ``abc`` and ``def`` (in any order):
.. code-block:: toml
[["some.txt".contains]]
line = "abc"
[["some.txt".contains]]
line = "def" | 6259904b8e71fb1e983bcec5 |
@register <NEW_LINE> class ImageRecorder(Recorder): <NEW_LINE> <INDENT> _model_name = Unicode('ImageRecorderModel').tag(sync=True) <NEW_LINE> _view_name = Unicode('ImageRecorderView').tag(sync=True) <NEW_LINE> image = Instance(Image).tag(sync=True, **widget_serialization) <NEW_LINE> format = Unicode('png', help='The fo... | Creates a recorder which allows to grab an Image from a MediaStream widget.
| 6259904b0a366e3fb87ddde5 |
class LevelFilter: <NEW_LINE> <INDENT> def __init__(self, min_level="NOTSET", max_level="CRITICAL"): <NEW_LINE> <INDENT> self.min_level = logging._checkLevel(min_level) <NEW_LINE> self.max_level = logging._checkLevel(max_level) <NEW_LINE> <DEDENT> def filter(self, record): <NEW_LINE> <INDENT> if self.min_level <= recor... | Log filter that accepts records in a certain level range | 6259904b004d5f362081f9e7 |
class InboxView(object): <NEW_LINE> <INDENT> template_name = None <NEW_LINE> http_method_names = ('GET', 'POST') <NEW_LINE> def render_to_response(self, context, template_name=None): <NEW_LINE> <INDENT> if template_name is None: <NEW_LINE> <INDENT> template_name = self.template_name <NEW_LINE> <DEDENT> template = get_t... | custom class-based view
to be used for pjax use and for generation
of content in the traditional way, where
the only the :method:`get_context` would be used. | 6259904be76e3b2f99fd9e0a |
class ListarCircuito(ListView): <NEW_LINE> <INDENT> model = Circuito <NEW_LINE> template_name = 'circuito/listar.html' <NEW_LINE> context_object_name = "listar_circuito" | Vista basada en clase: (`Listar`)
:param template_name: ruta de la plantilla
:param model: Modelo al cual se hace referencia
:param context_object_name: nombre del objeto que contiene esta vista | 6259904b16aa5153ce4018ed |
class ArgReal(Arg): <NEW_LINE> <INDENT> def __init__(self, key, value = None, help = '', min = -1.7976931348623157e308, max = 1.7976931348623157e308, isTemporary = 0, deprecated = False): <NEW_LINE> <INDENT> self.min = min <NEW_LINE> self.max = max <NEW_LINE> Arg.__init__(self, key, value, help, isTemporary, deprecated... | Arguments that represent floating point numbers | 6259904b7cff6e4e811b6e3a |
class NotebookTrainingTracker(NotebookProgressBar): <NEW_LINE> <INDENT> def __init__(self, num_steps, column_names=None): <NEW_LINE> <INDENT> super().__init__(num_steps) <NEW_LINE> self.inner_table = None if column_names is None else [column_names] <NEW_LINE> self.child_bar = None <NEW_LINE> <DEDENT> def display(self):... | An object tracking the updates of an ongoing training with progress bars and a nice table reporting metrics.
Args:
num_steps (:obj:`int`): The number of steps during training.
column_names (:obj:`List[str]`, `optional`):
The list of column names for the metrics table (will be inferred from the first c... | 6259904b3c8af77a43b6893d |
class PairwiseEMDEnergyEEDot(PairwiseEMDBaseFloat64): <NEW_LINE> <INDENT> thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> _eventgeometry.PairwiseEMDEnergyEEDot_swiginit(self, _eventgeometry.new_Pairwise... | Proxy of C++ fastjet::contrib::eventgeometry::PairwiseEMD< fastjet::contrib::eventgeometry::EMD< double,fastjet::contrib::eventgeometry::Energy,fastjet::contrib::eventgeometry::EEDot >,double > class. | 6259904b596a897236128fae |
class HendrixTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def noSettingsDeploy(self, action='start', options={}): <NEW_LINE> <INDENT> options.update({'wsgi': 'hendrix.tests.wsgi'}) <NEW_LINE> return HendrixDeploy(action, options) <NEW_LINE> <DEDENT> def withSettingsDeploy(self, action='start', options={}): <NEW_LIN... | This is where we collect our helper functions to test hendrix | 6259904bdc8b845886d549bd |
class ShellcodeSearchCommand(GenericCommand): <NEW_LINE> <INDENT> _cmdline_ = "shellcode search" <NEW_LINE> _syntax_ = "%s <pattern1> <pattern2>" % _cmdline_ <NEW_LINE> api_base = "http://shell-storm.org" <NEW_LINE> search_url = api_base + "/api/?s=" <NEW_LINE> def do_invoke(self, argv): <NEW_LINE> <INDENT> if len(arg... | Search patthern in shellcodes database. | 6259904b097d151d1a2c246e |
class FileTree: <NEW_LINE> <INDENT> def __init__(self, paths): <NEW_LINE> <INDENT> self.tree = {} <NEW_LINE> def get_parent(path): <NEW_LINE> <INDENT> parent = self.tree <NEW_LINE> while '/' in path: <NEW_LINE> <INDENT> directory, path = path.split('/', 1) <NEW_LINE> child = parent.get(directory) <NEW_LINE> if child is... | Convert a list of paths in a file tree.
:param paths: The paths to be converted.
:type paths: list | 6259904b009cb60464d02936 |
class Department(object): <NEW_LINE> <INDENT> def __init__(self, name, contact_info, number_of_employees, manager): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.employees = {} <NEW_LINE> self.office_hours = "9:00-5:00" <NEW_LINE> self.contact_info = contact_info <NEW_LINE> self.number_of_employees = number_of_e... | Parent class for all departments | 6259904bd99f1b3c44d06a99 |
class Config(object): <NEW_LINE> <INDENT> _instance = None <NEW_LINE> config: Any = None <NEW_LINE> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if cls._instance is None: <NEW_LINE> <INDENT> cls._instance = super(Config, cls).__new__(cls) <NEW_LINE> <DEDENT> return cls._instance <NEW_LINE> <DEDENT> def __init... | Singleton Config class for representing the pipeline configuration. | 6259904b07f4c71912bb0834 |
class ExternalServiceError(Exception): <NEW_LINE> <INDENT> pass | External service error. | 6259904b07f4c71912bb0835 |
class Netgear(object): <NEW_LINE> <INDENT> def __init__(self, host, username, password): <NEW_LINE> <INDENT> self.soap_url = "http://{}:5000/soap/server_sa/".format(host) <NEW_LINE> self.username = username <NEW_LINE> self.password = password <NEW_LINE> self.logged_in = False <NEW_LINE> <DEDENT> def login(self): <NEW_L... | Represents a Netgear Router. | 6259904b21a7993f00c6736a |
class H2OAutoEncoderModel(ModelBase): <NEW_LINE> <INDENT> def __init__(self, dest_key, model_json): <NEW_LINE> <INDENT> super(H2OAutoEncoderModel, self).__init__(dest_key, model_json,H2OAutoEncoderModelMetrics) <NEW_LINE> <DEDENT> def anomaly(self,test_data,per_feature=False): <NEW_LINE> <INDENT> if not test_data: rais... | Class for AutoEncoder models. | 6259904b379a373c97d9a42b |
class ConnectDevice(Action): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ConnectDevice, self).__init__() <NEW_LINE> self.name = "connect-device" <NEW_LINE> self.summary = "run connection command" <NEW_LINE> self.description = "use the configured command to connect serial to the device" <NEW_LINE> ... | General purpose class to use the device commands to
make a serial connection to the device. e.g. using ser2net
Inherit from this class and change the session_class and/or shell_class for different behaviour. | 6259904b3c8af77a43b6893e |
class ExampleAlgorithm(GeoAlgorithm): <NEW_LINE> <INDENT> OUTPUT_LAYER = 'OUTPUT_LAYER' <NEW_LINE> INPUT_LAYER = 'INPUT_LAYER' <NEW_LINE> def defineCharacteristics(self): <NEW_LINE> <INDENT> self.name = 'Create copy of layer' <NEW_LINE> self.group = 'Algorithms for vector layers' <NEW_LINE> self.addParameter(ParameterV... | This is an example algorithm that takes a vector layer and
creates a new one just with just those features of the input
layer that are selected.
It is meant to be used as an example of how to create your own
algorithms and explain methods and variables used to do it. An
algorithm like this will be available in all ele... | 6259904b50485f2cf55dc38c |
class CourseListViewTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.course3 = Course.objects.create( title="Python Django Reinhardt Appreciation Course 0", description="Course 0 is pretty self explanatory." ) <NEW_LINE> for x in range(1,5): <NEW_LINE> <INDENT> Course.objects.create( ti... | Tests for the Course list view | 6259904b96565a6dacd2d98a |
class MySlackServer(SlackServer): <NEW_LINE> <INDENT> def bind_route(self, server): <NEW_LINE> <INDENT> @server.route(self.endpoint, methods=['GET', 'POST']) <NEW_LINE> def event(): <NEW_LINE> <INDENT> if request.method == 'GET': <NEW_LINE> <INDENT> return make_response( "These are not the slackbots you're looking for.... | Override bind_route method to make | 6259904b6fece00bbacccdba |
class DemandeCreateView(LoginRequiredMixin, CreateView): <NEW_LINE> <INDENT> model = Demande <NEW_LINE> fields = ('description', ) <NEW_LINE> def form_valid(self, form) -> HttpResponse: <NEW_LINE> <INDENT> form.instance.demandeur = self.request.user <NEW_LINE> form.instance.cagnotte = get_object_or_404(Cagnotte, slug=s... | A view to add a Demande. | 6259904bb5575c28eb7136ca |
class WriteVariableActionMixin(object): <NEW_LINE> <INDENT> def __init__(self, value=None, **kwargs): <NEW_LINE> <INDENT> super(WriteVariableActionMixin, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def value_type(self, diagnostics=None, context=None): <NEW_LINE> <INDENT> raise NotImplementedError( 'operation value_typ... | User defined mixin class for WriteVariableAction. | 6259904bcb5e8a47e493cb88 |
class JWTAuthenticationMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, get_response): <NEW_LINE> <INDENT> self.get_response = get_response <NEW_LINE> <DEDENT> def __call__(self, request): <NEW_LINE> <INDENT> return self.get_response(request) <NEW_LINE> <DEDENT> def process_request(self, request): <NEW_LINE> ... | Middleware for authenticating JSON Web Tokens in Authorize Header | 6259904b0c0af96317c57762 |
class BasicInvalidCredentials(InvalidCredentials): <NEW_LINE> <INDENT> default_headers = {"www-authenticate": "basic"} <NEW_LINE> status = 401 | Invalid credentials provided for basic authentication. | 6259904b711fe17d825e169f |
class Executor: <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> args = Args(args) <NEW_LINE> config = SheBaoConfig(args.get_arg('-c')) <NEW_LINE> self.employee_data = EmployeeData(args.get_arg('-d')) <NEW_LINE> self.exporter = Exporter(args.get_arg('-o')) <NEW_LINE> self.calculator = Calculator(config... | 执行器实现
该执行器会调用各个类来实现税额计算功能 | 6259904b498bea3a75a58f23 |
class TestTerminationGDDR5(unittest.TestCase): <NEW_LINE> <INDENT> vdd = 1.5 <NEW_LINE> rankcnt = 2 <NEW_LINE> resistance = energydram.TermResistance(rz_dev=40, rz_mc=40, rtt_nom=60, rtt_wr=60, rtt_mc=60, rs=15) <NEW_LINE> term = energydram.Termination(vdd, rankcnt, resistance, width=32, with_dqs=False, with_dm=False, ... | Termination class unit tests for GDDR5.
Compare with Kenta & Makoto Excel sheet. | 6259904bd4950a0f3b111844 |
class SubscriptionListAPI(Resource): <NEW_LINE> <INDENT> @use_kwargs(SubscriptionQuerySchema(partial=True), locations=("query",)) <NEW_LINE> def get(self, **kwargs): <NEW_LINE> <INDENT> subscriptions = Subscription.get_subscriptions(**kwargs) <NEW_LINE> result = SubscriptionSchema().dump(subscriptions, many=True) <NEW_... | Resource/routes for subscriptions endpoints | 6259904b21a7993f00c6736c |
class Portgroup(Base): <NEW_LINE> <INDENT> __tablename__ = 'portgroups' <NEW_LINE> __table_args__ = ( schema.UniqueConstraint('uuid', name='uniq_portgroups0uuid'), schema.UniqueConstraint('address', name='uniq_portgroups0address'), schema.UniqueConstraint('name', name='uniq_portgroups0name'), table_args()) <NEW_LINE> i... | Represents a group of network ports of a bare metal node. | 6259904b07d97122c42180a6 |
class NotificationInstance(InstanceResource): <NEW_LINE> <INDENT> class Priority(object): <NEW_LINE> <INDENT> HIGH = "high" <NEW_LINE> LOW = "low" <NEW_LINE> <DEDENT> def __init__(self, version, payload, service_sid): <NEW_LINE> <INDENT> super(NotificationInstance, self).__init__(version) <NEW_LINE> self._properties = ... | PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. | 6259904b8e71fb1e983bcec9 |
class QuestionsViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> authentication_classes = [JWTAuthentication] <NEW_LINE> permission_classes = [permissions.IsAdminUser | ReadOnly] <NEW_LINE> queryset = Question.objects.all() <NEW_LINE> serializer_class = QuestionSerializer <NEW_LINE> filter_backends = (filters.DjangoF... | Returns a list questions. | 6259904ba79ad1619776b483 |
class VolumeUtilization(GenericChart): <NEW_LINE> <INDENT> _model = m_volumes.VolumeUtilizationModel <NEW_LINE> _label = 'Volume Utilization panel' | page object for Volume Utilization panel | 6259904bb830903b9686ee7c |
class Words(): <NEW_LINE> <INDENT> def __init__(self, words: List['Word']) -> None: <NEW_LINE> <INDENT> self.words = words <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'Words': <NEW_LINE> <INDENT> args = {} <NEW_LINE> if 'words' in _dict: <NEW_LINE> <INDENT> args['words'] = [Word.from_... | Information about the words from a custom language model.
:attr List[Word] words: An array of `Word` objects that provides information
about each word in the custom model's words resource. The array is empty if the
custom model has no words. | 6259904b3cc13d1c6d466b3c |
class Clan(): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.name = data["name"] <NEW_LINE> self.rank = data["rank"] <NEW_LINE> self.type = data["type"] | The class used to represent a user's clan.
Attributes
-----------
name : [str]
The clan's name. Not to be confused with :class:`Profile.name`
rank : [int]
The clan's rank.
type : [str]
The size of clan. | 6259904b16aa5153ce4018f1 |
class TypeExperience(Measure): <NEW_LINE> <INDENT> def measure(self, roundnum, women, game): <NEW_LINE> <INDENT> if self.midwife_type is not None: <NEW_LINE> <INDENT> women = filter(lambda x: x.player_type == self.midwife_type, women) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> group_log = itertools.chain(*map(lambda... | A measure that gives the frequency of a type experienced up
to that round by some (or all) types of midwife. | 6259904b596a897236128fb0 |
class CommandOptions(HelpProvider): <NEW_LINE> <INDENT> help_spec = HelpProvider.HelpSpec( help_name = 'wildcards', help_name_aliases = ['wildcard', '*', '**'], help_type = 'additional_help', help_one_line_summary = 'Wildcard Names', help_text = _detailed_help_text, subcommand_help_text = {}, ) | Additional help about wildcards. | 6259904b23e79379d538d902 |
class HueSaturationValue(ScalarField_RGB): <NEW_LINE> <INDENT> def compute(self): <NEW_LINE> <INDENT> rgb = self.rgb <NEW_LINE> MAX = np.max(rgb, -1) <NEW_LINE> MIN = np.min(rgb, -1) <NEW_LINE> MAX_MIN = np.ptp(rgb, -1) <NEW_LINE> H = np.empty_like(MAX) <NEW_LINE> idx = rgb[:, 0] == MAX <NEW_LINE> H[idx] = 60 * (rgb[id... | Hue, Saturation, Value colorspace.
| 6259904b94891a1f408ba0f7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.