code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class IDuringTaskTemplateFolderTriggering(Interface): <NEW_LINE> <INDENT> pass
Request marker present while generating tasks from a task template folder.
62598f6dec188e330fdf805a
class TestExtImageUpload(ExtFileTestCase): <NEW_LINE> <INDENT> def testManageFileUploadFromFileName(self): <NEW_LINE> <INDENT> self.addExtImage(id='image', file='') <NEW_LINE> self.image.manage_file_upload(file=gifImage) <NEW_LINE> self.image._finish() <NEW_LINE> self.assertEqual(self.reposit(), ['image.gif']) <NEW_LIN...
Test ExtImage upload
62598f6da8ecb033258709c0
class _PauseException(Exception): <NEW_LINE> <INDENT> pass
Raised by session.pause() indicating that the command session should be paused to ask the user for some arguments.
62598f6d5166f23b2e242b95
class View(core.View): <NEW_LINE> <INDENT> grok.context(ICouncilDirectoryItem) <NEW_LINE> grok.require('zope2.View') <NEW_LINE> template = grok.PageTemplateFile('templates/item.pt') <NEW_LINE> def tags(self): <NEW_LINE> <INDENT> directory = self.context.aq_inner.aq_parent <NEW_LINE> labels = directory.labels() <NEW_LIN...
Default view of a seantis.dir.council item.
62598f6dd4950a0f3b110a14
class GridGenerator: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.grid = Grid() <NEW_LINE> self.validator = Validator() <NEW_LINE> self.values = None <NEW_LINE> <DEDENT> def generate_grid(self): <NEW_LINE> <INDENT> empty_grid_text = "0" * 81 <NEW_LINE> self.values = self.grid.set_values(empty_grid_t...
Generator Sudoku dictionary
62598f6d1d351010ab8f32fc
class TextSignal(QtCore.QObject): <NEW_LINE> <INDENT> tsig = QtCore.pyqtSignal(str)
for passing text
62598f6d91af0d3eaad395c5
class DownloadHelper(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.downloadPercent = 0 <NEW_LINE> <DEDENT> def humanFormatSize(self,size): <NEW_LINE> <INDENT> for x in ['bytes','KB','MB','GB']: <NEW_LINE> <INDENT> if size < 1024.0 and size > -1024.0: <NEW_LINE> <INDENT> return "%3.1f%s" % (s...
Class to help download data for testing
62598f6d66656f66f7d59baa
class UserSchema(JsonApiSchema): <NEW_LINE> <INDENT> _object_class = User <NEW_LINE> id = fields.Integer(allow_none=False) <NEW_LINE> username = fields.String(allow_none=False) <NEW_LINE> email = fields.String(allow_none=False) <NEW_LINE> password_hash = fields.String(allow_none=False) <NEW_LINE> create_date = fields.D...
User marshmallow schema
62598f6d1f037a2d8b9e38aa
class IMergeIdentities(Intention): <NEW_LINE> <INDENT> objects = MergeIdentitiesManager() <NEW_LINE> scheduled = models.DateTimeField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'poolsched_merge_identities' <NEW_LINE> verbose_name_plural = "Merge Identities" <NEW_LINE> <DEDENT> @property <NEW_LINE> def proc...
Intention to merge indices authors with SortingHat data
62598f6d16aa5153ce3ffcb6
class CIFAR100(CIFAR10): <NEW_LINE> <INDENT> def __init__(self, root=os.path.join(base.data_dir(), 'datasets', 'cifar100'), fine_label=False, train=True, transform=None): <NEW_LINE> <INDENT> self._train = train <NEW_LINE> self._archive_file = ('cifar-100-binary.tar.gz', 'a0bb982c76b83111308126cc779a992fa506b90b') <NEW_...
CIFAR100 image classification dataset from https://www.cs.toronto.edu/~kriz/cifar.html Each sample is an image (in 3D NDArray) with shape (32, 32, 3). Parameters ---------- root : str, default $MXNET_HOME/datasets/cifar100 Path to temp folder for storing data. fine_label : bool, default False Whether to load ...
62598f6d15fb5d323ce7e4e2
class SheetIOException(Exception): <NEW_LINE> <INDENT> pass
Raised on problems with loading sample sheets
62598f6d73bcbd0ca4bc9a11
class ListStream: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.output = [] <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for s in self.output: <NEW_LINE> <INDENT> yield s <NEW_LINE> <DEDENT> <DEDENT> def write(self, s): <NEW_LINE> <INDENT> self.output.append(s) <NEW_LINE> <DEDENT> def ...
Helper class for output redirection into list. Class instances are file-like objects that can be assigned to output stream to store it into list container.
62598f6da4f1c619b294ddb2
class GoogleCloudStorageListOperator(BaseOperator): <NEW_LINE> <INDENT> template_fields = ('bucket', 'prefix', 'delimiter') <NEW_LINE> ui_color = '#f0eee4' <NEW_LINE> @apply_defaults <NEW_LINE> def __init__(self, bucket, prefix=None, delimiter=None, google_cloud_storage_conn_id='google_cloud_default', delegate_to=None,...
List all objects from the bucket with the give string prefix and delimiter in name. This operator returns a python list with the name of objects which can be used by `xcom` in the downstream task. :param bucket: The Google cloud storage bucket to find the objects. (templated) :type bucket: str :param prefix: Prefix ...
62598f6d7b25080760ed6c57
class V1beta1FSType(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { } <NEW_LINE> self.attribute_map = { } <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in iteritems(self.swagger_types): <NEW_LINE> <INDENT> value = getattr(self, ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f6d8e05c05ec3f6ea23
class Pet(object, metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, nickname): <NEW_LINE> <INDENT> self._nickname = nickname <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def make_voice(self): <NEW_LINE> <INDENT> pass
宠物
62598f6d1f037a2d8b9e38ac
class FilterBySmirks(CurationComponent): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> @functools.lru_cache(1000) <NEW_LINE> def _find_smirks_matches(smiles_pattern, *smirks_patterns): <NEW_LINE> <INDENT> from openff.toolkit.topology import Molecule <NEW_LINE> if len(smirks_patterns) == 0: <NEW_LINE> <INDENT> return [] ...
A component which filters a data set so that it only contains measurements made for molecules which contain (or don't) a set of chemical environments represented by SMIRKS patterns.
62598f6d38b623060ffa8858
class SearchService(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.index = defaultdict(set) <NEW_LINE> self.id_service = lookup("IdLookup") <NEW_LINE> <DEDENT> def _update(self, name, geonameid): <NEW_LINE> <INDENT> if name: <NEW_LINE> <INDENT> name = name.lower().split(" ") <NEW_LINE> one = ...
Simple geo name services uses trie
62598f6d5e10d32532ce34c9
class Join(ClashingBase, Base): <NEW_LINE> <INDENT> pass
Test that we follow MRO's order.
62598f6d66656f66f7d59bac
class NodalLoad(BaseVectorLoad): <NEW_LINE> <INDENT> def __init__(self,name, lstNod, loadVector): <NEW_LINE> <INDENT> super(NodalLoad,self).__init__(name,loadVector) <NEW_LINE> self.name=name <NEW_LINE> self.lstNod= lstNod <NEW_LINE> <DEDENT> def appendLoadToCurrentLoadPattern(self): <NEW_LINE> <INDENT> for n in self.l...
Point load applied on a list of nodes :ivar name: name identifying the load :ivar lstNod: list of nodes on which the load is applied. :ivar loadVector: xc.Vector with the six components of the load: xc.Vector([Fx,Fy,Fz,Mx,My,Mz]).
62598f6d711fe17d825dfea6
class Test(Goal): <NEW_LINE> <INDENT> name = 'test'
Runs tests.
62598f6d7c178a314d78cc5f
class AddExternalItemForm(ModelForm): <NEW_LINE> <INDENT> title = forms.CharField( widget=forms.widgets.TextInput(attrs={'size':35}) ) <NEW_LINE> note = forms.CharField ( widget=forms.widgets.Textarea(), help_text='Foo', ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Item <NEW_LINE> exclude = ('list','created_dat...
Form to allow users who are not part of the GTD system to file a ticket.
62598f6d8a349b6b436859fd
class FileMessage(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100,verbose_name="文件名") <NEW_LINE> file = models.FileField( blank=True, verbose_name='文件地址') <NEW_LINE> creat_time = models.DateTimeField(default=datetime.now, verbose_name="上传时间") <NEW_LINE> user = models.ForeignKey(User, verbose_n...
文件信息
62598f6d16aa5153ce3ffcb8
class StatevectorSimulatorTest(providers.BackendTestCase): <NEW_LINE> <INDENT> backend_cls = StatevectorSimulatorPy <NEW_LINE> circuit = None <NEW_LINE> def test_run_circuit(self): <NEW_LINE> <INDENT> self.circuit = ReferenceCircuits.bell_no_measure() <NEW_LINE> result = super().test_run_circuit() <NEW_LINE> actual = r...
Test BasicAer statevector simulator.
62598f6d287bf620b627137d
class BaseDictionaryModelAdmin(BaseModelAdmin): <NEW_LINE> <INDENT> list_display = ('id', 'title', 'status', 'ordering', 'created') <NEW_LINE> list_display_links = ('id', 'title') <NEW_LINE> search_fields = BaseModelAdmin.search_fields + ['title']
Базовый класс для админ.части модели BaseDictionaryModel
62598f6d15fb5d323ce7e4e4
class WordpressViewProcessorTestCase(unittest.TestCase): <NEW_LINE> <INDENT> @mock.patch('requests.get') <NEW_LINE> def test_views(self, mock_requests_get): <NEW_LINE> <INDENT> mock_response_view = mock.Mock() <NEW_LINE> mock_response_view.content = open(os.path.join(os.path.dirname(__file__), 'test_wordpress_view_proc...
wordpress_view_processor grabs views from the WordPress API and returns them for indexing in Elasticsearch by Sheer. This doesn't unittest individual functions within the module. It tests the `documents()` function, which is what Sheer calls, and ensures that the output is appropriate for the input.
62598f6d167d2b6e312b673a
class OsidOperableForm(abc_osid_objects.OsidOperableForm, OsidForm): <NEW_LINE> <INDENT> def get_enabled_metadata(self): <NEW_LINE> <INDENT> raise errors.Unimplemented() <NEW_LINE> <DEDENT> enabled_metadata = property(fget=get_enabled_metadata) <NEW_LINE> @utilities.arguments_not_none <NEW_LINE> def set_enabled(self, e...
This form is used to create and update operables.
62598f6d7b25080760ed6c59
class SmsThread(JNTBusThread): <NEW_LINE> <INDENT> def init_bus(self): <NEW_LINE> <INDENT> self.section = OID <NEW_LINE> from janitoo_sms.bus import SmsBus <NEW_LINE> self.bus = SmsBus(options=self.options, oid=self.section, name='SMS Manager bus', product_name="SMS controller", product_type="Core thread")
The SMS thread
62598f6dd18da76e235b6d15
class HCSIFlagsField(FlagsField): <NEW_LINE> <INDENT> def i2m(self, pkt, val): <NEW_LINE> <INDENT> if val is None: <NEW_LINE> <INDENT> val = 0 <NEW_LINE> if (pkt): <NEW_LINE> <INDENT> for i, name in enumerate(self.names): <NEW_LINE> <INDENT> name = name[0] <NEW_LINE> value = pkt.getfieldval(name) <NEW_LINE> if value is...
A FlagsField where each bit/flag turns a conditional field on or off. If the value is None when building a packet, i2m() will check the value of every field in self.names. If the field's value is not None, the corresponding flag will be set.
62598f6d21bff66bcd72241d
class OAREmbedding(snt.Module): <NEW_LINE> <INDENT> def __init__(self, torso: base.Module, num_actions: Union[int, Sequence[int]], internal_rewards: Optional[internal_reward.InternalRewards] = None): <NEW_LINE> <INDENT> super().__init__(name='oar_embedding') <NEW_LINE> num_actions_is_int = isinstance(num_actions, int) ...
Module for embedding (observation, action, reward) inputs together. This module is based on dm-acme's OAREmbedding module, but was enhanced to further support - multi-discrete/decomposed action spaces (such as the one from the FTW paper) - internal rewards (as used by the FTW agent). If a multi-discrete/decom...
62598f6d6fece00bbaccb149
class Replay: <NEW_LINE> <INDENT> FILE_EXT = ".atbp" <NEW_LINE> def __init__(self, entries=[], path=None, simple=False): <NEW_LINE> <INDENT> self.entries = entries <NEW_LINE> self.replay_file = None <NEW_LINE> if path: <NEW_LINE> <INDENT> self.replay_file = open(path, "w") <NEW_LINE> <DEDENT> self.simple = simple <NEW_...
Represents a replay. Allows for the reading and writing of replays.
62598f6dc432627299fa2793
class TestSubscribe(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> self.user1 = User.objects.create_user( username='user1', email='user1@mail.com', password='12345' ) <NEW_LINE> self.user2 = User.objects.create_user( username='user2', email='user2@mail.com', passwo...
Проверка правильности работы системы подписок.
62598f6d66656f66f7d59bae
class stock_picking(oe_lx, osv.osv): <NEW_LINE> <INDENT> _inherit = 'stock.picking' <NEW_LINE> def action_assign_wkf(self, cr, uid, ids, context=None): <NEW_LINE> <INDENT> res = super(stock_picking, self).action_assign_wkf(cr, uid, ids, context=context) <NEW_LINE> for picking_id in ids: <NEW_LINE> <INDENT> picking = se...
Inherit the stock.picking object to trigger upload of SO pickings
62598f6d507cdc57c63a4559
class IndexPackageList(list): <NEW_LINE> <INDENT> def __init__(self,*arg): <NEW_LINE> <INDENT> for buff in arg: <NEW_LINE> <INDENT> if isinstance(buff,IndexPackage): <NEW_LINE> <INDENT> self.append(buff) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError("IndexPackageList init error: the input parameters mu...
This class packs several IndexPackage as a whole for convenience.
62598f6d925a0f43d25e77fa
class DashControlServer: <NEW_LINE> <INDENT> def __init__(self, proc): <NEW_LINE> <INDENT> self.proc = proc <NEW_LINE> self.sock = None <NEW_LINE> self.d_sock = None <NEW_LINE> self.d_proc = None <NEW_LINE> self.dcb_obj = dcb.DashCircuitBoard() <NEW_LINE> <DEDENT> def configure_controller(self): <NEW_LINE> <INDENT> sel...
DASH GC Controller - Triggers Actions
62598f6dd6c5a102081e1903
class AlgorandMnemonicConst: <NEW_LINE> <INDENT> MNEMONIC_WORD_NUM: List[AlgorandWordsNum] = [ AlgorandWordsNum.WORDS_NUM_25, ] <NEW_LINE> CHECKSUM_BYTE_LEN: int = 2
Class container for Algorand mnemonic constants.
62598f6d26238365f5fac335
class StructOperationTest(test_lib.BaseTestCase): <NEW_LINE> <INDENT> def testInitialize(self): <NEW_LINE> <INDENT> byte_stream_operation = byte_operations.StructOperation('b') <NEW_LINE> self.assertIsNotNone(byte_stream_operation) <NEW_LINE> with self.assertRaises(errors.FormatError): <NEW_LINE> <INDENT> byte_operatio...
Python struct-base byte stream operation tests.
62598f6d73bcbd0ca4bc9a15
class Result(object): <NEW_LINE> <INDENT> __slots__ = ('queue', 'thread', 'result') <NEW_LINE> def __init__(self, queue, thread): <NEW_LINE> <INDENT> super(Asynchronous.Result, self).__init__() <NEW_LINE> self.result = None <NEW_LINE> self.queue = queue <NEW_LINE> self.thread = thread <NEW_LINE> <DEDENT> def is_done(se...
In charge of receive asynchronous function result.
62598f6dcad5886f8bdc4ade
class DjangoOrderingTestCase(DjangoStorageAdapterTestCase): <NEW_LINE> <INDENT> def test_order_by_text(self): <NEW_LINE> <INDENT> statement_a = StatementModel.objects.create(text='A is the first letter of the alphabet.') <NEW_LINE> statement_b = StatementModel.objects.create(text='B is the second letter of the alphabet...
Test cases for the ordering of sets of statements.
62598f6d8c3a8732951f5d0e
class Pr2ParkArms(ProcessModule): <NEW_LINE> <INDENT> def _execute(self, desig): <NEW_LINE> <INDENT> solutions = desig.reference() <NEW_LINE> if solutions['cmd'] == 'park': <NEW_LINE> <INDENT> _park_arms()
This process module is for moving the arms in a parking position. It is currently not used.
62598f6d15baa72349461748
class Panda(DHRobot): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> mm = 1e-3 <NEW_LINE> tool_offset = (103)*mm <NEW_LINE> flange = (107)*mm <NEW_LINE> L = [ RevoluteMDH( a=0.0, d=0.333, alpha=0.0, qlim=np.array([-2.8973, 2.8973]) ), RevoluteMDH( a=0.0, d=0.0, alpha=-np.pi/2, qlim=np.array([-1.7628, 1.762...
A class representing the Panda robot arm. ``Panda()`` is a class which models a Franka-Emika Panda robot and describes its kinematic characteristics using modified DH conventions. .. runblock:: pycon >>> import roboticstoolbox as rtb >>> robot = rtb.models.DH.Panda() >>> print(robot) .. note:: - SI ...
62598f6da4f1c619b294ddb6
class FeedbackControllerPanel(DocumentLayout): <NEW_LINE> <INDENT> def __init__( self, limits_panel, timeouts_panel, pid_panel, errors_plotter, errors_plotter_clear_button, title, nest_level, width=960 ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.limits_panel = limits_panel.make_document_layout() <NEW_LINE...
Parameters panel for the feedback controller.
62598f6d1f037a2d8b9e38b0
class _DpbServiceSpec(spec.BaseSpec): <NEW_LINE> <INDENT> def __init__(self, component_full_name, flag_values=None, **kwargs): <NEW_LINE> <INDENT> super(_DpbServiceSpec, self).__init__( component_full_name, flag_values=flag_values, **kwargs) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _GetOptionDecoderConstructions...
Configurable options of an Distributed Processing Backend Service. We may add more options here, such as disk specs, as necessary. When there are flags for these attributes, the convention is that the flag is prefixed with dpb. Attributes: service_type: string. pkb_managed or dataflow,dataproc,emr, etc. static_d...
62598f6dd18da76e235b6d16
class Signature(object): <NEW_LINE> <INDENT> def __init__(self, positional_arguments, keyword_arguments, annotations, arbitary_positional_arguments=None, arbitary_keyword_arguments=None, defaults=None, documentation=None): <NEW_LINE> <INDENT> self.positional_arguments = positional_arguments <NEW_LINE> self.keyword_argu...
Represents the signature of a callable object.
62598f6d38b623060ffa885c
class ConsumerGroupListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ConsumerGroup]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ConsumerGroupListResult, self).__init__(**kwargs...
The result to the List Consumer Group operation. :param value: Result of the List Consumer Group operation. :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup] :param next_link: Link to the next set of results. Not empty if Value contains incomplete list of Consumer Group. :type next_link...
62598f6d5166f23b2e242b9b
class AlbumTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_ensure_data_no_totaltracks(self): <NEW_LINE> <INDENT> album = Album(artist='Artist', album='Album', totalseconds=120) <NEW_LINE> with self.assertRaises(Exception): <NEW_LINE> <INDENT> album.ensure_data() <NEW_LINE> <DEDENT> <DEDENT> def test_ensure_data_...
Tests for our Album class
62598f6d6e29344779affe1d
class NodeSelectorRequirement(HelmYaml): <NEW_LINE> <INDENT> def __init__( self, key: str, operator: str, values: Optional[List[str]] = None, ): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.operator = operator <NEW_LINE> self.values = values
:param key: The label key that the selector applies to. :param operator: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. :param values: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If t...
62598f6dd10714528d69d68d
class CustomResNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, size=None, block=None, layers=None, num_classes=1000, extra_output=None, modify_sequence=None, halfsize=False): <NEW_LINE> <INDENT> standard_sizes = { 18: (resnet.BasicBlock, [2, 2, 2, 2]), 34: (resnet.BasicBlock, [3, 4, 6, 3]), 50: (resnet.Bottlenec...
Customizable ResNet, compatible with pytorch's resnet, but: * The top-level sequence of modules can be modified to add or remove or alter layers. * Extra outputs can be produced, to allow backprop and access to internal features. * Pooling is replaced by resizable GlobalAveragePooling so that any size can b...
62598f6d30c21e258be97fc2
class Phase(GraphOrderable): <NEW_LINE> <INDENT> def __init__(self, name, description, isInternal, after = None, placeAfterSeq = [], placeBeforeSeq = [] ): <NEW_LINE> <INDENT> GraphOrderable.__init__(self, name, after, placeAfterSeq, placeBeforeSeq ) <NEW_LINE> self.description = description <NEW_LINE> self.isInternal ...
Acts on a Compilation Unit (containing a tree and source data) Usually the action would be a transformaton of the tree, but it may be for data gathering, or other purposes. A phase should never throw errors. If it could throw an error, the Phase should carry a reporter attribute, to report. run() should be implemented,...
62598f6d30c21e258be97fc3
class MLEInference(Inference): <NEW_LINE> <INDENT> def infer_params(self, click_model, search_sessions): <NEW_LINE> <INDENT> if search_sessions is None or len(search_sessions) == 0: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> for search_session in search_sessions: <NEW_LINE> <INDENT> session_params = click_model.get...
The maximum likelihood estimation (MLE) approach to parameter inference.
62598f6dec188e330fdf8062
class VkApi(object): <NEW_LINE> <INDENT> def __init__(self, accessToken=None, apiVersion=None, apiDelay=None): <NEW_LINE> <INDENT> self.accessToken = accessToken <NEW_LINE> self.apiVersion = apiVersion <NEW_LINE> if self.apiVersion is None: <NEW_LINE> <INDENT> self.apiVersion = DEFAULT_API_VERSION <NEW_LINE> <DEDENT> s...
Класс для работы с API Вконтакте. Работает с версией API > 3. Методы API Вконтакте можно вызывать в удобном виде: <object VkApi>.users.get(user_id=123) Вместо именованных аргументов можно первым аргументом передавать словарь: <object VkApi>.users.get({'user_id': 123}) Это аналогично такой запис...
62598f6d167d2b6e312b673e
class Vocabulary(object): <NEW_LINE> <INDENT> def __init__(self, vocab, unk_id): <NEW_LINE> <INDENT> self._vocab = vocab <NEW_LINE> self._unk_id = unk_id <NEW_LINE> <DEDENT> def word_to_id(self, word): <NEW_LINE> <INDENT> if word in self._vocab: <NEW_LINE> <INDENT> return self._vocab[word] <NEW_LINE> <DEDENT> else: <NE...
Simple vocabulary wrapper.
62598f6d1f5feb6acb1623f9
class VMCImageNotReadyError(VMCBaseError): <NEW_LINE> <INDENT> pass
Raise if a request to clone the image is made but the image build has not completed.
62598f6d8e05c05ec3f6ea26
class CosmosTask(task.Task): <NEW_LINE> <INDENT> def __init__(self, addons=None, **kwargs): <NEW_LINE> <INDENT> super(CosmosTask, self).__init__(self.make_name(addons), **kwargs) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def make_name(cls, addons=None): <NEW_LINE> <INDENT> return _make_task_name(cls, addons)
The root task class for all cosmos tasks. It automatically names the given task using the module and class that implement the given task as the task name.
62598f6d6fece00bbaccb14d
class NoVmFound(CFMEException): <NEW_LINE> <INDENT> pass
Raised if a specific VM cannot be found.
62598f6d5e10d32532ce34cc
class protoc_python(Task.Task): <NEW_LINE> <INDENT> color = 'PINK' <NEW_LINE> def run(self): <NEW_LINE> <INDENT> command = [self.env.PROTOC, '-I', os.path.dirname(self.inputs[0].abspath()), '--python_out', self.outputs[0].parent.abspath(), self.inputs[0].abspath() ] <NEW_LINE> return self.exec_command(command)
Compiles .proto files into python sources
62598f6dc432627299fa2797
class Submenu(BaseList): <NEW_LINE> <INDENT> CHILD_ATTRIBUTE = "children"
Class to represent a submenu of links inside a :class:`.Menu`. .. include:: ../../typical_attributes.rst ============ ====================================================================== Attribute Description ============ ====================================================================== ``children`` A list ...
62598f6d3eb6a72ae0389e03
class PilatusCdTe2M(PilatusCdTe): <NEW_LINE> <INDENT> MAX_SHAPE = 1679, 1475 <NEW_LINE> aliases = ["Pilatus CdTe 2M", "Pilatus 2M CdTe", "Pilatus2M CdTe", "Pilatus2MCdTe"]
Pilatus CdTe 2M detector
62598f6d5166f23b2e242b9d
class FilePresent(Fact): <NEW_LINE> <INDENT> remote_path: str <NEW_LINE> def __init__(self, remote_path: str) -> None: <NEW_LINE> <INDENT> self.remote_path = remote_path <NEW_LINE> <DEDENT> async def enquire(self, host: Executor) -> bool: <NEW_LINE> <INDENT> command = "ls -d {}".format(self.remote_path) <NEW_LINE> retu...
Ensure that a file is present
62598f6dac7a0e7691f71cd7
class WaitOplogEmpty(BaseStep): <NEW_LINE> <INDENT> def __init__(self, scenario, timeout=1200): <NEW_LINE> <INDENT> super(WaitOplogEmpty, self).__init__(scenario, annotate=False) <NEW_LINE> self.description = "Waiting for oplog to drain" <NEW_LINE> self.timeout = timeout <NEW_LINE> <DEDENT> def _run(self): <NEW_LINE> <...
Wait for the cluster's oplog to be empty. Note: The firewall on the CVMs in the cluster must allow access to port 2009 to query /h/vars. Args: scenario (Scenario): Scenario this step belongs to. timeout (int): Seconds to wait for oplog to drain.
62598f6dd10714528d69d68f
class Ajattara(object): <NEW_LINE> <INDENT> def __init__(self, batch_count, batch_size, function, args=[], kwargs={}): <NEW_LINE> <INDENT> self.__function = function <NEW_LINE> self.__args = args <NEW_LINE> self.__kwargs = kwargs <NEW_LINE> self.__batch_count = batch_count <NEW_LINE> self.__batch_size = batch_size <NEW...
A class for measuring runtimes of things
62598f6d26238365f5fac339
class PubEntry(BibEntry): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.output = TaggedOutput().settag('p class="biblio"', True) <NEW_LINE> <DEDENT> def detect(self, pos): <NEW_LINE> <INDENT> return pos.checkfor('@') <NEW_LINE> <DEDENT> def parse(self, pos): <NEW_LINE> <INDENT> self.parser = BibTagPa...
A publication entry
62598f6d8c3a8732951f5d13
class circle(SVGelement): <NEW_LINE> <INDENT> def __init__(self,cx=None,cy=None,r=None,fill=None,stroke=None,stroke_width=None,**args): <NEW_LINE> <INDENT> if r==None: <NEW_LINE> <INDENT> raise ValueError('r is required') <NEW_LINE> <DEDENT> SVGelement.__init__(self,'circle',{'r':r},**args) <NEW_LINE> if cx!=None: <NEW...
c=circle(x,y,radius,fill,stroke,stroke_width,**args) The circle creates an element using a x, y and radius values eg
62598f6d5166f23b2e242b9f
class ScheduleMemberSpider(Spider): <NEW_LINE> <INDENT> name = 'schedule_member' <NEW_LINE> start_urls = [ 'http://app.legco.gov.hk/ScheduleDB/odata/Tmember' ] <NEW_LINE> def parse(self, response): <NEW_LINE> <INDENT> resp = json.loads(response.body_as_unicode()) <NEW_LINE> for v in resp['value']: <NEW_LINE> <INDENT> r...
Members from the schedule database. We need this to get the member_id for the members so we can rebuild the relationships. The url returns a JSON object.
62598f6d38b623060ffa8860
class SearchableListMixin(object): <NEW_LINE> <INDENT> search_fields = ["id"] <NEW_LINE> search_date_fields = None <NEW_LINE> search_date_formats = ["%d.%m.%y", "%d.%m.%Y"] <NEW_LINE> search_split = True <NEW_LINE> search_use_q = True <NEW_LINE> check_lookups = True <NEW_LINE> def get_words(self, query): <NEW_LINE> <IN...
Filter queryset like a django admin search_fields does, but with little more intelligence: if self.search_split is set to True (by default) it will split query to words (by whitespace) Also tries to convert each word to date with self.search_date_formats and then search each word in separate field e.g. with query 'f...
62598f6d796e427e5384df59
class MetaNeutronPluginV2TestRpcFlavor(base.BaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(MetaNeutronPluginV2TestRpcFlavor, self).setUp() <NEW_LINE> db._ENGINE = None <NEW_LINE> db._MAKER = None <NEW_LINE> db.configure_db() <NEW_LINE> self.addCleanup(db.clear_db) <NEW_LINE> self.addClean...
Tests for rpc_flavor.
62598f6dd10714528d69d691
class NewListViewIntegratedTest(TestCase): <NEW_LINE> <INDENT> def test_can_save_a_POST_request(self): <NEW_LINE> <INDENT> self.client.post('/lists/new', data={'text': 'A new list item'}) <NEW_LINE> self.assertEqual(Item.objects.count(), 1) <NEW_LINE> new_item = Item.objects.first() <NEW_LINE> self.assertEqual(new_item...
test new list
62598f6dd99f1b3c44d04e79
class PythonInputSource(InputSource): <NEW_LINE> <INDENT> def __init__(self, data, system_id=None): <NEW_LINE> <INDENT> self.content_type = None <NEW_LINE> self.auto_close = False <NEW_LINE> self.public_id = None <NEW_LINE> self.system_id = system_id <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> def getPublicId(self)...
Constructs an RDFLib Parser InputSource from a Python data structure, for example, loaded from JSON with json.load or json.loads: >>> import json >>> as_string = """{ ... "@context" : {"ex" : "http://example.com/ns#"}, ... "@graph": [{"@type": "ex:item", "@id": "#example"}] ... }""" >>> as_python = json.loads(as_s...
62598f6d167d2b6e312b6742
class SyncEphemeralSTRDSSamplingGeoJSONResource(AsyncEphemeralSTRDSSamplingGeoJSONResource): <NEW_LINE> <INDENT> @swagger.doc(deepcopy(SCHEMA_DOC)) <NEW_LINE> def post(self, location_name, mapset_name, strds_name): <NEW_LINE> <INDENT> check = self._execute(location_name, mapset_name, strds_name) <NEW_LINE> if check is ...
Sample a STRDS at vector point locations, synchronous call
62598f6d26238365f5fac33b
class GameState: <NEW_LINE> <INDENT> totalNodesCreated = 0 <NEW_LINE> def __init__(self, grid, currentPlayerChar): <NEW_LINE> <INDENT> GameState.totalNodesCreated += 1 <NEW_LINE> self.grid = grid <NEW_LINE> self.currentPlayerChar = currentPlayerChar <NEW_LINE> if (not grid.checkAllColumnsFull()): <NEW_LINE> <INDENT> se...
this class encapsulates both the game play grid and whose turn it is at this state, and is used to represent nodes in the search tree.
62598f6d711fe17d825dfeaf
class IBrowserLayer(IBaseLayer): <NEW_LINE> <INDENT> pass
The browser layer of the package
62598f6d66673b3332c2fb83
class PadToSquareWithLabel(object): <NEW_LINE> <INDENT> def __init__(self, fill=0, padding_mode='constant'): <NEW_LINE> <INDENT> assert isinstance(fill, (numbers.Number, str, tuple)) <NEW_LINE> assert padding_mode in ['constant', 'edge', 'reflect', 'symmetric'] <NEW_LINE> self.fill = fill <NEW_LINE> self.padding_mode =...
Pad to square the given PIL Image with label. Args: fill (int or tuple): Pixel fill value for constant fill. Default is 0. If a tuple of length 3, it is used to fill R, G, B channels respectively. This value is only used when the padding_mode is constant padding_mode (str): Type of padding. Shou...
62598f6d1f5feb6acb1623fd
class Test_fixZminionLogFilters(unittest.TestCase, common.ServiceMigrationTestCase): <NEW_LINE> <INDENT> initial_servicedef = 'zenoss-resmgr-5.1.5.json' <NEW_LINE> expected_servicedef = 'zenoss-resmgr-5.1.5-fixZminionLogFilters.json' <NEW_LINE> migration_module_name = 'fixZminionLogFilters' <NEW_LINE> migration_class_n...
Test that the log filter for zminion is fixed as expected.
62598f6dec188e330fdf8066
class InvalidFilter(Exception): <NEW_LINE> <INDENT> pass
Raised when an `IBranchMergeQueueCollection` can't apply the filter.
62598f6d7b25080760ed6c61
class LBFrontendIPConfigurationResourceSettings(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, 'private_ip_allocation_method': {'key': 'privateIpAllocationMethod', 'type': 'str'}, 'subnet': {'k...
Defines load balancer frontend IP configuration properties. :param name: Gets or sets the frontend IP configuration name. :type name: str :param private_ip_address: Gets or sets the IP address of the Load Balancer.This is only specified if a specific private IP address shall be allocated from the subnet specified in...
62598f6dff9c53063f519e1d
class MainCommunication(): <NEW_LINE> <INDENT> def __init__(self, general_, ip, port, create_thread): <NEW_LINE> <INDENT> self.general = general_ <NEW_LINE> self.socket = socket.socket() <NEW_LINE> self.ip = ip <NEW_LINE> self.port = port <NEW_LINE> self.socket.connect((self.ip, self.port)) <NEW_LINE> self.socket.send(...
This class is responsible for everything relates to the communication with the others in the system.
62598f6d1d351010ab8f3306
class Node(Protocol[Data]): <NEW_LINE> <INDENT> def __call__(self, data: Data) -> Text: <NEW_LINE> <INDENT> pass
A node is any object that can convert data into rich text.
62598f6dd10714528d69d692
class Meta(object): <NEW_LINE> <INDENT> api_path = ('api/v2/config_templates/:config_template_id/' 'template_combinations') <NEW_LINE> server_modes = ('sat')
Non-field information about this entity.
62598f6d5e10d32532ce34ce
class SocialUserCreationForm(forms.ModelForm): <NEW_LINE> <INDENT> username = forms.RegexField( required=not EMAIL_IS_USERNAME, max_length=30, regex=r'^[\w.@+-]+$', help_text=_('Required. 30 characters or fewer. Letters, digits and ' '@/./+/-/_ only.'), error_messages={'invalid': _('This value may contain only letters,...
Form that handles the validation of the social users setup.
62598f6d3eb6a72ae0389e07
class GameState: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.steps = 0 <NEW_LINE> self.browser, self.game = get_game() <NEW_LINE> self.state = self.screenshot() <NEW_LINE> self.states = deque(4*[self.screenshot()], maxlen=4) <NEW_LINE> self.goal = np.array(Image.open(params.goal).convert('L')) <NEW...
Used to describe current state of the game
62598f6d711fe17d825dfeb0
class PlaybackControllerPlayRequest(BaseRequest): <NEW_LINE> <INDENT> request_type = PLAY_COMMAND_REQUEST_TYPE
Sent when the user uses a "play" or "resume" button with the intent to start or resume playback.
62598f6d9b70327d1c57e572
class BetaModel(lmf.Model): <NEW_LINE> <INDENT> def __init__(self, independent_vars=['x'], prefix='', nan_policy='omit', **kwargs): <NEW_LINE> <INDENT> kwargs.update({'prefix': prefix, 'nan_policy': nan_policy, 'independent_vars': independent_vars}) <NEW_LINE> def beta(x, rmax, Topt, Tceil): <NEW_LINE> <INDENT> const1 ...
Beta model for temperature responce for development (Yan and Hunt 1999) input: x : Data temperatures [K] rmax : Max rate at optimum temperature Topt : optimum temperatura of development Tceil: ciling temerature where development ceases output: rate
62598f6d76d4e153a661c3e1
class PlaceLoader(object): <NEW_LINE> <INDENT> def __init__(self, in_file: TextIO, baseplace: Thing = Place): <NEW_LINE> <INDENT> self.base = baseplace <NEW_LINE> self.places = {} <NEW_LINE> if in_file: <NEW_LINE> <INDENT> self.process_file(in_file) <NEW_LINE> <DEDENT> <DEDENT> def process_file(self, in_file: TextIO): ...
A factory which loads a simple data format containing a description of rooms, and how they are connected, and produces room objects for each one.
62598f6dd10714528d69d693
class UserGUISettings(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, on_delete=models.CASCADE, unique=True) <NEW_LINE> enable_markdown_editor = models.NullBooleanField(verbose_name='Enable Markdown editor', null=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = "User GUI settings" <N...
UserGUISettings Extend the user model with particular GUI settings. Null = Use system's default True = Enable feature explicitly False = Disable feature explicitly
62598f6d8c3a8732951f5d16
class value_of_SSS_space(abstract_sum_from_gridcells): <NEW_LINE> <INDENT> def __init__(self, type): <NEW_LINE> <INDENT> self.gc_variable = "total_value_%s" % type <NEW_LINE> abstract_sum_from_gridcells.__init__(self)
Aggregation over the corresponding gridcell variable
62598f6d4d74a7450cd58abc
class Job(models.Model): <NEW_LINE> <INDENT> task = models.ForeignKey(Task, on_delete=models.CASCADE, db_index=True) <NEW_LINE> image = models.ForeignKey(Image, on_delete=models.CASCADE, db_index=True) <NEW_LINE> user = models.ForeignKey(User, on_delete=models.CASCADE, db_index=True) <NEW_LINE> is_example = models.Bool...
Represents a job (an annotation of the preferred objects) for an image by a user.
62598f6d925a0f43d25e7802
class QuadraticEquation(object): <NEW_LINE> <INDENT> def __init__(self, a, b, c): <NEW_LINE> <INDENT> if a == 0: <NEW_LINE> <INDENT> raise ValueError("Coefficient 'a' cannot be 0 in a quadratic equation.") <NEW_LINE> <DEDENT> self.__a = float(a) <NEW_LINE> self.__b = float(b) <NEW_LINE> self.__c = float(c) <NEW_LINE> <...
class modeling the quadratic equation
62598f6d6fece00bbaccb152
class YellowbrickError(Exception): <NEW_LINE> <INDENT> pass
The root exception for all yellowbrick related errors.
62598f6dcad5886f8bdc4ae7
class StepAborted(Exception): <NEW_LINE> <INDENT> pass
Raised by the @step decorator if keyboard-interrupted
62598f6dc432627299fa279d
class ImportHZD(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.import_hzd" <NEW_LINE> bl_label = "" <NEW_LINE> isGroup: bpy.props.BoolProperty() <NEW_LINE> Index: bpy.props.IntProperty() <NEW_LINE> LODIndex: bpy.props.IntProperty() <NEW_LINE> BlockIndex: bpy.props.IntProperty() <NEW_LINE> def execute(self...
Imports the mesh
62598f6d66656f66f7d59bb8
class SeqDiagCommandStack: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.stack = [] <NEW_LINE> <DEDENT> def pop(self): <NEW_LINE> <INDENT> if self.isEmpty(): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return self.stack.pop() <NEW_LINE> <DEDENT> <DEDENT> def push(sel...
This flowEntryList stores the embedded calls used to build the sequence diagram commands. It is used to build the return commands of the diagram.
62598f6d1f037a2d8b9e38b7
class Padam(Optimizer): <NEW_LINE> <INDENT> def __init__(self, params, lr, amsgrad, e=1e-8, b1=0.9, b2=0.999, partial=0.25, weight_decay=0, max_grad_norm=-1, **kwargs): <NEW_LINE> <INDENT> assert 0 < lr <NEW_LINE> assert 0 < b1 <= 1.0 <NEW_LINE> assert 0 < b2 <= 1.0 <NEW_LINE> assert 0 < e <NEW_LINE> assert 0 < partial...
Partially Adaptive Momentum Estimation algorithm
62598f6d7c178a314d78cc6b
class InputLayer(Layer): <NEW_LINE> <INDENT> def __init__(self, input_shape=None, batch_size=None, dtype=None, input_tensor=None, sparse=False, name=None, **kwargs): <NEW_LINE> <INDENT> if 'batch_input_shape' in kwargs: <NEW_LINE> <INDENT> batch_input_shape = kwargs.pop('batch_input_shape') <NEW_LINE> if input_shape an...
Layer to be used as an entry point into a Network (a graph of layers). It can either wrap an existing tensor (pass an `input_tensor` argument) or create its a placeholder tensor (pass arguments `input_shape`, and optionally, `dtype`). It is generally recommend to use the functional layer API via `Input`, (which creates...
62598f6d5166f23b2e242ba3
class MANUFACTURER_ACCESS_CMD_BQ40(DecoratedEnum): <NEW_LINE> <INDENT> InstrFlashChecksum = 0x04 <NEW_LINE> StaticDataFlashChecksum = 0x05 <NEW_LINE> ChemicalID = 0x06 <NEW_LINE> StaticChemDFSignature = 0x08 <NEW_LINE> AllDFSignature = 0x09 <NEW_LINE> ShutdownMode = 0x10 <NEW_LINE> SleepMode = 0x11 <NEW_LINE...
ManufacturerAccess sub-commands used in BQ40 family SBS chips
62598f6d6e29344779affe25
class LightweightTagDeletion(AbstractTagUpdate): <NEW_LINE> <INDENT> def self_sanity_check(self): <NEW_LINE> <INDENT> assert self.ref_kind == RefKind.tag_ref and self.object_type == "commit" <NEW_LINE> <DEDENT> def validate_ref_update(self): <NEW_LINE> <INDENT> if not git_config("hooks.allow-delete-tag"): <NEW_LINE> <I...
Update object for lightweight tag deletion. REMARKS For tag deletion, there are only very small differences between lightweight tags and annotated tags. Therefore, the implementation of some of the abstract methods is identical for both, and we expect the class handling annotated tags to inherit f...
62598f6d30c21e258be97fca
class UserProfileUpdateTest(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> cls.user = User.objects.create_user('testuser', password='testpassword') <NEW_LINE> cls.social_account = SocialAccount.objects.create( uid=12931, user=cls.user, extra_data={'guild': None} ) <NE...
Scenario: - user visits the site - updates their own profile
62598f6d30c21e258be97fcb
class Stats(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.cache_hits = 0 <NEW_LINE> self.cache_misses = 0
Used internally to track how many requests are being made.
62598f6d73bcbd0ca4bc9a1f
class Patient(object): <NEW_LINE> <INDENT> def __init__(self, viruses, maxPop): <NEW_LINE> <INDENT> self.viruses = list(viruses) <NEW_LINE> self.maxPop = maxPop <NEW_LINE> <DEDENT> def getViruses(self): <NEW_LINE> <INDENT> return list(self.viruses) <NEW_LINE> <DEDENT> def getMaxPop(self): <NEW_LINE> <INDENT> return sel...
Representation of a simplified patient. The patient does not take any drugs and his/her virus populations have no drug resistance.
62598f6d66673b3332c2fb87
class Connection(_http.JSONConnection): <NEW_LINE> <INDENT> API_BASE_URL = 'https://cloudresourcemanager.googleapis.com' <NEW_LINE> API_VERSION = 'v1beta1' <NEW_LINE> API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}' <NEW_LINE> _EXTRA_HEADERS = { _http.CLIENT_INFO_HEADER: _CLIENT_INFO, }
A connection to Google Cloud Resource Manager via the JSON REST API. :type client: :class:`~google.cloud.resource_manager.client.Client` :param client: The client that owns the current connection.
62598f6d1d351010ab8f3309
class dot: <NEW_LINE> <INDENT> def __init__(self, canvas, start, directions=None, mutate=True): <NEW_LINE> <INDENT> self.died = False <NEW_LINE> self.canvas = canvas <NEW_LINE> self.body = canvas.create_oval(start[0]-dot_size, start[1]-dot_size, start[0]+dot_size, start[1]+dot_size, fill='red') <NEW_LINE> self.fitness ...
Evolutionary dots, born with random directions and reproduce based on calculated fitness
62598f6dd10714528d69d696
class SparkSessionOptions(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'file': {'key': 'file', 'type': 's...
SparkSessionOptions. All required parameters must be populated in order to send to Azure. :param tags: A set of tags. Dictionary of :code:`<string>`. :type tags: dict[str, str] :param artifact_id: :type artifact_id: str :param name: Required. :type name: str :param file: :type file: str :param class_name: :type class...
62598f6d8e05c05ec3f6ea2a