code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ArPyRetFunctor_Bool(ArRetFunctor_Bool,ArPyFunctor): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> this = _AriaPy.new_ArPyRetFunctor_Bool(*args) <...
Proxy of C++ ArPyRetFunctor_Bool class
6259903696565a6dacd2d82d
class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'Name', 'type': 'str'}, 'display_name': {'key': 'DisplayName', 'type': 'str'}, 'description': {'key': 'Description', 'type': 'str'}, 'help_url': {'key': 'HelpUrl', 'type': 'str...
Static definitions of the ProactiveDetection configuration rule (same values for all components). :param name: The rule name :type name: str :param display_name: The rule name as it is displayed in UI :type display_name: str :param description: The rule description :type description: str :param help_url: URL which dis...
625990368c3a8732951f769b
class RosMsgInt64(RosSchema): <NEW_LINE> <INDENT> _valid_ros_msgtype = std_msgs.Int64 <NEW_LINE> _generated_ros_msgtype = std_msgs.Int64 <NEW_LINE> data = RosInt64()
RosMsgInt64 handles serialization from std_msgs.Int64 to python dict and deserialization from python dict to std_msgs.Int64 You should use strict Schema to trigger exceptions when trying to manipulate an unexpected type. >>> schema = RosMsgInt64(strict=True) >>> rosmsgFortytwo = std_msgs.Int64(data=42) >>> unmarshal...
6259903666673b3332c31537
class Validator(GenericValidator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.regexp = re.compile(r'^\d{9,10}$') <NEW_LINE> <DEDENT> def validate(self, vat_number): <NEW_LINE> <INDENT> if super(Validator, self).validate(vat_number) is False: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> vat...
For rules see /docs/VIES-VAT Validation Routines-v15.0.doc
625990368c3a8732951f769c
class TestExtLinkBugs(TestCase): <NEW_LINE> <INDENT> def test_issue_212(self): <NEW_LINE> <INDENT> def closer(x): <NEW_LINE> <INDENT> def w(): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if x: <NEW_LINE> <INDENT> x.close() <NEW_LINE> <DEDENT> <DEDENT> except IOError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> <DEDEN...
Bugs: Specific regressions for external links
62599036d164cc61758220b7
class Apcer(Metric): <NEW_LINE> <INDENT> def __init__(self, name, threshold=None): <NEW_LINE> <INDENT> super(Apcer, self).__init__(name, 'APCER') <NEW_LINE> self.threshold = threshold <NEW_LINE> self.threshold_needed = True <NEW_LINE> <DEDENT> def compute(self, y_score, y_true): <NEW_LINE> <INDENT> attack_ids = np.uniq...
Attack Presentation Classification Error Rate: proportion of attack presentations incorrectly classified as bona fide presentations
62599036287bf620b6272d2d
class Actor(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fc1_units=128, fc2_units=64): <NEW_LINE> <INDENT> super(Actor, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fc1 = nn.Linear(state_size, fc1_units) <NEW_LINE> self.bn1 = nn.BatchNorm1d(state_s...
Actor (Policy) Model.
6259903676d4e153a661db13
class CoordTwoDim(BaseObject): <NEW_LINE> <INDENT> description = 'A two-dimensional coordinate (a pair of reals).' <NEW_LINE> default_value = [0.0, 0.0] <NEW_LINE> SCHEMA = { 'type': 'list', 'len': 2, 'items': Real.SCHEMA, }
2D coordinate class.
62599036596a897236128de0
class Command(object): <NEW_LINE> <INDENT> def __init__(self, manager): <NEW_LINE> <INDENT> self.manager = manager <NEW_LINE> <DEDENT> def get_usage(self): <NEW_LINE> <INDENT> return "" <NEW_LINE> <DEDENT> def get_help(self): <NEW_LINE> <INDENT> return self.__class__.__doc__.strip() <NEW_LINE> <DEDENT> def run(self, ar...
Base class for a cloud command.
625990360a366e3fb87ddb2a
class CurveFit(AnalysisBase): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> super().__init__(options) <NEW_LINE> self.residual = None <NEW_LINE> self.poly = None <NEW_LINE> <DEDENT> def _xaxis(self): <NEW_LINE> <INDENT> if 'xaxis' in self.options: <NEW_LINE> <INDENT> xaxis = self.options['xaxis']...
Curve Fit
62599036cad5886f8bdc591d
class ProjManAPIView(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> response = {'url': request.build_absolute_uri('projects')} <NEW_LINE> return Response(response)
List ProjMan API endpoints
62599036dc8b845886d546f7
class DirectoryClient(): <NEW_LINE> <INDENT> def __init__(self, address, port): <NEW_LINE> <INDENT> self._address = address <NEW_LINE> self._port = port <NEW_LINE> <DEDENT> def register(self, address, port): <NEW_LINE> <INDENT> context = zmq.Context() <NEW_LINE> socket = context.socket(zmq.REQ) <NEW_LINE> socket.connec...
Directory Client Class
6259903650485f2cf55dc0c3
@six.add_metaclass(_template_meta(b"Can not found item with matched id", "找不到数据库对象")) <NEW_LINE> class IDError(CGTeamWorkException): <NEW_LINE> <INDENT> pass
Indicate can't specify shot id on cgtw.
625990361f5feb6acb163d37
class HtmlPrettifyMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if not settings.PRETTIFY_HTML: <NEW_LINE> <INDENT> raise MiddlewareNotUsed <NEW_LINE> <DEDENT> <DEDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if response['Content-Type'].split(...
HTML code prettification middleware.
62599036d99f1b3c44d067e9
class PhysicalHost(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> hostname = models.CharField(max_length=256, null=False) <NEW_LINE> service = models.TextField(null=True) <NEW_LINE> machine_room = models.TextField(null=True) <NEW_LINE> cabinet = models.TextField(null=True) <NEW_LI...
hostname 主机名 purchase 购买时间 service 维保时长 machine_room 机房 cabinet 机柜号 sn 主板sn号 主机唯一标示 datacenter 关联datacenter
62599036287bf620b6272d2f
class open(): <NEW_LINE> <INDENT> async def request_v4(self, record): <NEW_LINE> <INDENT> record.tape['path'] = record.b.device.decode() <NEW_LINE> if(record.b.mode == const.NDMP_TAPE_READ_MODE): <NEW_LINE> <INDENT> mode = os.O_RDONLY|os.O_NONBLOCK <NEW_LINE> <DEDENT> elif(record.b.mode in [const.NDMP_TAPE_WRITE_MODE, ...
This request opens the tape device in the specified mode. This operation is required before any other tape requests can be executed.
625990363eb6a72ae038b7ad
class Icontentview(form.Schema, IImageScaleTraversable): <NEW_LINE> <INDENT> pass
Description of the Example Type
6259903673bcbd0ca4bcb3cd
@python_2_unicode_compatible <NEW_LINE> class Post(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=70) <NEW_LINE> body = models.TextField() <NEW_LINE> created_time = models.DateTimeField() <NEW_LINE> modified_time = models.DateTimeField() <NEW_LINE> excerpt = models.CharField(max_length=200, blan...
文章的数据库表稍微复杂一点,主要是涉及的字段更多。
62599036ac7a0e7691f7362e
class VOCSemanticSegmentationDataset(VOCSemanticSegmentationDataset): <NEW_LINE> <INDENT> def __init__(self, data_dir='auto', split='train'): <NEW_LINE> <INDENT> if split not in ['train', 'trainval', 'val', 'test']: <NEW_LINE> <INDENT> raise ValueError( 'please pick split from \'train\', \'trainval\', \'val\', ' '\'tes...
Dataset class for the semantic segmantion task of PASCAL `VOC2012`_. The class name of the label :math:`l` is :math:`l` th element of :obj:`chainercv.datasets.voc_semantic_segmentation_label_names`. .. _`VOC2012`: http://host.robots.ox.ac.uk/pascal/VOC/voc2012/ Args: data_dir (string): Path to the root of the tra...
6259903691af0d3eaad3af76
class CrocodocLoaderService(object): <NEW_LINE> <INDENT> user = None <NEW_LINE> reviewdocument = None <NEW_LINE> service = None <NEW_LINE> @property <NEW_LINE> def crocodoc_uuid_recorded(self): <NEW_LINE> <INDENT> return self.reviewdocument.crocodoc_uuid not in [None, ''] <NEW_LINE> <DEDENT> def __init__(self, user, re...
Class to provide kwargs used to populate html template with params also used to provide url
625990364e696a045264e6c5
class PrivacySettingsForm(SiteSettingsForm): <NEW_LINE> <INDENT> terms_of_service_url = forms.URLField( label=_('Terms of service URL'), required=False, help_text=_('URL to your terms of service. This will be displayed on ' 'the My Account page and during login and registration.'), widget=forms.widgets.URLInput(attrs={...
Site-wide user privacy settings for Review Board.
625990368c3a8732951f769f
class IsActive(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> return request.user.is_active
Object-level permission to only allow owners of an object to edit it. Assumes the model instance has an `owner` attribute.
625990361d351010ab8f4c61
class WebsocketToPubSubEmitter: <NEW_LINE> <INDENT> def __init__(self, ws_url_arg, project_id_arg, topic_arg, seconds_arg=None): <NEW_LINE> <INDENT> self.publisher = PubSubPublisher(project_id_arg, topic_arg) <NEW_LINE> self.url = ws_url_arg <NEW_LINE> self.seconds = seconds_arg <NEW_LINE> self.ws = None <NEW_LINE> sel...
Class responsible for reading data from any Websocket (ws_url_arg) and sending it to pub/sub topic using PubSubPublisher class.
625990368a43f66fc4bf32d2
class CuratedExhibitAdmin(admin.StackedInline): <NEW_LINE> <INDENT> model = CuratedExhibit <NEW_LINE> raw_id_fields = ['exhibit'] <NEW_LINE> fields = [ 'exhibit', 'custom_title', 'thumbnail', 'publish_date' ] <NEW_LINE> extra = 0
Admin for a CuratedExhibit
625990368e05c05ec3f6f6fe
class Last: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def exec_num(): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def exec_np(data, ignore_nodata=True, dimension=0): <NEW_LINE> <INDENT> if is_empty(data): <NEW_LINE> <INDENT> return np.nan <NEW_LINE> <DEDENT> n_dims = len(data.shape) <NEW_LI...
Class implementing all 'last' processes.
6259903621bff66bcd723dad
class SafariExtensions(BaseModel): <NEW_LINE> <INDENT> uid = BigIntegerField(help_text="The local user that owns the extension") <NEW_LINE> name = TextField(help_text="Extension display name") <NEW_LINE> identifier = TextField(help_text="Extension identifier") <NEW_LINE> version = TextField(help_text="Extension long ve...
Safari browser extension details for all users. Examples: select count(*) from users JOIN safari_extensions using (uid)
62599036b57a9660fecd2bc2
class SetUpCaches(object): <NEW_LINE> <INDENT> def __init__(self, client_root): <NEW_LINE> <INDENT> self.canonical_path = CanonicalPath() <NEW_LINE> self.includepath_map = RelpathMapToIndex() <NEW_LINE> self.directory_map = DirectoryMapToIndex() <NEW_LINE> self.realpath_map = CanonicalMapToIndex(self.canonical_path.Can...
Erect the edifice of caches. Instance variables: includepath_map: RelpathMapToIndex directory_map: DirectoryMapToIndex realpath_map: CanonicalMapToIndex canonical_path: CanonicalPath build_stat_cache: BuildStatCache dirname_cache: DirnameCache simple_build_stat: SimpleBuildStat client_root: a path su...
62599036287bf620b6272d30
class PositionalArgument(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError("Please use the parameterized constructor.") <NEW_LINE> <DEDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name
A positional argument definition (needed when registering a command handler).
62599036507cdc57c63a5ee1
class Station(BaseModel): <NEW_LINE> <INDENT> id_station = PrimaryKeyField() <NEW_LINE> station_number = IntegerField() <NEW_LINE> station_name = CharField(255) <NEW_LINE> contract_name = CharField(255) <NEW_LINE> address = CharField(255) <NEW_LINE> banking = BooleanField() <NEW_LINE> bonus = BooleanField() <NEW_LINE> ...
Represents the Station SQL table
625990363eb6a72ae038b7af
class VerifiedHTTPSConnection(HTTPSConnection): <NEW_LINE> <INDENT> cert_reqs = None <NEW_LINE> ca_certs = None <NEW_LINE> ssl_version = None <NEW_LINE> assert_fingerprint = None <NEW_LINE> def set_cert(self, key_file=None, cert_file=None, cert_reqs=None, ca_certs=None, assert_hostname=None, assert_fingerprint=None): <...
Based on httplib.HTTPSConnection but wraps the socket with SSL certification.
625990366e29344779b01799
class SearchSubscription(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(UserProxy, related_name='search_subscriptions', help_text='The user who subscribed to the search.') <NEW_LINE> dataset = models.ForeignKey(Dataset, related_name='search_subscriptions', null=True, default=None, help_text='The dataset to...
A log of a user search.
62599036596a897236128de4
class SimpleTokenizer(TokenizerBase): <NEW_LINE> <INDENT> def __init__(self, strip_chars=None, index=None, ): <NEW_LINE> <INDENT> super(SimpleTokenizer, self).__init__(index=index) <NEW_LINE> if strip_chars is not None: <NEW_LINE> <INDENT> self.strip_chars = strip_chars <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> sel...
It will split a text on any white-char (like python's str.split()) and strip any chars from beginning and end of tokens contained in strip_chars.
6259903663f4b57ef0086617
class Predecessor(object): <NEW_LINE> <INDENT> def __init__(self, props=None, base_obj=None): <NEW_LINE> <INDENT> self._base = None <NEW_LINE> if base_obj is not None: <NEW_LINE> <INDENT> self._base = base_obj <NEW_LINE> <DEDENT> self._in_critical_path = Boolean() <NEW_LINE> self._invalid = Boolean() <NEW_LINE> self._l...
Smartsheet Predecessor data model.
625990368a349b6b43687388
class ReceiverInstance(BaseHandler): <NEW_LINE> <INDENT> @transport_security_check('receiver') <NEW_LINE> @authenticated('receiver') <NEW_LINE> @inlineCallbacks <NEW_LINE> def get(self): <NEW_LINE> <INDENT> receiver_status = yield get_receiver_settings(self.current_user.user_id, self.request.language) <NEW_LINE> self.s...
This class permit to the receiver to modify some of their fields: Receiver.description Receiver.password and permit the overall view of all the Tips related to the receiver GET and PUT /receiver/preferences
62599036b830903b9686ed1d
class ServiceInterface(metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, service_mode: ServiceMode , exit_callback=None): <NEW_LINE> <INDENT> self._service_mode = service_mode <NEW_LINE> self._exit_callback = exit_callback <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_async(self): <NEW_LINE> <INDENT> return ...
interface for services
625990368c3a8732951f76a1
class pyAlarmAlarmTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_CreateAlarm(self): <NEW_LINE> <INDENT> alarmTime = datetime.time(5, 0, 0) <NEW_LINE> alarm = Alarm("Work", "Monday", "elixir", 5, False, alarmTime, True) <NEW_LINE> self.assertEqual(Fals...
description of class
62599036c432627299fa4140
@base.ReleaseTracks(base.ReleaseTrack.ALPHA) <NEW_LINE> class RemoveProfileAlpha(RemoveProfile): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> os_arg = base.ChoiceArgument( '--operating-system', choices=('linux', 'windows'), required=False, default='linux', help_str='Specifies the p...
Remove the posix account information for the current user.
6259903666673b3332c3153d
class ContentType(LazyLoader): <NEW_LINE> <INDENT> def __init__(self, root, filename='[Content_Types].xml'): <NEW_LINE> <INDENT> super(ContentType, self).__init__(root=root, filename=filename) <NEW_LINE> self.ovr = OrderedDict() <NEW_LINE> <DEDENT> def register_overrides(self): <NEW_LINE> <INDENT> self.load() <NEW_LINE...
ContentType reflects [Content_Types].xml
62599036796e427e5384f8c4
class SingleConditionMethod(AnalysisMethod): <NEW_LINE> <INDENT> def __init__(self, short_name, long_name, short_desc, long_desc, ctrldata, annotation_path, output, replicates="Sum", normalization=None, LOESS=False, ignoreCodon=True, NTerminus=0.0, CTerminus=0.0, wxobj=None): <NEW_LINE> <INDENT> AnalysisMethod.__init__...
Class to be inherited by analysis methods that determine essentiality in a single condition (e.g. Gumbel, Binomial, HMM).
6259903650485f2cf55dc0c7
class MagmasAndAdditiveMagmas(Category_singleton): <NEW_LINE> <INDENT> class SubcategoryMethods: <NEW_LINE> <INDENT> @cached_method <NEW_LINE> def Distributive(self): <NEW_LINE> <INDENT> return self._with_axiom('Distributive') <NEW_LINE> <DEDENT> <DEDENT> def super_categories(self): <NEW_LINE> <INDENT> return [Magmas()...
The category of sets `(S,+,*)` with an additive operation '+' and a multiplicative operation `*` EXAMPLES:: sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas sage: C = MagmasAndAdditiveMagmas(); C Category of magmas and additive magmas This is the base category for the ...
62599036d53ae8145f9195ad
class EditInternalAd(forms.Form): <NEW_LINE> <INDENT> internalad_id = forms.ModelChoiceField(required=False, queryset=Internalad.objects.all(), label='Campaign Name') <NEW_LINE> contentSpecific = forms.CharField(required=False, max_length=30, label='Content Specific') <NEW_LINE> keywords = forms.CharField(required=Fals...
# The EditInternalAd Class will display # form to Update internal ads by selecting # internal ad displayed in combobox
62599036507cdc57c63a5ee3
class Requests(_DownloadableProxyMixin, _ItemsResourceProxy): <NEW_LINE> <INDENT> def add(self, url, status, method, rs, duration, ts, parent=None, fp=None): <NEW_LINE> <INDENT> return self._origin.add( url, status, method, rs, parent, duration, ts, fp=fp)
Representation of collection of job requests. Not a public constructor: use :class:`~scrapinghub.client.jobs.Job` instance to get a :class:`Requests` instance. See :attr:`~scrapinghub.client.jobs.Job.requests` attribute. Please note that :meth:`list` method can use a lot of memory and for a large amount of logs it's ...
6259903676d4e153a661db16
class SeriesViewSet(aaSembleV1ViewSet): <NEW_LINE> <INDENT> lookup_field = selff.default_lookup_field <NEW_LINE> lookup_value_regex = selff.default_lookup_value_regex <NEW_LINE> queryset = buildsvc_models.Series.objects.all() <NEW_LINE> serializer_class = selff.serializers.SeriesSerializer <NEW_LINE> def get_queryset(s...
API endpoint that allows series to be viewed or edited.
62599036cad5886f8bdc5920
class NotFollowerTwFriend(models.Model): <NEW_LINE> <INDENT> id_str = models.CharField(max_length=25, unique=True, primary_key=True) <NEW_LINE> screen_name = models.CharField(max_length=20, unique=True) <NEW_LINE> name = models.CharField(max_length=25) <NEW_LINE> description = models.TextField(default='') <NEW_LINE> st...
Model for Twitter friend who aren't follower
6259903630c21e258be99957
class WorkloadOrder(BASE, NovaBase): <NEW_LINE> <INDENT> __tablename__ = 'workload_orders' <NEW_LINE> id = Column(Integer, primary_key=True, autoincrement=True) <NEW_LINE> status = Column(String(255)) <NEW_LINE> workload_id = Column(Integer) <NEW_LINE> instances = Column(Integer) <NEW_LINE> memory_mb = Column(Integer) ...
Represents a Order related to a Workload.
62599036b57a9660fecd2bc5
class ChangeUserForm(happyforms.ModelForm): <NEW_LINE> <INDENT> email = forms.EmailField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('first_name', 'last_name', 'email') <NEW_LINE> <DEDENT> def _clean_names(self, data): <NEW_LINE> <INDENT> if not re.match(r'(^[A-Za-z\' ]+$)', data): <N...
Form to change user details.
625990368a349b6b4368738a
class FunderCompanyProcurementTable(tables.Table): <NEW_LINE> <INDENT> company = tables.LinkColumn('serbia:companies', args=[A('company.company.pk')], accessor='company.company.name', verbose_name='company') <NEW_LINE> procurement = tables.LinkColumn('serbia:procurements', args=[A('procurement.pk')], accessor='procurem...
political donors companies in procurement table
625990368c3a8732951f76a3
class PrettyDict(AttrDict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> _BREAK_LINES = kwargs.pop("breakLines", False) <NEW_LINE> super(PrettyDict, self).__init__(*args, **kwargs) <NEW_LINE> dict.__setattr__(self, "_BREAK_LINES", _BREAK_LINES) <NEW_LINE> <DEDENT> def __repr__(self): <NE...
Displays an abbreviated repr of values where possible. Inherits from AttrDict, so a callable value will be lazily converted to an actual value.
6259903650485f2cf55dc0c9
class TestCanonicalMAFunction(_ATestCanonical): <NEW_LINE> <INDENT> _condition = _canonical_parse = (u'foo("bar", 955CCA77, >, <, >=, <=, ==, ' u'!=)')
Tests if a multi-argument function parses correctly. Also checks all types of arguments.
6259903676d4e153a661db17
class Unsubscribed(Message): <NEW_LINE> <INDENT> MESSAGE_TYPE = 35 <NEW_LINE> def __init__(self, request, subscription=None, reason=None): <NEW_LINE> <INDENT> assert (type(request) is int) <NEW_LINE> assert (subscription is None or type(subscription) is int) <NEW_LINE> assert(reason is None or isinstance(reason, string...
A WAMP ``UNSUBSCRIBED`` message. Formats: * ``[UNSUBSCRIBED, UNSUBSCRIBE.Request|id]`` * ``[UNSUBSCRIBED, UNSUBSCRIBE.Request|id, Details|dict]``
6259903673bcbd0ca4bcb3d4
class Random_enhance_spl(object): <NEW_LINE> <INDENT> def __init__(self, min_value = -0.2, max_value = 0.2): <NEW_LINE> <INDENT> self.enhance_number = random.uniform(min_value, max_value) <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> spec = sample[0] <NEW_LINE> spec = spec.squeeze() <NEW_LINE> spe...
random enhance sound pressure level on spectrogram
625990364e696a045264e6c8
class BucketScanLog(object): <NEW_LINE> <INDENT> def __init__(self, log_dir, name): <NEW_LINE> <INDENT> self.log_dir = log_dir <NEW_LINE> self.name = name <NEW_LINE> self.fh = None <NEW_LINE> self.count = 0 <NEW_LINE> <DEDENT> @property <NEW_LINE> def path(self): <NEW_LINE> <INDENT> return os.path.join(self.log_dir, "%...
Offload remediated key ids to a disk file in batches A bucket keyspace is effectively infinite, we need to store partial results out of memory, this class provides for a json log on disk with partial write support. json output format: - [list_of_serialized_keys], - [] # Empty list of keys at end when we close the b...
62599036d10714528d69ef31
@dataclass <NEW_LINE> class Grid1D(Grid): <NEW_LINE> <INDENT> cells: List[Cell] <NEW_LINE> def __len__(self): <NEW_LINE> <INDENT> return len(self.cells) <NEW_LINE> <DEDENT> def __getitem__(self, i): <NEW_LINE> <INDENT> return self.cells[i] <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "".join(list(...
Represents a grid of cells.
625990368c3a8732951f76a5
class PostGroupIdDatasetSpec(): <NEW_LINE> <INDENT> def __init__(self, group_id, dataset_add_list, dataset_remove_list): <NEW_LINE> <INDENT> self.group_id = group_id <NEW_LINE> self.dataset_add_list = dataset_add_list <NEW_LINE> self.dataset_remove_list = dataset_remove_list <NEW_LINE> <DEDENT> def json(self): <NEW_LIN...
Class that helps validate and format the data being sent to LI when modifying datasets associated to a group. DISCLAIMER: At the time of writing this API was a technical preview.
62599036d18da76e235b79f5
class S3BucketPolicyWildcardActionRule(GenericWildcardPolicyRule): <NEW_LINE> <INDENT> AWS_RESOURCE = S3BucketPolicy
Soon to be replaced by `GenericResourceWildcardPolicyRule`. Checks for use of the wildcard `*` character in the Actions of Policy Documents of S3 Bucket Policies. This rule is a subclass of `GenericWildcardPolicyRule`. Filters context: | Parameter | Type | Description ...
6259903650485f2cf55dc0cb
class Metric(object): <NEW_LINE> <INDENT> def sample(self, value, sample_rate, timestamp=None): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def flush(self, timestamp): <NEW_LINE> <INDENT> raise NotImplementedError()
A base metric class that accepts points, slices them into time intervals and performs roll-ups within those intervals.
625990361f5feb6acb163d3f
class user(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> user = models.CharField(max_length=64, unique=True) <NEW_LINE> first_name = models.CharField(_('Nombre'), max_length=30, blank=True) <NEW_LINE> last_name = models.CharField(_('Apellidos'), max_length=30, blank=True) <NEW_LINE> is_active = models.Boolea...
docstring for user.
62599036287bf620b6272d36
class LazyDynamicMapping(LazyDynamicBase, Mapping): <NEW_LINE> <INDENT> def __init__( self, data: Mapping = {}, resolver: DataResolver = None, scope: DataResolverScope = None, parent=None, ): <NEW_LINE> <INDENT> super().__init__(data, resolver, scope, parent) <NEW_LINE> self._expressions = self._data.get("@expressions"...
Lazy dynamic implementation of Mapping.
6259903650485f2cf55dc0cc
class Shape(object): <NEW_LINE> <INDENT> def __init__(self, raw_shape, dim=None): <NEW_LINE> <INDENT> super(Shape, self).__init__() <NEW_LINE> self.dim = dim <NEW_LINE> w = len(raw_shape[0]) <NEW_LINE> for line in raw_shape: <NEW_LINE> <INDENT> if len(line) != w: <NEW_LINE> <INDENT> print("len('{}') != len('{}')".forma...
Shape.values is array of strings of bits representing shape
625990363eb6a72ae038b7b5
class Cifar10(tfds.core.GeneratorBasedBuilder): <NEW_LINE> <INDENT> VERSION = tfds.core.Version("1.0.2") <NEW_LINE> def _info(self): <NEW_LINE> <INDENT> return tfds.core.DatasetInfo( builder=self, description=("The CIFAR-10 dataset consists of 60000 32x32 colour " "images in 10 classes, with 6000 images per class. Ther...
CIFAR-10.
62599036be383301e0254962
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_...
Modelo que representa un autor
62599036d53ae8145f9195b1
class TestStreamingTradex(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return StreamingTradex...
StreamingTradex unit test stubs
6259903676d4e153a661db18
class TournamentDetailView(generic.DetailView): <NEW_LINE> <INDENT> context_object_name = 'tournament' <NEW_LINE> template_name = 'housing/tournament-detail.html' <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return get_object_or_404( models.Tournament, slug=self.kwargs.get('slug'), slug_key=self.kwargs.get('slu...
View the details of a specific tournament.
6259903671ff763f4b5e88e7
class TestMoat: <NEW_LINE> <INDENT> def test_Moat_S2(self): <NEW_LINE> <INDENT> data_string = "043e3702010000aabb611d12e12b0d09475648353130325f43423942030388ec02010515ff0010AABBCCDDEEFF11111111d46103cbbe0a0000aa" <NEW_LINE> data = bytes(bytearray.fromhex(data_string)) <NEW_LINE> ble_parser = BleParser() <NEW_LINE> sens...
Tests for the Moat parser
625990361d351010ab8f4c68
class Bitfield(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def from_bytes(byte_array): <NEW_LINE> <INDENT> return Bitfield(len(byte_array) * 8, initializer=byte_array) <NEW_LINE> <DEDENT> def __init__(self, length, default=False, initializer=None): <NEW_LINE> <INDENT> self._length = length <NEW_LINE> num_byte...
Naive implementation of a vector of booleans with __getitem__ and __setitem__.
6259903694891a1f408b9fa0
class ClarifyRepeat(Move): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Move.__init__(self, name = 'clarify_step_repeat', prior_moves = ['Recept repeat'], context = [['recept_stappen',5,{'no-input': 0.0, 'no-match': 0.0}],['recept_toelichting',5,{'no-input': 0.0, 'no-match': 0.0}]], suggestions = ['volge...
ClarifyRepeat ===== Class to model the preconditions and effects of the move to repeat a step
6259903630c21e258be9995a
class Ship: <NEW_LINE> <INDENT> def __init__(self, nam, att, dfns, hul, shld): <NEW_LINE> <INDENT> self._name = nam <NEW_LINE> self._attack = att <NEW_LINE> self._defense = dfns <NEW_LINE> self._shields = shld <NEW_LINE> self._hull = hul <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> retur...
Base class for different ship types
6259903696565a6dacd2d833
class Cert(cert_manager.Cert): <NEW_LINE> <INDENT> def __init__(self, certificate, private_key, intermediates=None, private_key_passphrase=None): <NEW_LINE> <INDENT> self.certificate = certificate <NEW_LINE> self.intermediates = intermediates <NEW_LINE> self.private_key = private_key <NEW_LINE> self.private_key_passphr...
Representation of a Cert for local storage.
6259903615baa723494630e9
class LunchBot: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.BOT_ID = os.environ.get("BOT_ID") <NEW_LINE> self.BOT_TOKEN = os.environ.get('SLACK_BOT_TOKEN') <NEW_LINE> self.AT_BOT = "<@" + self.BOT_ID + ">" <NEW_LINE> self.slack_client = SlackClient(self.BOT_TOKEN) <NEW_LINE> self.EXAMPLE_COMMAND = ...
For using google maps to get lunch reccomendations over slack
62599036711fe17d825e1543
class Engine: <NEW_LINE> <INDENT> pass
Emulates SQLAlchemy look-a-like in our examples.
6259903666673b3332c31542
class ReadCase(object): <NEW_LINE> <INDENT> decimals=3 <NEW_LINE> def test_read_comment(self): <NEW_LINE> <INDENT> with open(self.expected_comment_file) as f: <NEW_LINE> <INDENT> expected_comment = f.next() <NEW_LINE> <DEDENT> with gro.open(self.test_file_name, decimals=self.decimals) as f: <NEW_LINE> <INDENT> f.next()...
Test reading a known mdrd file.
62599036a8ecb0332587236d
class Movable(Collidable): <NEW_LINE> <INDENT> def __init__(self, x, y, w, h, a, cb): <NEW_LINE> <INDENT> Collidable.__init__(self, x, y, w, h, a, cb) <NEW_LINE> self.speed = 3 <NEW_LINE> self.dx, self.dy = self.set_direction() <NEW_LINE> self.a_dict = {'idle': sorted(os.listdir('images/movable'), key=Movable.natural_k...
functions with 'a_' for assigning current animation (on move button pressed)
6259903607d97122c4217deb
class BackupProductionShinePostgres(luigi.Task): <NEW_LINE> <INDENT> task_namespace = 'backup' <NEW_LINE> host = luigi.Parameter(default='access') <NEW_LINE> service = luigi.Parameter(default='access_shinedb') <NEW_LINE> db = luigi.Parameter(default='shine') <NEW_LINE> remote_host_backup_folder = luigi.Parameter(defaul...
This task runs a Docker PostgreSQL backup task for a specific system (production Shine) and then pushes the backup file up to HDFS.
6259903650485f2cf55dc0cd
@unittest.skipIf(tests.MYSQL_VERSION >= (5, 7, 5), "MySQL {0} does not support old password auth".format( tests.MYSQL_VERSION_TXT)) <NEW_LINE> class BugOra18415927(tests.MySQLConnectorTests): <NEW_LINE> <INDENT> user = { 'username': 'nativeuser', 'password': 'nativeP@ss', } <NEW_LINE> def setUp(self): <NEW_LINE> <INDEN...
BUG#18415927: AUTH_RESPONSE VARIABLE INCREMENTED WITHOUT BEING DEFINED
6259903607d97122c4217dec
class WelcomePage(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> username = self.request.get('username') <NEW_LINE> if valid_username(username): <NEW_LINE> <INDENT> welcome_text = "<h1>Welcome, " + username + "!</h1>" <NEW_LINE> self.response.write(welcome_text) <NEW_LINE> <DEDENT> else...
Handles requests coming to "/welcome", builds Welcome page
62599036d53ae8145f9195b3
class ScreenBase: <NEW_LINE> <INDENT> WIDTH_PX = 256 <NEW_LINE> HEIGHT_PX = 240 <NEW_LINE> VISIBLE_HEIGHT_PX = 224 <NEW_LINE> VISIBLE_WIDTH_PX = 240 <NEW_LINE> def __init__(self, ppu, scale=3, vertical_overscan=False, horizontal_overscan=False): <NEW_LINE> <INDENT> self.ppu = ppu <NEW_LINE> self.width = self.WIDTH_PX i...
Base class for screens. Not library specific.
6259903676d4e153a661db19
class ValoresDao(object): <NEW_LINE> <INDENT> __banco='' <NEW_LINE> def __init__(self, banco): <NEW_LINE> <INDENT> self.__banco=banco <NEW_LINE> <DEDENT> def add(self,valores): <NEW_LINE> <INDENT> sql = "INSERT INTO `values`(`VALUE`, `DATETIME`, `tag_idTAG`) VALUES (%f"%valores.getValor()+",'"+str(valores.getDataHora()...
classdocs
62599036a4f1c619b294f72f
class Battery: <NEW_LINE> <INDENT> def __init__(self, battery_size=75): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print(f"This car has a {self.battery_size}-KWh battery") <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDENT> if self.b...
A simple attempt to model a battery for an electric car.
6259903673bcbd0ca4bcb3d8
class Condition(AttrDict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> for key, value in self.items(): <NEW_LINE> <INDENT> if not key.isidentifier() or iskeyword(key): <NEW_LINE> <INDENT> raise ValueError('Keys must be valid python expression...
Represent environmental parameters that are constant in time. Conditions (subclass of AttrDict) group environemental parameters of individual boxes or the whole BoxModelSystem. Conditions are constants. That means that they are assumed to not change in time and that their values must not be callables. Args: dict ...
6259903615baa723494630eb
class HttpEquiv(HtmlTagAttribute): <NEW_LINE> <INDENT> belongs_to = ['Meta']
Provides an HTTP header for the information/value of the content attribute
6259903694891a1f408b9fa1
class EventStatus(externals.atom.core.XmlElement): <NEW_LINE> <INDENT> _qname = GDATA_TEMPLATE % 'eventStatus' <NEW_LINE> value = 'value'
The gd:eventStatus element.
62599036d18da76e235b79f7
class RegisterHandler(BaseHandler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> mobile = self.json_args.get("mobile") <NEW_LINE> sms_code = self.json_args.get("phonecode") <NEW_LINE> password = self.json_args.get("password") <NEW_LINE> if not all([mobile, sms_code, password]): <NEW_LINE> <INDENT> return sel...
注册
62599036b57a9660fecd2bcc
@attr.s <NEW_LINE> class RowPanel(Panel): <NEW_LINE> <INDENT> collapsed = attr.ib(default=False, validator=instance_of(bool)) <NEW_LINE> panels = attr.ib(default=attr.Factory(list), validator=instance_of(list)) <NEW_LINE> collapsed = attr.ib(default=False, validator=instance_of(bool)) <NEW_LINE> def _iter_panels(self):...
Generates Row panel json structure. :param title: title of the panel :param collapsed: set True if row should be collapsed :param panels: list of panels in the row, only to be used when collapsed=True
62599036c432627299fa4148
class TestMachinesPkView(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = reverse(transitionscbv_machines_pk, args=('matter',)) <NEW_LINE> <DEDENT> def test_get_request_succeeds(self): <NEW_LINE> <INDENT> response = self.client.get(self.url) <NEW_LINE> eq_(response.status_code, 200) <NE...
Tests the transitionscbv_machines_pk FBV.
6259903616aa5153ce40163d
class VehicleStatsDecorationsBatteryMilliVolts(object): <NEW_LINE> <INDENT> openapi_types = { 'value': 'int' } <NEW_LINE> attribute_map = { 'value': 'value' } <NEW_LINE> def __init__(self, value=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> local_vars...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
625990360a366e3fb87ddb38
class TableOfContents(Report): <NEW_LINE> <INDENT> def __init__(self, database, options, user): <NEW_LINE> <INDENT> Report.__init__(self, database, options, user) <NEW_LINE> self._user = user <NEW_LINE> menu = options.menu <NEW_LINE> <DEDENT> def write_report(self): <NEW_LINE> <INDENT> self.doc.insert_toc()
This report class generates a table of contents for a book.
62599036be383301e0254967
class JSONBiserialisable(JSONSerialisable, JSONDeserialisable[SelfType], ABC): <NEW_LINE> <INDENT> @ensure_error_type(JSONSerialisationError, "Error copying object using JSON serialisation: {0}") <NEW_LINE> def json_copy(self, validate: bool = True) -> SelfType: <NEW_LINE> <INDENT> return self.from_raw_json(self.to_raw...
Interface for classes which implement both JSONSerialisable and JSONDeserialisable[T].
62599036287bf620b6272d3b
class Client(object): <NEW_LINE> <INDENT> def __init__(self, config=None, create_data_service_auth=DataServiceAuth): <NEW_LINE> <INDENT> if not config: <NEW_LINE> <INDENT> config = create_config() <NEW_LINE> <DEDENT> self.dds_connection = DDSConnection(config, create_data_service_auth) <NEW_LINE> <DEDENT> def get_proje...
Client that connects to the DDSConnection base on ~/.ddsclient configuration. This configuration can be customized by passing in a ddsc.config.Config object
62599036a4f1c619b294f730
class JavaWriter(object): <NEW_LINE> <INDENT> OPEN_GROUPERS = ("(", "{", "[") <NEW_LINE> CLOSE_GROUPERS = (")", "}", "]") <NEW_LINE> INDENT_SIZE = 4 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.grouper_stack = [] <NEW_LINE> self.code_base = [] <NEW_LINE> self.current_indent_count = 0 <NEW_LINE> <DEDENT> def ...
Write you those Java strings. Features "syntax check" as - brace matching - auto indent
6259903673bcbd0ca4bcb3d9
class MadstError(Exception): <NEW_LINE> <INDENT> def __init__(self, str): <NEW_LINE> <INDENT> super().__init__(str)
Base class
6259903630c21e258be9995e
class Event(Item): <NEW_LINE> <INDENT> tag = "VEVENT"
Internal event class.
62599036d4950a0f3b1116e8
class InternalEntityServiceServicer(object): <NEW_LINE> <INDENT> def CreateEntityType(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT>...
Manages entity types in the Data API, for internal usage. This service is deprecated and replaced by the corresponding operations in EntityService.
62599036b830903b9686ed22
class DistanceMatrix(object): <NEW_LINE> <INDENT> __api_urls = { "base" : "https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?" } <NEW_LINE> __distance_matrix = [] <NEW_LINE> __response = {} <NEW_LINE> __last_requested = [] <NEW_LINE> __number_of_requests_saved = 0 <NEW_LINE> __number_of_requests_made = 0 <NEW_...
This class defines the mechanics for requesting a distance/duration matrix from a set of locations. This implementation relies on Microsoft Bing Maps DistanceMatrix API. A distance/duration can be requested by simply running the following line: Typical usage example: matrix = DistanceMatrix.get_matrix(geoc...
62599036b57a9660fecd2bce
@six.add_metaclass(abc.ABCMeta) <NEW_LINE> class KeyManager(object): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def create_key(self, ctxt, algorithm='AES', length=256, expiration=None, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def store_key(self, ctxt, key, expiratio...
Base Key Manager Interface A Key Manager is responsible for managing encryption keys for volumes. A Key Manager is responsible for creating, reading, and deleting keys.
62599036e76e3b2f99fd9b5f
class HardNegativePairSelector(PairSelector): <NEW_LINE> <INDENT> def __init__(self, cpu=True): <NEW_LINE> <INDENT> super(HardNegativePairSelector, self).__init__() <NEW_LINE> self.cpu = cpu <NEW_LINE> <DEDENT> def get_pairs(self, embeddings, labels): <NEW_LINE> <INDENT> if self.cpu: <NEW_LINE> <INDENT> embeddings = em...
Creates all possible positive pairs. For negative pairs, pairs with smallest distance are taken into consideration, matching the number of positive pairs.
625990361f5feb6acb163d45
class WebFunction(object): <NEW_LINE> <INDENT> def __init__(self, func, name, args, return_value, print_name=''): <NEW_LINE> <INDENT> super(WebFunction, self).__init__() <NEW_LINE> self.func = func <NEW_LINE> self.name = name <NEW_LINE> self.args = args or [] <NEW_LINE> for arg in self.args: <NEW_LINE> <INDENT> if arg....
A function to be published on the web UI
6259903650485f2cf55dc0d2
class ListVirtualHubsResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[VirtualHub]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ListVirtualHubsResult, self).__init__(**kwargs) <NEW_...
Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set of results. :param value: List of VirtualHubs. :type value: list[~azure.mgmt.network.v2018_11_01.models.VirtualHub] :param next_link: URL to get the next set of operation list results if there are any. :...
6259903630c21e258be99960
class TestAnonymousId(PloneSurveyTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> self.createSubSurvey() <NEW_LINE> <DEDENT> def testAnonymousIdGeneration(self): <NEW_LINE> <INDENT> s1 = getattr(self, 's1') <NEW_LINE> now = DateTime() <NEW_LINE> self.logout() <NEW_LINE> userid = s1.getSurveyId()...
Ensure anonymous id is correctly constructed
6259903630c21e258be99961
class Disk(_messages.Message): <NEW_LINE> <INDENT> class TypeValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> TYPE_UNSPECIFIED = 0 <NEW_LINE> PERSISTENT_HDD = 1 <NEW_LINE> PERSISTENT_SSD = 2 <NEW_LINE> LOCAL_SSD = 3 <NEW_LINE> <DEDENT> autoDelete = _messages.BooleanField(1) <NEW_LINE> name = _messages.StringField(2...
A Google Compute Engine disk resource specification. Enums: TypeValueValuesEnum: The type of the disk to create, if applicable. Fields: autoDelete: Specifies whether or not to delete the disk when the pipeline completes. This field is applicable only for newly created disks. See ht tps://cloud.google.com/...
625990368c3a8732951f76ad
class TfidfVectorizer(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.base_path = os.path.dirname(__file__) <NEW_LINE> self.dictionary_path = os.path.join(self.base_path, "dictionary") <NEW_LINE> self.tf_idf_model_path = os.path.join(self.base_path, "tfidf") <NEW_LINE> self.stemmer = NepStemmer() <N...
Transform text to tf-idf representation
625990365e10d32532ce41ad