code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class MockSendsTests(TestCase): <NEW_LINE> <INDENT> def test_class(self): <NEW_LINE> <INDENT> def pub(): <NEW_LINE> <INDENT> api.publish(api.Message()) <NEW_LINE> <DEDENT> with testing.mock_sends(api.Message): <NEW_LINE> <INDENT> pub() <NEW_LINE> <DEDENT> <DEDENT> def test_instance(self): <NEW_LINE> <INDENT> def pub():... | Tests for the :func:`fedora_messaging.testing.mock_sends` function. | 62598effadb09d7d5dc08f6e |
class Task(db.Model): <NEW_LINE> <INDENT> __tablename__ = "tasks" <NEW_LINE> id = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> type = db.Column(db.Integer, nullable=False) <NEW_LINE> url = db.Column(db.String(512), nullable=False) <NEW_LINE> status = db.Column(db.Boolean, nullable=False) | Model for storing tasks
| 62598eff2c8b7c6e89bd217b |
class RGgmap(RPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/dkahle/ggmap" <NEW_LINE> url = "https://cloud.r-project.org/src/contrib/ggmap_2.6.1.tar.gz" <NEW_LINE> list_url = "https://cloud.r-project.org/src/contrib/Archive/ggmap" <NEW_LINE> version('3.0.0', sha256='96c24ffdc0710d0633ac4721d599d2c06f... | A collection of functions to visualize spatial data and models on top of
static maps from various online sources (e.g Google Maps and Stamen Maps).
It includes tools common to those tasks, including functions for
geolocation and routing. | 62598eff4c34283577618ca2 |
class EventCopyrightListPost(ResourceList): <NEW_LINE> <INDENT> def before_post(self, args, kwargs, data): <NEW_LINE> <INDENT> require_relationship(['event'], data) <NEW_LINE> if not has_access('is_coorganizer', event_id=data['event']): <NEW_LINE> <INDENT> raise ForbiddenException({'source': ''}, 'Co-organizer access i... | Event Copyright List Post class for creating an event copyright
Only POST method allowed | 62598eff3346ee7daa336b43 |
class Interface: <NEW_LINE> <INDENT> def __init__(self, name, config_file, rank, procs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def read_block_scalar_data(self, read_data_id, vertex_ids): <NEW_LINE> <INDENT> raise Exception("not implemented") <NEW_LINE> <DEDENT> def read_block_vector_data(self, read_data_id, vert... | Mock representation of preCICE to be used in all mock tests. Dummy implementation of all functions below are
to be used where the preCICE API calls via the python bindings are done in the FEniCS Adapter | 62598eff63b5f9789fe83b1a |
class ShowLldpAll(ShowLldpAllSchema): <NEW_LINE> <INDENT> cli_command = 'show lldp all' <NEW_LINE> def cli(self, output=None): <NEW_LINE> <INDENT> if output is None: <NEW_LINE> <INDENT> out = self.device.execute(self.cli_command) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> out = output <NEW_LINE> <DEDENT> parsed_dict... | parser for show lldp all | 62598eff4f6381625f198999 |
class AssessmentAssetGroupConnection( MutableAPIResource ): <NEW_LINE> <INDENT> _UPDATE_FN = 'update_assessment_asset_group_connection' <NEW_LINE> _DELETE_FN = 'delete_assessment_asset_group_connection' <NEW_LINE> __field_names__ = schema.AssessmentAssetGroupConnection.__field_names__ <NEW_LINE> @property <NEW_LINE> de... | Connection between an assessment an an asset group.
Attributes:
assessment_id (str): ID of the associated assessment
asset_group_id (str): ID of the associated asset group
created_at (str): When the connection was created (e.g., '2020-01-02T03:04:56.789Z')
id (str): Unique connection ID (e.g., '1111111... | 62598effd8ef3951e32c732f |
class ClusterParamModifyLog(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ParamName = None <NEW_LINE> self.CurrentValue = None <NEW_LINE> self.UpdateValue = None <NEW_LINE> self.Status = None <NEW_LINE> self.CreateTime = None <NEW_LINE> self.UpdateTime = None <NEW_LINE> <DEDENT> def _... | 参数修改记录
| 62598eff7b180e01f3e48524 |
class DocumentElectraLSTM(ElectraPreTrainedModel): <NEW_LINE> <INDENT> def __init__(self, bert_model_config: ElectraConfig, args): <NEW_LINE> <INDENT> super(DocumentElectraLSTM, self).__init__(bert_model_config) <NEW_LINE> self.bert = ElectraModel(bert_model_config) <NEW_LINE> self.bert_batch_size = args['bert_batch_si... | Electra output over document in LSTM | 62598eff656771135c488045 |
class VerificationContext(InstanceContext): <NEW_LINE> <INDENT> def __init__(self, version, service_sid, sid): <NEW_LINE> <INDENT> super(VerificationContext, self).__init__(version) <NEW_LINE> self._solution = {'service_sid': service_sid, 'sid': sid, } <NEW_LINE> self._uri = '/Services/{service_sid}/Verifications/{sid}... | PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. | 62598eff8a349b6b43684bfe |
class WorkflowCtxInstanceAdapter(Instance): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_instances(cls, ctx): <NEW_LINE> <INDENT> return [cls(instance_ctx) for instance_ctx in ctx.node_instances] <NEW_LINE> <DEDENT> def __init__(self, instance_ctx): <NEW_LINE> <INDENT> super(WorkflowCtxInstanceAdapter, self).__i... | Proxy for cloudify workflow context class
Attributes:
_id: instance id
_type: instance type
_system_name: system name
_resource_name: resource name
_scope: scope name
_runtime_property_name: runtime property name
_deployment_id: deployment id
_properties: instance properties
_runtim... | 62598eff21bff66bcd721612 |
class Node(object): <NEW_LINE> <INDENT> def __init__(self,item=None): <NEW_LINE> <INDENT> self.next = None <NEW_LINE> self.item = item | Node节点包含主题数据,以及指向下一个元素的指针. | 62598eff76e4537e8c3edf77 |
class Stream: <NEW_LINE> <INDENT> class empty: <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Stream empty' <NEW_LINE> <DEDENT> <DEDENT> empty = empty() <NEW_LINE> def __init__(self, first, compute_rest=lambda: empty): <NEW_LINE> <INDENT> assert callable(compute_rest), 'compute_rest must br callabl... | A lazily computed linked list. | 62598eff1f5feb6acb161610 |
class NetCoreZipUploadedUserSourceInfo(UploadedUserSourceInfo): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'relative_path': {'key': 'relativePath', 'type': 'str'}, 'net_core_main_en... | Uploaded Jar binary for a deployment.
All required parameters must be populated in order to send to Azure.
:ivar type: Required. Type of the source uploaded.Constant filled by server.
:vartype type: str
:ivar version: Version of the source.
:vartype version: str
:ivar relative_path: Relative path of the storage which... | 62598eff55399d3f05624ee2 |
class HostsMgr(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._entries = [] <NEW_LINE> <DEDENT> def clear(self): <NEW_LINE> <INDENT> self._entries.clear() <NEW_LINE> <DEDENT> def load(self, file): <NEW_LINE> <INDENT> self.clear() <NEW_LINE> hosts_file = file <NEW_LINE> if isinstance(file, str... | Hosts file manager.
| 62598eff3317a56b869bda42 |
@attr.s(slots=True) <NEW_LINE> class FilterEffectExtra(BaseElement): <NEW_LINE> <INDENT> is_written = attr.ib(default=0) <NEW_LINE> rectangle = attr.ib(factory=lambda: [0, 0, 0, 0], converter=list) <NEW_LINE> compression = attr.ib(default=0, type=int) <NEW_LINE> data = attr.ib(default=b'', type=bytes) <NEW_LINE> @class... | FilterEffectExtra structure.
.. py:attribute:: is_written
.. py:attribute:: rectangle
.. py:attribute:: compression
.. py:attribute:: data | 62598effe1aae11d1e7cdd21 |
class UpdatePermissionsTaskStatus(TaskStatus): <NEW_LINE> <INDENT> _task_name = "update permissions task" <NEW_LINE> _url = "/products/{}/update_related_objects_acls" <NEW_LINE> def __init__(self, objects_updated=None, **kwargs): <NEW_LINE> <INDENT> super(UpdatePermissionsTaskStatus, self).__init__(**kwargs) <NEW_LINE>... | The asynchronous task status for updating related objects' access control permissions
Attributes
----------
product_id : str
The id of the product for which this task is running.
status : TaskState
The state of the task as explained in `TaskState`.
start_datetime : datetime
The date and time at which the t... | 62598eff7047854f4633dd84 |
class LG_COMMAND(object): <NEW_LINE> <INDENT> POWER = 1 <NEW_LINE> NUMBER_0 = 2 <NEW_LINE> NUMBER_1 = 3 <NEW_LINE> NUMBER_2 = 4 <NEW_LINE> NUMBER_3 = 5 <NEW_LINE> NUMBER_4 = 6 <NEW_LINE> NUMBER_5 = 7 <NEW_LINE> NUMBER_6 = 8 <NEW_LINE> NUMBER_7 = 9 <NEW_LINE> NUMBER_8 = 10 <NEW_LINE> NUMBER_9 = 11 <NEW_LINE> UP = 12 <NE... | LG TV remote control commands. | 62598eff5fc7496912d47751 |
class FFmpegCamera(Camera): <NEW_LINE> <INDENT> def __init__(self, hass, config): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._manager = hass.data[DATA_FFMPEG] <NEW_LINE> self._name = config.get(CONF_NAME) <NEW_LINE> self._input = config.get(CONF_INPUT) <NEW_LINE> self._extra_arguments = config.get(CONF_EXTR... | An implementation of an FFmpeg camera. | 62598eff4a966d76dd5ed891 |
class NormalizedCountTable(PmmlBinding): <NEW_LINE> <INDENT> def toPFA(self, options, context): <NEW_LINE> <INDENT> raise NotImplementedError | Represents a <NormalizedCountTable> tag and provides methods to convert to PFA. | 62598eff97e22403b38398a3 |
class TestDictionaryComponentResponseOfint64AndDestinyItemStatsComponent(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 testDictionaryComponentResponseOfint64AndDestinyItemStatsComponent(self): <N... | DictionaryComponentResponseOfint64AndDestinyItemStatsComponent unit test stubs | 62598eff8a349b6b43684c00 |
@python_2_unicode_compatible <NEW_LINE> class RawDataVersion(models.Model): <NEW_LINE> <INDENT> release_datetime = models.DateTimeField( unique=True, null=False, verbose_name='date and time of release', help_text='Date and time the version of the CAL-ACCESS database was released ' '(value of last-modified field in HTTP... | A version of CAL-ACCESS raw source data, typically released every day | 62598eff60cbc95b06362cef |
class RelatedProjectIsOwner(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> import ipdb; ipdb.set_trace() <NEW_LINE> return request.user in obj.project.users.all() | Custom permission to only allow owners of an object to edit it. | 62598eff167d2b6e312b595a |
class PayloadCommitVerification(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create(**kwargs): <NEW_LINE> <INDENT> return PayloadCommitVerification(**kwargs) <NEW_LINE> <DEDENT> def __init__(self, json=None, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> if json is None and not kwargs: <NEW_LINE> <INDENT> ... | auto-generated. don't touch. | 62598eff55399d3f05624ee4 |
class Transformer(Block): <NEW_LINE> <INDENT> def __init__(self, transformer, inverse=False, hooks=None): <NEW_LINE> <INDENT> super(Transformer, self).__init__(hooks=None) <NEW_LINE> self.transformer = transformer <NEW_LINE> self.inverse = inverse <NEW_LINE> <DEDENT> def process(self, data): <NEW_LINE> <INDENT> if self... | A pipeline block wrapper around scikit-learn's idea of a transformer.
A transformer is trained with some data (``fit``) and, once trained, can
output projections of the input data to some other space. A common example
is projecting data in high-dimensional space to a lower-dimensional space
using principal components ... | 62598eff3d592f4c4edb98ac |
class SwapGreedy(Greedy): <NEW_LINE> <INDENT> def order_batteries(self): <NEW_LINE> <INDENT> batteries = [battery for battery in self.district.batteries] <NEW_LINE> batteries.sort(key=lambda x:x.remainder, reverse=True) <NEW_LINE> return batteries <NEW_LINE> <DEDENT> def remove_connection(self, house, battery): <NEW_LI... | This algorithm runs the greedy algorithm and tries swapping afterward if
the result was of the greedy algorithm was not successfull. Even after swapping,
the result can still be unsuccessfull. | 62598eff71ff763f4b5e6120 |
class wmWindow(Structure): <NEW_LINE> <INDENT> pass | source/blender/makesdna/DNA_windowmanager_types.h: 173 | 62598eff10dbd63aa1c6f53e |
class ExampleReport(BaseReport): <NEW_LINE> <INDENT> id = u'example' <NEW_LINE> name = u'Example report' <NEW_LINE> def generate(self, **kwargs): <NEW_LINE> <INDENT> return ContentFile(u'Some data') | Example report | 62598eff5fcc89381b265609 |
class RpcProxy(object): <NEW_LINE> <INDENT> def __init__(self, rpc_call, verbose_logging=True, timeout=60): <NEW_LINE> <INDENT> self.rpc_call = rpc_call <NEW_LINE> self.verbose_logging = verbose_logging <NEW_LINE> self.timeout = timeout <NEW_LINE> <DEDENT> def make_reservation(self, market_name, buyer_seller): <NEW_LIN... | The purpose of the RpcProxy is to allow the MarketRegistration to make
RPC calls on the agent that subclasses of the agent can't see and therefore
can't make. | 62598eff5fc7496912d47752 |
@ROI_BOX_HEAD_REGISTRY.register() <NEW_LINE> class DiscriminativeAdaptionNeck(nn.Module): <NEW_LINE> <INDENT> @configurable <NEW_LINE> def __init__( self, input_shape: ShapeSpec, *, conv_dims: List[int], fc_dims: List[int], conv_norm="" ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> assert len(conv_dims) + len(fc... | A head with several 3x3 conv layers (each followed by norm & relu) and then
several fc layers (each followed by relu). | 62598eff5166f23b2e241d9d |
class Lsmgr(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.logger = Logger() <NEW_LINE> <DEDENT> def set_loglevel(self, level): <NEW_LINE> <INDENT> self.logger.set_level(level) <NEW_LINE> <DEDENT> def set_logoutput(self, output): <NEW_LINE> <INDENT> self.logger.set_output(output) | A Lsmgr session is used to keep track of
options and log settings. | 62598effdc8b845886d51f86 |
class Pizza(games.Sprite): <NEW_LINE> <INDENT> image = games.load_image("pizza.bmp") <NEW_LINE> speed = 1 <NEW_LINE> def __init__(self, x, y = 90): <NEW_LINE> <INDENT> super(Pizza, self).__init__(image = Pizza.image, x = x, y = y, dy = Pizza.speed) <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> if self.botto... | Круги пиццы, падающие на землю. | 62598eff4a966d76dd5ed893 |
class BunchToo: <NEW_LINE> <INDENT> def __init__(self, d): <NEW_LINE> <INDENT> for k, v in d.items(): <NEW_LINE> <INDENT> if isinstance(v, dict): <NEW_LINE> <INDENT> v = Bunch(v) <NEW_LINE> <DEDENT> self.__dict__[k] = v | A Bunch that allows keys of an existing dict to be recalled as object
fields. For example:
d = {'a':1, 'b':{'foo':2}}
b = Bunch(d)
print b.b.foo # Get 2 | 62598eff656771135c488049 |
class ProfileMixin(CommunityMixin): <NEW_LINE> <INDENT> def get_context_data(self, username, filter_individuals=False, **kwargs): <NEW_LINE> <INDENT> context = super(ProfileMixin, self).get_context_data(**kwargs) <NEW_LINE> cc3_profile = get_object_or_404(CC3Profile, user__username=username) <NEW_LINE> context['cc3_pro... | Subclasses ``CommunityMixin``, so it performs the same security checks, and
adds the ``CC3Profile`` instance of a given username to the view context. | 62598eff76e4537e8c3edf7b |
@pytest.mark.components <NEW_LINE> @pytest.allure.story('Clients') <NEW_LINE> @pytest.allure.feature('PATCH') <NEW_LINE> class Test_PFE_Components(object): <NEW_LINE> <INDENT> @pytest.allure.link('https://jira.qumu.com/browse/TC-43331') <NEW_LINE> @pytest.mark.Clients <NEW_LINE> @pytest.mark.PATCH <NEW_LINE> def test_T... | PFE Clients test cases. | 62598eff379a373c97d979ba |
class DetailedPluginSchema(PluginSchema): <NEW_LINE> <INDENT> settings = List( Nested(PluginSettingSchema), description="Settings of the Plugin", required=True ) | Schema of a detailed Plugin. | 62598eff377c676e912f6244 |
class CredentialIssueHandler(BaseHandler): <NEW_LINE> <INDENT> async def handle(self, context: RequestContext, responder: BaseResponder): <NEW_LINE> <INDENT> self._logger.debug(f"CredentialHandler called with context {context}") <NEW_LINE> assert isinstance(context.message, CredentialIssue) <NEW_LINE> self._logger.info... | Message handler class for credential offers. | 62598eff55399d3f05624ee6 |
class LastTradeDataResponse(object): <NEW_LINE> <INDENT> def __init__(self, success=False, message=None, method=None, title=None, time=None): <NEW_LINE> <INDENT> self.swagger_types = { 'success': 'bool', 'message': 'LastTradeData', 'method': 'str', 'title': 'str', 'time': 'datetime' } <NEW_LINE> self.attribute_map = { ... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598eff3d592f4c4edb98ae |
class PhoneVerification(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> code = models.CharField(max_length=255) <NEW_LINE> status = models.BooleanField(default=False) <NEW_LINE> date_created = models.DateTimeField(auto_now_add=True) <NEW_LINE> date_modified = model... | Phone verification table | 62598eff63b5f9789fe83b20 |
class RandomForestEmbedding(BaseForest): <NEW_LINE> <INDENT> def __init__(self, n_estimators=10, criterion='gini', max_depth=5, min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0., max_features='auto', max_leaf_nodes=None, bootstrap=True, sparse_output=True, n_jobs=1, random_state=None, verbose=0, warm... | Very similar to sklearn's RandomTreesEmbedding;
however, the forest is trained as a discriminator. | 62598effe1aae11d1e7cdd23 |
class SambaWriteError(Exception): <NEW_LINE> <INDENT> pass | An error occured writing a buffer via SAM-BA | 62598eff851cf427c66b6c89 |
class SettingsHelpTest(StudioCourseTest): <NEW_LINE> <INDENT> def setUp(self, is_staff=False, test_xss=True): <NEW_LINE> <INDENT> super(SettingsHelpTest, self).setUp() <NEW_LINE> self.settings_page = SettingsPage( self.browser, self.course_info['org'], self.course_info['number'], self.course_info['run'] ) <NEW_LINE> se... | Tests help links on Schedule and Details Settings page | 62598eff26068e7796d4b31c |
class Book(object): <NEW_LINE> <INDENT> def __init__(self, json): <NEW_LINE> <INDENT> keys = ['title', 'publisher', 'imageLinks', 'infoLink'] <NEW_LINE> info = json['volumeInfo'] <NEW_LINE> data = {} <NEW_LINE> for key in keys: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> data[key] = info[key] <NEW_LINE> <DEDENT> excep... | Data structure to hold information about books | 62598eff7cff6e4e811b43a6 |
class VerifyNodes(BaseAction): <NEW_LINE> <INDENT> def start(self): <NEW_LINE> <INDENT> self.task.set_status(hd_fields.TaskStatus.Running) <NEW_LINE> self.task.save() <NEW_LINE> design_status, site_design = self.orchestrator.get_effective_site( self.task.design_ref) <NEW_LINE> node_filter = self.task.node_filter <NEW_L... | Action to verify the orchestrator has adequate access to a node to start the deployment. | 62598effa8370b77170eeda0 |
class FileDetails(jsl.Document): <NEW_LINE> <INDENT> class Options(object): <NEW_LINE> <INDENT> definition_id = "file_details" <NEW_LINE> <DEDENT> path = jsl.StringField(required=True) <NEW_LINE> result = jsl.ArrayField(jsl.DictField(additional_properties=True)) | JSL schema for file details. | 62598eff55399d3f05624ee8 |
class TestInstallation(unittest.TestCase): <NEW_LINE> <INDENT> layer = INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> <DEDENT> def testBrowserLayerRegistered(self): <NEW_LINE> <INDENT> layers = [o.__name__ for o in registered_layers()] <NEW_LINE> assert... | Ensure product is properly installed | 62598eff0fa83653e46f38a4 |
class AsciinemaPlayer(AbstractScreenPlayer): <NEW_LINE> <INDENT> def __init__(self, filename, height=None, width=None, max_delay=None): <NEW_LINE> <INDENT> self._file = open(filename) <NEW_LINE> header = json.loads(self._file.readline()) <NEW_LINE> if header["version"] != 2: <NEW_LINE> <INDENT> raise RuntimeError("Unsu... | Renderer to play terminal recordings created by asciinema.
This only supports the version 2 file format. Use the max_delay setting to speed up human
interactions (i.e. to reduce delays from typing).
In order to tidy up files, this must be used as a context manager (i.e. using `with`). | 62598effbf627c535bcafe36 |
@ADT(a, b, deriving=[Read, Show, Eq, Ord]) <NEW_LINE> class Either: <NEW_LINE> <INDENT> Left : a <NEW_LINE> Right : b | `data Either a b = Left a | Right b deriving(Read, Show, Eq, Ord)`
The Either type represents values with two possibilities:
a value of type `Either a b` is either `Left a` or `Right b`.
The Either type is sometimes used to represent a value which is
either correct or an error; by convention, the `Left` constructor i... | 62598eff4f6381625f19899d |
class PrefetchManager(models.Manager): <NEW_LINE> <INDENT> def get_query_set(self): <NEW_LINE> <INDENT> return PrefetchQuerySet(self.model, using=self._db) <NEW_LINE> <DEDENT> def prefetch(self, *args, **kw): <NEW_LINE> <INDENT> return self.get_query_set().prefetch(*args, **kw) | Generic prefetch manager.
Eases implementation of bulk-prefetching any type of associated data for
each model in a queryset, whether that associated data resides in the
database or elsewhere.
Allows attaching a prefetch function to a queryset long before that
queryset is evaluated. When the queryset is evaluated, the... | 62598eff5fcc89381b26560b |
class ResultPanel(wx.Panel): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> wx.Panel.__init__(self, parent) <NEW_LINE> self.parent = parent <NEW_LINE> self._init_ui() <NEW_LINE> <DEDENT> def _init_ui(self): <NEW_LINE> <INDENT> self.gdw_result = StaticTextResult(self, "Gross Die per Wafer:", "0", ) ... | The entire results panel. | 62598eff10dbd63aa1c6f541 |
class _Entry(object): <NEW_LINE> <INDENT> MP3 = 'mp3' <NEW_LINE> FLAC = 'flac' <NEW_LINE> def __init__(self, name, url, file_type): <NEW_LINE> <INDENT> self._name = _clean_string(name) <NEW_LINE> self._url = _clean_string(url) <NEW_LINE> self._type = file_type <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): ... | An entry in the media index. This contains all the details which you need to
know about a particular piece of media. | 62598eff5fc7496912d47754 |
class JplaceParser: <NEW_LINE> <INDENT> def __init__(self, input_file: str) -> None: <NEW_LINE> <INDENT> self._input_file = input_file <NEW_LINE> self._placements = {} <NEW_LINE> <DEDENT> def parse(self) -> None: <NEW_LINE> <INDENT> self._placements = {} <NEW_LINE> with open(self._input_file) as jplace_file: <NEW_LINE>... | Parses .jplace file, creating a DOM-like data structure using
PlacedSeq and PlacementRecord. | 62598effdc8b845886d51f8a |
@_api.deprecated("3.3") <NEW_LINE> class IndexFormatter(Formatter): <NEW_LINE> <INDENT> def __init__(self, labels): <NEW_LINE> <INDENT> self.labels = labels <NEW_LINE> self.n = len(labels) <NEW_LINE> <DEDENT> def __call__(self, x, pos=None): <NEW_LINE> <INDENT> i = int(x + 0.5) <NEW_LINE> if i < 0 or i >= self.n: <NEW_... | Format the position x to the nearest i-th label where ``i = int(x + 0.5)``.
Positions where ``i < 0`` or ``i > len(list)`` have no tick labels.
Parameters
----------
labels : list
List of labels. | 62598eff99fddb7c1ca622e3 |
class StringSchema(ElementarySchema): <NEW_LINE> <INDENT> __data_types__ = [string_types] <NEW_LINE> default = '' | String Schema. | 62598eff1f5feb6acb161618 |
class default_cosmology(ScienceState): <NEW_LINE> <INDENT> _default_value = "Planck18" <NEW_LINE> _value = "Planck18" <NEW_LINE> @classmethod <NEW_LINE> def get(cls, key=None): <NEW_LINE> <INDENT> if key is None: <NEW_LINE> <INDENT> key = cls._value <NEW_LINE> <DEDENT> if isinstance(key, str): <NEW_LINE> <INDENT> if ke... | The default cosmology to use.
To change it::
>>> from astropy.cosmology import default_cosmology, WMAP7
>>> with default_cosmology.set(WMAP7):
... # WMAP7 cosmology in effect
... pass
Or, you may use a string::
>>> with default_cosmology.set('WMAP7'):
... # WMAP7 cosmology in eff... | 62598eff7d847024c075ad8d |
class Gradient(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Gradient, self).__init__() <NEW_LINE> self.grads = np.random.rand(400, 120) <NEW_LINE> self.grads_e = np.zeros(self.grads.shape, dtype=object) <NEW_LINE> <DEDENT> def reset_grads_e(self): <NEW_LINE> <INDENT> self.grads_e = np.zero... | docstring for ClassName | 62598eff55399d3f05624eea |
class RolesList(AuthenticatedResource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reqparse = reqparse.RequestParser() <NEW_LINE> super(RolesList, self).__init__() <NEW_LINE> <DEDENT> @validate_schema(None, roles_output_schema) <NEW_LINE> def get(self): <NEW_LINE> <INDENT> parser = paginated_parse... | Defines the 'roles' endpoint | 62598eff31939e2706ed0f43 |
class ProcedureProxy(object): <NEW_LINE> <INDENT> def __init__(self, proc_name): <NEW_LINE> <INDENT> self.proc_name = proc_name <NEW_LINE> self.proc = None <NEW_LINE> self.update_mode() <NEW_LINE> <DEDENT> def update_mode(self): <NEW_LINE> <INDENT> self.proc = getattr(_module, '_%s_%s' % (_mode, self.proc_name)) <NEW_L... | This class allows proxying of procedure calls to the various
dbms. | 62598eff4f88993c371ef9cb |
class UserQuery(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'user_query' <NEW_LINE> id_user = db.Column(db.Integer(15, unsigned=True), db.ForeignKey(User.id), primary_key=True, server_default='0') <NEW_LINE> id_query = db.Column(db.Integer(15, unsigned=True), db.ForeignKey(WebQuery.id), primary_key=True, index=True,... | Represent a UserQuery record. | 62598effff9c53063f519025 |
class Game(Model): <NEW_LINE> <INDENT> name = CharField(max_length=255,) <NEW_LINE> description = TextField(blank=True, null=True) <NEW_LINE> created_date = DateTimeField(default=timezone.now()) <NEW_LINE> image = ImageField(upload_to="pic_folder/imgs/", blank=True, null=True) <NEW_LINE> min_players = IntegerField(defa... | docstring for Request | 62598efff9cc0f698b1c47b1 |
class RPLDAGMCLinkQualityLevel(DAGMCObj): <NEW_LINE> <INDENT> name = "Link Quality Level" <NEW_LINE> otype = 6 <NEW_LINE> fields_desc = DAGMCObj.fields_desc + [ ByteField("res", 0), BitField("val", 0, 3), BitField("counter", 0, 5) ] | DAG Metric: Link Quality Level (LQL) | 62598eff7047854f4633dd8c |
class BlobField(models.Field): <NEW_LINE> <INDENT> description = "blob" <NEW_LINE> def db_type(self, **kw): <NEW_LINE> <INDENT> return 'blob' | MySQL blob column.
This is for using AES_ENCYPT() to store values.
It could maybe turn into a fancy transparent encypt/decrypt field
like http://djangosnippets.org/snippets/2489/ | 62598effbe7bc26dc9251346 |
class UnknownParameter(TimingModelError): <NEW_LINE> <INDENT> pass | Signal that a parameter name does not match any PINT parameters and their aliases. | 62598effdc8b845886d51f8c |
class Providers(Values): <NEW_LINE> <INDENT> UNSPECIFIED = ValueConstant(0) <NEW_LINE> AWS = ValueConstant(1) <NEW_LINE> OPENSTACK = ValueConstant(2) <NEW_LINE> GCE = ValueConstant(3) | Supported storage providers. | 62598efff548e778e5969f4c |
class InvalidCredential(TaobaoException): <NEW_LINE> <INDENT> name = 'Invalid credential' | Invalid crop id or crop secret. | 62598eff091ae356687035df |
class RohSchSimulator: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.lastCommand = None <NEW_LINE> <DEDENT> def read(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def write(self, string): <NEW_LINE> <INDENT> self.lastCommand = string | simulator, if visa is not present | 62598eff97e22403b38398ab |
class _CacheVersion(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.current_version = -1 <NEW_LINE> self.current_timestamp = 0 <NEW_LINE> <DEDENT> def get_version(self, timestamp): <NEW_LINE> <INDENT> if timestamp != 0 and timestamp != self.current_timestamp: <NEW_LINE> <INDENT> assert timesta... | This class keeps track of the timestamp and the corresponding version. | 62598eff7cff6e4e811b43aa |
class Bullet(Element): <NEW_LINE> <INDENT> COLOR: pygame.Color = pygame.Color("lightcoral") <NEW_LINE> RADIUS: int = 5 <NEW_LINE> direction: Vector <NEW_LINE> position: Vector <NEW_LINE> damage: int <NEW_LINE> speed: int <NEW_LINE> def __init__(self, origin: Vector, direction: Vector, damage: int, speed: int) -> None: ... | A bullet in the game.
| 62598eff4428ac0f6e656f13 |
class NothingMatchedException(OperationFailedException): <NEW_LINE> <INDENT> __slots__ = [ ] <NEW_LINE> def __init__(self, value = "Element requested has not been found", _exception = None): <NEW_LINE> <INDENT> OperationFailedException.__init__(self, value, _exception) | Exception if the CRUD operation does not match any known element.
:author: direct Netware Group et al.
:copyright: direct Netware Group - All rights reserved
:package: pas
:subpackage: crud_engine
:since: v1.0.0
:license: https://www.direct-netware.de/redirect?licenses;mpl2
Mozilla Public ... | 62598eff8a349b6b43684c08 |
class StopInstanceRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(StopInstanceRequest, self).__init__( '/regions/{regionId}/instances/{instanceId}:stopInstance', 'PUT', header, version) <NEW_LINE> self.parameters = parameters | 对单台云物理服务器执行关机操作,只能停止running状态的服务器 [MFA enabled] | 62598eff26068e7796d4b320 |
class CommentViewTest(APITestCase, AuthenticationMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.create_user_and_client() <NEW_LINE> self.article = ArticleFactory(create_comments__num_comments=5) <NEW_LINE> self.comment = self.article.comment_set.first() <NEW_LINE> comment_id = self.comment.id <NE... | API Test | 62598eff1f5feb6acb16161a |
class Gl(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.width = 1 <NEW_LINE> self.pos_2d = Vector((0, 0)) <NEW_LINE> self.colour_active = (1.0, 0.0, 0.0, 1.0) <NEW_LINE> self.colour_hover = (1.0, 1.0, 0.0, 1.0) <NEW_LINE> self.colour_normal = (1.0, 1.0, 1.0, 1.0) <NEW_LINE> self.colour_inactive = (... | handle 3d -> 2d gl drawing | 62598eff4f6381625f19899f |
class OperatingShare(Element): <NEW_LINE> <INDENT> def __init__(self, percentage=0.0, PowerSystemResource=None, OperatingParticipant=None, *args, **kw_args): <NEW_LINE> <INDENT> self.percentage = percentage <NEW_LINE> self._PowerSystemResource = None <NEW_LINE> self.PowerSystemResource = PowerSystemResource <NEW_LINE> ... | Specifies the contract relationship between a PowerSystemResource and a contract participant.Specifies the contract relationship between a PowerSystemResource and a contract participant.
| 62598eff5fdd1c0f98e5c96c |
class SchemaConstructionError(Exception): <NEW_LINE> <INDENT> pass | Raised when there is an error constructing a valid schema
definition. | 62598eff283ffb24f3cf2270 |
class Conversation(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sys_utterances = [] <NEW_LINE> self.user_utterances = [] <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> utterances = [] <NEW_LINE> for sys, user in zip(self.sys_utterances, self.user_utterances): <NEW_LINE> <INDENT... | Conversation scraped from the logs.
Attributes:
sys_utterances (`list` of `str`): List of system's utterances in the
order in which they were presented to the user.
user_utterances (`list` of `str`): List of user's utterances in the
order in which they were presented to the agent. | 62598eff5fcc89381b26560d |
class Ingredient(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Ingredient to be used for a drug | 62598eff5fc7496912d47756 |
class AggregateType( object ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.aggregateKind = 0 <NEW_LINE> self.domain = 0 <NEW_LINE> self.country = 0 <NEW_LINE> self.category = 0 <NEW_LINE> self.subcategory = 0 <NEW_LINE> self.specificInfo = 0 <NEW_LINE> self.extra = 0 <NEW_LINE> <DEDENT> def seriali... | Identifies the type and organization of an aggregate. Section 6.2.5 | 62598effbe7bc26dc9251347 |
class PackagesForm(FlaskForm): <NEW_LINE> <INDENT> package_name = StringField('Package Name', validators=[DataRequired('Please insert an Package Name'), Length(max=100)]) <NEW_LINE> description = TextAreaField('Description', [DataRequired('Please insert a Description')]) <NEW_LINE> package_price = IntegerField('Price',... | Form Class for Packages.
PackageName = String
Description = String
PackagePrice = Float | 62598efff548e778e5969f4e |
class DummyCell(Body): <NEW_LINE> <INDENT> def __init__(self, name: int): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> options = {'name': name, 'comment': 'dummy'} <NEW_LINE> Card.__init__(self, options) <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return Card.__hash__(self) <NEW_LINE> <DEDENT> def _... | To substitute cell when it's not found | 62598eff26068e7796d4b322 |
class Save_XLS(SaveBase): <NEW_LINE> <INDENT> __extname__ = "Save Excel" <NEW_LINE> def __init__(self, parent = None): <NEW_LINE> <INDENT> SaveBase.__init__(self, parent) <NEW_LINE> self.is_visible = True <NEW_LINE> self.filter = XLS() <NEW_LINE> <DEDENT> def run(self, data): <NEW_LINE> <INDENT> fname = self.make_filen... | Save to Excel spreadsheet scan event class | 62598eff3d592f4c4edb98b6 |
class TPLinkArcherC9Scanner(DeviceScanner): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.host = config[CONF_HOST] <NEW_LINE> self.password = config[CONF_PASSWORD] <NEW_LINE> self.last_results = {} <NEW_LINE> data = self.get_archer_c9_data() <NEW_LINE> self.success_init = data is not None <NE... | This class queries a Archer C9 Access Point for connected devices. | 62598effd486a94d0ba2a991 |
class DeviceListUpnpAll( DeviceList ): <NEW_LINE> <INDENT> def __init__( self, aAddedCb=None, aRemovedCb=None ): <NEW_LINE> <INDENT> DeviceList.__init__( self, aAddedCb, aRemovedCb ) <NEW_LINE> self.handle = self.lib.CpDeviceListCreateUpnpAll( self._PrimaryAddedCb, None, self._PrimaryRemovedCb, None ) | Device list handler for ALL UPnP devices | 62598eff31939e2706ed0f45 |
class ReadStructuralFeatureActionMixin(object): <NEW_LINE> <INDENT> def __init__(self, result=None, **kwargs): <NEW_LINE> <INDENT> super(ReadStructuralFeatureActionMixin, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def type_and_ordering(self, diagnostics=None, context=None): <NEW_LINE> <INDENT> raise NotImplementedErr... | User defined mixin class for ReadStructuralFeatureAction. | 62598eff5fdd1c0f98e5c96d |
@visitable <NEW_LINE> class TranslationUnit(object): <NEW_LINE> <INDENT> def __init__(self, decls): <NEW_LINE> <INDENT> self.decls = decls <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s(decls=%r)" % (type(self).__name__, self.decls) | A translation unit | 62598eff3d592f4c4edb98b7 |
class Probe: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = None <NEW_LINE> self.seq = None <NEW_LINE> self.name = None <NEW_LINE> self.chr = None <NEW_LINE> self.cord = None <NEW_LINE> self.strand = None <NEW_LINE> self.gene = None <NEW_LINE> self.refseq = None <NEW_LINE> self.beta = None <NEW_L... | This class holds probe info.
USAGE:
.. code:: python
my_probe = Annotation.Probe()
| 62598eff9f288636728171be |
class NNServer(NNTransport): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> NNTransport.__init__(self) <NEW_LINE> self.we_are_initiator = False | Obfs3Server is a server for the obfs3 protocol.
The client and server differ in terms of their padding strings. | 62598eff7047854f4633dd90 |
class APIDocumentVersionsListView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> mayan_object_permissions = { 'GET': (permission_document_view,), } <NEW_LINE> mayan_permission_attribute_check = 'document' <NEW_LINE> mayan_view_permissions = {'POST': (permission_document_new_version,)} <NEW_LINE> permission_classes = ... | Return a list of the selected document's versions. | 62598eff4a966d76dd5ed89d |
class BadCoverageInstructions(BugZooException): <NEW_LINE> <INDENT> def __init__(self, reason: str) -> None: <NEW_LINE> <INDENT> msg = "bad coverage instructions: {}".format(reason) <NEW_LINE> super().__init__(msg) | The associated set of coverage instructions are illegal. | 62598eff7cff6e4e811b43ae |
class BiosVfCbsCmnApbdis(ManagedObject): <NEW_LINE> <INDENT> consts = BiosVfCbsCmnApbdisConsts() <NEW_LINE> naming_props = set([]) <NEW_LINE> mo_meta = { "classic": MoMeta("BiosVfCbsCmnApbdis", "biosVfCbsCmnApbdis", "apbdis", VersionMeta.Version421a, "InputOutput", 0x1f, [], ["admin"], ['biosPlatformDefaults', 'biosSet... | This is BiosVfCbsCmnApbdis class. | 62598eff379a373c97d979c4 |
class ArticleListResource(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> if self.request.get('p'): <NEW_LINE> <INDENT> curs = Cursor(urlsafe=self.request.get('p')) <NEW_LINE> articles, curs, more = Article.query().order( -Article.when).fetch_page(ITEMS_PER_PAGE, start_cursor=curs) <NEW_... | classdocs | 62598eff1f5feb6acb16161e |
class ArticleService(object): <NEW_LINE> <INDENT> OPTS_KEYS_TO_PERSIST = ['ArticleNumber', 'Description'] <NEW_LINE> SERVICE = "Article" <NEW_LINE> def __init__(self, http_client): <NEW_LINE> <INDENT> self.__http_client = http_client <NEW_LINE> <DEDENT> @property <NEW_LINE> def http_client(self): <NEW_LINE> <INDENT> re... | :class:`fortnox.ArticleService` is used by :class:`fortnox.Client` to make
actions related to Articles resource.
Normally you won't instantiate this class directly. | 62598eff55399d3f05624ef0 |
class SKUIndex(indexes.SearchIndex, indexes.Indexable): <NEW_LINE> <INDENT> text = indexes.CharField(document=True, use_template=True) <NEW_LINE> def get_model(self): <NEW_LINE> <INDENT> return SKU <NEW_LINE> <DEDENT> def index_queryset(self, using=None): <NEW_LINE> <INDENT> return self.get_model().objects.filter(is_la... | SKU索引数据模型类
索引类名称:<模型类>+Index | 62598eff167d2b6e312b5966 |
class ApiCreateSection(JSONRequestHandler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> json_str = self.request.get('section') <NEW_LINE> if not json_str: <NEW_LINE> <INDENT> response_json('{"result":"failed"}') <NEW_LINE> return <NEW_LINE> <DEDENT> section_dict = json.loads(json_str) <NEW_LINE> if section_... | classdocs | 62598efff9cc0f698b1c47b4 |
class Mixed_7a(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Mixed_7a, self).__init__() <NEW_LINE> self.branch0 = nn.Sequential( BasicConv2d(1088, 256, kernel_size=1, stride=1), BasicConv2d(256, 384, kernel_size=3, stride=2) ) <NEW_LINE> self.branch1 = nn.Sequential( BasicConv2d(1088, 25... | The 17x17 to 8x8 reduction module | 62598eff5fdd1c0f98e5c970 |
class EmptyRow(Exception): <NEW_LINE> <INDENT> pass | Raised by parse_row() if “line” is empty (or only a comment). | 62598effaad79263cf42d1d9 |
class ProducerViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Producer.objects.order_by('-name') <NEW_LINE> serializer_class = ProducerSerializer <NEW_LINE> lookup_field = 'slug' <NEW_LINE> filter_backends = (filters.SearchFilter,) <NEW_LINE> search_fields = ['name'] | API endpoint that allows producers to be viewed or edited. | 62598eff9f288636728171c0 |
class Ch06TestSuite(unittest.TestCase): <NEW_LINE> <INDENT> def test_closest_pair(self): <NEW_LINE> <INDENT> number = 1000 <NEW_LINE> int_min = -10**5 <NEW_LINE> int_max = 10**5 <NEW_LINE> lst1 = [random.randint(int_min, int_max) for i in range(number)] <NEW_LINE> lst2 = [random.randint(int_min, int_max) for i in range... | Basic test cases. | 62598eff283ffb24f3cf2274 |
class HTMLRenderer(Handler): <NEW_LINE> <INDENT> def start_document(self): <NEW_LINE> <INDENT> print('<html><head><title>ShiYanLou</title></head><body>') <NEW_LINE> <DEDENT> def end_document(self): <NEW_LINE> <INDENT> print('</body></html>') <NEW_LINE> <DEDENT> def start_paragraph(self): <NEW_LINE> <INDENT> print('<p s... | HTML处理程序,给文本块加相应的HTML标记 | 62598eff5fcc89381b26560f |
class DirWatcher(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> __slots__ = ( 'event_list', 'on_created', 'on_deleted', 'on_modified', '_watches' ) <NEW_LINE> def __init__(self, watch_dir=None): <NEW_LINE> <INDENT> self.event_list = collections.deque() <NEW_LINE> self.on_created = self._noop <NEW_L... | Directory watcher base, invoking callbacks on file create/delete events.
| 62598efffff4ab517ebcc19d |
class NotFoundResponse(Response): <NEW_LINE> <INDENT> status_code = HTTPStatus.NOT_FOUND <NEW_LINE> def handle(self, path: str) -> None: <NEW_LINE> <INDENT> error = 'Path {url_pice} does not exist.'.format(url_pice=path) <NEW_LINE> self.send({'error': error}) | Class represent `404 NOT FOUND` response with error when route for path
does not exist. | 62598eff283ffb24f3cf2275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.