code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Saplings(TreeMaker): <NEW_LINE> <INDENT> __version__ = '0.0.2' <NEW_LINE> extra_branches = ['peaks.left','peaks.hit_time_mean','peaks.top_hitpattern_spread','peaks.area_fraction_top'] <NEW_LINE> def extract_data(self, event): <NEW_LINE> <INDENT> result = dict() <NEW_LINE> if not len(event.interactions): <NEW_LINE... | sum_s2s_before_main_s1: Sum up all the s2 peaks before main s1 peak
s1_hit_time_mean: Hit time mena of main s1 peak
largest_other_s2_area_fraction_top: Area fraction top of largest other s2 | 6259904615baa723494632f5 |
class CommandError(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, message, data=None, status=1, code=None) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.message = message <NEW_LINE> self.data = data <NEW_LINE> self.success = False <NEW_LINE> self.status = status <NEW_LINE> self.code = code <NEW... | raised if an error occurred while executing a command | 62599046d53ae8145f9197c3 |
class ExceptionContextImpl(ExceptionContext): <NEW_LINE> <INDENT> def __init__(self, exception, sqlalchemy_exception, connection, cursor, statement, parameters, context, is_disconnect): <NEW_LINE> <INDENT> self.connection = connection <NEW_LINE> self.sqlalchemy_exception = sqlalchemy_exception <NEW_LINE> self.original_... | Implement the :class:`.ExceptionContext` interface. | 6259904671ff763f4b5e8b07 |
class SelectHierarchy(Operator): <NEW_LINE> <INDENT> bl_idname = "object.select_hierarchy" <NEW_LINE> bl_label = "Select Hierarchy" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> direction = EnumProperty( items=(('PARENT', "Parent", ""), ('CHILD', "Child", ""), ), name="Direction", description="Direction to se... | Select object relative to the active object's positionin the hierarchy | 62599046596a897236128f61 |
@attr.s(auto_attribs=True) <NEW_LINE> class Widget: <NEW_LINE> <INDENT> widget: QSignaledWidget = attr.ib(factory=QSignaledWidget) <NEW_LINE> increment: QtWidgets.QPushButton = attr.ib(factory=QtWidgets.QPushButton) <NEW_LINE> decrement: QtWidgets.QPushButton = attr.ib(factory=QtWidgets.QPushButton) <NEW_LINE> label: Q... | A manager for a simple window with increment and decrement buttons to change a
counter which is displayed via a widget in the center. | 6259904607f4c71912bb0796 |
class ContrailRouteTableTest(rbac_base.BaseContrailTest): <NEW_LINE> <INDENT> def _delete_route_table(self, route_id): <NEW_LINE> <INDENT> self.route_client.delete_route_table(route_id) <NEW_LINE> <DEDENT> def _create_route_tables(self): <NEW_LINE> <INDENT> parent_type = 'project' <NEW_LINE> fq_name = ['default-domain'... | Test class to test route objects using RBAC roles | 62599046d99f1b3c44d06a04 |
class Gridding(Linop): <NEW_LINE> <INDENT> def __init__(self, oshape, coord, kernel='spline', width=2, param=1): <NEW_LINE> <INDENT> ndim = coord.shape[-1] <NEW_LINE> ishape = list(oshape[:-ndim]) + list(coord.shape[:-1]) <NEW_LINE> self.coord = coord <NEW_LINE> self.kernel = kernel <NEW_LINE> self.width = width <NEW_L... | Gridding linear operator.
Args:
oshape (tuple of ints): Output shape = batch_shape + pts_shape
ishape (tuple of ints): Input shape = batch_shape + grd_shape
coord (array): Coordinates, values from - nx / 2 to nx / 2 - 1.
ndim can only be 1, 2 or 3. of shape pts_shape + [ndim]
width (float):... | 62599046d4950a0f3b1117f4 |
class ArgumentParser(object): <NEW_LINE> <INDENT> def start(self): <NEW_LINE> <INDENT> print ('sys.argv') <NEW_LINE> print (sys.argv) <NEW_LINE> parser = argparse.ArgumentParser() <NEW_LINE> parser.add_argument('--level', help='logging level') <NEW_LINE> args = parser.parse_args() <NEW_LINE> if args.level: <NEW_LINE> <... | Parses input arguments | 6259904663b5f9789fe864d1 |
class Fichier(object): <NEW_LINE> <INDENT> def __init__(self, dossier_source): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> fichier_reader = dossier_source.reader(self.nom_fichier) <NEW_LINE> donnees_csv = [] <NEW_LINE> for ligne in fichier_reader: <NEW_LINE> <INDENT> donnees_ligne = self.extraction_ligne(ligne) <NEW_L... | Classe de base des classes d'importation de données
Attributs de classe (à définir dans les sous-classes) :
nom_fichier Le nom relatif du fichier à charger
libelle Un intitulé pour les messages d'erreur
cles La liste des colonnes à charger | 62599046d6c5a102081e3481 |
class DQN(Model): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.original = Network() <NEW_LINE> self.target = Network() <NEW_LINE> <DEDENT> def call(self, x): <NEW_LINE> <INDENT> return self.original(x) <NEW_LINE> <DEDENT> def q_original(self, x): <NEW_LINE> <INDENT> ret... | Simple Deep Q-Network for CartPole | 62599046d99f1b3c44d06a05 |
class Verbatim(models.Model): <NEW_LINE> <INDENT> verbatim = models.CharField(max_length=300) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return u"%s" % self.verbatim | MODEL
instances of verbatims and associated status | 625990468a43f66fc4bf34fa |
class Vector(Epetra.Vector): <NEW_LINE> <INDENT> def __neg__(self): <NEW_LINE> <INDENT> v = Vector(self) <NEW_LINE> v.Scale(-1.0) <NEW_LINE> return v <NEW_LINE> <DEDENT> def __truediv__(self, scal): <NEW_LINE> <INDENT> v = Vector(self) <NEW_LINE> v.Scale(1.0 / scal) <NEW_LINE> return v <NEW_LINE> <DEDENT> def dot(self,... | Distributed Epetra_Vector with some extra methods added to it for convenience. | 6259904621a7993f00c672cf |
class EventsPublisher(object): <NEW_LINE> <INDENT> def __init__(self, connection_url, routing_key=None): <NEW_LINE> <INDENT> self.connection_url = connection_url <NEW_LINE> self.connection = None <NEW_LINE> self.producer = None <NEW_LINE> self.default_routing_key = routing_key <NEW_LINE> self.exchange = Exchange("event... | Generic publisher class that specific publishers inherit from. | 625990466fece00bbacccd1b |
class ProfileAwareConfigLoader(PyFileConfigLoader): <NEW_LINE> <INDENT> def load_subconfig(self, fname, path=None, profile=None): <NEW_LINE> <INDENT> if profile is not None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> profile_dir = ProfileDir.find_profile_dir_by_name( get_ipython_dir(), profile, ) <NEW_LINE> <DEDENT> ... | A Python file config loader that is aware of IPython profiles. | 6259904673bcbd0ca4bcb5f3 |
class FakeUnbindPortContext(FakePortContext): <NEW_LINE> <INDENT> @property <NEW_LINE> def top_bound_segment(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @property <NEW_LINE> def bottom_bound_segment(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @property <NEW_LINE> def original_top_bound_seg... | Port context used during migration to unbind port. | 62599046287bf620b6272f4f |
class Display: <NEW_LINE> <INDENT> def __init__(self, initializers: Tuple[str, str] = ("", "")) -> None: <NEW_LINE> <INDENT> self._lcd = LCD.Adafruit_CharLCDPlate() <NEW_LINE> self._log = list(initializers) <NEW_LINE> self._cur_index = 1 <NEW_LINE> self._cur_side_index = 0 <NEW_LINE> self.clear() <NEW_LINE> self.show()... | Manages all display functionality regarding the 16x2 LCD display.
| 62599046507cdc57c63a6104 |
class AppAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ("id", "name", "is_active", "access_key", "secret_key", "created_on", "modified_on") <NEW_LINE> search_fields = ("name", "is_active", "access_key") | 第三方应用的后台管理页面 | 6259904763b5f9789fe864d3 |
class User: <NEW_LINE> <INDENT> alarms = {} <NEW_LINE> next_alarm = None <NEW_LINE> current_alarm = None <NEW_LINE> snooze = None <NEW_LINE> alarm_sound = 'alarm.wav' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def refresh(self): <NEW_LINE> <INDENT> if bool(self.alarms): <NEW_LINE> <INDE... | A regular user of the alarm clock | 6259904745492302aabfd839 |
class Component(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def destroy(self): <NEW_LINE> <INDENT> attr_list = list(self.__dict__.keys()) <NEW_LINE> for ... | Abstract class for all callables that could be used in Chainer's pipe. | 62599047d6c5a102081e3483 |
class alpha_PriceSwingDiv(alpha): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(alpha_PriceSwingDiv, self).__init__(*args, **kwargs) <NEW_LINE> self.prev_n = 10 <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> super(alpha_PriceSwingDiv, self).initialize() <NEW_LINE> if ... | description of class | 62599047009cb60464d0289c |
class UsageEvent(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'dimension_id': {'key': 'dimensionId', 'type': 'str'}, 'dimension_name': {'key': 'dimensionName', 'type': 'str'}, 'measure_unit': {'key': 'measureUnit', 'type': 'str'}, 'amount_billed': {'key': 'amountBilled', 'type': 'float'}, 'amount... | Usage event details.
:ivar dimension_id: The dimension id.
:vartype dimension_id: str
:ivar dimension_name: The dimension name.
:vartype dimension_name: str
:ivar measure_unit: The unit of measure.
:vartype measure_unit: str
:ivar amount_billed: The amount billed.
:vartype amount_billed: float
:ivar amount_consumed: T... | 6259904750485f2cf55dc2ef |
class Language(TableBase): <NEW_LINE> <INDENT> __tablename__ = 'languages' <NEW_LINE> __singlename__ = 'language' <NEW_LINE> id = Column(Integer, primary_key=True, nullable=False, doc=u"A numeric ID") <NEW_LINE> iso639 = Column(Unicode(79), nullable=False, doc=u"The two-letter code of the language. Note that it is not ... | A language the Pokémon games have been translated into. | 6259904771ff763f4b5e8b0b |
class LivestockPigCycle(ProduModel): <NEW_LINE> <INDENT> production_livestock = models.ForeignKey( "producer.ProductionLivestock", related_name="livestock_pig_cycle", on_delete=models.CASCADE ) <NEW_LINE> up_three_months = models.PositiveIntegerField(default=0) <NEW_LINE> three_eight_months = models.PositiveIntegerFiel... | Ciclo de cerdos relacionado
con la actividad productiva | 62599047462c4b4f79dbcd66 |
class TestAnalysisEvent(BaseTest): <NEW_LINE> <INDENT> SKETCH_ID = 1 <NEW_LINE> def test_event(self): <NEW_LINE> <INDENT> sketch = interface.Sketch(sketch_id=self.SKETCH_ID) <NEW_LINE> datastore = MockDataStore('127.0.0.1', 4711) <NEW_LINE> valid_event = dict( _id='1', _type='test', _index='test', _source={'__ts_timeli... | Tests for the functionality of the Event class. | 6259904730dc7b76659a0b9a |
class RadiusAttr_WLAN_Reason_Code(_RadiusAttrIntValue): <NEW_LINE> <INDENT> val = 185 | RFC 7268 | 625990476fece00bbacccd1d |
class Post(AbstractTranslatableEntry, ExcerptImageEntryMixin): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _("Blog post") <NEW_LINE> verbose_name_plural = _("Blog posts") <NEW_LINE> ordering = ('-publication_date',) | Custom blog entry model with an excerpt text. | 6259904707d97122c421800a |
@register_relay_node <NEW_LINE> class Function(Expr): <NEW_LINE> <INDENT> def __init__(self, params, ret_type, body, type_params=None): <NEW_LINE> <INDENT> if type_params is None: <NEW_LINE> <INDENT> type_params = convert([]) <NEW_LINE> <DEDENT> self.__init_handle_by_constructor__( _make.Function, params, ret_type, bod... | A function declaration expression.
Parameters
----------
params: List[tvm.relay.Var]
List of input parameters to the function.
ret_type: tvm.relay.Type
The return type annotation of the function.
body: tvm.relay.Expr
The body of the function.
type_params: Optional[List[tvm.relay.TypeParam]]
The addi... | 625990478da39b475be04558 |
class ReptorResource: <NEW_LINE> <INDENT> def __init__(self, ): <NEW_LINE> <INDENT> self._reputation_service = Reptor() <NEW_LINE> <DEDENT> @jsonschema.validate(get_json_schema) <NEW_LINE> def on_get(self, req:falcon.Request, resp:falcon.Response): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> rep_name = req.media['repu... | Falcon application for reputation. It only tries to work with things that are directly web-related.
It does not include the rules or algorithms for data handling once the JSON is digested. | 62599047287bf620b6272f51 |
class DataIngestionBot(pywikibot.Bot): <NEW_LINE> <INDENT> def __init__(self, reader, titlefmt, pagefmt, site=pywikibot.Site(u'commons', u'commons')): <NEW_LINE> <INDENT> super(DataIngestionBot, self).__init__(generator=reader) <NEW_LINE> self.reader = reader <NEW_LINE> self.titlefmt = titlefmt <NEW_LINE> self.pagefmt ... | Data ingestion bot. | 6259904724f1403a92686281 |
class _MMSchemaMeta(mm.schema.SchemaMeta, abc_schema.abc.ABCMeta): <NEW_LINE> <INDENT> ... | Combined meta class from Marshmallow and abc.ABCMeta, so we can inherit from both | 6259904723849d37ff852425 |
class MemoryDAO(dao.DAO): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> dao.DAO.register(MemoryDAO) <NEW_LINE> self._stack = {} <NEW_LINE> <DEDENT> def cls(self, obj): <NEW_LINE> <INDENT> return obj.__class__.__name__ <NEW_LINE> <DEDENT> def create(self, obj): <NEW_LINE> <INDENT> self._stack[obj.reg_id] =... | Store values in memory instead of any persistence
Usually used in tests as a test fixture to raise coverage | 62599047c432627299fa42b7 |
class Notification(QtWidgets.QWidget): <NEW_LINE> <INDENT> _type = None <NEW_LINE> def __init__( self, event=None, date=None, parent=None ): <NEW_LINE> <INDENT> super(Notification, self).__init__(parent=parent) <NEW_LINE> self.horizontalLayout = QtWidgets.QHBoxLayout() <NEW_LINE> verticalLayout = QtWidgets.QVBoxLayout(... | Represent a notification. | 62599047d4950a0f3b1117f6 |
class Market(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> unique_together = ('latitude', 'longitude') <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '%s' % (self.market_name) <NEW_LINE> <DEDENT> market_id = models.AutoField(primary_key=True) <NEW_LINE> market_name = models.TextF... | Market details, it consists of just Indian states | 6259904745492302aabfd83a |
class OAuthSignatureMethod_PLAINTEXT(OAuthSignatureMethod): <NEW_LINE> <INDENT> name = 'PLAINTEXT' <NEW_LINE> @property <NEW_LINE> def signature(self): <NEW_LINE> <INDENT> return self.base_secrets | Implements the PLAINTEXT signature logic.
http://oauth.net/core/1.0/#rfc.section.9.4 | 6259904763b5f9789fe864d5 |
class SSCModule(object): <NEW_LINE> <INDENT> def __init__(self, mod_name): <NEW_LINE> <INDENT> mod_name = bytes(mod_name, "utf-8") <NEW_LINE> self._module = _LIB.ssc_module_create(mod_name) <NEW_LINE> <DEDENT> def _module_data(self): <NEW_LINE> <INDENT> i = 0 <NEW_LINE> while True: <NEW_LINE> <INDENT> info = _LIB.ssc_m... | Generic base class for SSC modules | 62599047e64d504609df9d85 |
class CarsDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, mat_anno, data_dir, car_names, cleaned=None, transform=None): <NEW_LINE> <INDENT> self.full_data_set = scipy.io.loadmat(mat_anno) <NEW_LINE> self.car_annotations = self.full_data_set['annotations'] <NEW_LINE> self.car_annotations = self.car_annotations[... | Face Landmarks dataset. | 6259904750485f2cf55dc2f1 |
class TaskPriority: <NEW_LINE> <INDENT> SHOWSTOPPER = 0 <NEW_LINE> CRITICAL = 1 <NEW_LINE> HIGH = 2 <NEW_LINE> MEDIUM = 3 <NEW_LINE> LOW = 4 | Task Priorities | 625990471f5feb6acb163f5f |
class StoreJobIntermediateResultsBody(Model): <NEW_LINE> <INDENT> def __init__(self, gas_payer: str = None, gas_payer_private: str = None, address: str = None, rep_oracle_pub: str = None, results_url: str = None): <NEW_LINE> <INDENT> self.swagger_types = { 'gas_payer': str, 'gas_payer_private': str, 'address': str, 're... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259904782261d6c5273087a |
class Action71(Action): <NEW_LINE> <INDENT> def execute(self, instance): <NEW_LINE> <INDENT> instance.objectPlayer.set_hyperlink_color(get_text_color(5)) | Set Hyperlink color->Text of item selected in a control
Parameters:
0: ((unknown 25072)) | 625990476fece00bbacccd1f |
class GCSFileScheme(FileScheme): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("gcp", fstype=FileScheme.FileSchemeType.gcs) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def check_if_has_gcp(): <NEW_LINE> <INDENT> if has_google_cloud: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> rai... | Placeholder for GCS File schema, almost for sure going to need the 'gsutil' package,
probably a credentials file to access the files. Should call the report_progress param on cp | 62599047435de62698e9d16f |
class Lookup(_Rule): <NEW_LINE> <INDENT> def _configure(self, table=None, icase=False): <NEW_LINE> <INDENT> self.table = table or dict() <NEW_LINE> self.icase = icase <NEW_LINE> if icase: <NEW_LINE> <INDENT> self.table = {k.lower(): v for k, v in table.items()} <NEW_LINE> <DEDENT> <DEDENT> @_Rule.track_changes <NEW_LIN... | Implements a dead-simple lookup table which perform case sensitive
(default) or insensitive (icase=True) lookups. | 62599047be383301e0254b83 |
class TorConfigType(object): <NEW_LINE> <INDENT> def parse(self, s): <NEW_LINE> <INDENT> return s <NEW_LINE> <DEDENT> def validate(self, s, instance, name): <NEW_LINE> <INDENT> return s | Base class for all configuration types, which function as parsers
and un-parsers. | 6259904726068e7796d4dcb1 |
class MHSMPrivateEndpointConnectionsListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[MHSMPrivateEndpointConnection]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(MHSMPrivateEndp... | List of private endpoint connections associated with a managed HSM Pools.
:param value: The private endpoint connection associated with a managed HSM Pools.
:type value:
list[~azure.mgmt.keyvault.v2021_04_01_preview.models.MHSMPrivateEndpointConnection]
:param next_link: The URL to get the next set of managed HSM Poo... | 62599047507cdc57c63a6108 |
class EthernetDstAddress(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> logging.info("Running Ethernet Dst Address test") <NEW_LINE> of_ports = config["port_map"].keys() <NEW_LINE> of_ports.sort() <NEW_LINE> self.assertTrue(len(of_ports) > 1, "Not enough ports for test") <NEW_LI... | Verify match on single Header Field Field -- Ethernet Dst Address | 62599047d6c5a102081e3486 |
class BaiduPipeline(object): <NEW_LINE> <INDENT> def process_item(self, item, spider): <NEW_LINE> <INDENT> if isinstance(spider, BaiduSpider): <NEW_LINE> <INDENT> print("这是百度爬虫管道的数据") <NEW_LINE> <DEDENT> return item | 由此来判断item是属于哪个爬虫的对象 | 62599047379a373c97d9a395 |
class SketchCurvePoint(SketchBase): <NEW_LINE> <INDENT> CLASS = 'curvePoint' <NEW_LINE> ATTRS = { 'do_objectID': (asId, None), 'cornerRadius': (asNumber, 0), 'curveFrom': (SketchPositionString, POINT_ORIGIN), 'curveMode': (asInt, 1), 'curveTo': (SketchPositionString, POINT_ORIGIN), 'hasCurveFrom': (asBool, False), 'has... | type SketchCurvePoint = {
_class: 'curvePoint',
do_objectID: UUID,
cornerRadius: number,
curveFrom: SketchPositionString, --> SketchPoint
curveMode: number,
curveTo: SketchPositionString, --> SketchPoint
hasCurveFrom: bool,
hasCurveTo: bool,
point: SketchPositionString --> Point | 6259904763b5f9789fe864d7 |
class User(object): <NEW_LINE> <INDENT> def __init__(self, name, spotify_ids): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.spotify_ids = spotify_ids | A Spotify User | 62599047711fe17d825e1653 |
class mail_message(osv.Model): <NEW_LINE> <INDENT> _inherit = 'mail.message' <NEW_LINE> _columns = { 'email_to':fields.text('Email To'), 'email_cc':fields.char('Email cc', size=240), } <NEW_LINE> def _notify(self, cr, uid, newid, context=None): <NEW_LINE> <INDENT> notification_obj = self.pool.get('mail.notification') <... | Messages model: system notification (replacing res.log notifications),
comments (OpenChatter discussion) and incoming emails. | 62599047d6c5a102081e3487 |
class Addresses2(object): <NEW_LINE> <INDENT> swagger_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.discriminator = None <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in six.iteritems(self.swagger_types): <NEW_LINE> <IN... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62599047498bea3a75a58e8a |
class CapabilityUpdate(ManagedObject): <NEW_LINE> <INDENT> consts = CapabilityUpdateConsts() <NEW_LINE> naming_props = set(['version']) <NEW_LINE> mo_meta = MoMeta("CapabilityUpdate", "capabilityUpdate", "update-[version]", VersionMeta.Version131c, "InputOutput", 0x3f, [], ["admin"], ['capabilityEp'], [], ["Get"]) <NEW... | This is CapabilityUpdate class. | 6259904782261d6c5273087b |
class GMPYRationalField(RationalField): <NEW_LINE> <INDENT> dtype = GMPYRational <NEW_LINE> zero = dtype(0) <NEW_LINE> one = dtype(1) <NEW_LINE> alias = 'QQ_gmpy' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def to_sympy(self, a): <NEW_LINE> <INDENT> return SymPyRational(int(gmpy_numer(a)... | Rational field based on GMPY mpq class. | 62599047d10714528d69f043 |
class _CustomTexts(Model): <NEW_LINE> <INDENT> __tablename__ = 'customtexts' <NEW_LINE> id = Column(UnicodeText(36), primary_key=True, default=uuid4) <NEW_LINE> tid = Column(Integer, default=1, nullable=False) <NEW_LINE> lang = Column(UnicodeText(5), primary_key=True) <NEW_LINE> texts = Column(JSON, default=dict, nulla... | Class used to implement custom texts | 6259904710dbd63aa1c71f46 |
class GeoManager(Manager): <NEW_LINE> <INDENT> def get_query_set(self): <NEW_LINE> <INDENT> return GeoQuerySet(model=self.model) <NEW_LINE> <DEDENT> def area(self, *args, **kwargs): <NEW_LINE> <INDENT> return self.get_query_set().area(*args, **kwargs) <NEW_LINE> <DEDENT> def centroid(self, *args, **kwargs): <NEW_LINE> ... | Overrides Manager to return Geographic QuerySets. | 6259904726068e7796d4dcb3 |
class ParsingCheckError(ParsingError): <NEW_LINE> <INDENT> pass | Exception raised when a builtin check_*() function fails. | 6259904716aa5153ce40185a |
class DatasetDeflateCompression(DatasetCompression): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, } <NEW_LINE> _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'}, 'level': {'key': 'level', 'type': 'str'}, } <NEW_LINE> def __init__(self,... | The Deflate compression method used on a dataset.
:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param type: Constant filled by server.
:type type: str
:param level: The Deflate compression level. Possible values inc... | 6259904745492302aabfd83e |
class MarkForumsReadView(TemplateView): <NEW_LINE> <INDENT> success_message = _('Forums have been marked read.') <NEW_LINE> template_name = 'forum_tracking/mark_forums_read.html' <NEW_LINE> @method_decorator(login_required) <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return super(MarkFo... | Marks a set of forums as read. | 62599047379a373c97d9a397 |
class LaberintoADT: <NEW_LINE> <INDENT> def __init__(self, rens, cols, pasillos): <NEW_LINE> <INDENT> self.__laberinto = Array2D(rens, cols, '1') <NEW_LINE> for a in pasillos: <NEW_LINE> <INDENT> self.__laberinto.set_item(a[0], a[1], '0') <NEW_LINE> <DEDENT> <DEDENT> def to_string(self): <NEW_LINE> <INDENT> self.__labe... | 0 Pasillo, 1 Pared, S Salida y E entrada
pasillos es una tupla con coordenadas | 62599047711fe17d825e1654 |
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> print_symbol = '#' <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> if type(height) != int: <NEW_LINE> <INDENT> raise TypeError("height must be an integer") <NEW_LINE> <DEDENT> if height < 0: <NEW_LINE> <INDENT> raise ValueErro... | Initializing the Rectangle class
| 6259904723e79379d538d86b |
class DawgBuilder(object): <NEW_LINE> <INDENT> def __init__(self, reduced=True, field_root=False): <NEW_LINE> <INDENT> self._reduced = reduced <NEW_LINE> self._field_root = field_root <NEW_LINE> self.lastword = None <NEW_LINE> self.unchecked = [] <NEW_LINE> self.minimized = {} <NEW_LINE> self.root = BuildNode() <NEW_LI... | Class for building a graph from scratch.
>>> db = DawgBuilder()
>>> db.insert(u"alfa")
>>> db.insert(u"bravo")
>>> db.write(dbfile)
This class does not have the cleanest API, because it was cobbled together
to support the spelling correction system. | 625990470a366e3fb87ddd53 |
class GenericArrayCoderImpl(FieldCoderImpl): <NEW_LINE> <INDENT> def __init__(self, elem_coder: FieldCoderImpl): <NEW_LINE> <INDENT> self._elem_coder = elem_coder <NEW_LINE> <DEDENT> def encode_to_stream(self, value, out_stream): <NEW_LINE> <INDENT> out_stream.write_int32(len(value)) <NEW_LINE> for elem in value: <NEW_... | A coder for object array value (the element of array could be any kind of Python object). | 62599047004d5f362081f99d |
class DataprocProjectsLocationsAutoscalingPoliciesDeleteRequest(_messages.Message): <NEW_LINE> <INDENT> name = _messages.StringField(1, required=True) | A DataprocProjectsLocationsAutoscalingPoliciesDeleteRequest object.
Fields:
name: Required. The "resource name" of the autoscaling policy, as
described in https://cloud.google.com/apis/design/resource_names of the
form
projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}. | 62599047d53ae8145f9197cd |
class IptablesAuth(models.Model): <NEW_LINE> <INDENT> user = models.CharField(u'用户名', unique=True, max_length=32) <NEW_LINE> ip = models.CharField(u'ip地址', max_length=32) <NEW_LINE> p_key = models.CharField(u'私钥', max_length=32) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "iptables用户验证" <NEW_LINE> ... | iptables登陆验证 | 62599047462c4b4f79dbcd6c |
@implementer(IBodyProducer) <NEW_LINE> class BytesProducer(object): <NEW_LINE> <INDENT> def __init__(self, body): <NEW_LINE> <INDENT> self.body = body if body != None else b"" <NEW_LINE> self.length = len(self.body) <NEW_LINE> <DEDENT> def startProducing(self, consumer): <NEW_LINE> <INDENT> consumer.write(self.body) <N... | 生成http请求的body部分 | 625990473eb6a72ae038b9c8 |
class vernier(pya.PCellDeclarationHelper): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(vernier, self).__init__() <NEW_LINE> self.param("layer", self.TypeLayer, "Layer", default = pya.LayerInfo(1, 0)) <NEW_LINE> self.param("width", self.TypeDouble, "Width [um]", default = 4) <NEW_LINE> self.param("... | Generates a vernier scale pattern
Parameters
---------
layer : from interface
The layer and datatype for the patterns
width : from interface
The width of each tick mark
length : from interface
The length of the central tick mark
pitch : from interface
The distance between neighboring tick mar... | 6259904773bcbd0ca4bcb5fb |
class FeaturedSpeakerForm(messages.Message): <NEW_LINE> <INDENT> name = messages.StringField(1) <NEW_LINE> sessions = messages.StringField(2, repeated=True) | outbound Form containing fields for Speaker name
and corresponding Session names | 625990478da39b475be0455e |
class CDMIContainer(object): <NEW_LINE> <INDENT> def __init__(self, drastic_container, api_root): <NEW_LINE> <INDENT> self.collection = drastic_container <NEW_LINE> self.api_root = api_root <NEW_LINE> <DEDENT> def get_capabilitiesURI(self): <NEW_LINE> <INDENT> return (u'{0}/cdmi_capabilities/container{1}' ''.format(sel... | Wrapper to return CDMI fields from a Drastic Collection | 62599047379a373c97d9a399 |
class TreeDragWidget(QtGui.QTreeWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(TreeDragWidget, self).__init__(parent) <NEW_LINE> self.setDragEnabled(True) <NEW_LINE> self.setDropIndicatorShown(True) <NEW_LINE> self.setDragDropMode(QtGui.QAbstractItemView.DragOnly) <NEW_LINE> <DE... | Extends QtGui.QTreeWidget and lets it use drag and drop. | 62599047e76e3b2f99fd9d7a |
class SkillsField(ArrayField): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('base_field', models.CharField(max_length=30, blank=False)) <NEW_LINE> kwargs.setdefault('blank', True) <NEW_LINE> kwargs.setdefault('default', list) <NEW_LINE> super().__init__(*args, **kwargs) | ArrayField subclass to be used for saving skills under Seeker. Requires Postgres database. | 6259904729b78933be26aa7a |
class Square(Marker): <NEW_LINE> <INDENT> __example__ = "tests/glyphs/Square.py" | Render a square marker, optionally rotated. | 6259904723e79379d538d86d |
class IndexType(IntEnum): <NEW_LINE> <INDENT> VARIABLE = 1 <NEW_LINE> FORCED_INPUT = 2 <NEW_LINE> NONE = 3 | Represents the type of an index, can be either a index to state variables,
forced inputs or no index. | 6259904782261d6c5273087d |
class CatalogClass: <NEW_LINE> <INDENT> x1 = 'x1' <NEW_LINE> x2 = 'x2' <NEW_LINE> def __init__(self, param): <NEW_LINE> <INDENT> if param in self._class_method_choices: <NEW_LINE> <INDENT> self.param = param <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError(f'Invalid Value for Param: {param}') <NEW_LINE> <... | 第三种: 调用时更麻烦一点, 而且还要 @classmethod 修饰 | 625990478a43f66fc4bf3504 |
class GrossShippingMethodPriceCalculator(ShippingMethodPriceCalculator): <NEW_LINE> <INDENT> def get_price_net(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self.shipping_method.price / ((100 + self.shipping_method.tax.rate) / 100) <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> return self.... | ShippingMethodPriceCalculator which considers the entered price as gross
price.
See lfs.plugins.ShippingMethodPriceCalculator | 625990470fa83653e46f624c |
class Content(models.Model): <NEW_LINE> <INDENT> code = models.CharField(max_length=30, ) <NEW_LINE> name = models.CharField(max_length=70, blank=True, null=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Matière' <NEW_LINE> ordering = ['code', 'name'] <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LI... | Matières d'enseignement | 625990476fece00bbacccd25 |
class SphinxDocsBuilder: <NEW_LINE> <INDENT> def __init__(self, html_output_dir, is_release=True): <NEW_LINE> <INDENT> self.documented_modules = self._get_module_names_from_index_rst() <NEW_LINE> self.python_api_output_dir = "python_api" <NEW_LINE> self.html_output_dir = html_output_dir <NEW_LINE> self.is_release = is_... | SphinxDocsBuilder calls Python api docs generation and then calls
sphinx-build:
(1) The user call `make *` (e.g. `make html`) gets forwarded to make.py
(2) Calls PyAPIDocsBuilder to generate Python api docs rst files
(3) Calls `sphinx-build` with the user argument | 62599047cad5886f8bdc5a36 |
class SignupForm(UserCreationForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('username', 'email') <NEW_LINE> <DEDENT> def clean_username(self): <NEW_LINE> <INDENT> username = self.cleaned_data.get('username') <NEW_LINE> if not username: <NEW_LINE> <INDENT> raise ... | Form for registering a new user userprofile. | 625990478e71fb1e983bce3f |
class TestSubmission(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> right_answers_number = models.IntegerField(null=True) <NEW_LINE> date_submission = models.DateTimeField(null=False) <NEW_LINE> test = models.ForeignKey(Test, on_delete=models.CASCADE, null=False, related_name="tes... | Passed test model class. | 6259904726238365f5fadecc |
class BinHumanBytes(HumanBytes): <NEW_LINE> <INDENT> def __init__(self,formatter=None): <NEW_LINE> <INDENT> super(self.__class__,self).__init__(1024,( 'B','KB','MB','GB','TB','PB','EB','ZB','YB' ),formatter=formatter) <NEW_LINE> <DEDENT> def format(self,val,formatter=None): <NEW_LINE> <INDENT> if formatter==None: <NEW_... | BinHumanBytes instances use a divisor of 10**3 to express a given
number of bytes in a form easy for humans to interpret. These are the
available units:
B
KB
MB
GB
TB
PB
EB
ZB
YB | 6259904707f4c71912bb07a3 |
class Authentication(object): <NEW_LINE> <INDENT> def is_authenticated(self, request): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def challenge_headers(self): <NEW_LINE> <INDENT> raise NotImplementedError | Authentication interface | 6259904715baa72349463301 |
class IFunction(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'name', None, None, ), (2, TType.STRING, 'code', None, None, ), ) <NEW_LINE> def __init__(self, name=None, code=None,): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.code = code <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LI... | Attributes:
- name
- code | 6259904723849d37ff85242d |
class _xSEEntryPLGN(_ChunkEntry, _Dumpable, _Remappable): <NEW_LINE> <INDENT> __slots__ = ('mod_index', 'light_index', 'mod_name') <NEW_LINE> def __init__(self, ins): <NEW_LINE> <INDENT> self.mod_index = unpack_byte(ins) <NEW_LINE> if self.mod_index == 0xFE: <NEW_LINE> <INDENT> self.light_index = unpack_short(ins) <NEW... | A single PLGN entry. A PLGN chunk contains several of these. | 62599047d4950a0f3b1117fa |
class Deck: <NEW_LINE> <INDENT> def __init__(self, dead_cards: Iterable=None): <NEW_LINE> <INDENT> self.cards = [Card(rank, suit) for rank in range(2, 15) for suit in range(1, 5)] <NEW_LINE> if dead_cards: <NEW_LINE> <INDENT> self.remove_cards(dead_cards) <NEW_LINE> <DEDENT> <DEDENT> def __getitem__(self, item): <NEW_L... | Class representing a standard deck | 6259904745492302aabfd842 |
class User(Base): <NEW_LINE> <INDENT> __tablename__ = 'user' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(80), nullable=False) <NEW_LINE> email = Column(String(250), nullable=False) <NEW_LINE> picture = Column(String(250)) <NEW_LINE> @property <NEW_LINE> def serialize(self): <NEW_LI... | Logged in users information will be stored in user table in db | 6259904716aa5153ce40185e |
class AESCipher(object): <NEW_LINE> <INDENT> def __init__(self, key,bs): <NEW_LINE> <INDENT> self.bs = bs <NEW_LINE> self.key = key <NEW_LINE> <DEDENT> def encrypt(self, raw): <NEW_LINE> <INDENT> raw = self._pad(raw) <NEW_LINE> iv = Random.new().read(AES.block_size) <NEW_LINE> cipher = AES.new(self.key, AES.MODE_CBC, i... | - AESCipher is responsible for the management and initilization of the AES encryption process.
- It contains methods to perform encryption decryption as well as padding.
- key management to be done | 6259904730c21e258be99b77 |
class x_wmi_authentication (x_wmi): <NEW_LINE> <INDENT> pass | Raised when an invalid combination of authentication properties is attempted when connecting | 62599047ec188e330fdf9c0d |
class LabPair(Tkinter.Frame): <NEW_LINE> <INDENT> def __init__(self, master, deflist, name, **kw): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.default = kw.get('default') <NEW_LINE> self.hide = kw.get('hide') <NEW_LINE> label = kw.get('label', string.upper(name[:1]) + name[1:]) <NEW_LINE> self.label = Tkinter.... | Create a label/value pair for HDL with description LABEL. | 625990478e05c05ec3f6f813 |
class SeverityLevel(object): <NEW_LINE> <INDENT> verbose = 0 <NEW_LINE> information = 1 <NEW_LINE> warning = 2 <NEW_LINE> error = 3 <NEW_LINE> critical = 4 | Data contract class for type SeverityLevel. | 62599047dc8b845886d5492c |
class ViewsTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_page_redirects_when_not_logged_in(self): <NEW_LINE> <INDENT> with shoppinglister.app.test_request_context(): <NEW_LINE> <INDENT> self.assertEqual( shoppinglister.views.shopping_list().status_code, 302) <NEW_LINE> self.assertEqual(shoppinglister.views.sho... | Contains tests for the views | 62599047e64d504609df9d89 |
class TreeViewCustomGui(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def IsFocusItem(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def MakeVisible(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Refresh(sel... | TreeView gadget - Dialog element. | 6259904771ff763f4b5e8b15 |
class LCDCheckBox(urwid.CheckBox): <NEW_LINE> <INDENT> states = { True: urwid.SelectableIcon('\xd0'), False: urwid.SelectableIcon('\x05'), } <NEW_LINE> reserve_columns = 1 | A check box+label that uses only one character for the check box,
including custom CGRAM character | 625990471f5feb6acb163f67 |
class SKU(BaseModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=50, verbose_name='名称') <NEW_LINE> caption = models.CharField(max_length=100, verbose_name='副标题') <NEW_LINE> spu = models.ForeignKey(SPU, related_name='skus', on_delete=models.CASCADE, verbose_name='商品') <NEW_LINE> category = models.ForeignKey(... | 商品SKU | 625990476fece00bbacccd27 |
class ZkRenumberHeadingsCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> current_level = 0 <NEW_LINE> levels = [0] * 6 <NEW_LINE> regions_to_skip = 0 <NEW_LINE> while True: <NEW_LINE> <INDENT> h_regions = self.view.find_by_selector('markup.heading.markdown') <NEW_LINE> h... | Re-number headings of the current note. | 6259904715baa72349463302 |
class OraSegment(OraObject): <NEW_LINE> <INDENT> def getTablespace(self, db): <NEW_LINE> <INDENT> raise PysqlNotImplemented() | Father of tables and indexes | 62599047596a897236128f68 |
class PageEditSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> raw = serializers.CharField() <NEW_LINE> message = serializers.CharField(write_only=True) <NEW_LINE> extra_data = serializers.SerializerMethodField() <NEW_LINE> def get_extra_data(self, page): <NEW_LINE> <INDENT> form_extra_data = {} ... | Serializer Class to edit a Page. | 62599047a8ecb03325872583 |
class PyPickleshare(PythonPackage): <NEW_LINE> <INDENT> pypi = "pickleshare/pickleshare-0.7.4.tar.gz" <NEW_LINE> version('0.7.5', sha256='87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca') <NEW_LINE> version('0.7.4', sha256='84a9257227dfdd6fe1b4be1319096c20eb85ff1e82c7932f36efccfe1b09737b') <NEW_LINE> d... | Tiny 'shelve'-like database with concurrency support | 62599047435de62698e9d177 |
class TestRemovePermissions(unittest.TestCase): <NEW_LINE> <INDENT> layer = FTW_PERMISSIONMGR_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> portal = self.layer['portal'] <NEW_LINE> portal.portal_membership.setLocalRoles( obj=portal.folder1, member_ids=[TEST_USER_ID], member_role="Contributor", rei... | Sharing is well tested by Plone, so just our customized methods | 6259904707f4c71912bb07a5 |
class CPWWigglesByArea: <NEW_LINE> <INDENT> def __init__(self, structure, length, width, start_up=True, radius=None, pinw=None, gapw=None): <NEW_LINE> <INDENT> s = structure <NEW_LINE> if pinw is None: <NEW_LINE> <INDENT> pinw = s.__dict__['pinw'] <NEW_LINE> <DEDENT> if gapw is None: <NEW_LINE> <INDENT> gapw = s.__dict... | CPW Wiggles which fill an area specified by (length,width) | 6259904791af0d3eaad3b197 |
class DistanceMap: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self._map = data <NEW_LINE> <DEDENT> def get_distance(self, start_city, end_city): <NEW_LINE> <INDENT> return self._map.get((start_city, end_city)) | store the distances between cities present in the map data file
=== private attribues ===
@type _map: {(str,str),int}
Map the start city and end city to the distance from start city to end city
=== repersation invariants ===
the data must contain atleast two cities | 6259904745492302aabfd844 |
class RequestTypeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = RequestType.objects.all().order_by('id') <NEW_LINE> serializer_class = RequestTypeSerializer | API для типов заявки | 6259904730c21e258be99b79 |
class Solution: <NEW_LINE> <INDENT> def isInterleave(self, s1, s2, s3): <NEW_LINE> <INDENT> if len(s1) + len(s2) != len(s3): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> i1 = 0 <NEW_LINE> i2 = 0 <NEW_LINE> i = 0 <NEW_LINE> while i < len(s3): <NEW_LINE> <INDENT> ch = s3[i] <NEW_LINE> if i1 < len(s1) and i2 < len... | @params s1, s2, s3: Three strings as description.
@return: return True if s3 is formed by the interleaving of
s1 and s2 or False if not.
@hint: you can use [[True] * m for i in range (n)] to allocate a n*m matrix. | 62599047e76e3b2f99fd9d7e |
class LluviaField(ConPerfilMixin, serializers.Field): <NEW_LINE> <INDENT> def to_representation(self, value): <NEW_LINE> <INDENT> return lluvia_para_api(self.perfil, value) <NEW_LINE> <DEDENT> def to_internal_value(self, data): <NEW_LINE> <INDENT> return lluvia_desde_api(self.perfil, data) | Campo para el manejo de los datos de lluvia | 6259904745492302aabfd845 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.