code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Deadlock(gdb.Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Deadlock, self).__init__('deadlock', gdb.COMMAND_NONE) <NEW_LINE> <DEDENT> def invoke(self, arg, from_tty): <NEW_LINE> <INDENT> lwp_to_thread_id, blocked_threads = get_thread_info() <NEW_LINE> graph = DiGraph() <NEW_LINE> for... | Detects deadlocks | 62598f0726068e7796d4b412 |
class Field: <NEW_LINE> <INDENT> def __init__(self,max_animals,max_crops): <NEW_LINE> <INDENT> self._crops = [] <NEW_LINE> self._animals = [] <NEW_LINE> self._max_animals = max_animals <NEW_LINE> self._max_crops = max_crops <NEW_LINE> <DEDENT> def plant_crop(self,crop): <NEW_LINE> <INDENT> if len (self._crops) < self._... | Simulate a field that can contain animals and crop | 62598f079f288636728172b1 |
class XmlAssemblerTest(StetlTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(XmlAssemblerTest, self).setUp() <NEW_LINE> curr_dir = os.path.dirname(os.path.realpath(__file__)) <NEW_LINE> cfg_dict = {'config_file': os.path.join(curr_dir, 'configs/xmlassembler.cfg')} <NEW_LINE> self.etl = ETL(cfg_... | Unit tests for XmlAssembler | 62598f0750812a4eaa620149 |
class Contact(models.Model): <NEW_LINE> <INDENT> email = models.EmailField(_('email'), unique=True) <NEW_LINE> first_name = models.CharField(_('first name'), max_length=50, blank=True) <NEW_LINE> last_name = models.CharField(_('last name'), max_length=50, blank=True) <NEW_LINE> subscriber = models.BooleanField(_('subsc... | Contact for emailing | 62598f07bf627c535bcaff30 |
class Cliente(models.Model): <NEW_LINE> <INDENT> MP = 'MP' <NEW_LINE> EPS = 'EPS' <NEW_LINE> ARL = 'ARL' <NEW_LINE> OTRO = 'OTRO' <NEW_LINE> TIPOS = ( (EPS, 'EPS'), (ARL, 'ARL'), (MP, 'Prepagada'), (OTRO, 'Otras entidades'), ) <NEW_LINE> nombre = models.CharField(_lazy('nombre'), max_length=200) <NEW_LINE> razon_social... | Representa la información de los clientes a los cuales un tenant(IPS) le presta sus servicio. | 62598f070fa83653e46f399f |
class Expand(BooleanOption): <NEW_LINE> <INDENT> __metaclass__ = OptionType <NEW_LINE> option = 'expand' <NEW_LINE> requires = [] <NEW_LINE> excludes = [] <NEW_LINE> @classmethod <NEW_LINE> def default(cls): <NEW_LINE> <INDENT> return True | ``expand`` option to polynomial manipulation functions. | 62598f07ff9c53063f51911c |
class WindowClosedError(RobotException): <NEW_LINE> <INDENT> message = __doc__ | The window with the robot has been closed | 62598f07ab23a570cc2d42ca |
class ErrorsMixin: <NEW_LINE> <INDENT> async def test_bad_authentication(self): <NEW_LINE> <INDENT> request = await self.client.get( self.api_url('user'), headers=[('Authorization', 'bjchdbjshbcjd')] ) <NEW_LINE> self.json(request.response, 400) | Test for errors in corner case situations
| 62598f0771ff763f4b5e621f |
class disp_fig(object): <NEW_LINE> <INDENT> def __init__(self, arr): <NEW_LINE> <INDENT> self.array = arr <NEW_LINE> self.video = arr.reshape(1,8,152,152) <NEW_LINE> plt.figure(figsize=(20, 2)) <NEW_LINE> <DEDENT> def figure(self): <NEW_LINE> <INDENT> for i in range(8): <NEW_LINE> <INDENT> ax = plt.subplot(1, 8, i+1) <... | Class to display video frames
Args:
Accepts video frames numpy array to display using matplotlib
Output:
Displays 8 video frames using matplotlib window | 62598f070fa83653e46f39a1 |
class RMoveMeshOriginToSelection(bpy.types.Operator): <NEW_LINE> <INDENT> bl_description = "Move Origin to Selection." <NEW_LINE> bl_idname = "object.rmove_mesh_origin_to_selection" <NEW_LINE> bl_label = "Move Origin To Selection" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return con... | Tooltip | 62598f07ad47b63b2c5a62d6 |
class FunctionNotFound(KeyError): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "The function '{0}' isn't in this algorithm.".format(*self.args) | Used when a function is not found in an algorithm function list (subclasses
:py:exc:`KeyError`). | 62598f07aad79263cf42d2cd |
class SimpleBarrier(object): <NEW_LINE> <INDENT> def __init__(self, num_threads): <NEW_LINE> <INDENT> self.num_threads = num_threads <NEW_LINE> self.count_threads = self.num_threads <NEW_LINE> self.count_lock = Lock() <NEW_LINE> self.threads_event = Event() <NEW_LINE> <DEDENT> def wait(self): <NEW_LINE> <INDENT> with s... | Thread barrier which is only usable once. | 62598f07ff9c53063f51911e |
class Wrapper(object): <NEW_LINE> <INDENT> def __init__(self, func, instance=None): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> self.instance = instance <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> response = self.call_view(*args, **kwargs) <NEW_LINE> if isinstance(response, werkzeug... | Apply annotations to a view function.
:param func: View function to wrap
:param instance: Optional instance or parent | 62598f07aad79263cf42d2ce |
class MigrationError(ViewfinderError): <NEW_LINE> <INDENT> pass | Unable to upgrade database item. | 62598f079f288636728172b4 |
class _frommethod: <NEW_LINE> <INDENT> def __init__(self, methodname, reversed=False): <NEW_LINE> <INDENT> self.__name__ = methodname <NEW_LINE> self.__doc__ = self.getdoc() <NEW_LINE> self.reversed = reversed <NEW_LINE> <DEDENT> def getdoc(self): <NEW_LINE> <INDENT> meth = getattr(MaskedArray, self.__name__, None) or ... | Define functions from existing MaskedArray methods.
Parameters
----------
methodname : str
Name of the method to transform. | 62598f07ab23a570cc2d42cb |
class Radau5Error(AssimuloException): <NEW_LINE> <INDENT> msg = { -1 : 'The input is not consistent.', -2 : 'The solver took max internal steps but could not reach the next output time.', -3 : 'The step size became too small.', -4 : 'The matrix is repeatedly singular.', -5 : 'Repeated unexpected step rej... | Defines the Radau5Error and provides the textual error message. | 62598f077047854f4633de85 |
class DeepSEA(nn.Module): <NEW_LINE> <INDENT> def __init__(self, nclass, seq_length): <NEW_LINE> <INDENT> super(DeepSEA, self).__init__() <NEW_LINE> conv_kernel_size = 8 <NEW_LINE> pool_kernel_size = 4 <NEW_LINE> sequence_length = seq_length <NEW_LINE> n_targets=nclass <NEW_LINE> linear_size = 128 <NEW_LINE> self.src_w... | An implementation of the DeepSEA model described in "Predicting effects
of noncoding variants with deep learning–based sequence model", Zhou and Troyanskaya,
2015.
https://www.nature.com/articles/nmeth.3547
Args:
nclass (int): The number of classes to predict
seq_length (int): The length of the input sequen... | 62598f07adb09d7d5dc0906d |
class QuoraProcessor(DataProcessor): <NEW_LINE> <INDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> lines = self._read_tsv(os.path.join(data_dir, "train.csv")) <NEW_LINE> examples = [] <NEW_LINE> for (i, line) in enumerate(lines[:30000]): <NEW_LINE> <INDENT> if i == 0: <NEW_LINE> <INDENT> continue <NEW... | Processor for the Quora data set. | 62598f07fff4ab517ebcc292 |
class InvalidChunkLength(HTTPError, httplib_IncompleteRead): <NEW_LINE> <INDENT> def __init__(self, response, length): <NEW_LINE> <INDENT> super().__init__(response.tell(), response.length_remaining) <NEW_LINE> self.response = response <NEW_LINE> self.length = length <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <... | Invalid chunk length in a chunked response. | 62598f077b180e01f3e485a7 |
class CityDomain: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def check_city(data: str) -> int: <NEW_LINE> <INDENT> city = City.query.filter_by(name=data).first() <NEW_LINE> if city: <NEW_LINE> <INDENT> log.debug(f'city record found :: {repr(city)}') <NEW_LINE> return city.id <NEW_LINE> <DEDENT> return None <NEW_LINE>... | Domain logic for city Entity | 62598f07f9cc0f698b1c482e |
class OutputOptions( object ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.outformat = 'docx' <NEW_LINE> self.converter = 'pandoc' <NEW_LINE> <DEDENT> class Admin( ObjectAdmin ): <NEW_LINE> <INDENT> from camelot.view.controls import delegates <NEW_LINE> verbose_name = _('Rapportalternativ') <NEW_LI... | Dialog med inställningar för rapporter | 62598f07ff9c53063f519120 |
class Config: <NEW_LINE> <INDENT> def __init__(self, should_expose, entity_config=None): <NEW_LINE> <INDENT> self.should_expose = should_expose <NEW_LINE> self.entity_config = entity_config or {} | Hold the configuration for Yandex Smart Home. | 62598f077c178a314d78bf5e |
class FilesLoadException(ChartBuilderException): <NEW_LINE> <INDENT> message = ('A %(clazz)s exception occurred while trying to read ' 'file: %(file)s. Details:\n%(details)s') | Exception that occurs while trying to read a file in the chart directory.
**Troubleshoot:**
* Ensure that the file can be encoded to utf-8 or else it cannot be parsed. | 62598f073346ee7daa336bc3 |
class RoRResStage(Chain): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels_list, dropout_rate, downsample=True): <NEW_LINE> <INDENT> super(RoRResStage, self).__init__() <NEW_LINE> self.downsample = downsample <NEW_LINE> with self.init_scope(): <NEW_LINE> <INDENT> self.shortcut = conv1x1_block( in_channe... | RoR-3 residual stage.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels_list : list of int
Number of output channels for each unit.
dropout_rate : float
Parameter of Dropout layer. Faction of the input units to drop.
downsample : bool, default True
Whether downsample outpu... | 62598f07283ffb24f3cf236c |
class TestBeamsplitter: <NEW_LINE> <INDENT> theta = 0.242 <NEW_LINE> phi = 0.452 <NEW_LINE> def test_identity(self): <NEW_LINE> <INDENT> _, t = beamsplitter(0, 0) <NEW_LINE> assert t == 0 <NEW_LINE> <DEDENT> def test_hermitian(self, hbar): <NEW_LINE> <INDENT> H, _ = beamsplitter(self.theta, self.phi, hbar=hbar) <NEW_LI... | Tests for beamsplitter function | 62598f07aad79263cf42d2d0 |
class StaticHandler(StaticFileHandler): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(StaticHandler, self).__init__(*args, **kwargs) <NEW_LINE> self.xsrf_token | 自定义静态文件处理类, 在用户获取html页面的时候设置_xsrf的cookie | 62598f079f288636728172b6 |
class Solution(object): <NEW_LINE> <INDENT> def judgeSquareSum(self, c): <NEW_LINE> <INDENT> a = 0 <NEW_LINE> while a*a <= c: <NEW_LINE> <INDENT> b = c - a*a <NEW_LINE> l, r = a, b <NEW_LINE> while r >= l: <NEW_LINE> <INDENT> mid = int((l+r)/2) <NEW_LINE> if mid**2 == b: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDE... | def judgeSquareSum(self, c):
"""
:type c: int
:rtype: bool
"""
a = 0
while a*a <= c:
b = c - a*a
l, r = a, b
while r >= l:
mid = int((l+r)/2)
if mid**2 == b:
return True
elif mid**2 > b:
r = mid - 1
... | 62598f077047854f4633de87 |
class ConnectToSourceMySqlTaskInput(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'source_connection_info': {'required': True}, } <NEW_LINE> _attribute_map = { 'source_connection_info': {'key': 'sourceConnectionInfo', 'type': 'MySqlConnectionInfo'}, 'target_platform': {'key': 'targetPlatform', 'type'... | Input for the task that validates MySQL database connection.
All required parameters must be populated in order to send to Azure.
:param source_connection_info: Required. Information for connecting to MySQL source.
:type source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
:param target_platfo... | 62598f07956e5f7376df4bdc |
class AuthBackend(object): <NEW_LINE> <INDENT> backend_id = None <NEW_LINE> name = None <NEW_LINE> settings_form = None <NEW_LINE> supports_anonymous_user = True <NEW_LINE> supports_object_permissions = True <NEW_LINE> supports_registration = False <NEW_LINE> supports_change_name = False <NEW_LINE> supports_change_emai... | The base class for Review Board authentication backends. | 62598f07f548e778e596a048 |
class TestDateRange(object): <NEW_LINE> <INDENT> def test_hongkong_tz_convert(self): <NEW_LINE> <INDENT> dr = date_range('2012-01-01', '2012-01-10', freq='D', tz='Hongkong') <NEW_LINE> dr.hour <NEW_LINE> <DEDENT> @pytest.mark.parametrize('tzstr', ['US/Eastern', 'dateutil/US/Eastern']) <NEW_LINE> def test_date_range_spa... | Tests for date_range with timezones | 62598f0797e22403b38399a1 |
class MixturePart(models.Model): <NEW_LINE> <INDENT> mixture = models.ForeignKey('soakinspecks.Mixture', related_name='parts') <NEW_LINE> flavor = models.ForeignKey('soakinspecks.Flavor', related_name='mixture_participations') <NEW_LINE> parts = models.PositiveIntegerField() | Represents a part of a mixture recipe
| 62598f0731939e2706ed0fc2 |
class CacheMissingError(Exception): <NEW_LINE> <INDENT> pass | Cache could not be loaded. | 62598f079f288636728172b7 |
class Answer(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey(Author, on_delete=models.SET_NULL, null=True) <NEW_LINE> question = models.ForeignKey('Question', on_delete=models.SET_NULL, null=True) <NEW_LINE> answer_text = models.TextField(max_length=2000, help_text='Write your answer here...') <NEW_LINE> ... | Model representing a question. | 62598f07656771135c48814c |
class RunOrContinue (gdb.Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(RunOrContinue, self).__init__("run-or-continue", gdb.COMMAND_USER) <NEW_LINE> <DEDENT> def invoke(self, args, from_tty): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> gdb.selected_frame() <NEW_LINE> <DEDENT> except gdb.e... | Run or continue | 62598f070fa83653e46f39a5 |
class SecurityDevices(models.Model): <NEW_LINE> <INDENT> device_type_choice = ( (0, '防火墙'), (1, '入侵检测设备'), (2, '互联网网关'), (3, '运维审计系统'), ) <NEW_LINE> asset = models.OneToOneField('Assets', on_delete=models.CASCADE, related_name='security') <NEW_LINE> device_type = models.SmallIntegerField(choices=device_type_choice, def... | 安全设备 | 62598f07cc40096d6161973a |
class AfterEntryCreatedEvent(object): <NEW_LINE> <INDENT> def __init__(self, entry, timeentry): <NEW_LINE> <INDENT> self.entry = entry <NEW_LINE> self.timeentry = timeentry | A search entry was created | 62598f07a219f33f346c52ee |
class VtHistoryData(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.vtSymbol = EMPTY_STRING <NEW_LINE> self.symbol = EMPTY_STRING <NEW_LINE> self.exchange = EMPTY_STRING <NEW_LINE> self.interval = EMPTY_UNICODE <NEW_LINE> self.queryID = EMPTY_STRING <NEW_LINE> self.barList = [] | K线时间序列数据 | 62598f074c34283577618daa |
class Step: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def upload_file_next_step(graph_id, job_id, auth=None): <NEW_LINE> <INDENT> url = "/api/v1.2/graph-connections/%d/job-manager/%d/upload-file/next-step" % (graph_id, job_id) <NEW_LINE> code, res = Request().request(method='put', path=url, types="hubble") <NEW_LINE... | 导入过程中会有下一步的操作 | 62598f077c178a314d78bf60 |
class ArpProtocol(Protocol): <NEW_LINE> <INDENT> def set_ARP_entry(self, iface, mac_addr, ip_addr): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def get_ARP_entries(self): <NEW_LINE> <INDENT> raise NotImplementedError | Base Class for ARP protocol | 62598f07f9cc0f698b1c482f |
class FileDescriptor(DescriptorBase): <NEW_LINE> <INDENT> if _USE_C_DESCRIPTORS: <NEW_LINE> <INDENT> _C_DESCRIPTOR_CLASS = _message.FileDescriptor <NEW_LINE> def __new__(cls, name, package, options=None, serialized_pb=None, dependencies=None, syntax=None): <NEW_LINE> <INDENT> if serialized_pb: <NEW_LINE> <INDENT> retur... | Descriptor for a file. Mimics the descriptor_pb2.FileDescriptorProto.
Note that enum_types_by_name, extensions_by_name, and dependencies
fields are only set by the message_factory module, and not by the
generated proto code.
name: name of file, relative to root of source tree.
package: name of the package
syntax: str... | 62598f07ff9c53063f519122 |
class RecentDialog(BoxLayout): <NEW_LINE> <INDENT> listview = ObjectProperty(None) <NEW_LINE> select_button = ObjectProperty(None) <NEW_LINE> cancel_button = ObjectProperty(None) <NEW_LINE> adapter = ObjectProperty(None) <NEW_LINE> __events__ = ('on_select', 'on_cancel') <NEW_LINE> def __init__(self, file_list, **kwarg... | RecentDialog shows the list of recent files retrieved from RecentManager
It emits, 'on_select' event when a file is selected and select_button is
clicked and 'on_cancel' when cancel_button is pressed. | 62598f07167d2b6e312b5a5d |
class Env(dict): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def snapshot(): <NEW_LINE> <INDENT> return Env(os.environ) <NEW_LINE> <DEDENT> def copy(self, updated_from=None): <NEW_LINE> <INDENT> result = Env(self) <NEW_LINE> if updated_from is not None: <NEW_LINE> <INDENT> result.update(updated_from) <NEW_LINE> <DEDEN... | A dict for environment variables.
| 62598f073617ad0b5ee04bee |
class LockFileCacheQueueTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.cq = get_cache_queue(name='LockFileCacheQueueTests') <NEW_LINE> self.cq.reset() <NEW_LINE> <DEDENT> def test_add_message_pop_message(self): <NEW_LINE> <INDENT> messages = ['foo', 'bar', 123, {'spam': (0.123, True)}] <... | Tests that we can manage a queue with CacheQueue. | 62598f079f288636728172b8 |
class Activation(Layer): <NEW_LINE> <INDENT> def __init__(self, transform, name=None): <NEW_LINE> <INDENT> super(Activation, self).__init__(name) <NEW_LINE> self.transform = transform <NEW_LINE> self.nglayer = self.be.relu_layer() <NEW_LINE> self.owns_output = False <NEW_LINE> self.owns_delta = True <NEW_LINE> <DEDENT>... | A layer that applies a specified transform to the inputs and
produces outputs of the same shape.
Generally used to implemenent nonlinearities for layer post activations.
Arguments:
transform (Transform): a transform object with fprop and bprop
functions to apply
name (str, optional): Layer name. Defau... | 62598f07dc8b845886d52089 |
class Timeout_t3(BaseException): <NEW_LINE> <INDENT> pass | Base class for exceptions in this module. | 62598f07adb09d7d5dc09071 |
class CountryEntity(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.abbreviation, self.name = data | Represents a country database entity | 62598f078a349b6b43684d06 |
class YNAB3_MonthlyBudget(YNAB3_AccountingWidget, YNAB3_Lister): <NEW_LINE> <INDENT> def __init__(self, category_dom): <NEW_LINE> <INDENT> super(YNAB3_MonthlyBudget, self).__init__(category_dom, [xmlize('categoryName'), xmlize('month')]) <NEW_LINE> <DEDENT> def load_properties(self, child): <NEW_LINE> <... | YNAB3_MonthlyBudget
Please note: This class represents the base type MonthlyBudget.
MonthlySubCategoryBudgets are represented by the subclass
YNAB3_MonthlySubCategoryBudget. | 62598f07fff4ab517ebcc296 |
class OscanAmpStackSummaryConfig(BiasSummaryAnalysisConfig): <NEW_LINE> <INDENT> infilekey = EOUtilOptions.clone_param('infilekey', default='biasosstack-stats') <NEW_LINE> filekey = EOUtilOptions.clone_param('filekey', default='biasosstack-sum') | Configuration for CorrelWRTOScanSummaryTask | 62598f07656771135c48814e |
class ReorderedTransforms(Transforms): <NEW_LINE> <INDENT> __slots__ = '_parent', '_mask', '_indices' <NEW_LINE> __cache__ = '_rindices' <NEW_LINE> @types.apply_annotations <NEW_LINE> def __init__(self, parent: stricttransforms, indices: types.arraydata): <NEW_LINE> <INDENT> assert indices.dtype == int <NEW_LINE> self.... | A reordered :class:`Transforms` object.
Parameters
----------
parent : :class:`Transforms`
The transforms to reorder.
indices : one-dimensional array of :class:`int`\s
The new order of the transforms. | 62598f077047854f4633de8b |
class BlockTimer: <NEW_LINE> <INDENT> __slots__ = ( "wall_time_start", "wall_time_end", "wall_time_elapsed", "proc_time_start", "proc_time_end", "proc_time_elapsed", ) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.wall_time_start = None <NEW_LINE> self.wall_time_end = None <NEW_LINE> self.wall_time_elapsed = ... | A context manager that times the code in the ``with`` block. Print the :class:`BlockTimer` after exiting the block to see the results. | 62598f07091ae356687036df |
class Library: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> lib_name = ctypes.util.find_library(self.library) <NEW_LINE> if not lib_name: <NEW_LINE> <INDENT> raise Exception("Unable to find native dependency \"{}\"".format(self.library)) <NEW_LINE> <DEDENT> self.lib = CDLL(lib_name) <NEW_LINE> self.load_... | Native library loader. | 62598f078a349b6b43684d08 |
class SparseVector(Vector): <NEW_LINE> <INDENT> def __init__(self, values, indices, length = 0, zero_test = lambda x : (x == 0)): <NEW_LINE> <INDENT> super(SparseVector, self).__init__(values, zero_test) <NEW_LINE> self.length = length <NEW_LINE> self.indices = indices <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> ... | Vector that has very few non-zero entries
Values and corresponding indices are kept in separate lists | 62598f07d8ef3951e32c73b5 |
class Tags(Resource): <NEW_LINE> <INDENT> @swagger.doc(metadata.tags_get_docs) <NEW_LINE> def get(self, tags): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> records = getMetaByTags(tags) <NEW_LINE> res_json = json.dumps(records.to_struct()) <NEW_LINE> res = make_response(res_json, 200) <NEW_LINE> res.headers['Content-Ty... | Definition for endpoint @app.route('/metadata/geodata/tags/<tags>')
Contains HTTP GET endpoint
Contains swagger documentation | 62598f07cc40096d6161973c |
class UUID(Type): <NEW_LINE> <INDENT> def parse(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> c = click.UUID(value) <NEW_LINE> return str(c) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> log.error("Incorrect UUID %s", value) <NEW_LINE> <DEDENT> <DEDENT> def check(self, value): <NEW_LINE> <INDENT> try: <N... | UUID Type Definition class. | 62598f07a05bb46b3848933c |
class FilterWidget(WithUiMixin, QWidget): <NEW_LINE> <INDENT> ui = 'filter' <NEW_LINE> icons = { 'filterButton': ('view-refresh', 'series-list-refresh'), } <NEW_LINE> filter_changed = Signal(unicode) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(FilterWidget, self).__init__(*args, **kwargs) ... | Filter widget | 62598f07ff9c53063f519126 |
class MetaNonelike(type): <NEW_LINE> <INDENT> def __call__(cls): <NEW_LINE> <INDENT> return cls <NEW_LINE> <DEDENT> def __str__(cls): return cls.__name__ <NEW_LINE> def __repr__(cls): return cls.__name__ <NEW_LINE> def __hash__(cls): return id(cls) <NEW_LINE> def __bool__(cls): return False <NEW_LI... | Metaclass to make a class as None-like as possible. | 62598f07d486a94d0ba2aa8c |
class OWExample: <NEW_LINE> <INDENT> def __init__(self, link_uri): <NEW_LINE> <INDENT> self._cf = Crazyflie() <NEW_LINE> self._cf.connected.add_callback(self._connected) <NEW_LINE> self._cf.disconnected.add_callback(self._disconnected) <NEW_LINE> self._cf.connection_failed.add_callback(self._connection_failed) <NEW_LIN... | Simple example listing the 1-wire memories found and lists its contents. | 62598f07283ffb24f3cf2372 |
class FAMOUS_SAMPLES: <NEW_LINE> <INDENT> COLLECTION_PATH = DEFAULT_SAMPLE_PATH + "famous" + os.sep; <NEW_LINE> SAMPLE_OLD_FAITHFUL = COLLECTION_PATH + "OldFaithful.data"; <NEW_LINE> SAMPLE_IRIS = COLLECTION_PATH + "Iris.data"; <NEW_LINE> ANSWER_IRIS = COLLECTION_PATH + "Iris.answer"... | !
@brief The famous suite offers a variety of popular dataset that are mentioned in articles, book, etc. | 62598f079f288636728172bc |
class BellmanBudge(KeyWeightKeyAnalysis): <NEW_LINE> <INDENT> _DOC_ALL_INHERITED = False <NEW_LINE> name = 'Bellman Budge Key Analysis' <NEW_LINE> identifiers = ['bellman', 'budge', 'bellman-budge', 'bellmanbudge'] <NEW_LINE> def __init__(self, referenceStream=None): <NEW_LINE> <INDENT> KeyWeightKeyAnalysis.__init__(se... | Implementation of Bellman-Budge weightings for Krumhansl-Schmuckler key determination algorithm.
Values from from http://extra.humdrum.org/man/keycor, which describes these
weightings as "No particular tendancies for confusions with neighboring keys." | 62598f07377c676e912f62c9 |
class Roof(surfaceTypeBase): <NEW_LINE> <INDENT> typeId = 1.0 <NEW_LINE> radianceMaterial = PlasticMaterial.bySingleReflectValue("generic_roof", 0.80) | Roof. | 62598f07a219f33f346c52f4 |
@implementer(IRequest) <NEW_LINE> class Request( BaseRequest, URLMethodsMixin, CallbackMethodsMixin, InstancePropertyMixin, LocalizerRequestMixin, AuthenticationAPIMixin, AuthorizationAPIMixin, ): <NEW_LINE> <INDENT> exception = None <NEW_LINE> exc_info = None <NEW_LINE> matchdict = None <NEW_LINE> matched_route = None... | A subclass of the :term:`WebOb` Request class. An instance of
this class is created by the :term:`router` and is provided to a
view callable (and to other subsystems) as the ``request``
argument.
The documentation below (save for the ``add_response_callback`` and
``add_finished_callback`` methods, which are defined i... | 62598f07f9cc0f698b1c4832 |
class ServerMsgResultDataVideo(ServerMsgResultData): <NEW_LINE> <INDENT> protocol = ServerMsgProtocol.Video <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._type = 1 <NEW_LINE> self._count = 0 <NEW_LINE> self._title = "" <NEW_LINE> self._media = "" <NEW_LINE> self._media_all = list... | 封装视频协议。
ServerMsgResultDataVideo类需要调用下面几个method进行设置
(GateWay发送的Video协议字段可能会更多)
ins.title = ""
ins.media = ""
ins.media_title = ""
ins.link = {"compress_img": "", "img": ""}
ins.append(DataVideoInfo.export())
media_all为不同分辨率视频全集,默认使用media_all[0]数据
如果media_all为空,则使用media字段
link为预图地址,只使用array第一个元素
... | 62598f07be7bc26dc92513c6 |
class CreateNetworkProfile(neutronV20.CreateCommand): <NEW_LINE> <INDENT> resource = RESOURCE <NEW_LINE> def add_known_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument('name', help=_('Name for network profile.')) <NEW_LINE> parser.add_argument('segment_type', choices=SEGMENT_TYPE_CHOICES, help='Segment ... | Create a network profile. | 62598f073346ee7daa336bc7 |
class Exported(View): <NEW_LINE> <INDENT> def render(self): <NEW_LINE> <INDENT> exported = {} <NEW_LINE> if self.user.is_admin: <NEW_LINE> <INDENT> country = self.user.country <NEW_LINE> month, year = self.request.params.get('month').split('/') <NEW_LINE> month = int(month) <NEW_LINE> year = int(year) <NEW_LINE> sage_o... | Export all requests of a month to csv | 62598f07aad79263cf42d2d8 |
class Meta(object): <NEW_LINE> <INDENT> database = self.database | 元类
| 62598f07283ffb24f3cf2374 |
class PlayblastPreview(base.BaseWidget, object): <NEW_LINE> <INDENT> __DEFAULT_WIDTH__ = 320 <NEW_LINE> __DEFAULT_HEIGHT__ = 180 <NEW_LINE> def __init__(self, options, validator, parent=None): <NEW_LINE> <INDENT> self.options = options <NEW_LINE> self.validator = validator <NEW_LINE> super(PlayblastPreview, self).__ini... | Playblast image preview | 62598f07851cf427c66b6d91 |
class AnyMeta(TypingMeta): <NEW_LINE> <INDENT> def __new__(cls, name, bases, namespace, _root=False): <NEW_LINE> <INDENT> self = super().__new__(cls, name, bases, namespace, _root=_root) <NEW_LINE> return self <NEW_LINE> <DEDENT> def __instancecheck__(self, obj): <NEW_LINE> <INDENT> raise TypeError("Any cannot be used ... | Metaclass for Any. | 62598f078a349b6b43684d0c |
class ComputeAutoscalersGetRequest(_messages.Message): <NEW_LINE> <INDENT> autoscaler = _messages.StringField(1, required=True) <NEW_LINE> project = _messages.StringField(2, required=True) <NEW_LINE> zone = _messages.StringField(3, required=True) | A ComputeAutoscalersGetRequest object.
Fields:
autoscaler: Name of the persistent autoscaler resource to return.
project: Name of the project scoping this request.
zone: Name of the zone scoping this request. | 62598f07ad47b63b2c5a62e2 |
class V1JobList(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'api_version': 'str', 'items': 'list[V1Job]', 'kind': 'str', 'metadata': 'UnversionedListMeta' } <NEW_LINE> self.attribute_map = { 'api_version': 'apiVersion', 'items': 'items', 'kind': 'kind', 'metadata': 'metad... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f07cc40096d6161973e |
class Node(XmlBase): <NEW_LINE> <INDENT> def __init__(self, Factory, node_name, node_id, node_attrs): <NEW_LINE> <INDENT> XmlBase.__init__(self, Factory, "node", node_id, uname=node_name) <NEW_LINE> self.add_child(InstanceAttributes(Factory, "%s-1" % node_name, node_attrs)) | Create a <node> section with node attributes for one node | 62598f07a219f33f346c52f6 |
class InsertLinkPanelCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> self.counter = 0 <NEW_LINE> self.keys = ['url', 'linktext'] <NEW_LINE> self.dictionary = { 'url': Bunch(name='URL', value=''), 'linktext': Bunch(name='Linktext', value=''), } <NEW_LINE> if(settings.get... | { "keys": ["alt+shift+l"], "command": "insert_link_panel"}
| 62598f07ab23a570cc2d42d1 |
class RangeFinder(object): <NEW_LINE> <INDENT> def __init__(self, bst, a, b): <NEW_LINE> <INDENT> self.bst = bst <NEW_LINE> self.a = a <NEW_LINE> self.b = b <NEW_LINE> <DEDENT> def nodes_in_range(self): <NEW_LINE> <INDENT> raise NotImplementedError('This is an abstract class.') <NEW_LINE> <DEDENT> def count_range(self)... | Interface/Abstract class | 62598f077cff6e4e811b44b1 |
class VectorizerMixin: <NEW_LINE> <INDENT> def _preprocess(self, document: str) -> List[str]: <NEW_LINE> <INDENT> document = document.lower() <NEW_LINE> token_pattern = re.compile(r"(?u)\b\w\w+\b") <NEW_LINE> document = token_pattern.findall(document) <NEW_LINE> return document | Provides common code for text vectorizers (preprocessing logic) | 62598f0797e22403b38399ab |
@click.command() <NEW_LINE> @click.option('--user', prompt='Matrícula', envvar='FORPONTO_USER') <NEW_LINE> @click.option('--password', prompt='Senha', envvar='FORPONTO_PASSWORD') <NEW_LINE> class ListBreaksCommand(ListMarksCommand): <NEW_LINE> <INDENT> def _filter(self, mark): <NEW_LINE> <INDENT> return not mark.date.w... | Lista de intervalos registrados no último mês. | 62598f07099cdd3c6367493c |
class interactWithUserBySingleBtn_result: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'actionEx', (ServerActEx, ServerActEx.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, actionEx=None,): <NEW_LINE> <INDENT> self.actionEx = actionEx <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> ... | Attributes:
- actionEx | 62598f079f288636728172c1 |
class ResourceGroupPatchable(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'ResourceGroupProperties'}, 'managed_by': {'key': 'managedBy', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } <NEW_LINE> def _... | Resource group information.
:ivar name: The name of the resource group.
:vartype name: str
:ivar properties: The resource group properties.
:vartype properties: ~azure.mgmt.resource.resources.v2020_10_01.models.ResourceGroupProperties
:ivar managed_by: The ID of the resource that manages this resource group.
:vartype ... | 62598f07d8ef3951e32c73b8 |
class DcaProtocol: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def encap_input(procedure_name, para, id): <NEW_LINE> <INDENT> root = ElementTree.Element('Procedure') <NEW_LINE> element = ElementTree.SubElement(root, 'UUID') <NEW_LINE> element.text = str(... | Include encapsulation and decapsulation of data between master and agent.
| 62598f07656771135c488156 |
class CMSEditableObjectBlock(CMSEditableObject): <NEW_LINE> <INDENT> name = 'render_model_block' <NEW_LINE> options = Options( Argument('instance'), Argument('edit_fields', default=None, required=False), Argument('language', default=None, required=False), Argument('view_url', default=None, required=False), Argument('vi... | Templatetag that links a content extracted from a generic django model
to the model admin changeform.
The rendered content is to be specified in the enclosed block. | 62598f07ad47b63b2c5a62e4 |
class Node: <NEW_LINE> <INDENT> def __init__(self, state, i, j, parent=None, action=None, path_cost=0): <NEW_LINE> <INDENT> self.state = state <NEW_LINE> self.i = i <NEW_LINE> self.j = j <NEW_LINE> self.parent = parent <NEW_LINE> self.action = action <NEW_LINE> self.path_cost = path_cost <NEW_LINE> self.depth = 0 <NEW_... | A node in a search tree. Contains a pointer to the parent (the node
that this is a successor of) and to the actual state for this node. Note
that if a state is arrived at by two paths, then there are two nodes with
the same state. Also includes the action that got us to this state, and
the total path_cost (also known ... | 62598f07377c676e912f62cb |
return ks <NEW_LINE> class OneShotFactoryStash(PreemptiveStash, metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, worker, *args, **kwargs): <NEW_LINE> <INDENT> super(OneShotFactoryStash, self).__init__(*args, **kwargs) <NEW_LINE> self.worker = worker <NEW_LINE> <DEDENT> def _process_work(self): <NEW_LINE> <IND... | A stash that is populated by a callable or an iterable 'worker'. The data
is generated by the worker and dumped to the delegate. | 62598f07283ffb24f3cf2378 |
class Review(core_models.TimeStampModel): <NEW_LINE> <INDENT> review = models.TextField() <NEW_LINE> accuracy = models.IntegerField(validators=[MinValueValidator(1), MaxValueValidator(5)]) <NEW_LINE> communication = models.IntegerField(validators=[MinValueValidator(1), MaxValueValidator(5)]) <NEW_LINE> cleanliness = mo... | Review Model Definition | 62598f07851cf427c66b6d95 |
class BaseBAResourceTestCase(object): <NEW_LINE> <INDENT> maxDiff = None <NEW_LINE> def test_get_list_json(self): <NEW_LINE> <INDENT> resp = self.api_client.get('/api/v1/%s/' % self.resource_name, format='json') <NEW_LINE> self.assertValidJSONResponse(resp) <NEW_LINE> self.assertLessEqual(len(self.deserialize(resp)['ob... | Test generic model | 62598f0731939e2706ed0fc8 |
class AccelerationNormalAtTouchdown(KeyPointValueNode): <NEW_LINE> <INDENT> units = ut.G <NEW_LINE> def derive(self, acc_norm=P('Acceleration Normal Offset Removed'), touchdowns=KTI('Touchdown')): <NEW_LINE> <INDENT> for touchdown in touchdowns: <NEW_LINE> <INDENT> self.create_kpv(*bump(acc_norm, touchdown)) | This is the peak acceleration at landing, often used to identify hard
landings for maintenance purposes. | 62598f079f288636728172c3 |
class FeatureSet(object): <NEW_LINE> <INDENT> def __init__(self, features_repr=''): <NEW_LINE> <INDENT> assert type(features_repr) is StringType, 'features_repr: passed object of incorrect type' <NEW_LINE> self.snow = StringVar(value='S' if 'S' in features_repr else '') <NEW_LINE> self.rain = StringVar(value='R' if 'R'... | Class which stores information about all the features of the meteorogram.
Attributes of that class should contain the following values if the appropriate feature was detected.
Args:
snow (StringVar): S if detected, empty string otherwise.
rain (StringVar): R if detected, empty string otherwise.
storm (Stri... | 62598f075fc7496912d477d9 |
@register('basic_classification_iterator') <NEW_LINE> class BasicClassificationDatasetIterator(DataLearningIterator): <NEW_LINE> <INDENT> def __init__(self, data, fields_to_merge=None, merged_field=None, field_to_split=None, split_fields=None, split_proportions=None, seed: int = None, shuffle: bool = True, *args, **kwa... | Class gets data dictionary from DatasetReader instance,
merge fields if necessary,
split a field if necessary | 62598f07fff4ab517ebcc2a0 |
class NucleicPairStudy (object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_study_id(cls, ermrest_catalog, study_id): <NEW_LINE> <INDENT> r = ermrest_catalog.get(cls.metadata_query_url(study_id)) <NEW_LINE> r.raise_for_status() <NEW_LINE> result = r.json() <NEW_LINE> if len(result) != 1: <NEW_LINE> <INDENT> r... | Local representation of one remote Nucliec Pair Study record.
WORK IN PROGRESS...
Basic usage:
study = NucleicPairStudy.from_study_id(ermrest_catalog, study_id)
study.retrieve_data(hatrac_store)
The above will populate instance fields:
id: the same study_id passed to from_study_id()
spacing: the ZY... | 62598f077c178a314d78bf6b |
class Robot(object): <NEW_LINE> <INDENT> def act(self, game): <NEW_LINE> <INDENT> return ['guard'] | No-op sanity testing robot | 62598f07be7bc26dc92513c9 |
class TopReducer(DictCountReducer): <NEW_LINE> <INDENT> def __init__(self, k: int, key_conv, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(key_conv, 1, *args, **kwargs) <NEW_LINE> if not isinstance(k, int): <NEW_LINE> <INDENT> raise TypeError("K must be an integer.") <NEW_LINE> <DEDENT> if k < 1: <NEW_LINE> <I... | Returns a list of the most frequent values.
The resulting list is sorted in descending order of values frequency. | 62598f07ec188e330fdf737e |
class IIA(_II1): <NEW_LINE> <INDENT> def __init__(self, gait): <NEW_LINE> <INDENT> super(IIA, self).__init__(gait, 'amplitude') | Individual; Amplitude | 62598f07d486a94d0ba2aa94 |
class Plugin(CSMPlugin): <NEW_LINE> <INDENT> name = "Core Error Check Plugin" <NEW_LINE> platforms = {'ASR9K', 'XR12K', 'CRS', 'NCS1K', 'NCS1001', 'NCS4K', 'NCS540', 'NCS5K', 'NCS5500', 'NCS6K', 'IOSXRv-9K', 'IOSXRv-X64'} <NEW_LINE> phases = {'Post-Upgrade'} <NEW_LINE> _string_to_check_re = re.compile( "^(.*(?:[Ee][Rr]... | This plugin checks system logs against any errors, traceback of crash information. | 62598f073617ad0b5ee04bfa |
class BackupError(MigrationError): <NEW_LINE> <INDENT> pass | An error happened during the execution of the backup.
| 62598f07851cf427c66b6d97 |
class PagedException(Exception): <NEW_LINE> <INDENT> def __init__(self, cursor, error): <NEW_LINE> <INDENT> self.cursor = cursor <NEW_LINE> self.error = error <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<PagedException cursor=%r error=%r>" % ( self.cursor, self.error) <NEW_LINE> <DEDENT> def __s... | Exception raised during paged API calls that can be restarted by
specifying a start cursor.
Attributes:
cursor - The value of the cursor for which the paged request failed.
error - The exception that occurred. | 62598f07f548e778e596a056 |
class Hover(Renderable): <NEW_LINE> <INDENT> def __init__(self, name, rect, on_hover=None, off_hover=None): <NEW_LINE> <INDENT> rect = pygame.Rect(rect) <NEW_LINE> super().__init__(name, rect.x, rect.y) <NEW_LINE> self.zone = Zone(rect) <NEW_LINE> self.dirty = True <NEW_LINE> self.neutral = None <NEW_LINE> self.hover =... | Hover defines an interface which doesn't implement
'rendering' but does implements the hovering part of a zone. | 62598f077b180e01f3e485af |
class MappingException(UnifyException): <NEW_LINE> <INDENT> def __init__(self, msg, backtrack_possible, peak_vnf_cnt=None, peak_sc_cnt=None): <NEW_LINE> <INDENT> super(MappingException, self).__init__(msg + " Backtrack available: %s" %backtrack_possible) <NEW_LINE> self.backtrack_possible = backtrack_possible <NEW_LINE... | Raised when a mapping could not be found for the request given from the
upper layer. Not enough resources, no path found.
:param peak_vnf_cnt: the peak number of VNFs mapped at the same time
:type peak_vnf_cnt: int
:param peak_sc_cnt: the number of subchain which couldn't be mapped last
:type peak_sc_cnt: int
:return:... | 62598f07bf627c535bcaff44 |
class TestCountPrimes(unittest.TestCase): <NEW_LINE> <INDENT> def test_count_primes(self): <NEW_LINE> <INDENT> s = Solution() <NEW_LINE> self.assertEqual(4, s.countPrimes(10)) | Test q204_count_primes.py | 62598f07a05bb46b38489346 |
class TestDiscoverDate(unittest.TestCase): <NEW_LINE> <INDENT> def testDiscoverDate(self): <NEW_LINE> <INDENT> numHeaderLines, plateID, measDate = readHeader(pathToPlate1413MeasFile) <NEW_LINE> self.assertTrue(measDate is None) | Every method beginning with "test" is run automatically by the
unittest package
all self.assert* methods are provided by the unittest package | 62598f07283ffb24f3cf237b |
class StateChangeLogStorageBackend(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def write_state_change(self, data): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def write_state_snapshot(self, statechange_id, data): <NEW_LINE> <INDENT> pass <NEW_LI... | StateChangeLogStorageBackend
An abstract class defining the storage backend for the transaction log.
Allows for pluggable storage backends. | 62598f0750812a4eaa620153 |
class InformationRetrieval: <NEW_LINE> <INDENT> def get(self, query_vector): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def refresh_index(self, search_index): <NEW_LINE> <INDENT> pass | Information retrieval handles getting list of closest indexed vectors for the query vector | 62598f07851cf427c66b6d99 |
class ContextManager(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> if not self: <NEW_LINE> <INDENT> raise ExtractError(self) <NEW_LINE> <DEDENT> return self.bind(identity) <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_tb): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> bind... | Mixin class that support ``with`` statement for monad. | 62598f077cff6e4e811b44b7 |
class Episode(): <NEW_LINE> <INDENT> def __init__(self, name, parent_path, series, season, episode, year=None, original_series=True, tvdb_id=None, series_tvdb_id=None, series_imdb_id=None, release_group=None, video_codec=None, container=None, format=None, screen_size=None, **kwargs): <NEW_LINE> <INDENT> super(Episode, ... | Episode :class:`Video`.
:param str series: series of the episode.
:param int season: season number of the episode.
:param int episode: episode number of the episode.
:param str title: title of the episode.
:param int year: year of the series.
:param bool original_series: whether the series is the first with this name.
... | 62598f07adb09d7d5dc0907f |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.