code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class FnPerBucketPatchBuilder(PatchBuilder): <NEW_LINE> <INDENT> def __init__(self, bucket, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.hr = None <NEW_LINE> self.bucket = bucket <NEW_LINE> <DEDENT> def inspect(self, headroom): <NEW_LINE> <INDENT> self.hr = headroom <NEW_LINE> self.fn = sel... | Patch builder that shows function addresses vs capability
creation time for a given histogram bucket. | 62598f5b21a7993f00c654ed |
class VerticaGuestAgentAPI(guest_api.API): <NEW_LINE> <INDENT> def get_public_keys(self, user): <NEW_LINE> <INDENT> LOG.debug("Getting public keys for user: %s.", user) <NEW_LINE> version = guest_api.API.API_BASE_VERSION <NEW_LINE> return self._call("get_public_keys", self.agent_high_timeout, version=version, user=user... | Cluster Specific Datastore Guest API
**** VERSION CONTROLLED API ****
The methods in this class are subject to version control as
coordinated by guestagent/api.py. Whenever a change is made to
any API method in this class, add a version number and comment
to the top of guestagent/api.py and use the version number as... | 62598f5bbf627c535bcb09f4 |
class Plugin(BasePlugin): <NEW_LINE> <INDENT> def run_command(self, args): <NEW_LINE> <INDENT> hq = HeadQuarters() <NEW_LINE> print('cleaning up database in {0}'.format(hq.hq)) <NEW_LINE> try: <NEW_LINE> <INDENT> unlink(hq.db_name) <NEW_LINE> <DEDENT> except OSError: <NEW_LINE> <INDENT> pass | Removes the database file from the current HQ | 62598f5b287bf620b627112e |
class ProductSearchParams(_messages.Message): <NEW_LINE> <INDENT> class CategoryValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0 <NEW_LINE> SHOES = 1 <NEW_LINE> BAGS = 2 <NEW_LINE> <DEDENT> class ViewValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> BASIC = 0 <NEW_LINE> FU... | Parameters for a product search request.
Enums:
CategoryValueValuesEnum: The category to search in. Optional. It is
inferred by the system if it is not specified. [Deprecated] Use
`product_category`.
ViewValueValuesEnum: Specifies the verbosity of the product search
results. Optional. Defaults to `BAS... | 62598f5b56b00c62f0fb1e2d |
class SessionManager(object): <NEW_LINE> <INDENT> _instance = None <NEW_LINE> _sessionClass = Session <NEW_LINE> @classmethod <NEW_LINE> @auditApiCall("Session") <NEW_LINE> def startSession(cls, host, makeCurrent=True): <NEW_LINE> <INDENT> session = cls._sessionClass(host) <NEW_LINE> if makeCurrent: <NEW_LINE> <INDENT>... | A @ref Host facing convenience class to simplify a Hosts interactions with a
@ref Manager. It is intended to be used as a singleton manager of the
associated state, and @ref Manager instances within any single interaction
session.
It takes care of the following upon initialization:
@li Connecting a Host's logging int... | 62598f5b5166f23b2e242952 |
class DfNullValuesValidationError(CommandLineError): <NEW_LINE> <INDENT> def __init__(self, cols, values): <NEW_LINE> <INDENT> self.cols = cols <NEW_LINE> self.values = values <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.render( f"Your data has null values in the following columns: {self.cols}... | Raise when data frame does not pass validation | 62598f5bd164cc61758204ee |
class Test_parseFile(unittest.TestCase): <NEW_LINE> <INDENT> TestID = "ut004_5" <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.TestFunction = staticmethod(TestModule.parseFile) <NEW_LINE> cls.Logger = DualLogger(cls.__name__, bLogToFile = True, strFileName = os.path.join(LIB_ROOT, 'Test... | Test cases for the function parseFile() of the module GenericParsers.
Test ID - TEST-T-601, TEST-T-602, TEST-T-60C. | 62598f5b925a0f43d25e75ac |
class Date(npz.Date): <NEW_LINE> <INDENT> pass | Date-type data node for the mat backend. | 62598f5ba8ecb0332587077b |
class LamaPooling(nn.Module): <NEW_LINE> <INDENT> available_groups = [ "last", "avg", "avg_droplast", "max", "max_droplast", "sigmoid", "sigmoid_droplast", "softmax", "softmax_droplast", "tanh", "tanh_droplast", ] <NEW_LINE> def __init__(self, in_features, groups=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE>... | @TODO: Docs. Contribution is welcome. | 62598f5b9b70327d1c57e31f |
class ReadUpdateDeleteTestCase(utils.BaseAPITestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(ReadUpdateDeleteTestCase, cls).setUpClass() <NEW_LINE> client = api.Client(cls.cfg, api.json_handler) <NEW_LINE> cls.repos = tuple(( client.post(REPOSITORY_PATH, {'id': utils... | Establish we can read, update and delete repositories.
This test case assumes the assertions in :class:`CreateSuccessTestCase`
hold true. | 62598f5b8c3a8732951f5acc |
class GenotypeExtras(object): <NEW_LINE> <INDENT> def _add_genotype_calls(self, variant_obj, variant_line, case_obj): <NEW_LINE> <INDENT> variant_line = variant_line.split('\t') <NEW_LINE> if len(variant_line) > 8: <NEW_LINE> <INDENT> gt_format = variant_line[8].split(':') <NEW_LINE> for individual in case_obj.individu... | Class to store methods that deals with genotyping | 62598f5b507cdc57c63a4317 |
class DraftApiGroupRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.GroupId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.GroupId = params.get("GroupId") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in vars(self).ite... | DraftApiGroup请求参数结构体
| 62598f5b8c3a8732951f5acd |
class GetUniverseGraphicsInternalServerError(object): <NEW_LINE> <INDENT> def __init__(self, error=None): <NEW_LINE> <INDENT> self.swagger_types = { 'error': 'str' } <NEW_LINE> self.attribute_map = { 'error': 'error' } <NEW_LINE> self._error = error <NEW_LINE> <DEDENT> @property <NEW_LINE> def error(self): <NEW_LINE> <... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f5bbf627c535bcb09f8 |
class CallNotFoundError(Error): <NEW_LINE> <INDENT> pass | Raised by `APIProxy` calls when the requested method cannot be found. | 62598f5b462c4b4f79dbaf7e |
class List(IView): <NEW_LINE> <INDENT> def __init__(self, labels, width, height, callback, backgroudColor = QtCore.Qt.black): <NEW_LINE> <INDENT> self._labels = labels <NEW_LINE> self._width = width <NEW_LINE> self._height = height <NEW_LINE> self._cellHeight = 25 <NEW_LINE> self._backgroudColor = backgroudColor <NEW_L... | List widget simulate by QT painter | 62598f5b63f4b57ef008582e |
class SpiNNakerRouterError(Exception): <NEW_LINE> <INDENT> def __init__(self, count, x, y): <NEW_LINE> <INDENT> self.count = count <NEW_LINE> self.chip = (x, y) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ("Failed to allocate {} routing table entries on chip ({}, {})". format(self.count, self.chip... | Raised when it is not possible to allocated routing table entries on a
SpiNNaker chip.
Attributes
----------
count : int
The number of routing table entries requested.
chip : (x, y)
The coordinates of the chip the allocation failed on. | 62598f5b4d74a7450cd58996 |
class CreatureSubType(AbstractDnDEntity): <NEW_LINE> <INDENT> abilities = models.ManyToManyField( Ability, related_name="creature_subtypes", blank=True, null=True) <NEW_LINE> restrictions = models.ManyToManyField( Restriction, related_name="creature_subtypes", blank=True, null=True) <NEW_LINE> modifiers = models.ManyTo... | A Creature's Subtype | 62598f5b9b70327d1c57e323 |
class LayerNormalization(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, hidden_size): <NEW_LINE> <INDENT> super(LayerNormalization, self).__init__(dtype="float32") <NEW_LINE> self.hidden_size = hidden_size <NEW_LINE> <DEDENT> def build(self, input_shape): <NEW_LINE> <INDENT> self.scale = self.add_weight... | Applies layer normalization. | 62598f5b462c4b4f79dbaf80 |
class Sockets(common.AbstractWindowsCommand): <NEW_LINE> <INDENT> def __init__(self, config, *args, **kwargs): <NEW_LINE> <INDENT> common.AbstractWindowsCommand.__init__(self, config, *args, **kwargs) <NEW_LINE> config.add_option("PHYSICAL-OFFSET", short_option = 'P', default = False, cache_invalidator = False, help = ... | Print list of open sockets | 62598f5b6fece00bbaccaf0f |
class SentiText(object): <NEW_LINE> <INDENT> def __init__(self, text): <NEW_LINE> <INDENT> if not isinstance(text, str): <NEW_LINE> <INDENT> text = str(text.encode('utf-8')) <NEW_LINE> <DEDENT> self.text = text <NEW_LINE> self.words_and_emoticons = self._words_and_emoticons() <NEW_LINE> self.is_cap_diff = allcap_differ... | Identify sentiment-relevant string-level properties of input text. | 62598f5b63f4b57ef008582f |
class InvalidEmailException(Exception): <NEW_LINE> <INDENT> pass | "Email address failed to pass validation. | 62598f5b925a0f43d25e75b2 |
class OBJECT_OT_add_object(Operator, AddObjectHelper): <NEW_LINE> <INDENT> bl_idname = "mesh.add_object" <NEW_LINE> bl_label = "Add Mesh Object" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> scale: FloatVectorProperty( name="scale", default=(1.0, 1.0, 1.0), subtype='TRANSLATION', description="scaling", ) <NEW... | Create a new Mesh Object | 62598f5b796e427e5384dd13 |
class S3Handler(object): <NEW_LINE> <INDENT> def __init__(self, session, params, multi_threshold=MULTI_THRESHOLD, chunksize=CHUNKSIZE): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.done = threading.Event() <NEW_LINE> self.interrupt = threading.Event() <NEW_LINE> self.printQueue = NoBlockQueue() <NEW_LINE>... | This class sets up the process to perform the tasks sent to it. It
sources the ``self.executer`` from which threads inside the
class pull tasks from to complete. | 62598f5b8c3a8732951f5ad2 |
class IdFactory(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.classes = {} <NEW_LINE> <DEDENT> def register(self, _class): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> _class.id <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> raise Exception('A class must have an id attribute ... | An IdFactory chooses from a set of classes and creates an instance
of it based on the passed ID. | 62598f5bff9c53063f519bcf |
class AdminUserChangeForm(UserChangeForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kargs): <NEW_LINE> <INDENT> super(UserChangeForm, self).__init__(*args, **kargs) <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = '__all__' | A form for updating users. Includes all the fields on
the user, but replaces the password field with admin's
password hash display field. | 62598f5b5e10d32532ce33a7 |
class CfgHandlerAction(Bcfg2.Options.ComponentAction): <NEW_LINE> <INDENT> bases = ['Bcfg2.Server.Plugins.Cfg'] | Option parser action to load Cfg handlers | 62598f5b711fe17d825dfc76 |
class Code11(Barcode): <NEW_LINE> <INDENT> codetype = 'code11' <NEW_LINE> aliases = ('code 11', 'code_11', 'code-11') <NEW_LINE> class _Renderer(LinearCodeRenderer): <NEW_LINE> <INDENT> default_options = dict( LinearCodeRenderer.default_options, height=1, includecheck=False, includetext=False, includecheckintext=False,... | >>> bc = Code11()
>>> bc # doctest: +ELLIPSIS
<__main__.Code11 object at ...>
>>> print bc.render_ps_code('0123456789') # doctest: +ELLIPSIS
%!PS-Adobe-2.0
%%Pages: (attend)
%%Creator: Elaphe powered by barcode.ps
%%BoundingBox: 0 0 110 72
%%LanguageLevel: 2
%%EndComments
...
gsave
0 0 moveto
1.000000 1.000000 scale
(0... | 62598f5b21a7993f00c654f7 |
class IRCServerThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.srv = IRCServer(*args, **kwargs) <NEW_LINE> super(IRCServerThread, self).__init__() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> self.srv.serve_forever() <NEW_LINE> <DEDENT> def stop(self... | Thread where an IRCServer runs | 62598f5bd164cc61758204f7 |
class IndexedByIdValidator(Validator): <NEW_LINE> <INDENT> def get_validity(self, information: Dict): <NEW_LINE> <INDENT> for key, resource in information.items(): <NEW_LINE> <INDENT> if not isinstance(resource, dict): <NEW_LINE> <INDENT> return False, f"Expected resource represented as dict: {information}" <NEW_LINE> ... | Validates whether information is indexed by ID. | 62598f5b6fece00bbaccaf13 |
class FormatCBFFullPilatusDLS6MSN100(FormatCBFFullPilatus): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def understand(image_file): <NEW_LINE> <INDENT> header = FormatCBFFullPilatus.get_cbf_header(image_file) <NEW_LINE> for record in header.split("\n"): <NEW_LINE> <INDENT> if ( "# Detector" in record and "PILATUS" in ... | An image reading class for full CBF format images from Pilatus
detectors. | 62598f5b796e427e5384dd15 |
@type_checked <NEW_LINE> class ClaimantType(IntEnum): <NEW_LINE> <INDENT> CLAIMANT_TYPE_V0 = 0 <NEW_LINE> def pack(self, packer: Packer) -> None: <NEW_LINE> <INDENT> packer.pack_int(self.value) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def unpack(cls, unpacker: Unpacker) -> "ClaimantType": <NEW_LINE> <INDENT> value =... | XDR Source Code::
enum ClaimantType
{
CLAIMANT_TYPE_V0 = 0
}; | 62598f5bd18da76e235b6bf6 |
class ChangeSourceMixin(object): <NEW_LINE> <INDENT> changesource = None <NEW_LINE> started = False <NEW_LINE> DUMMY_CHANGESOURCE_ID = 20 <NEW_LINE> OTHER_MASTER_ID = 93 <NEW_LINE> DEFAULT_NAME = "ChangeSource" <NEW_LINE> def setUpChangeSource(self): <NEW_LINE> <INDENT> self.master = fakemaster.make_master(wantDb=True,... | This class is used for testing change sources, and handles a few things:
- starting and stopping a ChangeSource service
- a fake master with a data API implementation | 62598f5b8c3a8732951f5ad4 |
class FilePermissions(object): <NEW_LINE> <INDENT> def __init__(self, read=False, create=False, write=False, delete=False, _str=None): <NEW_LINE> <INDENT> if not _str: <NEW_LINE> <INDENT> _str = '' <NEW_LINE> <DEDENT> self.read = read or ('r' in _str) <NEW_LINE> self.create = create or ('c' in _str) <NEW_LINE> self.wri... | FilePermissions class to be used with
:func:`~azure.storage.file.fileservice.FileService.generate_file_shared_access_signature` API.
:ivar FilePermissions FilePermissions.CREATE:
Create a new file or copy a file to a new file.
:ivar FilePermissions FilePermissions.DELETE:
Delete the file.
:ivar FilePermissio... | 62598f5b507cdc57c63a431f |
class TestModel_VersionUpdateDescriptor(): <NEW_LINE> <INDENT> def test_version_update_descriptor_serialization(self): <NEW_LINE> <INDENT> state_model = {} <NEW_LINE> state_model['current'] = 'testString' <NEW_LINE> state_model['current_entered'] = "2019-01-01T12:00:00Z" <NEW_LINE> state_model['pending'] = 'testString'... | Test Class for VersionUpdateDescriptor | 62598f5bff9c53063f519bd1 |
class JSAProcMySQL(JSAProcDB): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> conn = mysql.connector.connect( host=config.get('database', 'host'), database=config.get('database', 'database'), user=config.get('database', 'user'), password=config.get('database', 'password')) <NEW_LINE> self.db = JSAP... | JSA processing database MySQL database access class. | 62598f5b925a0f43d25e75b6 |
class AlphaBetaAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, currGameState): <NEW_LINE> <INDENT> util.raiseNotDefined() | Your minimax agent with alpha-beta pruning (question 3) | 62598f5b796e427e5384dd17 |
class Error(StandardError): <NEW_LINE> <INDENT> def __init__(self, msg=None, errno=None, values=None, sqlstate=None): <NEW_LINE> <INDENT> super(Error, self).__init__() <NEW_LINE> self.msg = msg <NEW_LINE> self._full_msg = self.msg <NEW_LINE> self.errno = errno or -1 <NEW_LINE> self.sqlstate = sqlstate <NEW_LINE> if not... | Exception that is base class for all other error exceptions | 62598f5bd18da76e235b6bf7 |
class GameObject(BaseGameObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> BaseGameObject.__init__(self) <NEW_LINE> self._game_object_name = "" <NEW_LINE> self._id = "" <NEW_LINE> self._logs = [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def game_object_name(self) -> str: <NEW_LINE> <INDENT> return se... | The class representing the GameObject in the Checkers game.
An object in the game. The most basic class that all game classes should inherit from automatically. | 62598f5b5166f23b2e24295e |
class UserAdminView(BaseAdminView): <NEW_LINE> <INDENT> column_list = ('email',) <NEW_LINE> form_excluded_columns = ('password',) <NEW_LINE> form_rules = [ rules.FieldSet(('email', 'password2', 'active', 'roles')) ] <NEW_LINE> def get_query(self): <NEW_LINE> <INDENT> user = current_user._get_current_object() <NEW_LINE>... | Thanks to mrjoes and this Flask-Admin issue:
https://github.com/mrjoes/flask-admin/issues/173 | 62598f5b462c4b4f79dbaf88 |
class GlUniformBlock(AttributeDictionaryInterface): <NEW_LINE> <INDENT> def __init__(self, name, location, uniforms): <NEW_LINE> <INDENT> super(GlUniformBlock, self).__init__() <NEW_LINE> object.__setattr__(self, '_uniform_block_name', name) <NEW_LINE> object.__setattr__(self, '_uniform_block_location', location) <NEW_... | This class defines an uniform block. | 62598f5b507cdc57c63a4323 |
class LoonMeta(type): <NEW_LINE> <INDENT> def __new__(cls, name, bases, dict): <NEW_LINE> <INDENT> obj = super(LoonMeta, cls).__new__(cls, name, bases, dict) <NEW_LINE> obj.PARSERS = {cls.__name__: cls for cls in dict['PARSERS']} <NEW_LINE> for command in dict['COMMANDS']: <NEW_LINE> <INDENT> def command_method(self, c... | Loon meta-class to populate parsers and commands. | 62598f5bbf627c535bcb0a04 |
class Product(Model): <NEW_LINE> <INDENT> __tablename__ = 'products' <NEW_LINE> product_id = db.Column(db.Integer, unique=True, nullable=True, primary_key=True) <NEW_LINE> name = db.Column(db.String(80), nullable=False) <NEW_LINE> value = db.Column(db.Float, nullable=False) <NEW_LINE> created_at = db.Column(db.DateTime... | Model for a product record | 62598f5b56b00c62f0fb1e3d |
class ptGUIControl: <NEW_LINE> <INDENT> def __init__(self,controlKey): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def disable(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def enable(self,flag=1): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def focus(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getB... | Base class for all GUI controls | 62598f5bd164cc61758204fe |
class Tree(object): <NEW_LINE> <INDENT> def __init__(self, region, depth=0, max_depth=2): <NEW_LINE> <INDENT> self.region = region <NEW_LINE> self.depth = depth <NEW_LINE> self.max_depth = max_depth <NEW_LINE> self.children = [] <NEW_LINE> self.data = [] <NEW_LINE> self._ad_children() <NEW_LINE> <DEDENT> def _ad_childr... | A realy simple space partitioning tree. That covers the volume
[low, high) | 62598f5bff9c53063f519bd7 |
class Text2SpeechServicer(object): <NEW_LINE> <INDENT> def Synthesize(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def BatchSynthe... | endpoints of t2s generate service
| 62598f5b63f4b57ef0085834 |
class CreateCloudBaseRunServerVersionResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Result = None <NEW_LINE> self.VersionName = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Result = params.get("Result") <NEW... | CreateCloudBaseRunServerVersion返回参数结构体
| 62598f5b711fe17d825dfc7e |
class CurrentPopover(Popover): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Popover.__init__(self) <NEW_LINE> wayland = GLib.environ_getenv(GLib.get_environ(), "WAYLAND_DISPLAY") <NEW_LINE> if wayland: <NEW_LINE> <INDENT> view_type = ViewType.POPOVER <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> view_typ... | Popover showing current tracks | 62598f5bbe8e80087fbbe5e2 |
class ContextResource(ContextBase): <NEW_LINE> <INDENT> def is_not_found(self, request, response, **kwargs): <NEW_LINE> <INDENT> return self.get_object(request, **kwargs) is None <NEW_LINE> <DEDENT> def get(self, request, **kwargs): <NEW_LINE> <INDENT> params = self.get_params(request) <NEW_LINE> instance = self.get_ob... | Resource for accessing a single context | 62598f5b287bf620b6271142 |
class JobDBTestCase( unittest.TestCase ): <NEW_LINE> <INDENT> def setUp( self ): <NEW_LINE> <INDENT> gLogger.setLevel( 'DEBUG' ) <NEW_LINE> self.jobDB = JobDB() <NEW_LINE> <DEDENT> def tearDown( self ): <NEW_LINE> <INDENT> result = self.jobDB.selectJobs( {} ) <NEW_LINE> self.assert_( result['OK'], 'Status after selectJ... | Base class for the JobDB test cases
| 62598f5b56b00c62f0fb1e41 |
class Meta: <NEW_LINE> <INDENT> unique_together = ('vehicle', 'tires') | Table constraints | 62598f5b796e427e5384dd1f |
class NotIntegratorError(Exception): <NEW_LINE> <INDENT> pass | When integrator is False... check Consortium.run() parameters | 62598f5b8c3a8732951f5ade |
@dataclass <NEW_LINE> class AddNodeToSubset(NodeChange): <NEW_LINE> <INDENT> _inherited_slots: ClassVar[List[str]] = [] <NEW_LINE> class_class_uri: ClassVar[URIRef] = KGCL.AddNodeToSubset <NEW_LINE> class_class_curie: ClassVar[str] = "kgcl:AddNodeToSubset" <NEW_LINE> class_name: ClassVar[str] = "add node to subset" <NE... | Places a node inside a subset, by annotating that node | 62598f5b63f4b57ef0085836 |
class ActionInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.BodyPosture = None <NEW_LINE> self.Handup = None <NEW_LINE> self.LookHead = None <NEW_LINE> self.Writing = None <NEW_LINE> self.Height = None <NEW_LINE> self.Left = None <NEW_LINE> self.Top = None <NEW_LINE> self.Width = N... | 大教室场景肢体动作识别信息
| 62598f5cbf627c535bcb0a0b |
class MembershipGiftCardReferenceViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = MembershipGiftCardReference.objects.all() <NEW_LINE> serializer_class = ser.MembershipGiftCardReferenceSerializer <NEW_LINE> filter_fields = {'ctrlid'} | REST API endpoint that allows memberships to be viewed or edited. | 62598f5c462c4b4f79dbaf90 |
class Station(AbstractTimeTrackable, AbstractLocation): <NEW_LINE> <INDENT> TYPE_SMOGLY = 'smogly' <NEW_LINE> TYPE_CUSTOM = 'custom' <NEW_LINE> TYPE_AQICN = 'aqicn' <NEW_LINE> TYPE_BASIC_SDS011 = 'basic-sds011' <NEW_LINE> TYPE_CHOICES = ( (TYPE_SMOGLY, 'SMOGLY'), (TYPE_CUSTOM, 'CUSTOM'), (TYPE_AQICN, 'AQICN'), (TYPE_BA... | Model representing sensor station. Can be grouped using Project model. | 62598f5c507cdc57c63a432b |
class ZernikeOrderSetter(QWidget): <NEW_LINE> <INDENT> def __init__(self, parent = None,closeAction = None): <NEW_LINE> <INDENT> super(ZernikeOrderSetter,self).__init__(parent) <NEW_LINE> global ZernikeOrder <NEW_LINE> self.closeAction = closeAction <NEW_LINE> self.setAutoFillBackground(True) <NEW_LINE> p = self.palett... | Widget to set the Zernike Expansion order. | 62598f5cd164cc6175820504 |
class FiniteDifferenceHvp(HessianVectorProduct): <NEW_LINE> <INDENT> def __init__(self, base_eps=1e-8, symmetric=True, num_slices=1): <NEW_LINE> <INDENT> super().__init__(num_slices=num_slices) <NEW_LINE> self.base_eps = base_eps <NEW_LINE> self.symmetric = symmetric <NEW_LINE> <DEDENT> def update_hvp(self, f, target, ... | Computes Hessian-vector product using finite difference method.
Args:
base_eps (float): Base epsilon value.
symmetric (bool): Symmetric or not.
num_slices (int): Hessian-vector product function's inputs will be
divided into num_slices and then averaged together to improve
performance. | 62598f5c9b70327d1c57e334 |
class ItemList(collections.Iterable): <NEW_LINE> <INDENT> def __init__(self, items, tohu_items_cls=None): <NEW_LINE> <INDENT> assert isinstance(items, list) <NEW_LINE> self.items = items <NEW_LINE> self.num_items = len(items) <NEW_LINE> self.tohu_items_cls = tohu_items_cls <NEW_LINE> <DEDENT> def __repr__(self): <NEW_L... | Represents a list of items produced by calling `generate()` on a tohu generator. | 62598f5c8c3a8732951f5ae1 |
class Role(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name | A single role, eg as returned by `roles.moderator`. | 62598f5c6fece00bbaccaf21 |
class CreateUserPage(base.RequestHandler): <NEW_LINE> <INDENT> def djangoURLPatterns(self): <NEW_LINE> <INDENT> return [ django_url(r'^user/create$', self, name='create_user'), ] <NEW_LINE> <DEDENT> def checkAccess(self, data, check, mutator): <NEW_LINE> <INDENT> check.isNotUser() <NEW_LINE> <DEDENT> def templatePath(s... | View for creating the user profile.
| 62598f5c91af0d3eaad39397 |
class CNNEncoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CNNEncoder, self).__init__() <NEW_LINE> self.layer1 = nn.Sequential( nn.Conv2d(3,64,kernel_size=3,padding=0), nn.BatchNorm2d(64, momentum=1, affine=True), nn.ReLU(), nn.MaxPool2d(2)) <NEW_LINE> self.layer2 = nn.Sequential( nn... | docstring for ClassName | 62598f5c925a0f43d25e75c4 |
class SummaryTest2(UsingModulesMixin, CoverageTest): <NEW_LINE> <INDENT> run_in_temp_dir = False <NEW_LINE> def test_empty_files(self): <NEW_LINE> <INDENT> cov = coverage.Coverage(branch=True) <NEW_LINE> cov.start() <NEW_LINE> import usepkgs <NEW_LINE> cov.stop() <NEW_LINE> repout = StringIO() <NEW_LINE> cov.report(fil... | Another bunch of summary tests. | 62598f5cd164cc6175820507 |
class TwoPrefs(object): <NEW_LINE> <INDENT> def __init__(self, p1, p2): <NEW_LINE> <INDENT> self.p1 = p1 <NEW_LINE> self.p2 = p2 <NEW_LINE> print("Two-prefs algorithm with prefs:") <NEW_LINE> print("p1 " + str(p1)) <NEW_LINE> print("p2 " + str(p2)) | classdocs | 62598f5c462c4b4f79dbaf94 |
class VNCServerAuthenticator(VNCAuthenticator): <NEW_LINE> <INDENT> def __init__(self, password, options): <NEW_LINE> <INDENT> VNCAuthenticator.__init__(self, password) <NEW_LINE> self.options = options <NEW_LINE> if 'password' in options: <NEW_LINE> <INDENT> self.password = options['password'] <NEW_LINE> <DEDENT> <DED... | Trivial server protocol which can authenticate VNC clients.
This protocol is lacking lots of things, like support for older VNC
protocols. | 62598f5c507cdc57c63a432f |
class Cache: <NEW_LINE> <INDENT> init_state = None <NEW_LINE> inventory = None <NEW_LINE> config = None | Serves as a cache object to store the initial state of
outer object as well as the config returned by
_query_config and inventory. | 62598f5c4d74a7450cd589a2 |
class ColorData(object): <NEW_LINE> <INDENT> pass | Base color data class | 62598f5c167d2b6e312b6511 |
class AllSubDevicesGetManufacturerLabel(TestMixins.AllSubDevicesGetMixin, ResponderTestFixture): <NEW_LINE> <INDENT> CATEGORY = TestCategory.SUB_DEVICES <NEW_LINE> PID = 'MANUFACTURER_LABEL' | Send a Get MANUFACTURER_LABEL to ALL_SUB_DEVICES. | 62598f5c0383005118f6cc9a |
class GetSetterTests: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> @mark.parametrize('setter_path, expected_setter', [ (None, call_set_attr), (setters.__name__ + '.import_global', setters.import_global) ]) <NEW_LINE> def test_returns_setter(setter_path, expected_setter): <NEW_LINE> <INDENT> actual_setter = get_setter(X... | get_setter() tests | 62598f5cd164cc617582050b |
@implementer(IReactorFDSet) <NEW_LINE> class _ContinuousPolling(_PollLikeMixin, _DisconnectSelectableMixin): <NEW_LINE> <INDENT> _POLL_DISCONNECTED = 1 <NEW_LINE> _POLL_IN = 2 <NEW_LINE> _POLL_OUT = 4 <NEW_LINE> def __init__(self, reactor): <NEW_LINE> <INDENT> self._reactor = reactor <NEW_LINE> self._loop = None <NEW_L... | Schedule reads and writes based on the passage of time, rather than
notification.
This is useful for supporting polling filesystem files, which C{epoll(7)}
does not support.
The implementation uses L{_PollLikeMixin}, which is a bit hacky, but
re-implementing and testing the relevant code yet again is unappealing.
@i... | 62598f5c287bf620b627114c |
class TestRemoveFromConferenceAllOf(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 testRemoveFromConferenceAllOf(self): <NEW_LINE> <INDENT> pass | RemoveFromConferenceAllOf unit test stubs | 62598f5c9b70327d1c57e33a |
class IReadUnreadMarker(Interface): <NEW_LINE> <INDENT> pass | Marker interface for task containers. | 62598f5c56b00c62f0fb1e4a |
class TypeMixerMeta(BaseTypeMixerMeta): <NEW_LINE> <INDENT> def __new__(mcs, name, bases, params): <NEW_LINE> <INDENT> params['models_cache'] = dict() <NEW_LINE> cls = super(TypeMixerMeta, mcs).__new__(mcs, name, bases, params) <NEW_LINE> return cls <NEW_LINE> <DEDENT> def __load_cls(cls, cls_type): <NEW_LINE> <INDENT>... | Load django models from strings. | 62598f5cbe8e80087fbbe5ee |
class Shard(FileSequence): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def open(cls, directory, index, max_length, serializer): <NEW_LINE> <INDENT> path = cls.shard_path(directory, index) <NEW_LINE> if not os.path.isfile(path): <NEW_LINE> <INDENT> raise IOError('No such shard: {}'.format(path)) <NEW_LINE> <DEDENT> retu... | A FileSequence serving as a Shard in a ShardedSequence. | 62598f5c5166f23b2e242970 |
class HuaweiDeviceMap(SnmpPlugin): <NEW_LINE> <INDENT> maptype = "HuaweiDeviceMap" <NEW_LINE> snmpGetMap = GetMap({ '.1.3.6.1.2.1.1.2.0' : 'setHWProductKey', '.1.3.6.1.4.1.2011.5.25.19.1.4.2.1.5.1': 'setOSProductKey', }) <NEW_LINE> def process(self, device, results, log): <NEW_LINE> <INDENT> log.info('processing %s for... | Map mib elements from Huawei mib to get hw and os products.
| 62598f5c507cdc57c63a4333 |
class Street(Property): <NEW_LINE> <INDENT> def __init__(self, attributes): <NEW_LINE> <INDENT> Property.__init__(self, attributes) <NEW_LINE> self.build_cost = attributes['build_cost'] <NEW_LINE> self.rent_monopoly = self.rent * 2 <NEW_LINE> self.rent_house_1 = attributes['rent_house_1'] <NEW_LINE> self.rent_house_2 =... | Street Object - more accurately a bitcoin technology, company, or service | 62598f5c5e10d32532ce33b2 |
class HasSchema: <NEW_LINE> <INDENT> def __init__(self, input_schema_class=None, fail=True, normalize=False): <NEW_LINE> <INDENT> self.input_schema_class = input_schema_class <NEW_LINE> self.fail = fail <NEW_LINE> self.normalize = normalize <NEW_LINE> self.schema = None <NEW_LINE> <DEDENT> def mark(self, cls): <NEW_LIN... | decorator for classes with methods whose output can be validated by jsonschema | 62598f5c0383005118f6cc9c |
class Command(object): <NEW_LINE> <INDENT> def __init__(self, actor, line): <NEW_LINE> <INDENT> self.supplier = None <NEW_LINE> self.actor = actor <NEW_LINE> self.line = line <NEW_LINE> parts = space_matcher.split(line, 1) <NEW_LINE> if len(parts) == 1: <NEW_LINE> <INDENT> command, arg_line = parts[0], "" <NEW_LINE> <D... | A command sent by a player to be executed in mud world. | 62598f5c9b70327d1c57e33d |
class YahooActionReader(YahooDailyReader): <NEW_LINE> <INDENT> def read(self): <NEW_LINE> <INDENT> data = super(YahooActionReader, self).read() <NEW_LINE> actions = {} <NEW_LINE> if isinstance(data.columns, MultiIndex): <NEW_LINE> <INDENT> data = data.swaplevel(0, 1, axis=1) <NEW_LINE> for s in data.columns.levels[0]: ... | Returns DataFrame of historical corporate actions (dividends and stock
splits) from symbols, over date range, start to end. All dates in the
resulting DataFrame correspond with dividend and stock split ex-dates. | 62598f5c56b00c62f0fb1e4c |
class TestReplaceCatalog(base.BigramSplitterTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> qi = self.portal.portal_quickinstaller <NEW_LINE> qi.installProduct('BigramSplitter') <NEW_LINE> <DEDENT> def testWordSplitter(self): <NEW_LINE> <INDENT> from Products.ZCTextIndex.PipelineFactory import ... | Replace the catalog | 62598f5c63f4b57ef008583b |
class _UnconstrainedDeviceType(Device): <NEW_LINE> <INDENT> def duration_of(self, operation): <NEW_LINE> <INDENT> return Duration(picos=0) <NEW_LINE> <DEDENT> def validate_operation(self, operation): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def validate_scheduled_operation(self, schedule, scheduled_operation): <NEW... | A device that allows everything. | 62598f5c6fece00bbaccaf29 |
class CombinedReactionTrees: <NEW_LINE> <INDENT> def __init__(self, reaction_trees: Sequence[ReactionTree]) -> None: <NEW_LINE> <INDENT> self.graph = nx.DiGraph() <NEW_LINE> first_rt = reaction_trees[0] <NEW_LINE> self.root = first_rt.root <NEW_LINE> self.graph.add_node(self.root, in_stock=first_rt.in_stock(self.root))... | Encapsulation of an algorithm that combines several reaction trees into a
larger bipartite graph with all reactions and molecules.
The reactions at a specific level of the reaction trees are grouped based
on the reaction smiles.
:params reactions_trees: the list of reaction trees to combine | 62598f5cd18da76e235b6c01 |
class INumberFormat(IFormat): <NEW_LINE> <INDENT> type = Field( title=_u("Type"), description=(_u("The type into which a string is parsed. If ``None``, " "then ``int`` will be used for whole numbers and " "``float`` for decimals.")), default=None, required=False) <NEW_LINE> symbols = Dict( title=_u("Number Symbols"), k... | Specific number formatting interface. Here are the formatting
rules (I modified the rules from ICU a bit, since I think they did not
agree well with the real world XML formatting strings):
.. code-block:: none
posNegPattern := ({subpattern};{subpattern} | {subpattern})
subpattern := {padding}{prefix}... | 62598f5cff9c53063f519be7 |
class Size(): <NEW_LINE> <INDENT> def __init__(self, w, h=None): <NEW_LINE> <INDENT> if h == None: <NEW_LINE> <INDENT> self.w, self.h = w <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.w, self.h = w, h <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def t(self): <NEW_LINE> <INDENT> return (self.w, self.h) <NEW_LI... | A size class just to make things a bit easier. | 62598f5c91af0d3eaad3939f |
class Renderer(base.Renderer): <NEW_LINE> <INDENT> render = ViewPageTemplateFile('treeportlet.pt') <NEW_LINE> def header(self): <NEW_LINE> <INDENT> current = aq_inner(self.context) <NEW_LINE> if self.root_path() is not None: <NEW_LINE> <INDENT> portal_url = getToolByName(self.context, 'portal_url') <NEW_LINE> current =... | Portlet renderer.
This is registered in configure.zcml. The referenced page template is
rendered, and the implicit variable 'view' will refer to an instance
of this class. Other methods can be added and referenced in the template. | 62598f5c507cdc57c63a4335 |
class Meta: <NEW_LINE> <INDENT> verbose_name_plural = 'Hint_definition' | Changes the name displayed in the admin interface | 62598f5c4d74a7450cd589a4 |
class raises(object): <NEW_LINE> <INDENT> def __init__(self, ExcType): <NEW_LINE> <INDENT> self.ExcType = ExcType <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_t): <NEW_LINE> <INDENT> if exc_type: <NEW_LINE> <INDENT> if issubclass(exc_typ... | test helper in the form of a context manager, to assert that something raises an exception | 62598f5c56b00c62f0fb1e4e |
class OnlyTriggers(AbstractCallable): <NEW_LINE> <INDENT> def _give_targets(self): <NEW_LINE> <INDENT> return None | Baseclass for actions that do not have any targets (i.e. almost all actions). | 62598f5cac7a0e7691f71aaa |
class TestEntitiesController(BaseTestCase): <NEW_LINE> <INDENT> async def test_get_entity(self): <NEW_LINE> <INDENT> await test_service.get_entity(self) <NEW_LINE> <DEDENT> async def test_list_entity_addresses(self): <NEW_LINE> <INDENT> await test_service.list_entity_addresses(self) <NEW_LINE> <DEDENT> async def test_l... | EntitiesController integration test stubs | 62598f5cd18da76e235b6c02 |
class PostImport(generic.FormView): <NEW_LINE> <INDENT> template_name = 'main/import.html' <NEW_LINE> success_url = reverse_lazy('main:index') <NEW_LINE> form_class = CSVUploadForm <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> ctx = super().get_context_data(**kwargs) <NEW_LINE> ctx['form_name'] =... | テーブルの登録(csvアップロード) | 62598f5cff9c53063f519be9 |
class Proposition(AbstractNode): <NEW_LINE> <INDENT> def __init__(self, id, name, mentions, attributor, terms, entailment_graph): <NEW_LINE> <INDENT> AbstractNode.__init__(self, id, name, mentions, terms, entailment_graph) <NEW_LINE> self.attributor = attributor | A class for a proposition in the graph | 62598f5c5e10d32532ce33b4 |
@yaml_seq <NEW_LINE> class CartForces(Atoms3D): <NEW_LINE> <INDENT> pass | Cartesian forces as (natom, 3) array | 62598f5c56b00c62f0fb1e50 |
class Motorcycle(Vehicle): <NEW_LINE> <INDENT> wheels = 2 <NEW_LINE> def vehicle_type(self): <NEW_LINE> <INDENT> return "Motorcycle" | Класс, описывающий мотоцикл. | 62598f5cff9c53063f519beb |
class FotoladuDialogTest(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_icon_png(self): <NEW_LINE> <INDENT> path = ':/plugins/Fotoladu/icon.png' <NEW_LINE> icon = QIcon(path) <NEW_LINE> self.... | Test rerources work. | 62598f5c76d4e153a661c1ac |
class CommonsenseQAProcessor(DataProcessor): <NEW_LINE> <INDENT> SPLITS = ['qtoken', 'rand'] <NEW_LINE> LABELS = ['A', 'B', 'C', 'D', 'E'] <NEW_LINE> TRAIN_FILE_NAME = 'train_{split}_split.jsonl' <NEW_LINE> DEV_FILE_NAME = 'dev_{split}_split.jsonl' <NEW_LINE> TEST_FILE_NAME = 'test_{split}_split_no_answers.jsonl' <NEW_... | Processor for the CommonsenseQA data set. | 62598f5c167d2b6e312b6519 |
class MovieTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.new_movie = Movie(1234,'Python Be Crazy','A thrilling new Python Series','https://immage.tmdb.org/t/p/w500/khsjha27hbs',8.5,129993) <NEW_LINE> <DEDENT> def test_instance(self): <NEW_LINE> <INDENT> self.assertTrue(isinstanc... | Test Class to test the behaviour of the Movie class | 62598f5c711fe17d825dfc92 |
class HostnameVerifier(CoroutinePlugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(HostnameVerifier, self).__init__(category="cert", name="Hostname Verifier") <NEW_LINE> self.severity = Severity.WARNING <NEW_LINE> <DEDENT> def run_coroutine(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDE... | This plugin checks if:
1. `AllowAllHostnameVerifier` is instantiated
2. `setHostnameVerifier` is called with a value of `.ALLOW_ALL_HOSTNAME_VERIFIERS` | 62598f5cff9c53063f519bed |
class search_args(object): <NEW_LINE> <INDENT> def __init__(self, query=None, n=None, sorting=None,): <NEW_LINE> <INDENT> self.query = query <NEW_LINE> self.n = n <NEW_LINE> self.sorting = sorting <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans... | Attributes:
- query
- n
- sorting | 62598f5c462c4b4f79dbafa2 |
class Scheduler(object): <NEW_LINE> <INDENT> def __init__(self, ndata, nprocs, chunk=None, schedule='guided'): <NEW_LINE> <INDENT> if schedule not in ['guided', 'dynamic', 'static']: <NEW_LINE> <INDENT> raise ValueError('unknown scheduling strategy') <NEW_LINE> <DEDENT> self._ndata = mp.RawValue(ctypes.c_int, ndata) <N... | Provide chunks of data to work on based on various 'schedule' algorithms. | 62598f5c6fece00bbaccaf30 |
class Parallel(Worker): <NEW_LINE> <INDENT> def __init__(self, func, iterable_arg, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(func, iterable_arg, *args, **kwargs) <NEW_LINE> <DEDENT> def _init_lock(self, l_): <NEW_LINE> <INDENT> global lock <NEW_LINE> lock = l_ <NEW_LINE> <DEDENT> def _arg_kw(self, func, k,... | Class that inherit from `Worker` and subsequently provides parallel
processing functionality to a target function.
See Also
--------
Worker | 62598f5cd164cc6175820516 |
class MotionVersion(RESTModelMixin, AbsoluteUrlMixin, models.Model): <NEW_LINE> <INDENT> motion = models.ForeignKey(Motion, related_name='versions') <NEW_LINE> version_number = models.PositiveIntegerField(default=1) <NEW_LINE> title = models.CharField(max_length=255, verbose_name=ugettext_lazy("Title")) <NEW_LINE> text... | A MotionVersion object saves some date of the motion. | 62598f5c5e10d32532ce33b7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.