code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ComplexMaterial: <NEW_LINE> <INDENT> def __init__(self, setMaterialsAndWavelength, name): <NEW_LINE> <INDENT> self.__mat = setMaterialsAndWavelength <NEW_LINE> self.__name = name <NEW_LINE> <DEDENT> def get_mat(self): <NEW_LINE> <INDENT> return self.__mat <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT... | This class has got a dictionary of SingleMaterial with his wavelength | 6259905aac7a0e7691f73abe |
class Control(ioctl.Control): <NEW_LINE> <INDENT> magic = BTRFS_IOCTL_MAGIC | A btrfs IOCTL. | 6259905a7047854f4634099c |
class PyCdlibISO9660(object): <NEW_LINE> <INDENT> __slots__ = ('pycdlib_obj',) <NEW_LINE> def __init__(self, pycdlib_obj): <NEW_LINE> <INDENT> self.pycdlib_obj = pycdlib_obj <NEW_LINE> <DEDENT> def get_file_from_iso(self, local_path, iso_path): <NEW_LINE> <INDENT> self.pycdlib_obj.get_file_from_iso(local_path, iso_path... | The class representing the PyCdlib ISO9660 facade. | 6259905a435de62698e9d3e0 |
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = MyUser <NEW_LINE> fields = ('username', 'password', 'is_active', 'is_admin') <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE> <INDENT> return self.initial["passwor... | A form for updating users. Includes all the fields on
the user, but replaces the password field with admin's
password hash display field. | 6259905aa17c0f6771d5d690 |
class Logger(object): <NEW_LINE> <INDENT> logFile="logFile.txt" <NEW_LINE> @staticmethod <NEW_LINE> def writeAndPrintLine(text, errorLevel): <NEW_LINE> <INDENT> message=Logger.getTimeStamp()+' '+Logger.getErrorString(errorLevel)+':\t'+text <NEW_LINE> file=open(Logger.logFile, "a") <NEW_LINE> file.write(message+'\n') <N... | description of class | 6259905aadb09d7d5dc0bb47 |
class RescaleTransformTest(ClassTest): <NEW_LINE> <INDENT> def define_tests(self, dataset, range_): <NEW_LINE> <INDENT> min_, max_ = range_ <NEW_LINE> return [ RescaleTransformTestMin(dataset, min_), RescaleTransformTestMax(dataset, max_), ] <NEW_LINE> <DEDENT> def define_class_name(self): <NEW_LINE> <INDENT> return "R... | Test class RescaleTransform | 6259905a8a43f66fc4bf376a |
class RateLimit(object): <NEW_LINE> <INDENT> def __init__(self, verb, uri, regex, value, remain, unit, next_available): <NEW_LINE> <INDENT> self.verb = verb <NEW_LINE> self.uri = uri <NEW_LINE> self.regex = regex <NEW_LINE> self.value = value <NEW_LINE> self.remain = remain <NEW_LINE> self.unit = unit <NEW_LINE> self.n... | Data model that represents a flattened view of a single rate limit. | 6259905a21bff66bcd724242 |
class CustomIndexDashboard(Dashboard): <NEW_LINE> <INDENT> def init_with_context(self, context): <NEW_LINE> <INDENT> site_name = get_admin_site_name(context) <NEW_LINE> self.children.append(modules.ModelList( _('User Administration'), column=1, collapsible=False, models=('django.contrib.auth.*',) ), ) <NEW_LINE> self.c... | Custom index dashboard for www. | 6259905abe8e80087fbc0660 |
class RegisterClass(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getProfile(self, entryList): <NEW_LINE> <INDENT> custParms = [] <NEW_LINE> for i in entryList: <NEW_LINE> <INDENT> custParms.append(i.get()) <NEW_LINE> <DEDENT> custLogic = Customer(**custParms) <NEW_LINE> cu... | This class models the Register for new customers. Takes customer
information and validates customer via email or cellphone | 6259905aa219f33f346c7de2 |
class JwtPublicKeySignInternal(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def sign_and_encode_with_kid(self, token: _raw_jwt.RawJwt, kid: Optional[str]) -> str: <NEW_LINE> <INDENT> raise NotImplementedError() | Internal interface for creating a signed JWT.
"kid" is an optional value that is set by the wrapper for keys with output
prefix TINK, and it is set to None for output prefix RAW. | 6259905a99cbb53fe68324bd |
class SpokeKVConn: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.config = config.setup() <NEW_LINE> self.log = logger.setup(__name__) <NEW_LINE> self.kv_host = self.config.get('KV', 'kv_host') <NEW_LINE> self.kv_port = int(self.config.get('KV', 'kv_port', 6379)) <NEW_LINE> self.kv_db = self.config.ge... | Class representing Redis server connection. | 6259905a07f4c71912bb0a18 |
class AutoscalingModule(_messages.Message): <NEW_LINE> <INDENT> coolDownPeriodSec = _messages.IntegerField(1, variant=_messages.Variant.INT32) <NEW_LINE> description = _messages.StringField(2) <NEW_LINE> maxNumReplicas = _messages.IntegerField(3, variant=_messages.Variant.INT32) <NEW_LINE> minNumReplicas = _messages.In... | A AutoscalingModule object.
Fields:
coolDownPeriodSec: A integer attribute.
description: A string attribute.
maxNumReplicas: A integer attribute.
minNumReplicas: A integer attribute.
signalType: A string attribute.
targetModule: A string attribute.
targetUtilization: target_utilization should be in range... | 6259905a3cc13d1c6d466d1d |
class ScanNet(Dataset): <NEW_LINE> <INDENT> def __init__(self, io, dataroot, partition='train'): <NEW_LINE> <INDENT> self.partition = partition <NEW_LINE> self.data, self.label = load_data_h5py_scannet10(self.partition, dataroot) <NEW_LINE> self.num_examples = self.data.shape[0] <NEW_LINE> if partition == "train": <NEW... | scannet dataset for pytorch dataloader | 6259905a15baa7234946356f |
class StoryList(BaseListAPIView): <NEW_LINE> <INDENT> serializer_class = StoryReadSerializer <NEW_LINE> model = Story | This endpoint allows you to list stories.
## Listing stories
By making a ```GET``` request you can list all the stories for an organization, filtering them as needed. Each
story has the following attributes:
* **id** - the ID of the story (int)
* **title** - the TITLE of the story (string)
* **featured** - whether ... | 6259905a63d6d428bbee3d76 |
class ScreenRecord(AbstractTimestampTrashBinModel): <NEW_LINE> <INDENT> case = models.ForeignKey(Case, related_name='screens', on_delete=models.CASCADE) <NEW_LINE> name = models.CharField("screen name", max_length=40) <NEW_LINE> start_time = models.DateTimeField(default=now) <NEW_LINE> end_time = models.DateTimeField(n... | A record of each screen that was visited during the call,
and the operator's input. | 6259905ae76e3b2f99fd9fdc |
class TestFusion(unittest.TestCase): <NEW_LINE> <INDENT> def test_fusion_command(self): <NEW_LINE> <INDENT> gtf_file = '/'.join([ '/cluster/projects/carlsgroup/workinprogress/abdel', '20170418_INSPIRE_RNA/gencode.v26.annotation.gtf' ]) <NEW_LINE> fusions = get_fusions( junction='STAR/LTS-035_T_RNA_GCCAAT_L007Chimeric.o... | A simple test class. | 6259905a9c8ee82313040c79 |
class Structure(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=256, verbose_name=_(u"Nom")) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _(u"Structure") <NEW_LINE> verbose_name_plural = _(u"Structures") <... | Represents an organisational structure, to which users are related. | 6259905a379a373c97d9a602 |
class Update(_UpdateBase): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> @staticmethod <NEW_LINE> def from_dict(message_update): <NEW_LINE> <INDENT> if message_update is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return Update(message_update.get('update_id'), Message.from_result(message_update.get('messa... | This object represents an incoming update.
Attributes:
update_id (int) :The update‘s unique identifier. Update identifiers start from a certain
positive number and increase sequentially. This ID becomes especially handy
... | 6259905aac7a0e7691f73ac0 |
class Corr2d: <NEW_LINE> <INDENT> def __init__(self, data, labels=None, **kw): <NEW_LINE> <INDENT> if labels == None: <NEW_LINE> <INDENT> labels = ["P"+str(i+1) for i,_ in enumerate(data)] <NEW_LINE> <DEDENT> self.N = len(data) <NEW_LINE> self.labels = labels <NEW_LINE> self.data = data <NEW_LINE> self.hists = _hists(d... | Generate and manage 2D correlation histograms. | 6259905a435de62698e9d3e2 |
class GraphObjectFactory(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create(object_name, *args, **kwargs): <NEW_LINE> <INDENT> is_array = object_name in graph_reference.ARRAYS <NEW_LINE> is_object = object_name in graph_reference.OBJECTS <NEW_LINE> if not (is_array or is_object): <NEW_LINE> <INDENT> raise... | GraphObject creation in this module should run through this factory. | 6259905a379a373c97d9a603 |
class ProjectBuildJobsResource(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def get(self, project_id): <NEW_LINE> <INDENT> permissions.check_admin_permissions() <NEW_LINE> projects_service.get_project(project_id) <NEW_LINE> return playlists_service.get_build_jobs_for_project(project_id) | Retrieve all build jobs related to given project.
It's mainly used for synchronisation purpose. | 6259905a30dc7b76659a0d6f |
class NotFound(Exception): <NEW_LINE> <INDENT> pass | Raise when stats could not be found | 6259905a01c39578d7f14226 |
class GpVarDiagView(GpMeanVarBaseView): <NEW_LINE> <INDENT> _route_name = GP_VAR_DIAG_ROUTE_NAME <NEW_LINE> _pretty_route_name = GP_VAR_DIAG_PRETTY_ROUTE_NAME <NEW_LINE> response_schema = GpVarDiagResponse() <NEW_LINE> @view_config(route_name=_pretty_route_name, renderer=PRETTY_RENDERER) <NEW_LINE> def pretty_view(self... | Views for gp_var_diag endpoints. | 6259905ad99f1b3c44d06c80 |
class MockedConnectionTest(unittest.TestCase): <NEW_LINE> <INDENT> nsqd_ports = (12345, 12346) <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> with mock.patch('nsq.client.connection.Connection', MockConnection): <NEW_LINE> <INDENT> hosts = ['localhost:%s' % port for port in self.nsqd_ports] <NEW_LINE> self.client = Cli... | Create a client with mocked connection objects | 6259905a2ae34c7f260ac6c6 |
class QueryParseException(Exception): <NEW_LINE> <INDENT> pass | Raised by parse_query() when a query is invalid. | 6259905aadb09d7d5dc0bb49 |
class OperationalError(exceptions.SQLOperationalError): <NEW_LINE> <INDENT> pass | Exception raised for errors that are related to the database's
operation and not necessarily under the control of the programmer,
e.g. an unexpected disconnect occurs, the data source name is not
found, a transaction could not be processed, a memory allocation
error occurred during processing, etc. | 6259905a8e71fb1e983bd0a9 |
class Format(object): <NEW_LINE> <INDENT> def __init__(self, name, acronym, extensions, content_types): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.acronym = acronym <NEW_LINE> self.extensions = extensions <NEW_LINE> self.content_types = content_types <NEW_LINE> <DEDENT> @property <NEW_LINE> def extension(self... | A format represents a file format. | 6259905aa219f33f346c7de4 |
class ImageTestCases(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> funny = Category(name = "funny") <NEW_LINE> funny.save() <NEW_LINE> africa = Location(name = "Africa") <NEW_LINE> africa.save() <NEW_LINE> self.new_image = Image(name = "image",description = "h",location = africa,category = funny) ... | This is the class we will use to test the images | 6259905abaa26c4b54d50884 |
class PopupOperation(Popup): <NEW_LINE> <INDENT> def when_opened(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def update(self, title, text): <NEW_LINE> <INDENT> self.ids['message_operation_lbl'].text = text <NEW_LINE> self.title = title <NEW_LINE> <DEDENT> def close_after(self, dt=2.): <NEW_LINE> <INDENT> Clock.... | display a popup while an operation occures | 6259905ae76e3b2f99fd9fde |
class Instance(Field.Instance): <NEW_LINE> <INDENT> pass | An instance of the String field. | 6259905acc0a2c111447c5be |
class tektronixDPO5054(tektronixDPO5000): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__dict__.setdefault('_instrument_id', 'DPO5054') <NEW_LINE> super(tektronixDPO5054, self).__init__(*args, **kwargs) <NEW_LINE> self._analog_channel_count = 4 <NEW_LINE> self._digital_channel_count... | Tektronix DPO5054 IVI oscilloscope driver | 6259905a63b5f9789fe86752 |
class Permutation(nn.Module): <NEW_LINE> <INDENT> def __init__(self, dim): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.dim = dim <NEW_LINE> <DEDENT> def forward(self, inputs): <NEW_LINE> <INDENT> if self.dim <= 1: <NEW_LINE> <INDENT> return inputs <NEW_LINE> <DEDENT> nr_dims = len(inputs.size()) <NEW_LINE> i... | Create r! new predicates by permuting the axies for r-arity predicates. | 6259905a462c4b4f79dbcfe5 |
class TraceFreeBreakpoint(gdb.Breakpoint): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TraceFreeBreakpoint, self).__init__("__libc_free", gdb.BP_BREAKPOINT, internal=True) <NEW_LINE> self.silent = True <NEW_LINE> return <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> if is_x86_32(): <NEW_L... | Track calls to free() and attempts to detect inconsistencies. | 6259905a460517430c432b42 |
class KeyFSettings(FSettings): <NEW_LINE> <INDENT> def __init__(self, service_name = 'KeyFSettings'): <NEW_LINE> <INDENT> self.service_name = service_name <NEW_LINE> <DEDENT> def set(self, settings): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> for k,v in settings.items(): <NEW_LINE> <INDENT> keyring.set_password(self.... | A keyring based class settings
| 6259905aac7a0e7691f73ac2 |
class ModelAPI(StorageAPI): <NEW_LINE> <INDENT> def __init__(self, model_cls, name=None, **kwargs): <NEW_LINE> <INDENT> super(ModelAPI, self).__init__(**kwargs) <NEW_LINE> self._model_cls = model_cls <NEW_LINE> self._name = name or model_cls.__modelname__ <NEW_LINE> self._thread_local = threading.local() <NEW_LINE> sel... | Base class for model APIs ("MAPI"). | 6259905a99cbb53fe68324c0 |
class GridNode(): <NEW_LINE> <INDENT> def __init__(self, world, ID = None, **kwProperties): <NEW_LINE> <INDENT> self.__getAgent = world.getAgent <NEW_LINE> <DEDENT> def register(self, world, parentEntity=None, liTypeID=None, ghost=False): <NEW_LINE> <INDENT> world.addAgent(self, ghost=ghost) <NEW_LINE> world.grid.regis... | This enhancement identifies the agent as part of a grid. Currently, it only
registers itself in the location dictionary, found in the world
(see world.grid.registerNode()) | 6259905ad53ae8145f919a42 |
class OnBotUnmuteEventThread(Thread): <NEW_LINE> <INDENT> def __init__( self, plugin_name: str, event: Event ): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> self.plugin_name = plugin_name <NEW_LINE> self.event = event <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> exec("from plugins import " + self.plug... | Bot被取消禁言调用 | 6259905a8e71fb1e983bd0aa |
class CachedProperty(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> update_wrapper(self, func) <NEW_LINE> self.func = func <NEW_LINE> <DEDENT> def __get__(self, obj, cls): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> value = obj.__dict__[self.func._... | A property that is only computed once per instance and then replaces
itself with an ordinary attribute. Deleting the attribute resets the
property. | 6259905abaa26c4b54d50885 |
class HomeSeerStatusDevice: <NEW_LINE> <INDENT> def __init__(self, raw_data: dict, request: Callable) -> None: <NEW_LINE> <INDENT> self._raw_data = raw_data <NEW_LINE> self._request = request <NEW_LINE> self._update_callback = None <NEW_LINE> self._suppress_update_callback = False <NEW_LINE> <DEDENT> @property <NEW_LIN... | Representation of a HomeSeer device with no controls (i.e. status only).
Base representation for all other HomeSeer device objects. | 6259905a91f36d47f2231980 |
class Solution: <NEW_LINE> <INDENT> def winSum(self, nums, k): <NEW_LINE> <INDENT> if k <= 0 or k > len(nums): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> n = len(nums) <NEW_LINE> sums = [0] * (n - k + 1) <NEW_LINE> for i in range(k): <NEW_LINE> <INDENT> sums[0] += nums[i] <NEW_LINE> <DEDENT> for i in range(1, n ... | @param: nums: a list of integers.
@param: k: length of window.
@return: the sum of the element inside the window at each moving. | 6259905a2ae34c7f260ac6c8 |
class ConfigResource(CORSResource, MarketplaceResource): <NEW_LINE> <INDENT> version = fields.CharField() <NEW_LINE> flags = fields.DictField('flags') <NEW_LINE> settings = fields.DictField('settings') <NEW_LINE> class Meta(MarketplaceResource.Meta): <NEW_LINE> <INDENT> detail_allowed_methods = ['get'] <NEW_LINE> list_... | A resource that is designed to be exposed externally and contains
settings or waffle flags that might be relevant to the client app. | 6259905a8a43f66fc4bf376e |
class Alien(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen): <NEW_LINE> <INDENT> super(Alien, self).__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.ai_settings = ai_settings <NEW_LINE> self.image = pygame.image.load('images/alien.bmp') <NEW_LINE> self.rect = self.image.get_rect() <NEW_LI... | 表示单个外星人的类 | 6259905a8e71fb1e983bd0ab |
class Sections(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if self.__class__ is Sections: <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> self._sections = {} <NEW_LINE> <DEDENT> def get_section_content(self, section_name): <NEW_LINE> <INDENT> return self._sections[section_name... | Abstract class to be inherited by all classes that implement
user editable code sections | 6259905a4428ac0f6e659b1d |
class Robot_data(object): <NEW_LINE> <INDENT> def __init__(self,data_dir,filename_list,batch_size,imshape,num_classes,crop_shape=[0,0,0], if_random_crop=True, if_flip=False, if_bright=False, if_contrast=False, if_whiten=False, num_epochs=0): <NEW_LINE> <INDENT> self.data_dir=data_dir <NEW_LINE> self.filename_list=filen... | Function: read image data from .tfrecords file. and provide for Net trainning.
raw_label_input() return labels with shape [batch];
one_hot_input() return one-hot labels with shape [batch,num_labels]
@author: shuang | 6259905a3c8af77a43b68a31 |
class AutomatedRunMixin(object): <NEW_LINE> <INDENT> def get_menu(self, *args): <NEW_LINE> <INDENT> jump = MenuManager(Action(name='Jump to End', action='jump_to_end'), Action(name='Jump to Start', action='jump_to_start'), name='Jump') <NEW_LINE> move = MenuManager(Action(name='Move to Start', action='move_to_start'), ... | mixin for table of automated runs that have not yet been executed | 6259905a21a7993f00c6754f |
class ThisSchema(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ThisSchema, self).__init__() <NEW_LINE> self.args = args <NEW_LINE> self.kwargs = kwargs | Tool Used to set inner schemas with the same type with specific arguments
.
ThisSchema one might be use at the condition instanciation methods must not
reference the class.
..example::
class Test(Schema):
# contain an inner schema nullable 'test' of type Test.
test = ThisSchema(nullable=False)
... | 6259905a7b25080760ed87d0 |
class Status(Enum): <NEW_LINE> <INDENT> pending = 'pending' <NEW_LINE> complete = 'complete' | Enumeration of values for `CoinbaseTransaction.status`. | 6259905a55399d3f05627b01 |
class CustomUserUpdateView( LoginRequiredMixin, PermissionRequiredMixin, UpdateView ): <NEW_LINE> <INDENT> model = CustomUser <NEW_LINE> template_name = "customuser_update.html" <NEW_LINE> fields = ( "username", "first_name", "last_name", "email", "shifts_per_roster", "enforce_shifts_per_roster", "enforce_one_shift_per... | UserUpdateView. | 6259905a73bcbd0ca4bcb875 |
class User(ResponseObject): <NEW_LINE> <INDENT> REQUEST_URL = "user.json" <NEW_LINE> def __init__(self, api): <NEW_LINE> <INDENT> response = api.get(url=self.REQUEST_URL) <NEW_LINE> super().__init__(response) | A user represents a single Buffer user account. | 6259905a76e4537e8c3f0b6e |
class BugOra19584051(tests.MySQLConnectorTests): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> config = tests.get_mysql_config() <NEW_LINE> self.cnx = connection.MySQLConnection(**config) <NEW_LINE> self.cursor = self.cnx.cursor() <NEW_LINE> self.tbl = 'Bug19584051' <NEW_LINE> self.cursor.execute("DROP TABLE... | BUG#19584051: TYPE_CODE DOES NOT COMPARE EQUAL
| 6259905aa79ad1619776b5ae |
@attr.s(auto_attribs=True, init=False) <NEW_LINE> class LookmlModelExploreSet(model.Model): <NEW_LINE> <INDENT> name: Optional[str] = None <NEW_LINE> value: Optional[Sequence[str]] = None <NEW_LINE> def __init__( self, *, name: Optional[str] = None, value: Optional[Sequence[str]] = None ): <NEW_LINE> <INDENT> self.name... | Attributes:
name: Name
value: Value set | 6259905ad6c5a102081e3703 |
class ValidationError(ValidationErrors): <NEW_LINE> <INDENT> def __init__(self, message, value, invalid, against, path=None): <NEW_LINE> <INDENT> errors = [{ 'error': 'ValidationError', 'message': message, 'value': value, 'invalid': invalid, 'against': against, 'path': path or '', }] <NEW_LINE> super(ValidationError, s... | Cover a single validation error | 6259905a56ac1b37e63037d8 |
class InvalidLanguage(Exception): <NEW_LINE> <INDENT> pass | Error if the selected language is not available. | 6259905a3617ad0b5ee0772d |
class HalMessageError(object): <NEW_LINE> <INDENT> def __init__(self, source = "", message = "", m_exception = None, stack_trace = "NA", **kwds): <NEW_LINE> <INDENT> super().__init__(**kwds) <NEW_LINE> if not isinstance(source, str): <NEW_LINE> <INDENT> raise HalMessageException("source is not of type 'str'") <NEW_LINE... | If a module has a problem with a message that it can't handle then
it should call the message's addError() method with one of these objects. | 6259905a4e4d5625663739e9 |
class HashTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.model = gensim.models.fasttext.load_facebook_model(datapath('crime-and-punishment.bin')) <NEW_LINE> with smart_open.smart_open(datapath('crime-and-punishment.vec'), 'r', encoding='utf-8') as fin: <NEW_LINE> <INDENT> self.ex... | Loosely based on the test described here:
https://github.com/RaRe-Technologies/gensim/issues/2059#issuecomment-432300777
With a broken hash, vectors for non-ASCII keywords don't match when loaded
from a native model. | 6259905a7047854f463409a2 |
class BinarySearchTreeNode(BinaryTreeNode): <NEW_LINE> <INDENT> def __init__(self, d: int, parent: 'BinarySearchTreeNode'): <NEW_LINE> <INDENT> super().__init__(d) <NEW_LINE> self.parent = parent <NEW_LINE> self.size = 1 <NEW_LINE> <DEDENT> def insert(self, d: int) -> 'BinarySearchTreeNode': <NEW_LINE> <INDENT> self.si... | A very basic node in a binary tree.
Insert, find, and delete functionality shamelessly modeled from code at
https://en.wikipedia.org/wiki/Binary_search_tree
Attributes:
parent: The parent node
size: The number of nodes in this subtree, beginning at 1. | 6259905ad53ae8145f919a44 |
class Mouse(object): <NEW_LINE> <INDENT> def __init__(self, filename='/dev/input/mice'): <NEW_LINE> <INDENT> self.mouse = open(filename, 'rb') <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_value, traceback): <NEW_LINE> <INDENT> self.mouse.c... | Provides the ability to use `with Mouse() as mouse:` syntax to grab
mouse updates over in the Robot class | 6259905ae5267d203ee6ceb1 |
class ConnectionObject(object): <NEW_LINE> <INDENT> def __init__(self, region): <NEW_LINE> <INDENT> self.__conns = {} <NEW_LINE> self.conn_obj = AwsAuth() <NEW_LINE> self.region = region <NEW_LINE> <DEDENT> def get_conn(self): <NEW_LINE> <INDENT> conn = self.__conns.get(self.region) <NEW_LINE> if conn is None: <NEW_LIN... | Help on class ConnectionObject in auth_manager module:
NAME
ConnectionObject
DESCRIPTION
This class provides an object of AwsAuth class.
self.__conns attribute stores already initialized connection objects.
If requested connection object doesn't exist in self.__conns get_conn method
will get i... | 6259905abaa26c4b54d50887 |
class WordlistTable(wx.ListCtrl): <NEW_LINE> <INDENT> def __init__(self, parent, *args, **kwargs): <NEW_LINE> <INDENT> wx.ListCtrl.__init__(self, parent, *args, **kwargs) <NEW_LINE> self.parent = parent <NEW_LINE> self.wordlist = None <NEW_LINE> self.sortbyend = False <NEW_LINE> self.sortbyfreq = False <NEW_LINE> self.... | table for displaying the wordlist
attributes:
sortbyend sort wordlist by word ends?
sortbyfreq sort wordlist by frequency?
searchterm term that is searched within the list
lasthit index of the last found item
parent the parent window
wordlist the wordlist to be displayed | 6259905a507cdc57c63a6388 |
class CoreApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> if api_client is None: <NEW_LINE> <INDENT> api_client = ApiClient() <NEW_LINE> <DEDENT> self.api_client = api_client <NEW_LINE> <DEDENT> def get_api_versions(self, **kwargs): <NEW_LINE> <INDENT> kwargs['_return_http_data... | NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually. | 6259905aa17c0f6771d5d693 |
class View(six.with_metaclass(ViewMeta, models.Model)): <NEW_LINE> <INDENT> _deferred = False <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> managed = False | Helper for exposing Postgres views as Django models.
| 6259905a435de62698e9d3e7 |
class SendDialog(Widget): <NEW_LINE> <INDENT> def handle_paint(self, event): print('SendDialog: {}'.format(event)) | SendDialog是行为的控件。SendDialog仅能处理paint事件。 | 6259905a32920d7e50bc7629 |
class HexPresentor: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def present(self, data: bytes, step: int, pos: int, early=False) -> (list, list, list, int): <NEW_LINE> <INDENT> hex_rows = self._hex_creator(data, step) <NEW_LINE> ascii_rows = self._ascii_creator(data, ... | Класс предоставляет метод для конвертации данных в хекс формат.
Не меняйте длинну строки для уже сформированных данных. | 6259905a6e29344779b01c30 |
class UnauthorizedException(Exception): <NEW_LINE> <INDENT> pass | Authorization failed | 6259905a2ae34c7f260ac6ca |
class Languages(Base): <NEW_LINE> <INDENT> __tablename__ = 'languages_tb' <NEW_LINE> language = Column(String, primary_key=True) <NEW_LINE> fullname = Column(String, nullable=False) <NEW_LINE> enabled_ddtss = Column(Boolean, nullable=False, default=True) <NEW_LINE> translation_model = Column(TranslationModelType, nulla... | Each language also has metainfo | 6259905a1b99ca4002290029 |
class _FilePointer(ndb.Model): <NEW_LINE> <INDENT> changeset_num = ndb.IntegerProperty(required=True) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return '<_FilePointer path:%s namespace:%s changeset: %s>' % ( self.key.id(), self.key.namespace(), self.changeset_num) <NEW_LINE> <DEDENT> @property <NEW_LINE> def ve... | Pointer from a root file path to its current file version.
All _FilePointers are in the same entity group. As such, the entities
are updated atomically to point a set of files at new versions.
Attributes:
key.id(): Root file path string. Example: '/foo.html'
changeset_num: An integer pointing to the file's latest... | 6259905a2c8b7c6e89bd4dd1 |
class SessionSupport: <NEW_LINE> <INDENT> def session(self): <NEW_LINE> <INDENT> return openSession() | Class that provides for the services that use SQLAlchemy the session support.
All services that use SQLAlchemy have to extend this class in order to provide the sql alchemy session
of the request, the session will be automatically handled by the session processor. | 6259905a8da39b475be047c9 |
class ValueFromStringSubstring(Transformation): <NEW_LINE> <INDENT> def __init__(self, variable, patterns, case_sensitive=False, match_beginning=False): <NEW_LINE> <INDENT> super().__init__(variable) <NEW_LINE> self.patterns = patterns <NEW_LINE> self.case_sensitive = case_sensitive <NEW_LINE> self.match_beginning = ma... | Transformation that computes a discrete variable from a string variable by
pattern matching.
Given patterns `["abc", "a", "bc", ""]`, string data
`["abcd", "aa", "bcd", "rabc", "x"]` is transformed to values of the new
attribute with indices`[0, 1, 2, 0, 3]`.
Args:
variable (:obj:`~Orange.data.StringVariable`): t... | 6259905a3539df3088ecd87f |
class TestViewsDepends(ModuleTestCase): <NEW_LINE> <INDENT> module = "inventory_report" | Test views and depends | 6259905a7b25080760ed87d1 |
class SpiderServicer(object): <NEW_LINE> <INDENT> def SpiderConn(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 Report(self, req... | The spider service definition.
| 6259905a55399d3f05627b03 |
class getProductDesc_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not N... | Attributes:
- success | 6259905a63b5f9789fe86756 |
class Profile(ndb.Model): <NEW_LINE> <INDENT> displayName = ndb.StringProperty() <NEW_LINE> mainEmail = ndb.StringProperty() <NEW_LINE> teeShirtSize = ndb.StringProperty(default='NOT_SPECIFIED') <NEW_LINE> conferenceKeysToAttend = ndb.StringProperty(repeated=True) <NEW_LINE> sessionsWishList = ndb.StringProperty(repeat... | Profile -- User profile object | 6259905a07f4c71912bb0a1f |
class AMQPAdmin(object): <NEW_LINE> <INDENT> Shell = AMQShell <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.app = kwargs['app'] <NEW_LINE> self.out = kwargs.setdefault('out', sys.stderr) <NEW_LINE> self.silent = kwargs.get('silent') <NEW_LINE> self.args = args <NEW_LINE> <DEDENT> def connect(... | The celery :program:`celery amqp` utility. | 6259905a379a373c97d9a608 |
class PrivateTagsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = get_user_model().objects.create_user( 'test@londonapp.com', 'password123' ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_tags(self)... | test the authorized user tags API | 6259905a460517430c432b44 |
class TestHasOnlyReadOnly(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_HasOnlyReadOnly(self): <NEW_LINE> <INDENT> pass | HasOnlyReadOnly unit test stubs | 6259905aac7a0e7691f73ac6 |
class Median(RMS) : <NEW_LINE> <INDENT> def __init__ ( self , xmin , xmax ) : <NEW_LINE> <INDENT> RMS.__init__ ( self , xmin , xmax , err = False ) <NEW_LINE> <DEDENT> def _median_ ( self , func , xmin , xmax , *args ) : <NEW_LINE> <INDENT> from ostap.math.integral import Integral <NEW_LINE> iint = Integral ( fu... | Calculate median for the distribution or function
>>> xmin,xmax = 0,math.pi
>>> median = Median ( xmin,xmax ) ## specify min/max
>>> value = median ( math.sin ) | 6259905aa8ecb033258727fb |
class Analysis(object): <NEW_LINE> <INDENT> def __init__(self, ts_start, config_file_location, test_id=None): <NEW_LINE> <INDENT> self.ts_start = ts_start <NEW_LINE> self.ts_end = None <NEW_LINE> self.test_id = test_id <NEW_LINE> self.config_file_location = config_file_location | Class that saves state for analysis to be conducted | 6259905ad53ae8145f919a46 |
class AverageAcquisition(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AverageAcquisition, self).__init__( *args, **kwargs) <NEW_LINE> cls = 'IviScope' <NEW_LINE> grp = 'AverageAcquisition' <NEW_LINE> ivi.add_group_capability(self, cls+grp) <NEW_LINE> self._acquisition_numb... | Extension IVI methods for oscilloscopes supporting average acquisition | 6259905a009cb60464d02b19 |
class Path(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_project_path(): <NEW_LINE> <INDENT> return PROJECT_DIRECTORY | The server class is responsible for exchanging encryption keys with the client,
sending communications ports, and creating the thread for each client that connects. | 6259905a7cff6e4e811b7028 |
class CheckRestrictionsResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'field_restrictions': {'readonly': True}, 'content_evaluation_result': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'field_restrictions': {'key': 'fieldRestrictions', 'type': '[FieldRestrictions]'}, 'content_evaluation... | The result of a check policy restrictions evaluation on a resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar field_restrictions: The restrictions that will be placed on various fields in the
resource by policy.
:vartype field_restrictions: list[~azure.mgmt.policyi... | 6259905a507cdc57c63a638a |
class PrivateField(serializers.ReadOnlyField): <NEW_LINE> <INDENT> def get_attribute(self, instance): <NEW_LINE> <INDENT> if self.context.get('request').user is not None: <NEW_LINE> <INDENT> if instance.id == self.context.get('request').user.id or self.context.get('request').user.is_superuser: <NEW_LINE> <INDENT> retur... | A Serializer Field class that can be used to hide sensitive User data in the JSON output | 6259905a30dc7b76659a0d72 |
class TestPortfolioPerformanceWriter(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.pp_writer = PortfolioPerformanceWriter() <NEW_LINE> self.pp_writer.init_output() <NEW_LINE> <DEDENT> def test_init_output(self): <NEW_LINE> <INDENT> self.assertEqual(",".join(PP_FIELDNAMES), self.pp_writer.out_... | Test case implementation for PortfolioPerformanceWriter | 6259905a009cb60464d02b1a |
class MasterPostModel(PostModel): <NEW_LINE> <INDENT> title = ndb.StringProperty(verbose_name=_("Title")) <NEW_LINE> slug = ndb.StringProperty() <NEW_LINE> slave_count = ndb.IntegerProperty(default=0) <NEW_LINE> content = model.FilteredHtmlProperty(verbose_name=_("Content")) <NEW_LINE> """Pagination for slaves.""" <NEW... | Base class for posts that make a new "topic", such as blog entries, and the forum posts that starts a thread. | 6259905a0fa83653e46f64cb |
class ConfirmExtractionForm(forms.Form): <NEW_LINE> <INDENT> pass | Empty form, used for confirming that the detection worked correctly
| 6259905a45492302aabfdabd |
class ClassifierMixin(object): <NEW_LINE> <INDENT> def score(self, X, y): <NEW_LINE> <INDENT> return np.mean(self.predict(X) == y) | Mixin class for all classifiers in scikit-learn | 6259905a004d5f362081fae0 |
class RendezvousError(Exception): <NEW_LINE> <INDENT> pass | Represents the base type for rendezvous errors. | 6259905a16aa5153ce401ac8 |
class NotModeratorError(Error): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message | Exception raised when user is not a moderator of a subreddit they
are trying to post to.
Attributes:
message: Explanation of the error | 6259905a1b99ca400229002a |
class Generator: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def generate_user() -> dict[str, str]: <NEW_LINE> <INDENT> user = { 'username': Generator.generate_user_name(), 'password': Generator.generate_password(), 'email': Generator.generate_mail() } <NEW_LINE> return user <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE... | Generator class to generate data. | 6259905a4428ac0f6e659b21 |
class LoginManagerHelper(): <NEW_LINE> <INDENT> headers = {"Content-Type": "application/json"} <NEW_LINE> login_url = get_config("hackathon-api.endpoint") + "/api/user/login" <NEW_LINE> def load_user(self, id): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> req = requests.get(self.login_url, {"id": id}) <NEW_LINE> login_... | Helper class for flask-login.LoginManager | 6259905a07f4c71912bb0a21 |
class OBOTerm(CVTerm): <NEW_LINE> <INDENT> dot_graph_name = "ontology_part" <NEW_LINE> def __init__(self, term_id, namespace, name, ontology, url_fmt=None, relationships=None, **kwargs): <NEW_LINE> <INDENT> super(OBOTerm, self).__init__(term_id, namespace, name, url_fmt) <NEW_LINE> self.relationships = relationships if... | Open Biomedical Ontologies term. | 6259905a76e4537e8c3f0b72 |
@public <NEW_LINE> @implementer(IBounceDetector) <NEW_LINE> class LLNL: <NEW_LINE> <INDENT> def process(self, msg): <NEW_LINE> <INDENT> for line in body_line_iterator(msg): <NEW_LINE> <INDENT> mo = acre.search(line) <NEW_LINE> if mo: <NEW_LINE> <INDENT> address = mo.group('addr').encode('us-ascii') <NEW_LINE> return No... | LLNL's custom Sendmail bounce message. | 6259905a462c4b4f79dbcfeb |
class ConnectionError(TransportError): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'ConnectionError(%s) caused by: %s(%s)' % ( self.error, self.info.__class__.__name__, self.info) | Error raised when there was an exception while talking to ES. | 6259905a8e7ae83300eea673 |
class TestBlockDeviceAPIAttachDetach(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.mock_client = MagicMock() <NEW_LINE> self.mock_client.con_info = CONF_INFO_MOCK <NEW_LINE> self.mock_client.backend_type = messages.SCBE_STRING <NEW_LINE> self.mock_client.map_volume = MagicMock() <NEW... | Unit testing for IBMStorageBlockDeviceAPI Class attach detach methods | 6259905a460517430c432b45 |
class Scrape(object): <NEW_LINE> <INDENT> def __init__(self, soup): <NEW_LINE> <INDENT> self.soup = soup <NEW_LINE> <DEDENT> def links(self): <NEW_LINE> <INDENT> homepage_url = "http://www.agriculture.gov.au" <NEW_LINE> atags = self.soup.find('ul', class_="flex-container").find_all('a') <NEW_LINE> links = [homepage_url... | fethes every field | 6259905add821e528d6da473 |
class UtilCCHelper(object): <NEW_LINE> <INDENT> def __init__(self, type_manager): <NEW_LINE> <INDENT> self._type_manager = type_manager <NEW_LINE> <DEDENT> def PopulateArrayFromDictionary(self, array_prop, src, name, dst): <NEW_LINE> <INDENT> prop = array_prop.item_type <NEW_LINE> sub = { 'namespace': _API_UTIL_NAMESPA... | A util class that generates code that uses
tools/json_schema_compiler/util.cc. | 6259905a435de62698e9d3ea |
class Queue: <NEW_LINE> <INDENT> def __init__(self, queue_dict, parent_name='root'): <NEW_LINE> <INDENT> self.absolute_capacity_used = queue_dict['absoluteUsedCapacity'] <NEW_LINE> self.applications = queue_dict['numApplications'] <NEW_LINE> self.capacity_used = queue_dict['usedCapacity'] <NEW_LINE> self.name = '.'.joi... | REST representation of a queue
Has these properties:
* absolute_capacity_used - amount of cluster's max capacity it is using
* applications - number of applications currently running
* capacity_used - amount of this queue's max capacity it is using
* containers - Number of containers used. Only leaf queues can have
... | 6259905a627d3e7fe0e08472 |
class IndexTypeGoodsBanner(BaseModel): <NEW_LINE> <INDENT> DISPLAY_TYPE_CHOICES = ( (0, "标题"), (1, "图片") ) <NEW_LINE> type = models.ForeignKey( 'GoodsType', verbose_name='商品类型', on_delete=models.CASCADE) <NEW_LINE> sku = models.ForeignKey( 'GoodsSKU', verbose_name='商品SKU', on_delete=models.CASCADE) <NEW_LINE> display_t... | 首页分类商品展示模型类 | 6259905ae64d504609df9ec2 |
class __NonDiffusionTerm(_NonDiffusionTerm): <NEW_LINE> <INDENT> pass | Dummy subclass for tests | 6259905a99cbb53fe68324c6 |
class PercentileMetric(Model): <NEW_LINE> <INDENT> _validation = { 'start_time': {'readonly': True}, 'end_time': {'readonly': True}, 'time_grain': {'readonly': True}, 'name': {'readonly': True}, 'metric_values': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, ... | Percentile Metric data.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar start_time: The start time for the metric (ISO-8601 format).
:vartype start_time: datetime
:ivar end_time: The end time for the metric (ISO-8601 format).
:vartype end_time: datetime
:ivar time_grain: ... | 6259905aa17c0f6771d5d695 |
class _Bucket: <NEW_LINE> <INDENT> pass | Anonymous attribute-bucket class. | 6259905a8a43f66fc4bf3774 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.