code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class AddDistroTests(DatabaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(AddDistroTests, self).setUp() <NEW_LINE> session = Session() <NEW_LINE> self.user = models.User(email="user@fedoraproject.org", username="user") <NEW_LINE> user_social_auth = social_models.UserSocialAuth( user_id=self...
Tests for the :func:`anitya.admin.add_distro` view function.
625990a6c4546d3d9def826c
class TestEnv(Env): <NEW_LINE> <INDENT> @property <NEW_LINE> def action_space(self): <NEW_LINE> <INDENT> return Box(low=0, high=0, shape=(0,), dtype=np.float32) <NEW_LINE> <DEDENT> @property <NEW_LINE> def observation_space(self): <NEW_LINE> <INDENT> return Box(low=0, high=0, shape=(0,), dtype=np.float32) <NEW_LINE> <D...
Test environment used to run simulations in the absence of autonomy. Required from env_params None Optional from env_params reward_fn : A reward function which takes an an input the environment class and returns a real number. States States are an empty list. Actions No actions are provided to a...
625990a6c4546d3d9def826d
class Author(models.Model): <NEW_LINE> <INDENT> first_name = models.CharField(max_length=100) <NEW_LINE> last_name = models.CharField(max_length=100) <NEW_LINE> date_of_birth = models.DateField(null=True, blank=True) <NEW_LINE> date_of_death = models.DateField('Died', null=True, blank=True) <NEW_LINE> def get_absolute_...
Model representing an author.
625990a6187af65679d2abb8
class OnePointElementCrossover(ElementCrossover): <NEW_LINE> <INDENT> def __init__(self, element_pool, max_diff_elements=None, min_percentage_elements=None, verbose=False, rng=np.random): <NEW_LINE> <INDENT> ElementCrossover.__init__(self, element_pool, max_diff_elements, min_percentage_elements, verbose, rng=rng) <NEW...
Crossover of the elements in the atoms objects. Point of cross is chosen randomly. Parameters: element_pool: List of elements in the phase space. The elements can be grouped if the individual consist of different types of elements. The list should then be a list of lists e.g. [[list1], [list2]] max_diff_elem...
625990a6c4546d3d9def826f
class Server(_AsyncioServer): <NEW_LINE> <INDENT> def __init__(self, targets, id_parameters=None): <NEW_LINE> <INDENT> _AsyncioServer.__init__(self) <NEW_LINE> self.targets = targets <NEW_LINE> self.id_parameters = id_parameters <NEW_LINE> <DEDENT> @asyncio.coroutine <NEW_LINE> def _handle_connection_cr(self, reader, w...
This class creates a TCP server that handles requests coming from ``Client`` objects. The server is designed using ``asyncio`` so that it can easily support multiple connections without the locking issues that arise in multi-threaded applications. Multiple connection support is useful even in simple cases: it allows n...
625990a6187af65679d2abbb
class AutoDiffException(Exception): <NEW_LINE> <INDENT> pass
Base class for all exceptions related to automatic differentiation failures.
625990a6187af65679d2abbc
class BackendAddressPool(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'type': {'readonly': True}, 'backend_ip_configurations': {'readonly': True}, 'load_balancing_rules': {'readonly': True}, 'outbound_rule': {'readonly': True}, 'outbound_rules': {'readonly': True}, 'provisioning_state':...
Pool of backend IP addresses. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param name: The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resou...
625990a7091ae35668706bdb
class MailRequest(object): <NEW_LINE> <INDENT> def __init__(self, Peer, From, To, Data): <NEW_LINE> <INDENT> self.Peer = Peer <NEW_LINE> self.Data = Data <NEW_LINE> try: <NEW_LINE> <INDENT> self.From = _decode_header_randomness(From).pop() <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> self.From = None <NEW_L...
This is what is given to your message handlers. The information you get out of this is *ALWAYS* in Python str (unicode in Python 2.7) and should be usable by any API. Modifying this object will cause other handlers that deal with it to get your modifications, but in general you don't want to do more than maybe tag a f...
625990a7adb09d7d5dc0c508
class LinksFacets(): <NEW_LINE> <INDENT> pass
The links arrayThe links array is an optional child property of the items array. It contains one or more anonymous objects, each with five possible properties: href (REQUIRED), rel (REQURIED), name (OPTIONAL), render(OPTIONAL), prompt (OPTI...
625990a7c4546d3d9def8274
class DesktopChromeDriver(Driver): <NEW_LINE> <INDENT> def __init__(self, properties): <NEW_LINE> <INDENT> Driver.__init__(self, properties) <NEW_LINE> if ((properties.get_remote_url() is None) or (properties.get_remote_url() == "")): <NEW_LINE> <INDENT> executable_path = properties.get_executable_path() <NEW_LINE> pri...
Init desktop Chrome driver.
625990a7091ae35668706bdf
class TingYunObjectWrapperBase(_ObjectProxy): <NEW_LINE> <INDENT> @property <NEW_LINE> def _previous_object(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self._self_previous_object <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> self._self_previous_object = getattr(self.__wrapped__, '_previo...
使用细则参考 http://wrapt.readthedocs.io/en/latest/
625990a7c4546d3d9def8276
class UnversionedListMeta(object): <NEW_LINE> <INDENT> def __init__(self, self_link=None, resource_version=None): <NEW_LINE> <INDENT> self.swagger_types = { 'self_link': 'str', 'resource_version': 'str' } <NEW_LINE> self.attribute_map = { 'self_link': 'selfLink', 'resource_version': 'resourceVersion' } <NEW_LINE> self....
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
625990a7adb09d7d5dc0c514
class Student: <NEW_LINE> <INDENT> def __init__(self, first_name, last_name, age): <NEW_LINE> <INDENT> self.first_name = first_name <NEW_LINE> self.last_name = last_name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def to_json(self, attrs=None): <NEW_LINE> <INDENT> dic = {} <NEW_LINE> if attrs is None: <NEW_LINE> <IND...
Public instance attributes: first_name last_name age
625990a7091ae35668706beb
class TsfPageApiGroupInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.Content = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("TotalCount") <NEW_LINE> if params.get("Content") is not None: ...
ApiGroupInfo翻页结构体
625990a7adb09d7d5dc0c518
class EEG_Report: <NEW_LINE> <INDENT> def __init__(self, path=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> <DEDENT> def get_age_sex(self): <NEW_LINE> <INDENT> import eegreportparser as erp <NEW_LINE> ageStr,sex = erp.GetDemographics(self.path) <NEW_LINE> try: <NEW_LINE> <INDENT> age = float(ageStr) <NEW_LINE>...
Each instance of this class represents an EEG recording session in the dataset.
625990a7187af65679d2abc6
class PlotlyDisplay(IPython.core.display.HTML): <NEW_LINE> <INDENT> def __init__(self, url, width, height): <NEW_LINE> <INDENT> self.resource = url <NEW_LINE> self.embed_code = get_embed(url, width=width, height=height) <NEW_LINE> super(PlotlyDisplay, self).__init__(data=self.embed_code) <NEW_LINE> <DEDENT> def _repr_h...
An IPython display object for use with plotly urls PlotlyDisplay objects should be instantiated with a url for a plot. IPython will *choose* the proper display representation from any Python object, and using provided methods if they exist. By defining the following, if an HTML display is unusable, the PlotlyDisplay o...
625990a7187af65679d2abc7
class Subscriber: <NEW_LINE> <INDENT> def __init__(self, context, address, tick_filter=""): <NEW_LINE> <INDENT> self.filter = tick_filter <NEW_LINE> self.context = context <NEW_LINE> self.address = address <NEW_LINE> self.socket = None <NEW_LINE> self.handler = None <NEW_LINE> self.quit_event = threading.Event()...
订阅者
625990a7c4546d3d9def827d
class PoxCliDriver(Emulator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Emulator, self).__init__() <NEW_LINE> self.handle = self <NEW_LINE> self.wrapped = sys.modules[__name__] <NEW_LINE> <DEDENT> def connect(self, **connectargs): <NEW_LINE> <INDENT> for key in connectargs: <NEW_LINE> <INDENT> v...
PoxCliDriver driver provides the basic functions of POX controller
625990a8c4546d3d9def8283
class LinearCalibration(AbstractCalibration): <NEW_LINE> <INDENT> def __init__(self, y_intercept, slope): <NEW_LINE> <INDENT> super(LinearCalibration, self).__init__() <NEW_LINE> self.constant = y_intercept <NEW_LINE> self.slope = slope <NEW_LINE> <DEDENT> def __call__(self, x): <NEW_LINE> <INDENT> return self.constant...
Linear calibration :math:`x \mapsto a + b x`, where *a* is the y-intercept and *b* is the slope. :param y_intercept: y-intercept :param slope: Slope of the affine transformation
625990a8c4546d3d9def8284
class Chanel(object): <NEW_LINE> <INDENT> def __init__(self, api): <NEW_LINE> <INDENT> self.api = api <NEW_LINE> <DEDENT> @property <NEW_LINE> def session(self): <NEW_LINE> <INDENT> return self.api.get_session() <NEW_LINE> <DEDENT> def send_wss_request(self, name, msg): <NEW_LINE> <INDENT> return self.api.send_wss_requ...
Class for base IQ option websocket chanel.
625990a8091ae35668706c01
class AmphoraFinalize(BaseAmphoraTask): <NEW_LINE> <INDENT> def execute(self, amphora): <NEW_LINE> <INDENT> self.amphora_driver.finalize_amphora(amphora) <NEW_LINE> LOG.debug("Finalized the amphora.") <NEW_LINE> <DEDENT> def revert(self, result, amphora, *args, **kwargs): <NEW_LINE> <INDENT> if isinstance(result, failu...
Task to finalize the amphora before any listeners are configured.
625990a8c4546d3d9def8286
class ObjectNameCase(unittest.TestCase): <NEW_LINE> <INDENT> def testSimple(self): <NEW_LINE> <INDENT> name = 'object1' <NEW_LINE> obj = QObject() <NEW_LINE> obj.setObjectName(name) <NEW_LINE> self.assertEqual(name, obj.objectName()) <NEW_LINE> <DEDENT> def testEmpty(self): <NEW_LINE> <INDENT> name = '' <NEW_LINE> obj ...
Tests related to QObject object name
625990a8091ae35668706c03
class SeleniumSessionWorkflowPopulator(SeleniumSessionGetPostMixin, populators.BaseWorkflowPopulator, ImporterGalaxyInterface): <NEW_LINE> <INDENT> def __init__(self, selenium_context: GalaxySeleniumContext): <NEW_LINE> <INDENT> self.selenium_context = selenium_context <NEW_LINE> self.dataset_populator = SeleniumSessio...
Implementation of BaseWorkflowPopulator backed by bioblend.
625990a8c4546d3d9def828c
class STD_ANON_7 (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/home/claudio/Applications/eudat/b2safe/manifest/mets.xsd', 1483, 8) <NEW_LINE> _Documentation = None
An atomic simple type.
625990a8c4546d3d9def8290
class VirtualMachineScaleSetStorageProfile(Model): <NEW_LINE> <INDENT> _attribute_map = { 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, 'os_disk': {'key': 'osDisk', 'type': 'VirtualMachineScaleSetOSDisk'}, } <NEW_LINE> def __init__(self, image_reference=None, os_disk=None): <NEW_LINE> <INDENT>...
Describes a virtual machine scale set storage profile. :param image_reference: the image reference. :type image_reference: :class:`ImageReference <azure.mgmt.compute.models.ImageReference>` :param os_disk: the OS disk. :type os_disk: :class:`VirtualMachineScaleSetOSDisk <azure.mgmt.compute.models.VirtualMachineScale...
625990a9187af65679d2abde
class ProfileWriter(ProfileParser): <NEW_LINE> <INDENT> def set_rule(self, rule): <NEW_LINE> <INDENT> action = rule[0] <NEW_LINE> target = rule[1] <NEW_LINE> sub = rule[2] <NEW_LINE> rule_list = [] <NEW_LINE> if not self.has_section(target): <NEW_LINE> <INDENT> self.add_section(target) <NEW_LINE> <DEDENT> if self.has_o...
Object that writes basic CoPilot profiles
625990a9091ae35668706c1f
class HostStats(object): <NEW_LINE> <INDENT> def __init__(self, host, target, method = '', baseline = None, measures = None, baselineMeasures = None): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.target = target <NEW_LINE> if measures is not None: <NEW_LINE> <INDENT> self.measures = measures <NEW_LINE> <DEDENT>...
Storage for delay results
625990a9187af65679d2abe5
class LineMemoryMonitor(LineMonitor): <NEW_LINE> <INDENT> def __init__(self, recorder, record_type=None): <NEW_LINE> <INDENT> if record_type is None: <NEW_LINE> <INDENT> record_type = LineMemoryRecord <NEW_LINE> <DEDENT> super(LineMemoryMonitor, self).__init__(recorder, record_type) <NEW_LINE> self._process = None <NEW...
Record process memory on python line events. The class hooks on the settrace function to receive trace events and record the current process memory when a line of code is about to be executed.
625990a9187af65679d2abec
class User_Event_Entity: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> unique_users = set() <NEW_LINE> unique_events = set() <NEW_LINE> events_for_user = defaultdict(set) <NEW_LINE> users_for_event = defaultdict(set) <NEW_LINE> for filename in ['data/train.csv', 'data/test.csv']: <NEW_LINE> <INDENT> with ...
user-event 信息: user_index : 用户id event_index: 事件id user_event_scores: user --> event 感兴趣程度 unique_user_pairs: 有关系的用户对 unique_event_pairs: 有关系的事件对
625990a9091ae35668706c3b
class Solution: <NEW_LINE> <INDENT> def winSum(self, nums, k): <NEW_LINE> <INDENT> if not nums: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> s = sum(nums[:k]) <NEW_LINE> result = [s] <NEW_LINE> for i in range(len(nums) - k): <NEW_LINE> <INDENT> j = i + k <NEW_LINE> s = s - nums[i] + nums[j] <NEW_LINE> result.appen...
@param: nums: a list of integers. @param: k: length of window. @return: the sum of the element inside the window at each moving.
625990aa091ae35668706c45
class EncoderDecoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, encoder, decoder, src_embed, tgt_embed, generator): <NEW_LINE> <INDENT> super(EncoderDecoder, self).__init__() <NEW_LINE> self.encoder = encoder <NEW_LINE> self.decoder = decoder <NEW_LINE> self.src_embed = src_embed <NEW_LINE> self.tgt_embed = tgt...
Standard Encoder-Decoder Architecture. Base class for the transformer model
625990aa091ae35668706c47
class KeyDefaultdict(collections.defaultdict): <NEW_LINE> <INDENT> def __missing__(self, key): <NEW_LINE> <INDENT> if self.default_factory is None: <NEW_LINE> <INDENT> raise KeyError(key) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ret = self[key] = self.default_factory(key) <NEW_LINE> return ret
Default dict where KeyDefaultdict(C)[x] = C(x)
625990aa091ae35668706c49
class TenantDiscovery(plugin.DiscoveryBase): <NEW_LINE> <INDENT> def discover(self, manager, param=None): <NEW_LINE> <INDENT> tenants = manager.keystone.projects.list() <NEW_LINE> return tenants or []
Discovery that supplies keystone tenants. This discovery should be used when the pollster's work can't be divided into smaller pieces than per-tenants. Example of this is the Swift pollster, which polls account details and does so per-project.
625990aa187af65679d2abf5
class BinaryTree: <NEW_LINE> <INDENT> def __init__(self, node, left=None, right=None): <NEW_LINE> <INDENT> self.node = node <NEW_LINE> self.left = left <NEW_LINE> self.right = right <NEW_LINE> <DEDENT> @property <NEW_LINE> def isLeaf(self): <NEW_LINE> <INDENT> return self.left is None and self.right is None <NEW_LINE...
Class representing full binary tree
625990aac4546d3d9def82ac
class DefaultConfig: <NEW_LINE> <INDENT> PORT = 3978 <NEW_LINE> APP_ID = os.environ.get("MicrosoftAppId", "") <NEW_LINE> APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") <NEW_LINE> LUIS_APP_ID = os.environ.get("LuisAppId", "541aa899-3c02-4e7f-bffe-45cfe953f276") <NEW_LINE> LUIS_API_KEY = os.environ.get("LuisAP...
Bot Configuration
625990aac4546d3d9def82ad
class BackupSchedule(base.Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> return self.manager.get(server=self.server) <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> self.manager.delete(server=self.server) <NEW_LINE> <DEDENT> def update(self, enabled=True, weekly='disabled', daily='disabled'...
Represents the daily or weekly backup schedule for some server.
625990aac4546d3d9def82af
@Metric.register("hit_at_k_within_d") <NEW_LINE> class HitAtKWithinD(Metric): <NEW_LINE> <INDENT> def __init__(self, k=5, d=2) -> None: <NEW_LINE> <INDENT> self._k = k <NEW_LINE> self._k = 2 <NEW_LINE> self._hit_at_k_within_d = 0.0 <NEW_LINE> self._batch_size = 0 <NEW_LINE> self._predictions = None <NEW_LINE> self._gol...
Just checks batch-equality of two tensors and computes an accuracy metric based on that. This is similar to :class:`CategoricalAccuracy`, if you've already done a ``.max()`` on your predictions. If you have categorical output, though, you should typically just use :class:`CategoricalAccuracy`. The reason you might w...
625990aa091ae35668706c58
class AuthTokenSerializer(serializers.Serializer): <NEW_LINE> <INDENT> email = serializers.CharField() <NEW_LINE> password = serializers.CharField( style={'input_type': 'password'}, trim_whitespace=False ) <NEW_LINE> def validate(self, attrs): <NEW_LINE> <INDENT> email = attrs.get('email') <NEW_LINE> password = attrs.g...
Serialização para o objeto de autenticação de usuário
625990ab187af65679d2abfe
class FAQs(models.Model): <NEW_LINE> <INDENT> question = models.CharField(max_length=255, unique=True) <NEW_LINE> brief_response = models.TextField() <NEW_LINE> detailed_response_url = models.URLField( max_length=400, null=True, blank=True)
Questions not associated with any particular users.. This is because these questions tend to cut across almost all users
625990ab091ae35668706c5e
class AppTokenObtainPairView(TokenObtainPairView): <NEW_LINE> <INDENT> serializer_class = serializers.AppTokenObtainPairSerializer
Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials. Also returns language of logged in user
625990ab091ae35668706c64
class PutCmd(Command): <NEW_LINE> <INDENT> aliases = ('put', 'place', 'drop') <NEW_LINE> syntax = '<thing> {in|into|inside of|inside} <container>' <NEW_LINE> arg_parsers = { 'thing': MatchObject(cls=Thing, search_for='thing', show=True), 'container': 'this' } <NEW_LINE> lock = locks.all_pass <NEW_LINE> def run(self, th...
put <thing> in <container> Places a thing inside an open container.
625990abc4546d3d9def82b8
class Scheduler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def submit(self, pbs_script, pbs_config, pbs_vars=None, python_exe=None): <NEW_LINE> <INDENT> raise NotImplementedError
Abstract scheduler class.
625990ab187af65679d2ac02
class ExpressRouteCircuitAuthorization(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', '...
Authorization in an ExpressRouteCircuit resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param name: The name of the resource that is unique within a resource group. This name can be used to access the resource. :type name: str :...
625990ab091ae35668706c68
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('email', 'password', 'birthdate', 'is_active') <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE> <INDENT> return self.initial["password"]
A form for updating users. Includes all the fields on the user, but replaces the password field with admin's password hash display field.
625990ab091ae35668706c6c
class UserRegister(generics.CreateAPIView): <NEW_LINE> <INDENT> queryset = get_user_model().objects.all() <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> def create(self, request, *args, **kwargs): <NEW_LINE> <INDENT> serializer = UserSerializer(data=request.data) <NEW_LINE> random_number = random_token.generat...
Class representing the view for creating a user
625990ac187af65679d2ac11
class Chemistry(Enum): <NEW_LINE> <INDENT> tenX_v2 = "tenX_v2" <NEW_LINE> tenX_v3 = "tenX_v3"
Parameters for 10x chemistry used by the Optimus pipeline: https://github.com/HumanCellAtlas/skylab/blob/optimus_v1.4.0/pipelines/optimus/Optimus.wdl#L39
625990acc4546d3d9def82ca
class SettingsList(FormatMany): <NEW_LINE> <INDENT> def take_action(self, parsed_args): <NEW_LINE> <INDENT> super(SettingsList, self).take_action(parsed_args) <NEW_LINE> headers = ['Setting', 'Value'] <NEW_LINE> records = [] <NEW_LINE> for s, v in settings.all_settings().items(): <NEW_LINE> <INDENT> records.append([s, ...
List current Tapis CLI settings
625990ac091ae35668706c8c
class Register(RegisterFactory): <NEW_LINE> <INDENT> def identity_verify(self, identity: str) -> bool: <NEW_LINE> <INDENT> logging.info(f'verify identity {identity} ') <NEW_LINE> session = Session() <NEW_LINE> query = session.query(Auths).filter(Auths.identity == identity) <NEW_LINE> result = True <NEW_LINE> try: <NEW_...
具体注册器
625990ac187af65679d2ac19
class API: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._buffer = '' <NEW_LINE> self._servers = {} <NEW_LINE> return <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> for server in self._servers: <NEW_LINE> <INDENT> server.delete() <NEW_LINE> <DEDENT> self._servers = {} <NEW_LINE> self._buff...
Client API.
625990acc4546d3d9def82d3
class Timer(): <NEW_LINE> <INDENT> def __init__(self, function): <NEW_LINE> <INDENT> self.function = function <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> start_time = time.time() <NEW_LINE> result = self.function(*args, **kwargs) <NEW_LINE> end_time = time.time() <NEW_LINE> print("실행시간은...
Source: https://jupiny.com/2016/09/25/decorator-class/ __call__: 클래스의 객체가 함수처럼 호출되면 실행되게 만드는 함수
625990ad091ae35668706ca2
class IPv6Address(_BaseV6, _BaseAddress): <NEW_LINE> <INDENT> __slots__ = ('_ip', '__weakref__') <NEW_LINE> def __init__(self, address): <NEW_LINE> <INDENT> if isinstance(address, _compat_int_types): <NEW_LINE> <INDENT> self._check_int_address(address) <NEW_LINE> self._ip = address <NEW_LINE> return <NEW_LINE> <DEDENT>...
Represent and manipulate single IPv6 Addresses.
625990ad187af65679d2ac21
class SegmentationMetric(EvalMetric): <NEW_LINE> <INDENT> def __init__(self, nclass): <NEW_LINE> <INDENT> super(SegmentationMetric, self).__init__('pixAcc & mIoU') <NEW_LINE> self.nclass = nclass <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def update(self, labels, preds): <NEW_LI...
Computes pixAcc and mIoU metric scroes
625990adc4546d3d9def82da
class GetTopPeers(Object): <NEW_LINE> <INDENT> ID = 0xd4982db5 <NEW_LINE> def __init__(self, offset: int, limit: int, hash: int, correspondents: bool = None, bots_pm: bool = None, bots_inline: bool = None, phone_calls: bool = None, groups: bool = None, channels: bool = None): <NEW_LINE> <INDENT> self.correspondents = c...
Attributes: ID: ``0xd4982db5`` Args: offset: ``int`` ``32-bit`` limit: ``int`` ``32-bit`` hash: ``int`` ``32-bit`` correspondents (optional): ``bool`` bots_pm (optional): ``bool`` bots_inline (optional): ``bool`` phone_calls (optional): ``bool`` groups (optional): ``bool`` chann...
625990adc4546d3d9def82de
class DeploymentTimeout(DeploymentFailed): <NEW_LINE> <INDENT> pass
Timeout during deployment.
625990ad091ae35668706cb4
class Address(models.Model): <NEW_LINE> <INDENT> address = models.TextField(max_length=100, null=False, blank=False) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.address <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = 'Addresses'
A class representing an address.
625990ad187af65679d2ac2c
class SchemaProperties(object): <NEW_LINE> <INDENT> def __init__(self, properties, schema, rootschema=None): <NEW_LINE> <INDENT> self._properties = properties <NEW_LINE> self._schema = schema <NEW_LINE> self._rootschema = rootschema or schema <NEW_LINE> <DEDENT> def __bool__(self): <NEW_LINE> <INDENT> return bool(self....
A wrapper for properties within a schema
625990ad091ae35668706cbc
class PDF417(Barcode): <NEW_LINE> <INDENT> def __init__(self, data, rows=None, columns=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.data_hex = binascii.hexlify(data.encode('ISO-8859-1')).decode('utf8') <NEW_LINE> self.rows = rows <NEW_LINE> self.columns = columns <NEW_LINE> <DEDENT> @property <N...
0 0 moveto <{hexdata}> ({options}) /pdf417 /uk.co.terryburton.bwipp findresource exec
625990ad091ae35668706cbe
class Int(Saveable): <NEW_LINE> <INDENT> default = 0 <NEW_LINE> @staticmethod <NEW_LINE> def to_python(val): <NEW_LINE> <INDENT> return int(val)
A Saveable integer Integers are a little different in JSON than Python. Strictly speaking JSON only has "numbers", which can be integer or float, so a little to do here to make sure we get an int in Python.
625990ae091ae35668706cc2
class World: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.things = {} <NEW_LINE> self.locations = {} <NEW_LINE> <DEDENT> def step(self): <NEW_LINE> <INDENT> for agent in [thing for thing in self.things if hasattr(thing, "ai")]: <NEW_LINE> <INDENT> perception = agent.percept() <NEW_LINE> action = age...
The environment in which everything takes place.
625990aec4546d3d9def82e9
class Input: <NEW_LINE> <INDENT> def __init__( self: Input, name: str, structs: List[Struct], inputs: List[Variable], subject: str, output: str, ) -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.structs = structs <NEW_LINE> self.input = inputs <NEW_LINE> self.subject = subject <NEW_LINE> self.output = out...
Represents the user input, parsed
625990ae187af65679d2ac34
class ComputeInstancesDeleteAccessConfigRequest(_messages.Message): <NEW_LINE> <INDENT> accessConfig = _messages.StringField(1, required=True) <NEW_LINE> instance = _messages.StringField(2, required=True) <NEW_LINE> networkInterface = _messages.StringField(3, required=True) <NEW_LINE> project = _messages.StringField(4,...
A ComputeInstancesDeleteAccessConfigRequest object. Fields: accessConfig: The name of the access config to delete. instance: The instance name for this request. networkInterface: The name of the network interface. project: Project ID for this request. requestId: An optional request ID to identify requests. S...
625990ae187af65679d2ac35
def get_variable_days(self, year): <NEW_LINE> <INDENT> days = super(Hawick, self).get_variable_days(year) <NEW_LINE> first_monday = self.get_nth_weekday_in_month(year, 6, MON) <NEW_LINE> friday = first_monday + timedelta(days=4) <NEW_LINE> saturday = first_monday + timedelta(days=5) <NEW_LINE> days.append((friday, "Com...
Hawick
625990aec4546d3d9def82ee
class Discriminator(nn.Module): <NEW_LINE> <INDENT> def __init__(self, image_size=64, conv_dim=64, c_dim=5, repeat_num=5): <NEW_LINE> <INDENT> super(Discriminator, self).__init__() <NEW_LINE> layers = [] <NEW_LINE> layers.append(nn.Conv2d(3, conv_dim, kernel_size=4, stride=2, padding=1)) <NEW_LINE> layers.append(nn.Lea...
Discriminator network with PatchGAN.
625990ae187af65679d2ac39
class DataAPI(object): <NEW_LINE> <INDENT> BASE_RPC_API_VERSION = '1.0' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(DataAPI, self).__init__() <NEW_LINE> target = messaging.Target(topic=CONF.data_topic, version=self.BASE_RPC_API_VERSION) <NEW_LINE> self.client = rpc.get_client(target, version_cap='1.0') <NE...
Client side of the data RPC API. API version history: 1.0 - Initial version, Add migration_start(), data_copy_cancel(), data_copy_get_progress()
625990aec4546d3d9def82f1
class TagPopularity(db.Model): <NEW_LINE> <INDENT> tag = db.ReferenceProperty(Tag, required = True) <NEW_LINE> date = db.DateProperty(required = True) <NEW_LINE> number_of_posts = db.IntegerProperty(required = True, default = 0)
The number of posts that refer to a given tag on a given date Used for "popular tags" boxes
625990aec4546d3d9def82f5
class Solution: <NEW_LINE> <INDENT> def reverseWords(self, s: str) -> str: <NEW_LINE> <INDENT> s_split = s.split(' ') <NEW_LINE> if len(s_split) < 1: <NEW_LINE> <INDENT> return s <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return ' '.join([item[::-1] for item in s_split]) <NEW_LINE> <DEDENT> <DEDENT> def reverseWords...
给定一个字符串,你需要反转字符串中每个单词的字符顺序,同时仍保留空格和单词的初始顺序 思路:
625990ae187af65679d2ac3e
class UseCase: <NEW_LINE> <INDENT> def execute(self, request): <NEW_LINE> <INDENT> if not request: <NEW_LINE> <INDENT> return ResponseFailure.build_from_invalid_request( request) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> return self.process_request(request) <NEW_LINE> <DEDENT> except Exception as exc: <NEW_LINE> <IN...
Abstract class for business logic of application. Layer between domain and repo.
625990af187af65679d2ac3f
class ContainsArrow(Thing): <NEW_LINE> <INDENT> def __init__(self, lumpy, parent, child, **options): <NEW_LINE> <INDENT> self.lumpy = lumpy <NEW_LINE> self.parent = parent <NEW_LINE> self.child = child <NEW_LINE> underride(options, fill='orange', arrow=LAST) <NEW_LINE> self.options = options <NEW_LINE> <DEDENT> def dra...
Represents a contains arrow. Shows a has-a relationship between classes in a class diagram.
625990afc4546d3d9def82f9
class Solution: <NEW_LINE> <INDENT> def insertNode(self, root, node): <NEW_LINE> <INDENT> if (root == null): <NEW_LINE> <INDENT> return node <NEW_LINE> <DEDENT> if (node.val < root.val): <NEW_LINE> <INDENT> root.left = insertNode(root.left, node) <NEW_LINE> <DEDENT> elif (node.val > root.val): <NEW_LINE> <INDENT> root....
@param root: The root of the binary search tree. @param node: insert this node into the binary search tree. @return: The root of the new binary search tree.
625990af091ae35668706ce8
class RetryConfig(_messages.Message): <NEW_LINE> <INDENT> maxAttempts = _messages.IntegerField(1, variant=_messages.Variant.INT32) <NEW_LINE> maxBackoff = _messages.StringField(2) <NEW_LINE> maxDoublings = _messages.IntegerField(3, variant=_messages.Variant.INT32) <NEW_LINE> maxRetryDuration = _messages.StringField(4) ...
Retry config. These settings determine how a failed task attempt is retried. Fields: maxAttempts: The maximum number of attempts for a task. Cloud Tasks will attempt the task `max_attempts` times (that is, if the first attempt fails, then there will be `max_attempts - 1` retries). Must be > 0. maxBackof...
625990afc4546d3d9def82fc
class ReadCSVTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> data = get_sample_image_csv_data() <NEW_LINE> self.header = data.pop(0) <NEW_LINE> self.sample_data = data <NEW_LINE> <DEDENT> def test_valid_csv_no_header_no_names_specified(self): <NEW_LINE> <INDENT> f = _make_csv_tempfile(...
Tests `read_csv`.
625990af091ae35668706cee
class DashboardConfig(AppConfig): <NEW_LINE> <INDENT> name = 'dashboard'
Dashboard Django Application Meta Class
625990af627d3e7fe0e08f31
class DataNotSent(Exception): <NEW_LINE> <INDENT> pass
Sonar is not sending information.
625990af091ae35668706cf2
class ECLexer(CLexer): <NEW_LINE> <INDENT> name = 'eC' <NEW_LINE> aliases = ['ec'] <NEW_LINE> filenames = ['*.ec', '*.eh'] <NEW_LINE> mimetypes = ['text/x-echdr', 'text/x-ecsrc'] <NEW_LINE> tokens = { 'statements': [ (r'(virtual|class|private|public|property|import|delete|new|new0|' r'renew|renew0|define|get|set|remote...
For eC source code with preprocessor directives. .. versionadded:: 1.5
625990afc4546d3d9def82ff
class SearchEionet(BrowserView): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> ldap_filter = self.request.form.get('filter') <NEW_LINE> agent = self.context._get_ldap_agent() <NEW_LINE> encres = json.dumps(agent.search_user(ldap_filter)) <NEW_LINE> self.request.response.setHeader("Content-Type", 'applicat...
ldap search vor javascript frontend
625990af091ae35668706cf4
class Clients(_ClientSelectCmd): <NEW_LINE> <INDENT> options = _ClientSelectCmd.options + [ Bcfg2.Options.BooleanOption( "-c", "--clean", help="Show only clean hosts"), Bcfg2.Options.BooleanOption( "-d", "--dirty", help="Show only dirty hosts"), Bcfg2.Options.BooleanOption( "--stale", help="Show hosts that haven't run ...
Query hosts
625990afc4546d3d9def8300
class BaseBlenderSettings(BaseSettingsWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None, *args, **kwargs): <NEW_LINE> <INDENT> super(BaseBlenderSettings, self).__init__(parent=parent) <NEW_LINE> self.fileInput = Widgets.CueLabelLineEdit('Blender File:') <NEW_LINE> self.outputPath = Widgets.CueLabelLineEdit( '...
Standard Blender settings widget to be used from outside Blender.
625990af627d3e7fe0e08f3f
class Serializable(metaclass=ABCMeta): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_bytes(cls, data, index=0, **kwargs): <NEW_LINE> <INDENT> obj = cls(**kwargs) <NEW_LINE> index = obj.load_in_place(data, index) <NEW_LINE> return obj, index <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def to_bytes(self): <NEW_...
A Serializable type is a type that can be converted to and from a bytes object. Each type must define it's own to_bytes and from_bytes methods. As each type clearly defines how it is stored, in contrast to storing data with pickle, the data should be compact, easily loadable, and easily interpreted from other programm...
625990af091ae35668706cfe
class Feed(MergeableDocumentElement, Source): <NEW_LINE> <INDENT> __tag__ = 'feed' <NEW_LINE> __xmlns__ = ATOM_XMLNS <NEW_LINE> entries = Child('entry', Entry, xmlns=ATOM_XMLNS, multiple=True)
Atom feed document, acting as a container for metadata and data associated with the feed. It corresponds to ``atom:feed`` element of :rfc:`4287#section-4.1.1` (section 4.1.1).
625990b0187af65679d2ac4f
class Treater: <NEW_LINE> <INDENT> def __init__(self,path): <NEW_LINE> <INDENT> paths = [] <NEW_LINE> for path, _, files in os.walk(path): <NEW_LINE> <INDENT> for afile in files: <NEW_LINE> <INDENT> if afile.split('.')[1] == 'txt': <NEW_LINE> <INDENT> paths.append(f"{path}{afile}") <NEW_LINE> <DEDENT> <DEDENT> <DEDENT>...
This class is for just treat txt files.
625990b0091ae35668706d06
class TestResponse: <NEW_LINE> <INDENT> @pytest.fixture <NEW_LINE> def mock_response(self) -> MagicMock: <NEW_LINE> <INDENT> mock_response = MagicMock(RequestsResponse) <NEW_LINE> mock_response.url = "https://fake.com" <NEW_LINE> mock_response.json.return_value = { "status_code": 1, "number_of_page_results": 1, "number...
Tests for the Response.
625990b0627d3e7fe0e08f4b
class MultiDict(object): <NEW_LINE> <INDENT> def __init__(self, initial, group_callback=None): <NEW_LINE> <INDENT> self.items_list = [] <NEW_LINE> self.items_dict = {} <NEW_LINE> for item in initial: <NEW_LINE> <INDENT> if group_callback is not None: <NEW_LINE> <INDENT> group = group_callback(item) <NEW_LINE> <DEDENT> ...
Given a queryset or a list, group it by the group attribute of each item but still preserv the original list navigation, giving a bidimensional access.
625990b0091ae35668706d0a
class YetiBinarySensor(YetiEntity, BinarySensorEntity): <NEW_LINE> <INDENT> def __init__( self, api: Yeti, coordinator: DataUpdateCoordinator, name: str, description: BinarySensorEntityDescription, server_unique_id: str, ) -> None: <NEW_LINE> <INDENT> super().__init__(api, coordinator, name, server_unique_id) <NEW_LINE...
Representation of a Goal Zero Yeti sensor.
625990b0c4546d3d9def830c
class Error(Schema): <NEW_LINE> <INDENT> codes: List[str]
**email_already_use**: на данную почту уже зарегистрирован аккаунт; **password_too_short**: введенный пароль сильно короткий; **password_entirely_numeric**: пароль состоит только из цифр; **invalid_email**: введен некорректный email **invalid_full_name**: неправильный формат ФИО **invalid_password**: неправильный ...
625990b0627d3e7fe0e08f51
class MissingRuntimeError(Error): <NEW_LINE> <INDENT> pass
Raised when the `runtime` field is omitted for a non-VM.
625990b0187af65679d2ac57
class reify(): <NEW_LINE> <INDENT> def __init__(self, wrapped): <NEW_LINE> <INDENT> self.wrapped = wrapped <NEW_LINE> update_wrapper(self, wrapped) <NEW_LINE> <DEDENT> def __get__(self, inst, objtype=None): <NEW_LINE> <INDENT> if inst is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> val = self.wrapped(inst)...
From https://github.com/Pylons/pyramid and their BSD-style license
625990b0091ae35668706d14
class CommandManager(cliff.commandmanager.CommandManager): <NEW_LINE> <INDENT> def __init__(self, namespace, convert_underscores=True): <NEW_LINE> <INDENT> self.group_list = [] <NEW_LINE> super(CommandManager, self).__init__(namespace, convert_underscores) <NEW_LINE> <DEDENT> def load_commands(self, namespace): <NEW_LI...
Add additional functionality to cliff.CommandManager Load additional command groups after initialization Add _command_group() methods
625990b0627d3e7fe0e08f59
class Card: <NEW_LINE> <INDENT> def __init__(self, rank, suit): <NEW_LINE> <INDENT> if rank not in all_ranks: <NEW_LINE> <INDENT> raise InvalidRank('Invalid rank input to constructor: {}' .format(rank)) <NEW_LINE> <DEDENT> if suit not in all_suits: <NEW_LINE> <INDENT> raise InvalidSuit('Inv...
Instances of this class represent a single card in a deck of 52.
625990b0c4546d3d9def8313
class Player(Spectator): <NEW_LINE> <INDENT> @classproperty <NEW_LINE> def MODEL_RULES(cls): <NEW_LINE> <INDENT> rules = super(Player, cls).MODEL_RULES <NEW_LINE> rules.update({ 'hand': ('hand', DataModel, lambda x: x.model), 'team': ('team', str, None), 'abandoned': ('abandoned', bool, None) }) <NEW_LINE> return rules...
Game player. Init Parameters: user -- The user object. team -- The player's team. Properties: :type team: str -- The player's team identifier.
625990b0187af65679d2ac5b
class DjContext(object): <NEW_LINE> <INDENT> def get_context(self): <NEW_LINE> <INDENT> raise NotImplemented()
Rappresenta una classe astratta da utilizzare per ottenere un oggetto Context
625990b0c4546d3d9def8315
class Interpolation: <NEW_LINE> <INDENT> POLY = 'poly' <NEW_LINE> LINEAR = 'linear' <NEW_LINE> SPLINE = 'spline' <NEW_LINE> def __init__(self, px: np.ndarray, py: np.ndarray, typ): <NEW_LINE> <INDENT> self.px = px <NEW_LINE> self.py = py <NEW_LINE> if typ == self.POLY: <NEW_LINE> <INDENT> self.ipfunc = _PolynomialInter...
插值算法
625990b0c4546d3d9def8317
class TestParserRejectsEmptyCondition(_ATestParserRejects): <NEW_LINE> <INDENT> pass
Tests if the parser rejects an empty condition string.
625990b1091ae35668706d25
class PipelineService(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._pipeline = PennPipeline() <NEW_LINE> <DEDENT> def parse_text(self, request): <NEW_LINE> <INDENT> text = request.in_ <NEW_LINE> rospy.loginfo("NLP pipeline request: %r" % text) <NEW_LINE> response = self._pipeline.parse_text(text)...
Provides a connection to the pipeline via a ROS service.
625990b1627d3e7fe0e08f67
class Timeservers(NodeConfigFileSection): <NEW_LINE> <INDENT> keys = ("OVIRT_NTP",) <NEW_LINE> @NodeConfigFileSection.map_and_update_defaults_decorator <NEW_LINE> def update(self, servers): <NEW_LINE> <INDENT> assert type(servers) is list <NEW_LINE> servers = [i.strip() for i in servers] <NEW_LINE> servers = [i for i i...
Configure timeservers >>> from ovirt.node.utils import fs >>> n = Timeservers(fs.FakeFs.File("dst")) >>> servers = ["10.0.0.4", "10.0.0.5", "0.example.com"] >>> n.update(servers) >>> data = n.retrieve() >>> all([servers[idx] == s for idx, s in enumerate(data["servers"])]) True >>> n.update([]) >>> n.retrieve() {'serve...
625990b1c4546d3d9def8319
class StartOperation(VDOOperation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(StartOperation, self).__init__(checkBinaries=True) <NEW_LINE> <DEDENT> @exclusivelock <NEW_LINE> def execute(self, args): <NEW_LINE> <INDENT> self.applyToVDOs(args, self._startVDO, readonly=False) <NEW_LINE> <DEDENT> @...
Implements the start command.
625990b1627d3e7fe0e08f69
class CT_ChartLines(BaseOxmlElement): <NEW_LINE> <INDENT> spPr = ZeroOrOne("c:spPr", successors=())
Used for `c:majorGridlines` and `c:minorGridlines`. Specifies gridlines visual properties such as color and width.
625990b1c4546d3d9def831a
class CompleteCertificateResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CertificateId = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.CertificateId = params.get("CertificateId") <NEW_LINE> self.RequestId = pa...
CompleteCertificate返回参数结构体
625990b1187af65679d2ac63
class TestMpiInstitution(BaseTest): <NEW_LINE> <INDENT> def test_subprocess_called_correctly(self): <NEW_LINE> <INDENT> fix = MpiInstitution('var_components.nc', '/a') <NEW_LINE> fix.apply_fix() <NEW_LINE> self.mock_subprocess.assert_called_once_with( "ncatted -h -a institution,global,o,c," "'Max Planck Institute for M...
Test MpiInstitution
625990b1627d3e7fe0e08f71
class Movie(Video): <NEW_LINE> <INDENT> MPAA_RATINGS = ['G', 'PG', 'PG-13', 'R', ''] <NEW_LINE> def __init__( self, title, synopsis, rating, poster_url, duration, starring, trailer_id, mpaa_rating, year ): <NEW_LINE> <INDENT> Video.__init__( self, title, synopsis, rating, poster_url, duration, starring ) <NEW_LINE> sel...
This class provides a way to store movie-related information. Parameters: ---------- title (str) - Title of the movie synopsis (str) - Short summary of the movie rating (str) - Rating from viewers of the movie poster_url (str) - URL pointing to the poster image of the movie duration (int) - Length of the movie in minu...
625990b1627d3e7fe0e08f73
class InvalidDurationError(Error): <NEW_LINE> <INDENT> pass
Raised when an invalid EXEMPTION_DURATION is provided.
625990b1187af65679d2ac6a