code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class CustomTopo(Topo): <NEW_LINE> <INDENT> def __init__(self, **opts): <NEW_LINE> <INDENT> Topo.__init__(self, **opts) <NEW_LINE> s = [] <NEW_LINE> s.append(self.addSwitch('s1')) <NEW_LINE> s.append(self.addSwitch('s2')) <NEW_LINE> s.append(self.addSwitch('s3')) <NEW_LINE> s.append(self.addSwitch('s4')) <NEW_LINE> s.a...
Simple Data Center Topology
62599042d99f1b3c44d0696d
class ConfigError(JukeboxException): <NEW_LINE> <INDENT> pass
Jukebox Exception that is raised when some error occurs concerning Config files.
625990426fece00bbacccc81
class CloudBioLinux(Edition): <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> Edition.__init__(self,env) <NEW_LINE> self.name = "CloudBioLinux Edition" <NEW_LINE> self.short_name = "cloudbiolinux" <NEW_LINE> <DEDENT> def post_install(self, pkg_install=[]): <NEW_LINE> <INDENT> _freenx_scripts(self.env) ...
Specific customizations for CloudBioLinux builds.
6259904276d4e153a661dbdc
class ClearSessionsCommandOptions(management.CommandOptions): <NEW_LINE> <INDENT> args = base.args <NEW_LINE> help = base.help <NEW_LINE> option_list = base.option_list[ len(management.BaseCommandOptions.option_list):] <NEW_LINE> option_groups = ( ("[clearsessions options]", "These options will be passed to clearsessio...
ClearSessions command options.
6259904221bff66bcd723f3a
class FormChecker(BaseChecker): <NEW_LINE> <INDENT> __implements__ = IAstroidChecker <NEW_LINE> name = "django-form-checker" <NEW_LINE> msgs = { f"W{BASE_ID}04": ( "Use explicit fields instead of exclude in ModelForm", "modelform-uses-exclude", "Prevents accidentally allowing users to set fields, especially when adding...
Django model checker.
6259904294891a1f408ba05e
class ThreadHandlerHeader(object): <NEW_LINE> <INDENT> def __init__(self, key, trigger_frequency, process_entry): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.trigger_frequency = trigger_frequency <NEW_LINE> self.process_entry = process_entry
ThreadHandlerHeader is a data structure representing key Thread Handler features. It is passed to the Timer instance and later on - to the Scheduler's running function as an argument
6259904230c21e258be99ad6
class GetJSON(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_json(cls, entity): <NEW_LINE> <INDENT> return cls().dump(entity).data
docstring for GetJSON
6259904266673b3332c316c9
class HomeViewSetRetrieveTests(HomeViewSetBaseTests): <NEW_LINE> <INDENT> def test_retrieve_home_obj(self): <NEW_LINE> <INDENT> home_obj = self.create_home_obj() <NEW_LINE> response = self.retrieve_obj( url=self.detail_url, data=self.data, pk=home_obj.pk, ) <NEW_LINE> self.assertEqual( response.status_code, status.HTTP...
Test Case Code Format: #THV-R00 Test cases for retrieving an existing home object
6259904224f1403a92686234
class SlicingAdapter(Adapter): <NEW_LINE> <INDENT> __slots__ = ["start", "stop", "step"] <NEW_LINE> def __init__(self, subcon, start, stop = None): <NEW_LINE> <INDENT> Adapter.__init__(self, subcon) <NEW_LINE> self.start = start <NEW_LINE> self.stop = stop <NEW_LINE> <DEDENT> def _encode(self, obj, context): <NEW_LINE>...
Adapter for slicing a list (getting a slice from that list) :param subcon: the subcon to slice :param start: start index :param stop: stop index (or None for up-to-end) :param step: step (or None for every element)
625990420fa83653e46f61aa
class PluginInstanceDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> http_method_names = ['get', 'put', 'delete'] <NEW_LINE> serializer_class = PluginInstanceSerializer <NEW_LINE> queryset = PluginInstance.objects.all() <NEW_LINE> permission_classes = (permissions.IsAuthenticated, IsOwnerOrChrisOrRead...
A plugin instance view.
6259904207f4c71912bb0702
class TestTrapRockpage(TestwithMocking): <NEW_LINE> <INDENT> def test_TrapRockPage_read(self): <NEW_LINE> <INDENT> trap_rock_page = TrapRockPage(mocked=True) <NEW_LINE> assert trap_rock_page is not None <NEW_LINE> status = trap_rock_page.fetch_taplist(brewery='Trap Rock') <NEW_LINE> assert not status <NEW_LINE> <DEDENT...
test for the departed soles web scraping page
6259904226068e7796d4dc16
class OrganisationUserListSerializer(CustomUserListSerializer): <NEW_LINE> <INDENT> organisation_name = serializers.SerializerMethodField() <NEW_LINE> size = serializers.SerializerMethodField() <NEW_LINE> description = serializers.SerializerMethodField() <NEW_LINE> sports = serializers.SerializerMethodField() <NEW_LINE...
Serializer to list organisation profile.
62599042e76e3b2f99fd9cdb
class IterMultipleComponents(object): <NEW_LINE> <INDENT> def __init__(self, stream, key=None, number_components=None): <NEW_LINE> <INDENT> substreams = collections.defaultdict(stream.__class__) <NEW_LINE> for tr in stream: <NEW_LINE> <INDENT> k = (tr.id[:-1], str(tr.stats[key]) if key is not None else None) <NEW_LINE>...
Return iterable to iterate over associated components of a stream. :param stream: Stream with different, possibly many traces. It is split into substreams with the same seed id (only last character i.e. component may vary) :type key: str or None :param key: Additionally, the stream is grouped by the values of ...
6259904229b78933be26aa2b
class TestSuite: <NEW_LINE> <INDENT> def test_missing_reputation(self): <NEW_LINE> <INDENT> assert is_healthy() <NEW_LINE> delete_reputation(get_ip()) <NEW_LINE> r = simple_request() <NEW_LINE> assert r.status_code == 200 <NEW_LINE> assert r.text == "the backend!\n" <NEW_LINE> <DEDENT> def test_good_reputation(self): <...
Basic Test Suite to be run on blocking mode iprepd-nginx
62599042e64d504609df9d39
class TestRingBinarySensorSetup(unittest.TestCase): <NEW_LINE> <INDENT> DEVICES = [] <NEW_LINE> def add_entities(self, devices, action): <NEW_LINE> <INDENT> for device in devices: <NEW_LINE> <INDENT> self.DEVICES.append(device) <NEW_LINE> <DEDENT> <DEDENT> def cleanup(self): <NEW_LINE> <INDENT> if os.path.isfile(self.c...
Test the Ring Binary Sensor platform.
62599042d4950a0f3b1117a9
class NodeClientFactory(pb.PBClientFactory): <NEW_LINE> <INDENT> node = None <NEW_LINE> def __init__(self, node, manager): <NEW_LINE> <INDENT> self.node = node <NEW_LINE> self.connection_manager = manager <NEW_LINE> pb.PBClientFactory.__init__(self) <NEW_LINE> <DEDENT> def clientConnectionLost(self, connector, reason):...
Subclassing of PBClientFactory to add auto-reconnect via Master's reconnection code. This factory is specific to the master acting as a client of a Node.
62599042c432627299fa426a
class FunctionalTests_AcmeDnsServerAccount(AppTest): <NEW_LINE> <INDENT> def _get_one(self): <NEW_LINE> <INDENT> focus_item = ( self.ctx.dbSession.query(model_objects.AcmeDnsServerAccount) .order_by(model_objects.AcmeDnsServerAccount.id.asc()) .first() ) <NEW_LINE> assert focus_item is not None <NEW_LINE> return focus_...
python -m unittest tests.test_pyramid_app.FunctionalTests_AcmeDnsServerAccount
6259904210dbd63aa1c71ea9
class HaystackFilter(BaseFilterBackend): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_request_filters(request): <NEW_LINE> <INDENT> return request.GET.copy() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def build_filter(view, filters=None): <NEW_LINE> <INDENT> terms = [] <NEW_LINE> exclude_terms = [] <NEW_LINE>...
A filter backend that compiles a haystack compatible filtering query.
6259904271ff763f4b5e8a71
class IUnauthorizedEvent(IObjectEvent): <NEW_LINE> <INDENT> pass
An Event that's called during the Challenge phase of the PAS process Allows custom handling of access to the object
6259904273bcbd0ca4bcb55c
class Nature(TableBase): <NEW_LINE> <INDENT> __tablename__ = 'natures' <NEW_LINE> __singlename__ = 'nature' <NEW_LINE> id = Column(Integer, primary_key=True, nullable=False, info=dict(description="A numeric ID")) <NEW_LINE> identifier = Column(Unicode(8), nullable=False, info=dict(description="An identifier", format='i...
A nature a Pokémon can have, such as Calm or Brave
62599042d53ae8145f91972f
class Scasb(X86InstructionBase): <NEW_LINE> <INDENT> def __init__(self, prefix, mnemonic, operands, architecture_mode): <NEW_LINE> <INDENT> super(Scasb, self).__init__(prefix, mnemonic, operands, architecture_mode) <NEW_LINE> <DEDENT> @property <NEW_LINE> def source_operands(self): <NEW_LINE> <INDENT> return [ ] <NEW_L...
Representation of Scasb x86 instruction.
6259904296565a6dacd2d8f3
class SQLiteClient(BaseRDMSClient): <NEW_LINE> <INDENT> data_table_cls = DataTable <NEW_LINE> result_cls = Result <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SQLiteClient, self).__init__(*args, **kwargs) <NEW_LINE> self.connection = Database.connect(**self._conn_params) <NEW_LINE> <DEDENT>...
Same API as Beeswax
62599042b57a9660fecd2d4d
class threaded_cached_property(cached_property): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> super(threaded_cached_property, self).__init__(func) <NEW_LINE> self.lock = threading.RLock() <NEW_LINE> <DEDENT> def __get__(self, obj, cls): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return...
A cached_property version for use in environments where multiple threads might concurrently try to access the property.
6259904223e79379d538d7d0
class UserProfile(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> phone_regex = RegexValidator(regex=r'(\+?\d{1,3})?[-\s]?[6789]\d{9}', message = "Phone number entered is invalid") <NEW_LINE> corporate_email = models.EmailField(max_length=255, unique=True) <NEW_LINE> email = models.EmailField(max_length=255, u...
Represents the User Profile inside our system.
6259904229b78933be26aa2c
class TVBExporter(ABCExporter): <NEW_LINE> <INDENT> OPERATION_FOLDER_PREFIX = "Operation_" <NEW_LINE> def get_supported_types(self): <NEW_LINE> <INDENT> return [model.DataType] <NEW_LINE> <DEDENT> def get_label(self): <NEW_LINE> <INDENT> return "TVB Format" <NEW_LINE> <DEDENT> def export(self, data, export_folder, proj...
This exporter simply provides for download data in TVB format
625990428e05c05ec3f6f7c4
class Solution: <NEW_LINE> <INDENT> def mergeKLists(self, lists): <NEW_LINE> <INDENT> if not lists: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> hp = [] <NEW_LINE> for lst in lists: <NEW_LINE> <INDENT> if lst: <NEW_LINE> <INDENT> heapq.heappush(hp, (lst.val, lst)) <NEW_LINE> <DEDENT> <DEDENT> cur = dummy_head = ...
@param lists: a list of ListNode @return: The head of one sorted list.
6259904207d97122c4217f72
class CommentPKView(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Comment.objects.all().order_by("-create_at") <NEW_LINE> serializer_class = CommentSerializer <NEW_LINE> permission_classes = (IsAuthenticated, IsAuthor)
Interactions with the Comment Model that requires the comment PK Comment deletion, updation or single retrieve
6259904223e79379d538d7d1
class FileField(BaseField): <NEW_LINE> <INDENT> proxy_class = GridFSProxy <NEW_LINE> def __init__(self, db_alias=DEFAULT_CONNECTION_NAME, collection_name="fs", **kwargs): <NEW_LINE> <INDENT> super(FileField, self).__init__(**kwargs) <NEW_LINE> self.collection_name = collection_name <NEW_LINE> self.db_alias = db_alias <...
A GridFS storage field. .. versionadded:: 0.4 .. versionchanged:: 0.5 added optional size param for read .. versionchanged:: 0.6 added db_alias for multidb support
62599042be383301e0254aeb
class UserViewSet(mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> permission_classes = (IsOwnerOrReadOnly,) <NEW_LINE> def create(self, request, *args, **kwarg...
Creates, Updates, and retrieves User accounts
6259904226238365f5fade2c
class Context(object): <NEW_LINE> <INDENT> def __init__(self, key): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return self.key
Used for mocking up context type objects.
6259904250485f2cf55dc258
class RHSimple(RH): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> RH.__init__(self) <NEW_LINE> self.func = func <NEW_LINE> <DEDENT> def _process(self): <NEW_LINE> <INDENT> rv = self.func() <NEW_LINE> return rv <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def wrap_function(cls, func): <NEW_LINE> <INDE...
A simple RH that calls a function to build the response. The preferred way to use this class is by using the `RHSimple.wrap_function` decorator. :param func: A function returning HTML
6259904291af0d3eaad3b0f7
class AdminaccountsaddpendinguserProvider(object): <NEW_LINE> <INDENT> openapi_types = { 'name': 'str' } <NEW_LINE> attribute_map = { 'name': 'name' } <NEW_LINE> def __init__(self, name=None): <NEW_LINE> <INDENT> self._name = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> @pro...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62599042d6c5a102081e33f9
class KernelWrapper(object): <NEW_LINE> <INDENT> def __init__(self, wrapped): <NEW_LINE> <INDENT> self.wrapped=wrapped <NEW_LINE> <DEDENT> def __call__(self, inst1, inst2): <NEW_LINE> <INDENT> return self.wrapped(inst1, inst2)
A base class for kernel function wrappers. :param wrapped: a kernel function to wrap
62599042507cdc57c63a6070
class TensorboardXWriter(EventWriter): <NEW_LINE> <INDENT> def __init__(self, log_dir: str, window_size: int = 20, **kwargs): <NEW_LINE> <INDENT> self._window_size = window_size <NEW_LINE> from tensorboardX import SummaryWriter <NEW_LINE> self._writer = SummaryWriter(log_dir, **kwargs) <NEW_LINE> self._last_write = -1 ...
Write all scalars to a tensorboard file.
6259904273bcbd0ca4bcb55e
class ClusterRunner(Runner): <NEW_LINE> <INDENT> default_time = '1-00:00:00' <NEW_LINE> default_steps = [ {'process_samples': {}}, {'combine_reads': {}}, {'run_uparse': {}}, {'otu_uparse.taxonomy_silva.assign': {}}, {'otu_uparse.taxonomy_silva.make_otu_table':...
Will run stuff on an cluster
6259904245492302aabfd7af
class SHA1Hasher(_CryptographyHasher): <NEW_LINE> <INDENT> ENCRYPT_FIRST = False <NEW_LINE> PROVIDER = hashes.SHA1() <NEW_LINE> def __init__(self, iv): <NEW_LINE> <INDENT> super(SHA1Hasher, self).__init__(iv)
SHA1 hash, full length digest.
6259904273bcbd0ca4bcb55f
class LatLongField(forms.MultiValueField): <NEW_LINE> <INDENT> widget = LatLongWidget <NEW_LINE> srid = 4326 <NEW_LINE> default_error_messages = { 'invalid_latitude': ('Enter a valid latitude.'), 'invalid_longitude': ('Enter a valid longitude.'), } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> fie...
custom field that takes in a lat and long
62599042a8ecb033258724e5
class TestInlineResponse20099PhoneNumbers(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 testInlineResponse20099PhoneNumbers(self): <NEW_LINE> <INDENT> pass
InlineResponse20099PhoneNumbers unit test stubs
62599042e76e3b2f99fd9cdf
class FrictionData(clawdata.ClawData): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(FrictionData, self).__init__() <NEW_LINE> self.add_attribute('variable_friction',False) <NEW_LINE> self.add_attribute('friction_regions',[]) <NEW_LINE> self.add_attribute('friction_files',[]) <NEW_LINE> <DEDENT> def...
Data class representing variable friction parameters and data sources
6259904230dc7b76659a0b04
class TopicDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Topic.objects.all() <NEW_LINE> serializer_class = TopicSerializer
Retrieve, update or delete a topic instance
6259904223849d37ff85238e
class OperationResourceServiceSpecification(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationResourceMetricSpecification]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(OperationResourceServiceSpeci...
Service specification. :param metric_specifications: List of metric specifications. :type metric_specifications: list[~azure.mgmt.storagesync.models.OperationResourceMetricSpecification]
62599042596a897236128f19
class ExprCaseFilter(object): <NEW_LINE> <INDENT> implements(ICaseFilter) <NEW_LINE> def __init__(self, expr): <NEW_LINE> <INDENT> self.expr = expr <NEW_LINE> <DEDENT> def __getstate__(self): <NEW_LINE> <INDENT> state = self.__dict__.copy() <NEW_LINE> state['_code'] = None <NEW_LINE> <DEDENT> def __setstate__(self, sta...
Select based on a boolean Python expression of the case data or ``seqno``. Case data is accessed by ``case['name']`` expr: string Boolean expression referring to the case data or ``seqno``. Examples: - select failed cases ``'case.msg'``. - select first 3 cases: ``'seqno < 3'``. - select case with 'par...
62599042e64d504609df9d3b
class IF(object): <NEW_LINE> <INDENT> def __init__(self, conditional, action = None, delete_clause = ()): <NEW_LINE> <INDENT> if type(conditional) == list and action == None: <NEW_LINE> <INDENT> return self.__init__(*conditional) <NEW_LINE> <DEDENT> if isinstance(action, str): <NEW_LINE> <INDENT> action = [ action ] <N...
A conditional rule. This should have the form IF( antecedent, THEN(consequent) ), or IF( antecedent, THEN(consequent), DELETE(delete_clause) ). The antecedent is an expression or AND/OR tree with variables in it, determining under what conditions the rule can fire. The consequent is an expression or list of expressi...
62599042097d151d1a2c233d
class Graph: <NEW_LINE> <INDENT> def __init__(self, filename=None): <NEW_LINE> <INDENT> self._graph = [] <NEW_LINE> if filename: <NEW_LINE> <INDENT> with open(filename, "r") as fw: <NEW_LINE> <INDENT> rows = fw.read().splitlines() <NEW_LINE> for row in rows: <NEW_LINE> <INDENT> self._graph.append([int(each) for each in...
This class represents the graph, which is read from a file. The file contains the adjcency matrix representation of the graph.
625990426fece00bbacccc87
class Payline(models.Model): <NEW_LINE> <INDENT> def __unicode__(self): <NEW_LINE> <INDENT> return str(self.id) <NEW_LINE> <DEDENT> id = models.AutoField(primary_key=True, db_column='iPAYLINE_ID') <NEW_LINE> pay_run = models.ForeignKey('PayRun', db_column='iPAY_RUN_ID', null=True, default=0) <NEW_LINE> cycle = models.F...
* [pays].[XTB_Payline] * default alias
6259904215baa72349463267
class Stats(): <NEW_LINE> <INDENT> def __init__(self, vals): <NEW_LINE> <INDENT> self.__calcStats(vals) <NEW_LINE> self.vals = vals <NEW_LINE> <DEDENT> def __calcStats(self, vals): <NEW_LINE> <INDENT> self.N = len(vals) <NEW_LINE> self.min, self.max = np.min(vals), np.max(vals) <NEW_LINE> p = np.percentile(vals, [25, 5...
Calculates, stores and renders for printing statistical measures of a list of numbers.
625990421d351010ab8f4df4
class TestExtensionsCollector(object): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.workbench = Workbench() <NEW_LINE> self.workbench.register(CoreManifest()) <NEW_LINE> self.workbench.register(ErrorsManifest()) <NEW_LINE> self.workbench.register(ExtensionManifest()) <NEW_LINE> <DEDENT> def test_regist...
Test the ExtensionsCollector behaviour.
6259904215baa72349463268
class RangeUnsatisfiable(HTTPException): <NEW_LINE> <INDENT> code = 416 <NEW_LINE> description = ( '<p>The server cannot satisfy the request range(s).</p>' )
*416* `Range Unsatisfiable` The status code returned if the server is unable to satisfy the request range
6259904282261d6c5273082f
class PlugVIPPort(BaseNetworkTask): <NEW_LINE> <INDENT> def execute(self, amphora, amphorae_network_config): <NEW_LINE> <INDENT> vrrp_port = amphorae_network_config.get(amphora.id).vrrp_port <NEW_LINE> LOG.debug('Plugging VIP VRRP port ID: %(port_id)s into compute ' 'instance: %(compute_id)s.', {'port_id': vrrp_port.id...
Task to plug a VIP into a compute instance.
6259904245492302aabfd7b1
class CollectAndDestroyGraftingNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, screen_channels, screen_resolution): <NEW_LINE> <INDENT> super(CollectAndDestroyGraftingNet, self).__init__() <NEW_LINE> self.conv_select = nn.Conv2d(screen_channels, 16, kernel_size=(5, 5), stride=1, padding=2) <NEW_LINE> self.conv_c...
Multitask model with 1 shared hidden layers task1: select unit and task policy task2: collect mineral shards task3: attack buildings
62599042379a373c97d9a300
class DNSHandler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.cache = LRUCache(1000) <NEW_LINE> <DEDENT> def get(self, host, default=None): <NEW_LINE> <INDENT> addr = self.cache.get(host, None) <NEW_LINE> if addr: <NEW_LINE> <INDENT> return addr <NEW_LINE> <DEDENT> addrinfo = socket.getaddr...
Cache DNS Names - this is plugged into the Tornado Async Client
625990423eb6a72ae038b937
class Talea(AbjadValueObject): <NEW_LINE> <INDENT> __documentation_section__ = 'Specifiers' <NEW_LINE> __slots__ = ( '_counts', '_denominator', ) <NEW_LINE> def __init__( self, counts=(1,), denominator=16, ): <NEW_LINE> <INDENT> counts = self._to_tuple(counts) <NEW_LINE> assert isinstance(counts, tuple) <NEW_LINE> asse...
Talea. .. container:: example :: >>> talea = rhythmmakertools.Talea( ... counts=(2, 1, 3, 2, 4, 1, 1), ... denominator=16, ... ) .. container:: example :: >>> talea[2] NonreducedFraction(3, 16) .. container:: example :: >>> for non...
625990428a349b6b4368751f
class SuitcaseCopyError(SuitcaseException): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.message_prefix = "Suitcase File Copy Error:" <NEW_LINE> SuitcaseException.__init__(self, value)
Exception raised when there's a problem with copying files
62599042d7e4931a7ef3d34c
class ParamType(str, Enum): <NEW_LINE> <INDENT> ini_cndtn = "initial condition" <NEW_LINE> param = "parameter"
These are the possible values of ``param_type`` column in ``parameters`` table in ``simulations.db`` database.
62599042b830903b9686ede5
class _CacheControl(UpdateDictMixin, dict): <NEW_LINE> <INDENT> no_cache = cache_property('no-cache', '*', None) <NEW_LINE> no_store = cache_property('no-store', None, bool) <NEW_LINE> max_age = cache_property('max-age', -1, int) <NEW_LINE> no_transform = cache_property('no-transform', None, None) <NEW_LINE> def __init...
Subclass of a dict that stores values for a Cache-Control header. It has accessors for all the cache-control directives specified in RFC 2616. The class does not differentiate between request and response directives. Because the cache-control directives in the HTTP header use dashes the python descriptors use undersc...
6259904216aa5153ce4017c4
class ServerErrorMockGovDelivery(MockGovDelivery): <NEW_LINE> <INDENT> def handle(self, method, *args, **kwargs): <NEW_LINE> <INDENT> response = super(ServerErrorMockGovDelivery, self).handle( method, *args, **kwargs ) <NEW_LINE> response.status_code = 500 <NEW_LINE> return response
Mock class for testing the GovDelivery API. Behaves like MockGovDelivery but returns a failing response that contains an HTTP status code of 500
625990428c3a8732951f7831
class TestQtProgressBar(QtTestAssistant, progress_bar.TestProgressBar): <NEW_LINE> <INDENT> def get_value(self, widget): <NEW_LINE> <INDENT> return widget.value() <NEW_LINE> <DEDENT> def get_minimum(self, widget): <NEW_LINE> <INDENT> return widget.minimum() <NEW_LINE> <DEDENT> def get_maximum(self, widget): <NEW_LINE> ...
QtProgressBar tests.
6259904271ff763f4b5e8a77
class NT_FE_CONSOLE_PROPS(object): <NEW_LINE> <INDENT> def __new__(cls): <NEW_LINE> <INDENT> raise Exception('This class just for typing, can not be instanced!') <NEW_LINE> <DEDENT> @property <NEW_LINE> def Signature(self)->'Any': <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> def CodePage(self)->'An...
Dictionary containing information for a NT_FE_CONSOLE_PROPS struct
6259904230c21e258be99ade
class FunctionNameExistsError(Error): <NEW_LINE> <INDENT> def __init__(self,message): <NEW_LINE> <INDENT> self.message = message
Raised when attempt made to create a function with a non-unique name
6259904282261d6c52730830
class LiveQueryJob(BaseQueryJob): <NEW_LINE> <INDENT> def __init__(self, query_id, base_url, repository, user_token): <NEW_LINE> <INDENT> super().__init__(query_id, base_url, repository, user_token) <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> headers = self._default_user_headers ...
Manages a live queryjob
6259904245492302aabfd7b3
class Ratings(models.Model): <NEW_LINE> <INDENT> article = models.ForeignKey(Article, on_delete=models.CASCADE) <NEW_LINE> """user_id of the person who rates the article has to be stored""" <NEW_LINE> user_id = models.IntegerField() <NEW_LINE> """this column takes the rating/score given by a user for an article.""" <NE...
This class enables authenticated users to rate articles on a scale of 1 to 5 and average ratings to be returned for every article. It also allows authenticated users to re-rate articles.
6259904273bcbd0ca4bcb563
class ILinkIntegrityNotificationException(Interface): <NEW_LINE> <INDENT> pass
an exception indicating a prevented link integrity breach
6259904223e79379d538d7d6
class Array(Type): <NEW_LINE> <INDENT> def __init__(self, length, baseType): <NEW_LINE> <INDENT> self.length = length <NEW_LINE> self.baseType = baseType <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if isinstance(other, Array): <NEW_LINE> <INDENT> return self.length == other.length and self.baseType...
Fixed-length array type. An array is a contiguously allocated memory for a single base type. .. attribute:: length Length of the array. It could be zero. .. attribute:: baseType The base :class:`Type` of the array.
62599042b57a9660fecd2d54
class EnvironmentList(collections.MutableSequence): <NEW_LINE> <INDENT> def __init__(self, environment): <NEW_LINE> <INDENT> env = os.getenv(environment) <NEW_LINE> self.env = [] if env is None else env.split(os.pathsep) <NEW_LINE> self.name = environment <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> retur...
Converts the system environment
625990428a43f66fc4bf346a
class PermissionAcceptedRequest(Request): <NEW_LINE> <INDENT> deserialized_types = { 'object_type': 'str', 'request_id': 'str', 'timestamp': 'datetime', 'locale': 'str', 'body': 'ask_sdk_model.events.skillevents.permission_body.PermissionBody', 'event_creation_time': 'datetime', 'event_publishing_time': 'datetime' } <N...
:param request_id: Represents the unique identifier for the specific request. :type request_id: (optional) str :param timestamp: Provides the date and time when Alexa sent the request as an ISO 8601 formatted string. Used to verify the request when hosting your skill as a web service. :type timestamp: (optional) dateti...
62599042d164cc6175822250
@implementer(ICommandLineScript) <NEW_LINE> class CAScript(object): <NEW_LINE> <INDENT> def main(self, reactor, options): <NEW_LINE> <INDENT> if options.subCommand is not None: <NEW_LINE> <INDENT> return maybeDeferred(options.subOptions.run) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return options.opt_help()
Command-line script for ``flocker-ca``.
6259904223e79379d538d7d7
class BidirectionalCallback(object): <NEW_LINE> <INDENT> swagger_types = { 'send_alert_actions': 'bool', 'bidirectional_callback_type': 'str' } <NEW_LINE> attribute_map = { 'send_alert_actions': 'sendAlertActions', 'bidirectional_callback_type': 'bidirectional-callback-type' } <NEW_LINE> def __init__(self, send_alert_a...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599042097d151d1a2c2341
class ApplicationGatewayBackendAddressPool(SubResource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, 'backend_addresses': {'key': 'properties.backendAddresses', 'type':...
Backend Address Pool of an application gateway. :param id: Resource ID. :type id: str :param backend_ip_configurations: Collection of references to IPs defined in network interfaces. :type backend_ip_configurations: list[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration] :param backend_addresses...
62599042d4950a0f3b1117ad
class CreateDemandCallback(object): <NEW_LINE> <INDENT> def __init__(self, locations): <NEW_LINE> <INDENT> self.matrix = locations <NEW_LINE> <DEDENT> def Demand(self, from_node, to_node): <NEW_LINE> <INDENT> return self.matrix[from_node][3]
Create callback to get demands at each location.
62599042d99f1b3c44d06977
class PkgResourcesDirDiscoveryRegistry(ModuleAutoDiscoveryRegistry): <NEW_LINE> <INDENT> def _discover_module(self, pkg): <NEW_LINE> <INDENT> if resource_isdir(pkg, self.module_name): <NEW_LINE> <INDENT> for filename in resource_listdir(pkg, self.module_name): <NEW_LINE> <INDENT> self.register(os.path.join( os.path.dir...
Specialized ``ModuleAutoDiscoveryRegistry`` that will search a list of Python packages in an ``ImportPathRegistry`` or ``ModuleRegistry`` for a specific resource directory and register all files found in the directories. By default the list of Python packages is read from the ``packages`` registry namespace.
6259904250485f2cf55dc25e
class ListGroupsForUserResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
A ResultSet with methods tailored to the values returned by the ListGroupsForUser Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62599042ec188e330fdf9b74
class Application: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def run(): <NEW_LINE> <INDENT> TestApp.run() <NEW_LINE> film_repo = FilmFileRepository("filme.txt") <NEW_LINE> client_repo = ClientFileRepository("clienti.txt") <NEW_LINE> rent_repo = RentFileRepository("rents.txt") <NEW_LINE> film_validator = FilmValidato...
Builder for the application
6259904221bff66bcd723f44
class Solid(aocutils.brep.base.BaseObject): <NEW_LINE> <INDENT> def __init__(self, topods_solid): <NEW_LINE> <INDENT> if not isinstance(topods_solid, OCC.TopoDS.TopoDS_Solid): <NEW_LINE> <INDENT> msg = 'need a TopoDS_Solid, got a %s' % topods_solid.__class__ <NEW_LINE> logger.critical(msg) <NEW_LINE> raise aocutils.exc...
Solid class Parameters ---------- topods_solid : OCC.TopoDS.TopoDS_Solid
62599042d6c5a102081e33ff
class LoggingTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> d = RunInTempDir() <NEW_LINE> dfs = _DelayFileStream('foo') <NEW_LINE> self.assertEqual(dfs.filename, os.path.join(d.tmpdir, 'foo')) <NEW_LINE> self.assertEqual(dfs.stream, None) <NEW_LINE> self.assertEqual(os.path.exists...
Check job logging
62599042c432627299fa426e
class _NotFound(HTTPError): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> status = '404 Not Found' <NEW_LINE> headers = {'Content-Type': 'text/html'} <NEW_LINE> HTTPError.__init__(self, status, headers, _Pretty.handle404())
`404 Not Found` error.
6259904207d97122c4217f79
class TaskQueue(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.prio_task_cnt = [0] * 10 <NEW_LINE> self.prio_task_list = [[]] * 10 <NEW_LINE> self.total_task_cnt = 0 <NEW_LINE> <DEDENT> def normalize_priority(self, score): <NEW_LINE> <INDENT> return int(score * 1000) % 10 <NEW_LINE> <DEDENT> ...
global crawler task queue shared by worker and page crawler Input: page crawler write tasks into the queue Output: worker fetches the task and assigns to page crawler
625990424e696a045264e78e
class ChangeBrotliSettingRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(ChangeBrotliSettingRequest, self).__init__( '/zones/{zone_identifier}/settings$$brotli', 'PATCH', header, version) <NEW_LINE> self.parameters = parameters
当请求资产的客户端支持brotli压缩算法时,星盾将提供资产的brotli压缩版本。
6259904282261d6c52730831
class PacketReceiver(StateController): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._recvd_count = None <NEW_LINE> StateController.__init__(self) <NEW_LINE> <DEDENT> def get_received_pps(self): <NEW_LINE> <INDENT> return self._recvd_count / self.get_running_time()
Base class for any packet receivers.
6259904245492302aabfd7b5
class FrameworkFactory(object): <NEW_LINE> <INDENT> __singleton = None <NEW_LINE> @classmethod <NEW_LINE> def get_framework(cls, properties=None): <NEW_LINE> <INDENT> if cls.__singleton is None: <NEW_LINE> <INDENT> cls.__singleton = Framework(properties) <NEW_LINE> <DEDENT> return cls.__singleton <NEW_LINE> <DEDENT> @c...
A framework factory
6259904273bcbd0ca4bcb565
class FoodEaten(UniverseEvent): <NEW_LINE> <INDENT> def __init__(self, food_pos): <NEW_LINE> <INDENT> self.food_pos = food_pos <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'FoodEaten(%s)' % repr(self.food_pos)
Signifies that food has been eaten. Parameters ---------- food_pos : tuple of (int, int) position of the eaten food
6259904223e79379d538d7d8
class HiveQueryTask(BaseHadoopJobTask): <NEW_LINE> <INDENT> def query(self): <NEW_LINE> <INDENT> raise RuntimeError("Must implement query!") <NEW_LINE> <DEDENT> def hiverc(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def job_runner(self): <NEW_LINE> <INDENT> return HiveQueryRunner()
Task to run a hive query
625990428a43f66fc4bf346c
class ExecutorRequirement(PyEnum): <NEW_LINE> <INDENT> RECONSTRUCTABLE_PIPELINE = "RECONSTRUCTABLE_PIPELINE" <NEW_LINE> RECONSTRUCTABLE_JOB = "RECONSTRUCTABLE_PIPELINE" <NEW_LINE> NON_EPHEMERAL_INSTANCE = "NON_EPHEMERAL_INSTANCE" <NEW_LINE> PERSISTENT_OUTPUTS = "PERSISTENT_OUTPUTS"
An ExecutorDefinition can include a list of requirements that the system uses to check whether the executor will be able to work for a particular job/pipeline execution.
6259904226068e7796d4dc20
class Merge(AFNICommand): <NEW_LINE> <INDENT> _cmd = '3dmerge' <NEW_LINE> input_spec = MergeInputSpec <NEW_LINE> output_spec = AFNICommandOutputSpec
Merge or edit volumes using AFNI 3dmerge command For complete details, see the `3dmerge Documentation. <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dmerge.html>`_ Examples ======== >>> from nipype.interfaces import afni >>> merge = afni.Merge() >>> merge.inputs.in_files = ['functional.nii', 'functional2.nii...
6259904223849d37ff852395
class Migration(migrations.Migration): <NEW_LINE> <INDENT> dependencies = [ ('djangae_contenttypes', '0001_patch_contenttypes_migrations'), ('contenttypes', '0001_initial'), ] <NEW_LINE> operations = [ AlterFieldInOtherApp( app_label='contenttypes', model_name='contenttype', name='id', field=models.BigIntegerField(auto...
Migration that changes the `id` field in the DJANGO ContentType app, so that foreign keys which point to it will allow 64 bit ints. This then allows those foreign keys to work with the IDs returned by our SimulatedContentTypeManager.
625990426fece00bbacccc8d
class TestWorker(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def run_test(container_id, value): <NEW_LINE> <INDENT> cmd = ['docker exec -it {0} echo "I am container {0}!, this is message: {1}"' .format(container_id, value)] <NEW_LINE> process = subprocess.Popen(cmd, shell=True, stdout=subproces...
This Class is executed by each container
62599042d6c5a102081e3401
class Architecture(object): <NEW_LINE> <INDENT> command_base = 'architecture'
Manipulates Foreman's architecture.
62599042004d5f362081f953
class FixedIntervalLoopingCall(LoopingCallBase): <NEW_LINE> <INDENT> def start(self, interval, initial_delay=None): <NEW_LINE> <INDENT> self._running = True <NEW_LINE> done = event.Event() <NEW_LINE> def _inner(): <NEW_LINE> <INDENT> if initial_delay: <NEW_LINE> <INDENT> greenthread.sleep(initial_delay) <NEW_LINE> <DED...
A fixed interval looping call.
625990426e29344779b0192f
class NeuralNetwork: <NEW_LINE> <INDENT> def __init__(self, __input_nodes, __hidden_nodes, __output_nodes, __learning_rate): <NEW_LINE> <INDENT> self.i_nodes = __input_nodes <NEW_LINE> self.h_nodes = __hidden_nodes <NEW_LINE> self.o_nodes = __output_nodes <NEW_LINE> self.lr = __learning_rate <NEW_LINE> self.w_ih = nump...
人工神经网络
625990420fa83653e46f61b6
class NamsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_first_last_name(self): <NEW_LINE> <INDENT> formatted_name = get_formatted_name('janis', 'joplin') <NEW_LINE> self.assertEqual(formatted_name, 'Janis Joplin') <NEW_LINE> <DEDENT> def test_first_last_middle_name(self): <NEW_LINE> <INDENT> formatted_name ...
测试name_function.py
6259904273bcbd0ca4bcb567
class AuthMetadataPluginCallback(six.with_metaclass(abc.ABCMeta)): <NEW_LINE> <INDENT> def __call__(self, metadata, error): <NEW_LINE> <INDENT> raise NotImplementedError()
Callback object received by a metadata plugin.
62599042711fe17d825e160b
class RelaxAndPhononWork(Work): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_scf_input(cls, scf_input, volumes, ngqpt, with_becs, optcell, ionmov, edos_ngkpt=None): <NEW_LINE> <INDENT> work = cls() <NEW_LINE> work.initial_scf_input = scf_input <NEW_LINE> work.ngqpt = np.reshape(ngqpt, (3,)) <NEW_LINE> work.edos...
This work performs a structural relaxation for different volumes, then it uses the relaxed structures to compute phonons, BECS and the dielectric tensor with DFPT. .. rubric:: Inheritance Diagram .. inheritance-diagram:: RelaxAndPhononWork
6259904223849d37ff852397
class EnumLogLevel(object): <NEW_LINE> <INDENT> DEBUG = 10 <NEW_LINE> INFO = 20 <NEW_LINE> Environment = 21 <NEW_LINE> ENVIRONMENT = Environment <NEW_LINE> RESOURCE = 22 <NEW_LINE> WARNING = 30 <NEW_LINE> ERROR = 40 <NEW_LINE> ASSERT = 41 <NEW_LINE> CRITICAL = 60 <NEW_LINE> APPCRASH = 61 <NEW_LINE> TESTTIMEOUT = 62 <NE...
日志级别
6259904226068e7796d4dc22
class FeedView(View): <NEW_LINE> <INDENT> def dispatch(self, request, city_name, rubric_name=None, filter_name='last'): <NEW_LINE> <INDENT> rubric = None <NEW_LINE> if rubric_name: <NEW_LINE> <INDENT> rubric = get_object_or_404(ArticleRubric.objects.select_related('donc_data'), name=rubric_name, city__name=city_name) <...
Show list of articles for the certain city and rubric.
62599042d53ae8145f91973a
class SetGraderRedirectView(LoginRequiredMixin, generic.RedirectView): <NEW_LINE> <INDENT> pattern_name = "submissions:grading" <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> SetGraderFormset = modelformset_factory(Feedback, form=forms.SetGraderMeForm) <NEW_LINE> formset = SetGraderFormset(req...
Lisätään palautus käyttäjän tarkastuslistalle.
62599042a79ad1619776b35c
class ReferencePath(nx.DiGraph): <NEW_LINE> <INDENT> def __init__(self, root): <NEW_LINE> <INDENT> nx.DiGraph.__init__(self) <NEW_LINE> self.root = root <NEW_LINE> self.add_node(root) <NEW_LINE> <DEDENT> def __print_node(self, node): <NEW_LINE> <INDENT> string = '{}'.format(node) <NEW_LINE> suc = self.successors(node) ...
Represents a reference path in memory.
6259904221a7993f00c67245
class TestBasics(SummerTestCase): <NEW_LINE> <INDENT> def test_runthru(self): <NEW_LINE> <INDENT> self.s.readline("hello 10 nums or 20 not.\n") <NEW_LINE> self.s.readline("again 2 nums but not -54.345e") <NEW_LINE> <DEDENT> def test_basic_summing(self): <NEW_LINE> <INDENT> self.ensure_input("<@sum = 0>") <NEW_LINE> sel...
test the basic functionality: evaluating calculations and summings.
625990426fece00bbacccc8f
class DataSourceBitStampFile(DataSourceBitStampBase, DataSourceCSVReader): <NEW_LINE> <INDENT> def __init__(self, broker, filename='assets/bitstampUSD.csv.gz', start=None, stop=None): <NEW_LINE> <INDENT> super(DataSourceBitStampFile,self).__init__(broker) <NEW_LINE> self._ts_start = dt2epock(date_parse(start)) if start...
Ingest data from CSV files of BitStamp trades. These come from http://api.bitcoincharts.com/v1/csv/
62599042287bf620b6272ec4
class TestDataset(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> dirs = [join(basedir, d) for d in dataset_dirs] <NEW_LINE> dir_tbts = filter(lambda x: exists(x[0]) and exists(join(x[0], x[1])), zip(dirs, tbt_files)) <NEW_LINE> cls.datasets = [CSVDataset(d, tbt)...
Unit test for Dataset module.
62599042d10714528d69effb
class iterqueue(object): <NEW_LINE> <INDENT> def __init__(self, queue, maxcount=None): <NEW_LINE> <INDENT> self.queue = queue <NEW_LINE> self.maxcount = maxcount <NEW_LINE> self.count = 0 <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> while (self.maxcount is None) or (self.count < self.maxcount): <NEW_LINE...
Iterate a queue til a maximum number of messages are read or the queue is empty it exposes an attribute "count" with the number of messages read >>> from Queue import Queue >>> q = Queue() >>> for x in xrange(10): ... q.put(x) >>> qiter = iterqueue(q) >>> list(qiter) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> qiter.count...
6259904266673b3332c316d7
class FileDTO(Model): <NEW_LINE> <INDENT> _validation = { 'file_name': {'required': True, 'max_length': 200, 'min_length': 1}, 'file_uri': {'required': True}, } <NEW_LINE> _attribute_map = { 'file_name': {'key': 'fileName', 'type': 'str'}, 'file_uri': {'key': 'fileUri', 'type': 'str'}, } <NEW_LINE> def __init__(self, *...
DTO to hold details of uploaded files. All required parameters must be populated in order to send to Azure. :param file_name: Required. File name. Supported file types are ".tsv", ".pdf", ".txt", ".docx", ".xlsx". :type file_name: str :param file_uri: Required. Public URI of the file. :type file_uri: str
6259904215baa72349463270