code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@inside_glslc_testsuite('SpirvAssembly') <NEW_LINE> class TestEmptyAssemblyFile(expect.ValidObjectFile): <NEW_LINE> <INDENT> shader = FileShader('', '.spvasm') <NEW_LINE> glslc_args = ['-c', shader] | Tests that glslc accepts an empty assembly file. | 62598faceab8aa0e5d30bd50 |
class UdimIntAdapter(object): <NEW_LINE> <INDENT> def __init__(self, value, width=10): <NEW_LINE> <INDENT> super(UdimIntAdapter, self).__init__() <NEW_LINE> self.value = value <NEW_LINE> self.width = width <NEW_LINE> <DEDENT> def __iadd__(self, value): <NEW_LINE> <INDENT> if not isinstance(value, int): <NEW_LINE> <INDE... | A class that will make dealing with 1D/2D UDIM indexes less painful. | 62598fac498bea3a75a57ae2 |
class PostgreSQLDatabase(Database): <NEW_LINE> <INDENT> query_cls = PostgreSQLQuery <NEW_LINE> def __init__( self, host="localhost", port=5432, database=None, user=None, password=None, **kwags ): <NEW_LINE> <INDENT> super(PostgreSQLDatabase, self).__init__(host, port, database, **kwags) <NEW_LINE> self.user = user <NEW... | PostgreSQL client that uses the psycopg module. | 62598fac32920d7e50bc6019 |
class StudentsFetch(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def get(self, username): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> student_details = fetch_student.find_all_student(username) <NEW_LINE> return get_response(data=student_details, code=201) <NEW_LINE> <DEDENT> except Exception as e: <NEW_LINE... | To fetch all the students details
only by admin | 62598fac4527f215b58e9ea5 |
class OntologyWordListView(ListAPIView): <NEW_LINE> <INDENT> permission_classes = [AllowAny] <NEW_LINE> queryset = OntologyWord.objects.all() <NEW_LINE> serializer_class = OntologyWordSerializer <NEW_LINE> pagination_class = None | Returns a collection of ontology words instances. | 62598faca17c0f6771d5c1fa |
class LegalHoldProperties(Model): <NEW_LINE> <INDENT> _validation = { 'has_legal_hold': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, 'tags': {'key': 'tags', 'type': '[TagProperty]'}, } <NEW_LINE> def __init__(self, *, tags=None, **kwargs) -> None: <NEW_L... | The LegalHold property of a blob container.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar has_legal_hold: The hasLegalHold public property is set to true by
SRP if there are at least one existing tag. The hasLegalHold public
property is set to false by SRP if all exis... | 62598fac3d592f4c4edbae90 |
class SheetItemTimeline(generics.ListAPIView): <NEW_LINE> <INDENT> def get(self, request, entity_pk, *args, **kwargs): <NEW_LINE> <INDENT> nodes = self.request.QUERY_PARAMS.get('nodes', None) <NEW_LINE> if nodes: <NEW_LINE> <INDENT> nodes = [int(node_id) for node_id in nodes.split(',')] <NEW_LINE> <DEDENT> else: <NEW_L... | API endpoint that retrieves a timeline of sheet items.
The timeline is created according to the given entity, node(s) | 62598fac6aa9bd52df0d4e8c |
class OMAttribution(OMCompoundElement, CompoundAttributes): <NEW_LINE> <INDENT> _fields = ['pairs', 'obj', 'id', 'cdbase'] | An OpenMath Attribution Object. | 62598fac3539df3088ecc277 |
class __Proxy(cls, metaclass=Meta, class_name=cls.__name__, logger=logger): <NEW_LINE> <INDENT> pass | Proxy class required for proper interception. | 62598fac38b623060ffa905e |
class Site(object): <NEW_LINE> <INDENT> def __init__(self, position, occupant="", occ_alias="", charge=None): <NEW_LINE> <INDENT> self.occupant = occupant <NEW_LINE> self.occ_alias = occ_alias <NEW_LINE> self.charge = charge <NEW_LINE> self.position = position <NEW_LINE> try: <NEW_LINE> <INDENT> _, _, _ = [float(x) for... | Site in a basis.
Contains:
self.occupant = CASM specie name, empty string by default
self.occ_alias = alias (atom file) name, empty string by default
self.position = vec of float
self.charge = charge at this coordinate | 62598fac99fddb7c1ca62dcb |
class Soubor(object): <NEW_LINE> <INDENT> csv_adresář = os.path.join(os.path.dirname(__file__), 'experts/files/talasnica/python') <NEW_LINE> def __init__(self, jméno): <NEW_LINE> <INDENT> self.encoding = encoding <NEW_LINE> csv_adresář = self.csv_adresář <NEW_LINE> for adresář in symbol.replace('.', '_'), JMÉNO_GRAF... | zapíše do souboru | 62598fac0c0af96317c56347 |
class Multiply(object): <NEW_LINE> <INDENT> def __init__(self, value=1.0): <NEW_LINE> <INDENT> if value < 0.0: <NEW_LINE> <INDENT> raise TypeError('The video is blacked out since for value < 0.0') <NEW_LINE> <DEDENT> self.value = value <NEW_LINE> <DEDENT> def __call__(self, clip): <NEW_LINE> <INDENT> is_PIL = isinstanc... | Multiply all pixel intensities with given value.
This augmenter can be used to make images lighter or darker.
Args:
value (float): The value with which to multiply the pixel intensities
of video. | 62598fac71ff763f4b5e7734 |
class SugarActivityCheckBase(CheckBase): <NEW_LINE> <INDENT> def __init__(self, base): <NEW_LINE> <INDENT> CheckBase.__init__(self, base, __file__) | Common base class for sugar checks. | 62598fac56ac1b37e63021b0 |
class User(AbstractUser): <NEW_LINE> <INDENT> USER_TYPE_CHOICES = ( ('admin' , 'Administrator'), ('parent' , 'Parent' ), ('student', 'Student' ), ) <NEW_LINE> user_type = models.CharField('User Type', max_length=16, editable=False, choices=USER_TYPE_CHOICES, default='admin') <NEW_LINE> def save(self, force_... | A parent profile has a foreign key relationship to:
* a list of students | 62598fac63d6d428bbee2770 |
class Content(urwid.ListBox): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.header = HeaderWidget() <NEW_LINE> self.keywords = KeywordsWidget() <NEW_LINE> self.record_body = BodyWidget() <NEW_LINE> super(Content, self).__init__( body=urwid.SimpleFocusListWalker([ self.header, urwid.Divider('-'), self... | Container to hold header, keywords, and body widgets | 62598fac10dbd63aa1c70b78 |
class PushConf(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._registries = { "docker": [], "pulp": {}, } <NEW_LINE> <DEDENT> def add_docker_registry(self, registry_uri, insecure=False): <NEW_LINE> <INDENT> if registry_uri is None: <NEW_LINE> <INDENT> raise RuntimeError("registry URI cannot b... | configuration of remote registries: docker-registry or pulp | 62598fac7d847024c075c388 |
class TestTask(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return Task( class_ref = airflow_... | Task unit test stubs | 62598fac56b00c62f0fb287a |
class Board(object): <NEW_LINE> <INDENT> def __init__(self, tiles): <NEW_LINE> <INDENT> self.goal = [1,2,3,4,5,6,7,8,"x"] <NEW_LINE> self.tiles = tiles <NEW_LINE> <DEDENT> def is_goal(self): <NEW_LINE> <INDENT> if self.tiles==self.goal: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return False <NEW_LINE> <DEDENT... | Esta classe representa uma configuração do tabuleiro do
quebra-cabeça. O tabuleiro é um estado no problema de busca.
O tabuleiro tem 9 posições (em inglês tiles), sendo 8 posições dedicadas
aos números de 1 até 8 e uma posição especial "x" que representa a posição
vazia.
O tabuleiro é representado de forma linear, po... | 62598fac4a966d76dd5eeea6 |
class RetailerBusinessCreateSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> bank_details = RetailerBankDetailsSerializer(read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = RetailerBusiness <NEW_LINE> fields = ('id', 'retailer_id', 'name', 'address1', 'address2', 'postcode', 'town', 'unique_... | serializer to create Retailer business | 62598fac283ffb24f3cf3852 |
class Solution: <NEW_LINE> <INDENT> def binaryTreePaths(self, root): <NEW_LINE> <INDENT> res = [] <NEW_LINE> if not root: <NEW_LINE> <INDENT> return res <NEW_LINE> <DEDENT> if not root.left and not root.right: <NEW_LINE> <INDENT> res.append(str(root.val)) <NEW_LINE> return res <NEW_LINE> <DEDENT> leftS = self.binaryTre... | @param: root: the root of the binary tree
@return: all root-to-leaf paths | 62598fac3317a56b869be52d |
class Exciter(GroupBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.common_params.extend(('syn',)) <NEW_LINE> self.common_vars.extend(('vout', 'vi',)) <NEW_LINE> self.VoltComp = BackRef() <NEW_LINE> self.PSS = BackRef() | Exciter group for synchronous generators. | 62598fac5fcc89381b26612f |
class NoAliasingCompensation(AliasingCompensation): <NEW_LINE> <INDENT> def __init__(self, input_signal=None, maximum_harmonics=1): <NEW_LINE> <INDENT> AliasingCompensation.__init__(self, input_signal=input_signal, maximum_harmonics=maximum_harmonics) <NEW_LINE> <DEDENT> def CreateModified(self, input_signal=None, maxi... | A class which acts as a pass through of signals. | 62598face5267d203ee6b8d0 |
class OpenProducer(Open): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> Open.__init__(self, name, constants.FLAG_OPEN_PRODUCER) | Open producer spec | 62598facac7a0e7691f724cf |
class File(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'files' <NEW_LINE> id = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> path = db.Column(db.String(200)) <NEW_LINE> uploaded_on = db.Column(db.DateTime) <NEW_LINE> incident_id = db.Column(db.Integer, db.ForeignKey('incidents.id')) <NEW_LIN... | Model for files storage paths | 62598fac460517430c432040 |
class LoopGC(VM): <NEW_LINE> <INDENT> def __init__(self, nodes, thunks, pre_call_clear, post_thunk_clear): <NEW_LINE> <INDENT> super(LoopGC, self).__init__(nodes, thunks, pre_call_clear) <NEW_LINE> self.post_thunk_clear = post_thunk_clear <NEW_LINE> self.allow_gc = True <NEW_LINE> if not (len(nodes) == len(thunks) == l... | Unconditional start-to-finish program execution in Python.
Garbage collection is possible on intermediate results. | 62598fac9c8ee82313040154 |
class CharacterExtraction: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__image_matrix = 0 <NEW_LINE> self.__image_name = "" <NEW_LINE> self.__image_height = 0 <NEW_LINE> self.__image_width = 0 <NEW_LINE> self.__image_list = [] <NEW_LINE> <DEDENT> def split_image(self, image_object): <NEW_LINE> <IND... | Add the class description here | 62598fac7b25080760ed7475 |
class add_header_redefinition(Plugin): <NEW_LINE> <INDENT> summary = 'Nested "add_header" drops parent headers.' <NEW_LINE> severity = gixy.severity.MEDIUM <NEW_LINE> description = ('"add_header" replaces ALL parent headers. ' 'See documentation: http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header') <... | Insecure example:
server {
add_header X-Content-Type-Options nosniff;
location / {
add_header X-Frame-Options DENY;
}
} | 62598fac2c8b7c6e89bd378b |
class activity(AbstractedFileStructureElement): <NEW_LINE> <INDENT> campus: "wuecampus" <NEW_LINE> course_: "course" <NEW_LINE> section_: "section" <NEW_LINE> title: str <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> return normalized(self.title) | Activity management class. | 62598fac67a9b606de545f93 |
class Add1(AvocadoTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test(self): <NEW_LINE> <INDENT> pass | :avocado: enable | 62598facfff4ab517ebcd7ab |
class XTCReader(XDRBaseReader): <NEW_LINE> <INDENT> format = 'XTC' <NEW_LINE> units = {'time': 'ps', 'length': 'nm'} <NEW_LINE> _writer = XTCWriter <NEW_LINE> _file = XTCFile <NEW_LINE> def _frame_to_ts(self, frame, ts): <NEW_LINE> <INDENT> ts.frame = self._frame <NEW_LINE> ts.time = frame.time <NEW_LINE> ts.data['step... | XTC is a compressed trajectory format from Gromacs. The trajectory is saved
with reduced precision (3 decimal places) compared to other lossless
formarts like TRR and DCD. The main advantage of XTC files is that they
require significantly less disk space and the loss of precision is usually
not a problem.
Notes
-----
... | 62598facbaa26c4b54d4f279 |
class ApplicationGatewayListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ApplicationGateway]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ApplicationGatewayListResult, self).__... | Response for ListApplicationGateways API service call.
:param value: List of an application gateways in a resource group.
:type value: list[~azure.mgmt.network.v2020_08_01.models.ApplicationGateway]
:param next_link: URL to get the next set of results.
:type next_link: str | 62598faca8370b77170f03a2 |
class ProgressBar(RemoteProgress): <NEW_LINE> <INDENT> class Action(Enum): <NEW_LINE> <INDENT> PULL = 1 <NEW_LINE> PUSH = 2 <NEW_LINE> <DEDENT> def setup(self, repo_name, action=Action.PULL): <NEW_LINE> <INDENT> if action == ProgressBar.Action.PULL: <NEW_LINE> <INDENT> message = 'Pulling from {}'.format(repo_name) <NEW... | Nice looking progress bar for long running commands | 62598fac21bff66bcd722c2d |
class User(Base): <NEW_LINE> <INDENT> __tablename__ = 'user' <NEW_LINE> id = sa.Column(sa.String(36), primary_key=True) <NEW_LINE> first_name = sa.Column(sa.Text) <NEW_LINE> last_name = sa.Column(sa.Text) <NEW_LINE> gender = sa.Column(sa.Text) <NEW_LINE> email = sa.Column(sa.Text) <NEW_LINE> birthdate = sa.Column(sa.Te... | Описывает структуру таблицы user, содержащую данные о пользователях | 62598fac01c39578d7f12d46 |
class TestMasterUI(RWTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(type(self), TestMasterUI).setUp(self) <NEW_LINE> self.masterui = mommy.make('rw.MasterUI') <NEW_LINE> self.other_uimode = mommy.make('rw.UIMode') <NEW_LINE> self.project = self.masterui.project <NEW_LINE> <DEDENT> @use_locmem... | exercise MasterUI model class | 62598fac8e7ae83300ee9069 |
class SpellingPropertiesDialog(QDialog, Ui_SpellingPropertiesDialog): <NEW_LINE> <INDENT> def __init__(self, project, new, parent): <NEW_LINE> <INDENT> QDialog.__init__(self, parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.project = project <NEW_LINE> self.parent = parent <NEW_LINE> self.pwlCompleter = E4FileComp... | Class implementing the Spelling Properties dialog. | 62598fac3346ee7daa33762c |
class _CompleterModel(QAbstractItemModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> QAbstractItemModel.__init__(self) <NEW_LINE> self.completer = None <NEW_LINE> <DEDENT> def index(self, row, column, parent): <NEW_LINE> <INDENT> return self.createIndex(row, column) <NEW_LINE> <DEDENT> def parent(self... | QAbstractItemModel implementation.
Adapter between complex and not intuitive QAbstractItemModel interface
and simple AbstractCompleter interface.
Provides data for TreeView with completions and information | 62598fac0c0af96317c56349 |
class TestDataIntegrationsApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = openlattice.api.data_integrations_api.DataIntegrationsApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_entity_key_ids(self): <NEW_LINE> <INDENT> pa... | DataIntegrationsApi unit test stubs | 62598fac10dbd63aa1c70b7a |
class SearchFacultyBusiness(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> user = users.get_current_user() <NEW_LINE> query = db.GqlQuery("SELECT * from CountReviews") <NEW_LINE> if user: <NEW_LINE> <INDENT> template_values = { 'user_mail': users.get_current_user().email(), 'logout': us... | Display search page | 62598fac7d847024c075c38a |
class Comment(models.Model): <NEW_LINE> <INDENT> author = models.CharField(max_length=80) <NEW_LINE> email = models.EmailField() <NEW_LINE> text = models.CharField(max_length=160) <NEW_LINE> commented = models.DateTimeField(default=timezone.now) <NEW_LINE> event = models.ForeignKey(Event, on_delete=models.CASCADE, rela... | "Comentário efetuados em um determinado evento. | 62598faca79ad1619776a02d |
class Br(SelfClosingTag): <NEW_LINE> <INDENT> tag = "br" | Class that changes the closing tag to breaks | 62598fac66673b3332c30393 |
class ModelFactory(object): <NEW_LINE> <INDENT> models = dict() <NEW_LINE> loaders = dict() <NEW_LINE> @staticmethod <NEW_LINE> def get_model(name, params): <NEW_LINE> <INDENT> return ModelFactory.models[name](params) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def load_model(name, files, params): <NEW_LINE> <INDENT> ... | A factory class for managing the model loaders and builder.
Loaders and builders can be registered and then they can get used
by the with_model_loader or with_model_builder decorators.
| 62598face1aae11d1e7ce807 |
class CompatLogCaptureFixture(LogCaptureFixture): <NEW_LINE> <INDENT> def _warn_compat(self, old, new): <NEW_LINE> <INDENT> self._item.warn(code='L1', message=("{0} is deprecated, use {1} instead" .format(old, new))) <NEW_LINE> <DEDENT> @CallableStr.compat_property <NEW_LINE> def text(self): <NEW_LINE> <INDENT> return ... | Backward compatibility with pytest-capturelog. | 62598fac4a966d76dd5eeea8 |
class Catalog(Updateable, Pretty): <NEW_LINE> <INDENT> pretty_attrs = ['name', 'items'] <NEW_LINE> def __init__(self, name=None, description=None, items=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.items = items <NEW_LINE> <DEDENT> def create(self): <NEW_LINE> <I... | Represents a Catalog | 62598fac3317a56b869be52e |
class Resize(object): <NEW_LINE> <INDENT> def __init__(self, target_shape, correct_box = False): <NEW_LINE> <INDENT> self.h_target, self.w_target = target_shape <NEW_LINE> self.correct_box = correct_box <NEW_LINE> <DEDENT> def __call__(self, img, bboxes = None): <NEW_LINE> <INDENT> h_org, w_org, _= img.shape <NEW_LINE>... | 调整图片大小
__init__ args:
target_shape: (h_target, w_target),调整后的图片大小
correct_box: bool = False,对框也进行对应调整
__call__ args:
img: 待调整的图片
bboxes: default = None,待调整的框,实际值
returns:
image: 调整后的图片
bboxes: 调整后的框(如果correct_box == True),实际值
notes:
将图片转为目标大小,BGR转换为RGB,归一化到[0, 1]上
bboxes依然是以图片大小为参考的实际值 | 62598fac8e7ae83300ee906a |
class IPListMixin(object): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> start_ip = IPAddress(self.first, self.version) <NEW_LINE> end_ip = IPAddress(self.last, self.version) <NEW_LINE> return iter_iprange(start_ip, end_ip) <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> retur... | A mixin class providing shared list-like functionality to classes
representing groups of IP addresses. | 62598fac091ae35668704be6 |
class DataSelectionPreferencesManager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def serialize(self, filename): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def deserialize(self, filename): <NEW_LINE> <INDENT> pass | Stores GUI preference info, e.g. the most-recently uses directory for browsing data files. | 62598facac7a0e7691f724d1 |
class Option: <NEW_LINE> <INDENT> option = None <NEW_LINE> is_Flag = False <NEW_LINE> requires = [] <NEW_LINE> excludes = [] <NEW_LINE> after = [] <NEW_LINE> before = [] <NEW_LINE> @classmethod <NEW_LINE> def default(cls): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def preprocess(cls, o... | Base class for all kinds of options. | 62598facf7d966606f747fad |
class BidResponse(Object): <NEW_LINE> <INDENT> id = Field(String, required=True) <NEW_LINE> seatbid = Field(Array(SeatBid), required=True) <NEW_LINE> bidid = Field(String) <NEW_LINE> cur = Field(String) <NEW_LINE> customdata = Field(String) <NEW_LINE> nbr = Field(constants.NoBidReason) <NEW_LINE> ext = Field(Object) <N... | The top-level bid response object.
The “id” attribute is a reflection of the bid request ID for logging purposes.
Similarly, “bidid” is an optional response tracking ID for bidders.
If specified, it can be included in the subsequent win notice call if the bidder wins.
At least one “seatbid” object is required, which c... | 62598fac9c8ee82313040155 |
@fixed_state <NEW_LINE> class Protein(IonComplex): <NEW_LINE> <INDENT> _state = {'name': 'Protein name.', 'members': 'Name of the peptide members.' } <NEW_LINE> sequences = tuple() <NEW_LINE> def __init__(self, name=None, ids=None, sequences=None, members=None): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> if membe... | Protein represents an ion composed of a complex of peptides.
:param name: Name of the protein.
:param ids: Names of the peptide members.
:param sequences: Sequences of the peptide members.
:param members: An iterable of the peptide members.
If members and sequences are not provided, the name will be searched in the
P... | 62598fac435de62698e9bdbc |
class GridFS(object): <NEW_LINE> <INDENT> def __init__(self, database, collection="fs"): <NEW_LINE> <INDENT> if not isinstance(database, Database): <NEW_LINE> <INDENT> raise TypeError("database must be an instance of Database") <NEW_LINE> <DEDENT> self.__database = database <NEW_LINE> self.__collection = database[colle... | An instance of GridFS on top of a single Database.
| 62598fac7d43ff24874273e6 |
class hr_recruitment_stage(osv.osv): <NEW_LINE> <INDENT> _name = "hr.recruitment.stage" <NEW_LINE> _description = "Stage of Recruitment" <NEW_LINE> _order = 'sequence' <NEW_LINE> _columns = { 'name': fields.char('Name', required=True, translate=True), 'sequence': fields.integer('Sequence', help="Gives the sequence orde... | Stage of HR Recruitment | 62598fac7b25080760ed7477 |
@override_settings( DOVECOT_LOOKUP_PATH=["{}/dovecot".format(os.path.dirname(__file__))]) <NEW_LINE> class MailboxOperationTestCase(ModoTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> super(MailboxOperationTestCase, cls).setUpTestData() <NEW_LINE> factories.populate_da... | Test management command. | 62598fac3539df3088ecc27a |
class BugNotFound(BugWatchUpdateWarning): <NEW_LINE> <INDENT> pass | The bug was not found in the external bug tracker. | 62598fac4e4d5625663723ee |
class Commune: <NEW_LINE> <INDENT> def __init__(self, code_commune, nom_commune, pop_totale, code_dept): <NEW_LINE> <INDENT> self._code_commune = code_commune <NEW_LINE> self._nom_commune = nom_commune <NEW_LINE> self._pop_totale = pop_totale <NEW_LINE> self._code_dept = code_dept <NEW_LINE> <DEDENT> def __str__(self):... | Cette classe représente une commune
Attr:
_code_commune (int): l'identifiant commune (PK)
_nom_commune (str): le nom de la commune
_pop_totale (int): le nombre d'habitants
_code_dept (int): pseudo clé étrangère sur les département | 62598fac498bea3a75a57ae6 |
class IMeasureGroup(form.Schema, IAttributeUUID, IMeasureFormDefinition, IMeasureSourceType, ): <NEW_LINE> <INDENT> pass | Measure group (folderish) content interface. Measure groups
contain both measure and common topic/collection/dataset items
used by all measures contained within. | 62598fac2c8b7c6e89bd378e |
class EventHandler(pyinotify.ProcessEvent): <NEW_LINE> <INDENT> def _get_profile_ids(self, event): <NEW_LINE> <INDENT> path = os.path.basename(event.pathname) <NEW_LINE> device_uid = os.path.basename(os.path.dirname(event.pathname)) <NEW_LINE> if path.endswith(".macros") and not path.startswith("."): <NEW_LINE> <INDENT... | Event handle the listens for the inotify events and informs all callbacks
that are registered in the profile_listeners variable | 62598fac3d592f4c4edbae94 |
class LaunchFlows(renderers.AngularDirectiveRenderer): <NEW_LINE> <INDENT> description = "Start new flows" <NEW_LINE> behaviours = frozenset(["Host"]) <NEW_LINE> order = 10 <NEW_LINE> directive = "grr-start-flow-view" <NEW_LINE> def Layout(self, request, response): <NEW_LINE> <INDENT> self.directive_args = {} <NEW_LINE... | Launches a new flow. | 62598fac6aa9bd52df0d4e90 |
class Fellow(Person): <NEW_LINE> <INDENT> designation = 'FELLOW' <NEW_LINE> office = None <NEW_LINE> living_space = None <NEW_LINE> def __init__(self, name, wants_accommodation): <NEW_LINE> <INDENT> super(Person, self).__init__() <NEW_LINE> self.name = name <NEW_LINE> self.wants_accommodation = wants_accommodation | docstring for Fellow | 62598fac91f36d47f2230e8a |
class PageCleaner(CleanupModelLearner): <NEW_LINE> <INDENT> def __init__(self, cleanup_model=None, cleanup_threshold=0.1, **kwargs): <NEW_LINE> <INDENT> Extractor.__init__(self, **kwargs) <NEW_LINE> self.cleanup_model = cleanup_model <NEW_LINE> self.cleanup_threshold = cleanup_threshold <NEW_LINE> assert self.cleanup_m... | Clean web pages based on a previously learned model | 62598facaad79263cf42e79c |
class InstanceViewStatus(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'level': {'key': 'level', 'type': 'str'}, 'display_status': {'key': 'displayStatus', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-860... | Instance view status.
:ivar code: The status code.
:vartype code: str
:ivar level: The level code. Possible values include: "Info", "Warning", "Error".
:vartype level: str or ~azure.mgmt.compute.v2017_03_30.models.StatusLevelTypes
:ivar display_status: The short localizable label for the status.
:vartype display_statu... | 62598facfff4ab517ebcd7ae |
class FileReader: <NEW_LINE> <INDENT> def __init__(self, fname): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open(fname, 'r') as f: <NEW_LINE> <INDENT> self.file_lines_list = f.readlines() <NEW_LINE> <DEDENT> <DEDENT> except IOError: <NEW_LINE> <INDENT> error("Error opening file " + fname) <NEW_LINE> self.file_li... | Wrapper around file that provides facilities for backing up | 62598fac21bff66bcd722c2f |
class TestPostureManagementV1(): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT> if os.path.exists(config_file): <NEW_LINE> <INDENT> os.environ['IBM_CREDENTIALS_FILE'] = config_file <NEW_LINE> cls.posture_management_service = PostureManagementV1.new_instance( ) <NEW_LINE> assert cl... | Integration Test Class for PostureManagementV1 | 62598facf9cc0f698b1c52ad |
class NetworkInterfaceLoadBalancersOperations(object): <NEW_LINE> <INDENT> models = models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self.api_version = ... | NetworkInterfaceLoadBalancersOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:ivar api_version: Client API version. Constant value: "2017-06-01". | 62598fac1f037a2d8b9e40b7 |
class TLSSNI01Test(unittest.TestCase): <NEW_LINE> <INDENT> auth_key = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) <NEW_LINE> achalls = [ achallenges.KeyAuthorizationAnnotatedChallenge( challb=acme_util.chall_to_challb( challenges.TLSSNI01(token=b'token1'), "pending"), domain="encryption-example.demo", acc... | Tests for certbot.plugins.common.TLSSNI01. | 62598fac379a373c97d98fdc |
class stadium(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> print("cheese") | This is the class that stores stadium information | 62598fadd58c6744b42dc2bb |
@PatternPlayer.subcommand("text") <NEW_LINE> class TextCLI(cli.Application, PatternPlayerMixin): <NEW_LINE> <INDENT> def main(self): <NEW_LINE> <INDENT> self.main_from_renderer(text) | An experiment with drawing text to the SkyScreen. | 62598fad56ac1b37e63021b4 |
class Echo(protocol.Protocol): <NEW_LINE> <INDENT> def writeToTransport(self, response): <NEW_LINE> <INDENT> self.transport.write(response.encode("ascii")) <NEW_LINE> <DEDENT> def dataReceived(self, data): <NEW_LINE> <INDENT> message = data.decode("ascii") <NEW_LINE> response = 'OK ... ' + message <NEW_LINE> self.write... | This is just about the simplest possible protocol | 62598fadf548e778e596b56d |
class RegisterForm(forms.Form): <NEW_LINE> <INDENT> email = forms.EmailField(required=True) <NEW_LINE> password = forms.CharField(required=True, min_length=5) <NEW_LINE> captcha = CaptchaField(error_messages={'invalid': '验证码错误!'}) | 注册信息验证 | 62598fad97e22403b383aed6 |
class JsonResource(HttpServer, resource.Resource): <NEW_LINE> <INDENT> isLeaf = True <NEW_LINE> _PathEntry = collections.namedtuple("_PathEntry", ["pattern", "callback"]) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> resource.Resource.__init__(self) <NEW_LINE> self.path_regexs = {} <NEW_LINE> <DEDENT> def register... | This implements the HttpServer interface and provides JSON support for
Resources.
Register callbacks via register_path() | 62598fad63d6d428bbee2774 |
class IScopePrioritySetter(object): <NEW_LINE> <INDENT> pass | description of class | 62598fad10dbd63aa1c70b7c |
class ProvisaoBase(object): <NEW_LINE> <INDENT> def get_produto(self, ncm, ncm_ex): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_servico(self, nbs): <NEW_LINE> <INDENT> raise NotImplementedError() | Classe base para o provisionamento da consulta, tornando possível o
armazenamento das consultas dos valores aproximados dos tributos em
cache, acelerando a consulta para produtos e serviços recém consultados.
Esta classe em particular não faz esse provisionamento, apenas fornece
uma base para os métodos básicos que da... | 62598fad8c0ade5d55dc3676 |
class QHead(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.d_classes = 200 <NEW_LINE> self.d_rest_code = 2 <NEW_LINE> self.d_code = self.d_classes + 2*self.d_rest_code <NEW_LINE> self.define_module() <NEW_LINE> <DEDENT> def define_module(self): <NEW_LINE> <IND... | Discriminator head for predicting the latent code. | 62598fad66656f66f7d5a3b9 |
class UtilsTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_parameters_counter(self): <NEW_LINE> <INDENT> class ParamsHolder(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, n_params): <NEW_LINE> <INDENT> super(ParamsHolder, self).__init__() <NEW_LINE> self.p1 = torch.nn.Parameter(torch.Tensor(n_params //... | Tests for utils | 62598fad7d847024c075c38c |
class FreezeTime(object): <NEW_LINE> <INDENT> def __init__( self, dt, tz=datetime.timezone.utc, fold=0, tick=False, extra_patch_datetime=(), extra_patch_time=(), ): <NEW_LINE> <INDENT> datetime_targets = ('datetime.datetime',) + tuple(extra_patch_datetime) <NEW_LINE> time_targets = ('time.time',) + tuple(extra_patch_ti... | A context manager that freezes the datetime to the given datetime object.
It simulates that the system timezone is the passed timezone.
If `tick=True` is passed, the clock will tick, otherwise the clock will
remain at the given datetime.
Additional patch targets can be passed via `extra_patch_datetime` and
`extra_pa... | 62598fad7d847024c075c38d |
class DiceToken: <NEW_LINE> <INDENT> __slots__ = ["__sequence"] <NEW_LINE> def __init__(self, statement): <NEW_LINE> <INDENT> self.__sequence = [] <NEW_LINE> for token in tokenize( statement.lower(), specifications=[("DICE", r"\d*[d]\d*")] ): <NEW_LINE> <INDENT> if token._type == "DICE": <NEW_LINE> <INDENT> dice_split ... | A sequence of dice rolls and numbers.
Parameter:
str A dice statement, in the format of #d#+#+d# or the such that is
parsed for rolling. | 62598faddd821e528d6d8efe |
class TargetTemp(Resource): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.parser = reqparse.RequestParser() <NEW_LINE> self.parser.add_argument( 'target_temp_c', type=int, choices=range(150, 551), help='target_temp can be 150..550 deg F. Note that ' 'hardware seems to limit this to ... | When freshroastsr700 is in thermostat mode, this is the set
point value for the chamber temperature. | 62598fad30bbd7224646995d |
class SqliteDBError(sqlite3.OperationalError): <NEW_LINE> <INDENT> pass | General error exception encountered during database operations. | 62598fad0c0af96317c5634c |
class ConfigurationError(Exception): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() | Exception to be raised when a configuration error occurs. | 62598fad63b5f9789fe85130 |
class ServerAnnounceObserver(Observer): <NEW_LINE> <INDENT> def __init__(self, target='/dev/null', pct_interval=10): <NEW_LINE> <INDENT> self.pct_interval = pct_interval <NEW_LINE> self.target_handle = open(target, 'w') <NEW_LINE> self.last_update = 0 <NEW_LINE> super(ServerAnnounceObserver, self).__init__() <NEW_LINE>... | Send the output to a Minecraft server via FIFO or stdin | 62598fadbd1bec0571e150a8 |
class Category(models.Model): <NEW_LINE> <INDENT> category_id = models.AutoField(serialize=False, primary_key=True) <NEW_LINE> name = models.CharField(max_length=100, unique = True) <NEW_LINE> def save(self, *args, **kwargs): <NEW_LINE> <INDENT> self.name = self.name.lower() <NEW_LINE> super(Category, self).save(*args,... | Model for Category | 62598fad5166f23b2e2433a2 |
class FidoClientMockError(FidoClientMock): <NEW_LINE> <INDENT> async def fetch_data(self): <NEW_LINE> <INDENT> raise PyFidoErrorMock("Fake Error") | Fake Fido client error. | 62598fad236d856c2adc9422 |
class Container(Object): <NEW_LINE> <INDENT> def __init__(self, name, location=None, owner=None): <NEW_LINE> <INDENT> super(Container, self).__init__(name, location, owner) <NEW_LINE> self.locks.insert = locks.Pass() <NEW_LINE> self.locks.remove = locks.Pass() | An otherwise-default Object whose insert and remove locks are Pass(). | 62598fad57b8e32f52508100 |
class SlugRedirect(ModelBase): <NEW_LINE> <INDENT> content_type = models.ForeignKey(ContentType) <NEW_LINE> old_object_slug = models.CharField(max_length=200) <NEW_LINE> new_object_id = models.PositiveIntegerField() <NEW_LINE> new_object = generic.GenericForeignKey('content_type', 'new_object_id') <NEW_LINE> def __unic... | A model to represent a redirect from an old slug
This is particular useful when we merge two candidates, but don't
want the old URL to break | 62598fad67a9b606de545f96 |
class LookupDimension(Dimension): <NEW_LINE> <INDENT> def __init__(self, expression, lookup, **kwargs): <NEW_LINE> <INDENT> if "default" in kwargs: <NEW_LINE> <INDENT> kwargs["lookup_default"] = kwargs.pop("default") <NEW_LINE> <DEDENT> kwargs["lookup"] = lookup <NEW_LINE> super(LookupDimension, self).__init__(expressi... | DEPRECATED Returns the expression value looked up in a lookup dictionary | 62598fade5267d203ee6b8d3 |
class ShowSnapshot3Test(BaseTest): <NEW_LINE> <INDENT> fixtureDB = True <NEW_LINE> fixtureCmds = ["aptly snapshot create snap1 from mirror wheezy-non-free"] <NEW_LINE> runCmd = "aptly snapshot show snap1" <NEW_LINE> outputMatchPrepare = lambda _, s: re.sub(r"Created At: [0-9:A-Za-z -]+\n", "", s) | show snapshot: from mirror w/o packages | 62598fad76e4537e8c3ef577 |
class DeleteKnowledgeBaseRequest(proto.Message): <NEW_LINE> <INDENT> name = proto.Field(proto.STRING, number=1,) <NEW_LINE> force = proto.Field(proto.BOOL, number=2,) | Request message for
[KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBase].
Attributes:
name (str):
Required. The name of the knowledge base to delete. Format:
``projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>``.
... | 62598fadac7a0e7691f724d3 |
class PortStateWrite(FeedbackCommand): <NEW_LINE> <INDENT> def __init__(self, State, WriteMask = [0xff, 0xff, 0xff]): <NEW_LINE> <INDENT> self.state = State <NEW_LINE> self.writeMask = WriteMask <NEW_LINE> self.cmdBytes = [ 27 ] + WriteMask + State <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<u3... | PortStateWrite Feedback command
State: A list of 3 bytes representing FIO, EIO, CIO
WriteMask: A list of 3 bytes, representing which to update.
The Default is all ones.
>>> import u3
>>> d = u3.U3()
>>> d.debug = True
>>> d.getFeedback(u3.PortStateWrite(State = [0xab, 0xcd, 0xef], WriteMask = [0xff, 0xff, ... | 62598fad4f88993c371f04ef |
class StuckDoorDriver(PerfectDoorDriver): <NEW_LINE> <INDENT> def __init__(self, transit_time, accelerate_time): <NEW_LINE> <INDENT> super(StuckDoorDriver, self).__init__(transit_time, accelerate_time) <NEW_LINE> self.stuck_count = 0 <NEW_LINE> self.instance = self <NEW_LINE> <DEDENT> def start_door_signal(self): <NEW_... | This driver emulates a door wich stucks on first trigger. | 62598fad7d43ff24874273e7 |
class so(LieAlgebra): <NEW_LINE> <INDENT> abelian = False <NEW_LINE> def get_dimension(self): <NEW_LINE> <INDENT> n = self.get_shape() <NEW_LINE> return int(n*(n-1)/2) <NEW_LINE> <DEDENT> def get_vector(self): <NEW_LINE> <INDENT> n = self.get_shape() <NEW_LINE> vlen = int(n*(n-1)/2) <NEW_LINE> vector = np.zeros(vlen) <... | Lie algebra :math:`so(n)`.
For a Lie algebra element of the form :math:`(x, y, z)`, the matrix representation is of the form:
.. math::
\begin{bmatrix}
0 & -z & y \\
z & 0 & -x \\
-y & x & 0
\end{bmatrix} | 62598fad7b180e01f3e49035 |
class ParsableErrorMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> state = {} <NEW_LINE> def replacement_start_response(status, headers, exc_info=None): <NEW_LINE> <INDENT> try: <NEW_... | Replace error body with something the client can parse. | 62598fad3539df3088ecc27c |
class MZD(object): <NEW_LINE> <INDENT> def __init__(self,iterable=None): <NEW_LINE> <INDENT> self.d = dict() <NEW_LINE> if iterable: <NEW_LINE> <INDENT> for key,val in iterable: <NEW_LINE> <INDENT> self[key]=val <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def __contains__(self,other): <NEW_LINE> <INDENT> for key in self.d.ke... | dict like object for storing {MZ:intensity} data.
overrides __contains__ in order to do MZ __eq__ method
Note:
MZ objects are mutable, weird things can happen making dicts from
mutable ojbects... might re-implement in Cython to solve this problem.
see below for example:
https://stackoverflow.com/questions/4828080... | 62598fad99cbb53fe6830ea2 |
class SQARequirements(MooseMarkdownCommon, Pattern): <NEW_LINE> <INDENT> RE = r'(?<!`)!sqa requirements' <NEW_LINE> @staticmethod <NEW_LINE> def defaultSettings(): <NEW_LINE> <INDENT> settings = MooseMarkdownCommon.defaultSettings() <NEW_LINE> return settings <NEW_LINE> <DEDENT> def __init__(self, markdown_instance=Non... | Builds SQA requirement list from test specification files. | 62598fad7047854f4633f3a4 |
class ElevatorDoor(mc.RoomExit): <NEW_LINE> <INDENT> def __init__(self, *arg, **kwarg): <NEW_LINE> <INDENT> mc.RoomExit.__init__(self, *arg, **kwarg) <NEW_LINE> self.isNoisey = True <NEW_LINE> self.isOpen = False <NEW_LINE> <DEDENT> def open_state(self, isOpen): <NEW_LINE> <INDENT> if isOpen == self.isOpen: <NEW_LINE> ... | This special door class cannot be opened by players but is never locked. | 62598fad91f36d47f2230e8b |
class Decoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Decoder, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def init_state(self, enc_outputs, *args): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def forward(self, X, state): <NEW_LINE> <INDENT> raise N... | The base decoder interface for the encoder-decoder archtecture. | 62598fad5fc7496912d48267 |
class FileRelationshipFactory(factory.django.DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = "tool_manager.FileRelationship" | Minimal representation of a FileRelationship | 62598fada8370b77170f03a7 |
class MainViewTestCase(untitled.ClickAppTestCase): <NEW_LINE> <INDENT> def test_initial_label(self): <NEW_LINE> <INDENT> app = self.launch_application() <NEW_LINE> label = app.main_view.select_single(objectName='label') <NEW_LINE> self.assertThat(label.text, Equals('Hello..')) <NEW_LINE> <DEDENT> def test_click_button_... | Generic tests for the Hello World | 62598fad8a43f66fc4bf2147 |
class Job(object): <NEW_LINE> <INDENT> _ident = 0 <NEW_LINE> _lock = threading.Lock() <NEW_LINE> def __init__(self, func, job_props, interval, when=None, job_id=None): <NEW_LINE> <INDENT> self._props = job_props <NEW_LINE> self._func = func <NEW_LINE> if when is None: <NEW_LINE> <INDENT> self._when = time.time() <NEW_L... | Timer wraps the callback and timestamp related stuff | 62598fad7047854f4633f3a5 |
class StockCode(scrapy.Item): <NEW_LINE> <INDENT> name = scrapy.Field() <NEW_LINE> code = scrapy.Field() | stock code and it's name | 62598fad63d6d428bbee2776 |
class peakFilter(): <NEW_LINE> <INDENT> def __init__(self,c,xmin,xmax): <NEW_LINE> <INDENT> self.c = c <NEW_LINE> self.xmin = xmin <NEW_LINE> self.xmax = xmax <NEW_LINE> <DEDENT> def peakPos(self,x,y): <NEW_LINE> <INDENT> allpeaks = [] <NEW_LINE> pieces_x, pieces_y, pieces_id = scissor(self.c,x,y) <NEW_LINE> for px, py... | Call function peakIden to do the job within a range of (xmin,xmax)
Arguments:
c: a critical value below which the input data is ignored
xmin: lower bound of the range
xmax: upper bound of the range
Methods:
peakPos: call peakIden to find peaks within (xmin,xmax)
markPeak: mark the peak position (x,y) on existing axis h... | 62598fad55399d3f056264ef |
class RubyArtifact: <NEW_LINE> <INDENT> def __init__(self, platform, arch): <NEW_LINE> <INDENT> self.name = 'ruby_native_gem_%s_%s' % (platform, arch) <NEW_LINE> self.platform = platform <NEW_LINE> self.arch = arch <NEW_LINE> self.labels = ['artifact', 'ruby', platform, arch] <NEW_LINE> <DEDENT> def pre_build_jobspecs(... | Builds ruby native gem. | 62598fad66656f66f7d5a3bb |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.