code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class IdaLogHandler(logging.Handler): <NEW_LINE> <INDENT> def emit(self, record): <NEW_LINE> <INDENT> idc.msg("%s\n" % (super(IdaLogHandler, self).format(record)))
Integrate the log messages with IDA's output window.
62598ee25166f23b2e2419e8
class CatalysisModelDMNLY0(Model): <NEW_LINE> <INDENT> def __init__(self, name='Catalysis model (dimensionless)'): <NEW_LINE> <INDENT> super(CatalysisModelDMNLY0, self).__init__(5, 30, name=name) <NEW_LINE> <DEDENT> def _eval(self, x): <NEW_LINE> <INDENT> x = view_as_column(x) <NEW_LINE> t = np.array([0., 1./6, 1./3, 1...
A class representing the forward model of the catalysis problem.
62598ee2cad5886f8bdc3912
class RespUnknownError(RespError): <NEW_LINE> <INDENT> pass
Received an unknown line
62598ee23539df3088eca8c4
class InvalidServiceList(TypeError): <NEW_LINE> <INDENT> pass
Service List has invalid entries
62598ee2462c4b4f79dba00d
class CustomCosineDecay(learning_rate_schedule.LearningRateSchedule): <NEW_LINE> <INDENT> def __init__(self, training_steps, learning_rate, min_learning_rate_mult, constant_fraction, warmup_fraction, name = None): <NEW_LINE> <INDENT> super(CustomCosineDecay, self).__init__() <NEW_LINE> self.config = { "training_steps":...
A custom cosine learning rate decay that is used by the optimizer list.
62598ee2c432627299fa15ca
class MalformedData(Exception): <NEW_LINE> <INDENT> status_code = 400 <NEW_LINE> message_template = "Malformed data: %s" <NEW_LINE> def __init__(self, data): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.message = self.message_template % data
Raise exception if incoming data is malformed
62598ee244b2445a339b5c70
class DreamyUserChangeForm(UserChangeForm): <NEW_LINE> <INDENT> class Meta(UserChangeForm.Meta): <NEW_LINE> <INDENT> model = User
This class overrides the default UserCreation form to use the overridden User model definition
62598ee255399d3f05624b43
class StatisticsProbe(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.min = None <NEW_LINE> self.max = None <NEW_LINE> self.sum = None <NEW_LINE> self.count = 0 <NEW_LINE> self.fields = ["min", "max", "sum", "count"] <NEW_LINE> <DEDENT> @property <NEW_LINE> def average(self): <NEW_LINE> <INDEN...
Data quality statistics for a dataset field :Attributes: * `min` - minimum value found * `max` - maxumum value found * `sum` - sum of values * `count` - count of values * `average` - average value
62598ee276e4537e8c3edbcb
class Meta: <NEW_LINE> <INDENT> model = Subarea <NEW_LINE> fields = '__all__'
Default meta class.
62598ee256ac1b37e63007ff
class SubscribedUser(models.Model): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, null=False, unique=True) <NEW_LINE> name = models.CharField(max_length=255, null=False) <NEW_LINE> created_on = models.DateTimeField(auto_now_add=True) <NEW_LINE> subscribe_news = models.BooleanField(null=False, default=Tr...
Subscribed user model
62598ee2bd1bec0571e143d5
class CourseForm(forms.ModelForm): <NEW_LINE> <INDENT> def save(self, commit=True, *args, **kwargs): <NEW_LINE> <INDENT> instance = super(CourseForm, self).save(commit=False) <NEW_LINE> if instance.code: <NEW_LINE> <INDENT> instance.hidden = True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> instance.hidden = False <NE...
course form for moderators
62598ee23eb6a72ae0388c55
class CardDeck: <NEW_LINE> <INDENT> def __init__(self, shuffle_on_build=False): <NEW_LINE> <INDENT> self.cards = deque(maxlen=52) <NEW_LINE> self._build_deck() <NEW_LINE> if shuffle_on_build: <NEW_LINE> <INDENT> self.shuffle() <NEW_LINE> <DEDENT> <DEDENT> def deal_card(self): <NEW_LINE> <INDENT> return self.cards.pop()...
Deque wrapper. Represents a deck of cards.
62598ee27d43ff2487426705
@implementer(IMLSAgencyContactInfoSettingsEditForm) <NEW_LINE> class MLSAgencyContactInfoSettingsEditForm(SelfHealingRegistryEditForm): <NEW_LINE> <INDENT> schema = IMLSAgencyContactInformation <NEW_LINE> label = u'' <NEW_LINE> def updateFields(self): <NEW_LINE> <INDENT> super(MLSAgencyContactInfoSettingsEditForm, self...
MLS Agency Contact Info Settings Form.
62598ee2498bea3a75a56148
class Meeting(models.Model): <NEW_LINE> <INDENT> date = models.DateTimeField(default=datetime.datetime.now, blank=True) <NEW_LINE> notes = models.CharField(max_length=500, blank=True, null=True) <NEW_LINE> qr_code = models.CharField(max_length=150, blank=True, null=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <IN...
Meeting Information
62598ee266656f66f7d589f4
class mock_httpcache: <NEW_LINE> <INDENT> def __init__(self, cachedict): <NEW_LINE> <INDENT> self.cachedict = cachedict <NEW_LINE> <DEDENT> def get(self, uri, use_referrer=True): <NEW_LINE> <INDENT> return self.cachedict[uri]
rather than hitting the actual HTTP cache, we can simulate behavior for this test
62598ee256b00c62f0fb0ee3
class NewsSitemapView(CommonSitemapView): <NEW_LINE> <INDENT> implements(ISitemapView) <NEW_LINE> @property <NEW_LINE> def additional_maps(self): <NEW_LINE> <INDENT> return ( ('publication_date', lambda x: x.Date and formatDate(x.Date) or ""), ('keywords', lambda x: x.Subject and ', '.join(x.Subject) or ""), ('title', ...
News Sitemap browser view
62598ee2adb09d7d5dc08bda
class DownloadOnlineContent(SingleOnlineContentViewMixin, DownloadViewMixin): <NEW_LINE> <INDENT> requested_file = None <NEW_LINE> allowed_types = ["md", "html", "pdf", "epub", "zip", "tex"] <NEW_LINE> mimetypes = { "html": "text/html", "md": "text/plain", "pdf": "application/pdf", "epub": "application/epub+zip", "zip"...
Views that allow users to download 'extra contents' of the public version
62598ee263d6d428bbee0de5
class ParseDate(Transformation): <NEW_LINE> <INDENT> DEFAULT_TIMEZONE = utc <NEW_LINE> @property <NEW_LINE> def tz(self): <NEW_LINE> <INDENT> return self.kwargs.get("tz", self.DEFAULT_TIMEZONE) <NEW_LINE> <DEDENT> def function(self, source, *call_args): <NEW_LINE> <INDENT> value = call_args[0] <NEW_LINE> if isinstance(...
Parse a date-ish string into a datetime object. Args: tz (tzinfo): the time zone to assume if none supplied
62598ee23cc13d1c6d463d7f
class Counter: <NEW_LINE> <INDENT> def __init__(self, method_name): <NEW_LINE> <INDENT> self.method_name = method_name <NEW_LINE> self.hit = 0 <NEW_LINE> self.miss = 0 <NEW_LINE> CounterList.append(self) <NEW_LINE> <DEDENT> def display(self): <NEW_LINE> <INDENT> fmt = " %7d hits %7d misses %s()" <NEW_LINE> print(...
Base class for counting memoization hits and misses. We expect that the metaclass initialization will have filled in the .name attribute that represents the name of the function being counted.
62598ee2f7d966606f746603
class UndoTransaction(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> _undoInfo(ock=True) <NEW_LINE> return self <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_value, traceback): <NEW_LINE> <INDENT> if exc_type: <NEW_LINE> <INDENT> doNothingCmd() <NEW_LINE> _undoInfo(cck=True) <NEW_LINE> _un...
コンテキストで例外が発生した場合にアンドゥするトランザクション。 インスタンス `undoTransaction` が生成済み。
62598ee21f037a2d8b9e271a
class EmergContactForm(FormUnrestrictedOtherUser): <NEW_LINE> <INDENT> emerg_first_name = StrippedCharField(length=25, max_length=64) <NEW_LINE> emerg_last_name = StrippedCharField(length=30, max_length=64) <NEW_LINE> emerg_e_mail = forms.EmailField(required=False) <NEW_LINE> emerg_phone_day = USPhoneNumberField() <NEW...
Contact form for emergency contacts
62598ee28da39b475be017be
class Converter(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> <DEDENT> def __call__(self, value, request, *args, **kwargs): <NEW_LINE> <INDENT> return self
Converter class that converts to itself. This object can be inspected in the tests to check how parameters are parsed.
62598ee27047854f4633d9ea
class ClosableObject: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._closed = False <NEW_LINE> <DEDENT> def _close(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> if not self._closed: <NEW_LINE> <INDENT> self._close() <NEW_LINE> self._closed = True <NEW_LINE> ...
Any class deriving from ClosableObject needs to be closed.
62598ee285dfad0860cbed72
class Rosetta(object): <NEW_LINE> <INDENT> def __init__(self, keys): <NEW_LINE> <INDENT> self._localized_strings = {} <NEW_LINE> self._localized_keys = keys <NEW_LINE> <DEDENT> def acquire_storm_object(self, obj): <NEW_LINE> <INDENT> self._localized_strings = {key: getattr(obj, key) for key in self._localized_keys} <NE...
This Class can manage all the localized strings inside one Storm object. AKA: manage three language on a single stone. Hell fucking yeah, History!
62598ee2b7558d5895461c60
class BookStoreBackFrameClass(tk.Canvas): <NEW_LINE> <INDENT> def __init__(self, root): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.__Parent = root <NEW_LINE> self['bd'] = 2 <NEW_LINE> self['bg'] = 'navy' <NEW_LINE> self.configure(scrollregion=(0, 0, self['height'], self['width'])) <NEW_LINE> return
this frame is the base widget upon which all other widgets are created
62598ee28e7ae83300ee76a2
class MyHorizontalFlipTransform(object): <NEW_LINE> <INDENT> def __init__(self, p = 0.5): <NEW_LINE> <INDENT> self.p = p <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> img = sample['image'] <NEW_LINE> mask = sample['mask'] <NEW_LINE> if random.random() < self.p: <NEW_LINE> <INDENT> img = np.fliplr(...
Horizontally flip the given numpy ndarray randomly with a given probability. Args: p (float): probability of the image being flipped. Default value is 0.5
62598ee2796e427e5384cdac
class SiteSettings(dict): <NEW_LINE> <INDENT> def __init__(self, site): <NEW_LINE> <INDENT> super(SiteSettings, self).__init__() <NEW_LINE> self.site = site <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return super(SiteSettings, self).__getitem__(force_str(key).lower()) <NEW_LINE> <DEDENT> def __...
A cache of Settings for a specific Site
62598ee25166f23b2e2419ea
class CompanyViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = CompanySerializer <NEW_LINE> queryset = Company.objects.all()
A viewset for viewing and editing company instances.
62598ee291f36d47f22301ad
class _opaque_pthread_mutex_t (my_endian): <NEW_LINE> <INDENT> _pack_ = 1 <NEW_LINE> _fields_ = [ ("__sig" , ctypes.c_int64 ), ("__opaque" , ctypes.c_char * 56 )] <NEW_LINE> def SetConstants(self): <NEW_LINE> <INDENT> pass
_opaque_pthread_mutex_t { long __sig; char __opaque[__PTHREAD_MUTEX_SIZE__];
62598ee2e76e3b2f99fd704d
class RayCastAnyCallback(b2RayCastCallback): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Any hit' <NEW_LINE> <DEDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> b2RayCastCallback.__init__(self, **kwargs) <NEW_LINE> self.fixture = None <NEW_LINE> self.hit = False <NEW_LINE> <DEDENT> def Re...
This callback finds any hit
62598ee238b623060ffa76aa
class PublishErrorsHandlerTestCase(test_utils.BaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(PublishErrorsHandlerTestCase, self).setUp() <NEW_LINE> self.publisherrorshandler = (log_handler. PublishErrorsHandler(logging.ERROR)) <NEW_LINE> <DEDENT> def test_emit_cfg_log_notifier_in_notifier...
Tests for log.PublishErrorsHandler
62598ee2009cb60464cffb63
class Dance(object): <NEW_LINE> <INDENT> def __init__(self, song_name, num_parts, parts): <NEW_LINE> <INDENT> super(Dance, self).__init__() <NEW_LINE> self.song_name = song_name <NEW_LINE> self.num_parts = num_parts <NEW_LINE> self.parts = parts <NEW_LINE> <DEDENT> def get_part(self, part_num): <NEW_LINE> <INDENT> retu...
Nao robot dance. The attribute num_parts is the number of parts in the dance. The parts attribute is a list of DanceParts
62598ee2adb09d7d5dc08bdc
class TrackedLoader(jinja2.FileSystemLoader): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.names_loaded = set() <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def get_source(self, environment, template): <NEW_LINE> <INDENT> self.names_loaded.add(template) <NEW_LINE...
Template loader that tracks which files are actually loaded.
62598ee221bff66bcd721267
class TotalHDDMeter(MeterBase): <NEW_LINE> <INDENT> def __init__(self,base,temperature_unit_str,**kwargs): <NEW_LINE> <INDENT> super(TotalHDDMeter,self).__init__(**kwargs) <NEW_LINE> self.base = base <NEW_LINE> self.temperature_unit_str = temperature_unit_str <NEW_LINE> <DEDENT> def evaluate_mapped_inputs(self,consumpt...
Sums the total heating degree days observed over the course of a ConsumptionHistory instance Parameters ---------- base : int or float The heating degree day base. temperature_unit_str : {"degF", "degC"} A string denoting the temperature unit to be used.
62598ee2442bda511e95aa7c
class Laser: <NEW_LINE> <INDENT> def __init__(self, crosshair, color): <NEW_LINE> <INDENT> self.crosshair = crosshair <NEW_LINE> self.color = color <NEW_LINE> self.running = False <NEW_LINE> self.checked = False <NEW_LINE> self.hit = False <NEW_LINE> self.progress = 0 <NEW_LINE> self.laserSound = TargetSound("laser.wav...
represents the laser for the gun
62598ee224f1403a92684baf
class SchedulerService(PantsService): <NEW_LINE> <INDENT> def __init__(self, fs_event_service, legacy_graph_helper): <NEW_LINE> <INDENT> super(SchedulerService, self).__init__() <NEW_LINE> self._fs_event_service = fs_event_service <NEW_LINE> self._graph_helper = legacy_graph_helper <NEW_LINE> self._scheduler = legacy_g...
The pantsd scheduler service. This service holds an online Scheduler instance that is primed via watchman filesystem events. This provides for a quick fork of pants runs (via the pailgun) with a fully primed ProductGraph in memory.
62598ee244b2445a339b5c71
class MessageInteractionCounters: <NEW_LINE> <INDENT> QUALNAME = "pyrogram.raw.base.MessageInteractionCounters" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> raise TypeError("Base types can only be used for type checking purposes: " "you tried to use a base type instance as argument, " "but you need to instantiate...
This base type has 1 constructor available. Constructors: .. hlist:: :columns: 2 - :obj:`MessageInteractionCounters <pyrogram.raw.types.MessageInteractionCounters>`
62598ee2c432627299fa15cc
class UnhandledEnumValueError(Exception): <NEW_LINE> <INDENT> message = "Encountered unhandled enum value."
Unhandled enum value exception.
62598ee223849d37ff84f6cc
class Tree(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.index = None <NEW_LINE> self.label = None <NEW_LINE> self.content = None <NEW_LINE> self.lemma = None <NEW_LINE> self.pos_tag = None <NEW_LINE> self.children = [] <NEW_LINE> self.pos_tag_mapping = None <NEW_LINE> self.label_mapping = N...
Represents a word (tree node) in the natural language syntax tree. Each tree node may contain zero or more children (dependent) tree nodes. This representation is not tied to any specific parser implementation.
62598ee23617ad0b5ee04744
class PurgeVarnishCacheAddForm(AddForm): <NEW_LINE> <INDENT> form_fields = form.FormFields(IPurgeVarnishCacheAction) <NEW_LINE> label = u"Add a Purge Varnish Cache action" <NEW_LINE> description = u"Purge Varnish cache of translations." <NEW_LINE> def create(self, data): <NEW_LINE> <INDENT> a = PurgeVarnishCacheAction(...
Purge Varnish cache action addform
62598ee276e4537e8c3edbcd
class NoResultFound(sa_exc.InvalidRequestError): <NEW_LINE> <INDENT> pass
A database result was required but none was found.
62598ee22ae34c7f260a96fd
class Word(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.author_id = 0 <NEW_LINE> self.author_name = '' <NEW_LINE> self.revision = 0 <NEW_LINE> self.value = '' <NEW_LINE> self.matched = False <NEW_LINE> self.length = 0 <NEW_LINE> self.freq = [] <NEW_LINE> self.deleted = [] <NEW_LINE> self.in...
Implementation of the structure "Word", which includes the authorship information.
62598ee299cbb53fe682f4c7
class CloudConfig(software_config.SoftwareConfig): <NEW_LINE> <INDENT> support_status = support.SupportStatus(version='2014.1') <NEW_LINE> PROPERTIES = ( CLOUD_CONFIG ) = ( 'cloud_config' ) <NEW_LINE> properties_schema = { CLOUD_CONFIG: properties.Schema( properties.Schema.MAP, _('Map representing the cloud-config data...
A configuration resource for representing cloud-init cloud-config. This resource allows cloud-config YAML to be defined and stored by the config API. Any intrinsic functions called in the config will be resolved before storing the result. This resource will generally be referenced by OS::Nova::Server user_data, or OS...
62598ee2796e427e5384cdae
class Position(object): <NEW_LINE> <INDENT> swagger_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.discriminator = None <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in six.iteritems(self.swagger_types): <NEW_LINE> <INDE...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee2be8e80087fbbd663
class FasterRCNNResnet152FeatureExtractor(FasterRCNNResnetV1FeatureExtractor): <NEW_LINE> <INDENT> def __init__(self, is_training, first_stage_features_stride, batch_norm_trainable=False, reuse_weights=None, weight_decay=0.0, activation_fn=tf.nn.relu): <NEW_LINE> <INDENT> super(FasterRCNNResnet152FeatureExtractor, self...
Faster R-CNN Resnet 152 feature extractor implementation.
62598ee2379a373c97d97611
class ValidationException(FHIRException): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if not isinstance(kwargs.get('response'), OperationOutcome): <NEW_LINE> <INDENT> raise ValueError("This error must have an OperationOutcome") <NEW_LINE> <DEDENT> super(ValidationException, self).__init...
Various errors related to validation
62598ee27d847024c075a9e5
class AccessTokenManager(models.Manager): <NEW_LINE> <INDENT> def create_access_token(self, **kwargs): <NEW_LINE> <INDENT> kwargs['token'] = kwargs.get('token', AccessToken.random_token_value()) <NEW_LINE> kwargs['expires_on'] = kwargs.get('expires_on', default_expiry()) <NEW_LINE> return AccessToken(**kwargs).save() <...
Custom model manager for AccessTokens.
62598ee22ae34c7f260a96fe
class VariableList(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.items = [] <NEW_LINE> <DEDENT> def __getitem__(self, p_name): <NEW_LINE> <INDENT> index = self.find(p_name) <NEW_LINE> if index == -1: <NEW_LINE> <INDENT> self.items.append(Variable(p_name)) <NEW_LINE> <DEDENT> return self.item...
Массив переменных
62598ee267a9b606de5445e4
class Graph: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def draw_bipartite(nx_graph: nx.Graph, vertex_tuples=None): <NEW_LINE> <INDENT> if not nx.is_bipartite(nx_graph): <NEW_LINE> <INDENT> raise Exception('Provided graph must be bipartite.') <NEW_LINE> <DEDENT> l_part, r_part = Graph.sets_bipartite_nonconnected(nx_g...
Helper methods for networkx.Graph class.
62598ee23539df3088eca8c8
class InstanceView(object): <NEW_LINE> <INDENT> def __init__(self, instance, req=None): <NEW_LINE> <INDENT> self.instance = instance <NEW_LINE> self.req = req <NEW_LINE> <DEDENT> def data(self): <NEW_LINE> <INDENT> instance_dict = { "id": self.instance.id, "name": self.instance.name, "status": self.instance.status, "li...
Uses a SimpleInstance.
62598ee201c39578d7f113bf
class MyLinearRegression: <NEW_LINE> <INDENT> def __init__ (self, learning_rate=0.005): <NEW_LINE> <INDENT> self.theta = 0; <NEW_LINE> self.alpha = learning_rate; <NEW_LINE> self.cost = 0; <NEW_LINE> <DEDENT> def gradientDescent(self, X_train, y_train, theta, alpha, iters): <NEW_LINE> <INDENT> X = np.concatenate([np.o...
Define what a linear regressor can do
62598ee263d6d428bbee0de9
class UnManagedModelTestRunner(DiscoverRunner): <NEW_LINE> <INDENT> def setup_test_environment(self, *args, **kwargs): <NEW_LINE> <INDENT> print("\nsetup_test_environment\n") <NEW_LINE> from django.db.models.loading import get_models <NEW_LINE> super(UnManagedModelTestRunner, self).setup_test_environment(*args, **kwarg...
Test runner that automatically makes all unmanaged models managed for the duration of the test run.
62598ee2462c4b4f79dba011
@allure.feature('App小程序自动化') <NEW_LINE> class Test_Web: <NEW_LINE> <INDENT> def setup_class(self): <NEW_LINE> <INDENT> self.app = App() <NEW_LINE> <DEDENT> @allure.step <NEW_LINE> def run_step(self, func, params): <NEW_LINE> <INDENT> func(*params) <NEW_LINE> <DEDENT> @allure.story('美团小程序') <NEW_LINE> @pytest.mark.param...
数据驱动执行Web自动化用例
62598ee2d7e4931a7ef3a6b4
class TypeOfChildcareRegisterForm(ChildminderForms): <NEW_LINE> <INDENT> field_label_classes = 'form-label-bold' <NEW_LINE> error_summary_template_name = 'standard-error-summary.html' <NEW_LINE> auto_replace_widgets = True
GOV.UK form for the Type of childcare: register page
62598ee2d58c6744b42db5c2
class NodeCommand(CommandExtension): <NEW_LINE> <INDENT> def add_arguments(self, parser, cli_name): <NEW_LINE> <INDENT> self._subparser = parser <NEW_LINE> add_subparsers_on_demand( parser, cli_name, '_verb', 'ros2node.verb', required=False) <NEW_LINE> <DEDENT> def main(self, *, parser, args): <NEW_LINE> <INDENT> if no...
Various node related sub-commands.
62598ee24527f215b58e851d
class AsynchronousFileReader(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, fd, queue): <NEW_LINE> <INDENT> assert isinstance(queue, Queue) <NEW_LINE> assert callable(fd.readline) <NEW_LINE> threading.Thread.__init__(self) <NEW_LINE> self._fd = fd <NEW_LINE> self._queue = queue <NEW_LINE> self.daemon = True ...
Helper class to implement asynchronous reading of a file in a separate thread. Pushes read lines on a queue to be consumed in another thread.
62598ee21b99ca400228e818
class QByteArrayOperatorStr(unittest.TestCase): <NEW_LINE> <INDENT> def testBasic(self): <NEW_LINE> <INDENT> self.assertEqual(QByteArray().__str__(), str(b'')) <NEW_LINE> self.assertEqual(QByteArray(bytes('', "UTF-8")).__str__(), str(b'')) <NEW_LINE> self.assertEqual(QByteArray(bytes('aaa', "UTF-8")).__str__(), str(b'a...
Test case for __str__ operator of QByteArray
62598ee224f1403a92684bb0
class DestinyDestinyItemQuantity(object): <NEW_LINE> <INDENT> swagger_types = { 'item_hash': 'int', 'item_instance_id': 'int', 'quantity': 'int' } <NEW_LINE> attribute_map = { 'item_hash': 'itemHash', 'item_instance_id': 'itemInstanceId', 'quantity': 'quantity' } <NEW_LINE> def __init__(self, item_hash=None, item_insta...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee230dc7b766599de9f
class Random(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def random(self, start, end): <NEW_LINE> <INDENT> seed = time() * 1000000 <NEW_LINE> diff = end - start <NEW_LINE> lower_random = seed % diff <NEW_LINE> return int(start + lower_random) <NEW_LINE> <DEDENT> def ran...
It generators multiple random numbers with biased higher and lower persentage.
62598ee26e29344779afec46
class HugeTreeClient (Client): <NEW_LINE> <INDENT> def parse(self, xml): <NEW_LINE> <INDENT> parser = etree.XMLParser(huge_tree=True) <NEW_LINE> return etree.XML(xml, parser=parser)
A variation of oaipmh.Client that uses the huge_tree option in lxml that allows larger amounts of XML data to be parsed without errors.
62598ee299cbb53fe682f4c8
class LimitDescription(CloudFormationLintRule): <NEW_LINE> <INDENT> id = 'E1003' <NEW_LINE> shortdesc = 'Template description limit' <NEW_LINE> description = 'Check if the size of the template description is less than the upper limit' <NEW_LINE> source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...
Check Template Description Size
62598ee223849d37ff84f6cd
class CursorChanger(TempValueSetter): <NEW_LINE> <INDENT> def __init__(self, window, cursor): <NEW_LINE> <INDENT> assert isinstance(window, wx.Window) <NEW_LINE> self.window = window <NEW_LINE> self.cursor = cursor if isinstance(cursor, wx.Cursor) else wx.StockCursor(cursor) <NEW_LINE> TempValueSet...
Context manager for showing specified cursor while suite executes.
62598ee23617ad0b5ee04746
class CRUDAdapter(BackendAdapter): <NEW_LINE> <INDENT> _model_name = None <NEW_LINE> def search(self, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def read(self, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def search_read(self, *args, **kwar...
Base External Adapter specialized in the handling of records on external systems. Subclasses can implement their own implementation for the methods.
62598ee2097d151d1a2bf637
class BorrachoTradicional(Borracho): <NEW_LINE> <INDENT> def __init__(self, nombre): <NEW_LINE> <INDENT> super().__init__(nombre) <NEW_LINE> <DEDENT> def camina(self): <NEW_LINE> <INDENT> return random.choice([(0, 1), (0, -1), (1, 0), (-1, 0)])
Clase BorrachoTradicional hereda de Borracho. Contiene método camina()
62598ee299cbb53fe682f4c9
class PlanListListView(PermissionRequiredMixin, abstract.ListView): <NEW_LINE> <INDENT> model = models.PlanList <NEW_LINE> permission_required = 'subscriptions.subscriptions' <NEW_LINE> raise_exception = True <NEW_LINE> context_object_name = 'plan_lists' <NEW_LINE> template_name = 'subscriptions/plan_list_list.html'
List of plan lists.
62598ee297e22403b3839508
class options(GlobalOptions): <NEW_LINE> <INDENT> NAME = 'LazyLaurentSeriesRing' <NEW_LINE> module = 'sage.rings.lazy_series_ring' <NEW_LINE> display_length = dict(default=7, description='the number of coefficients to display from the valuation', checker=lambda x: x in ZZ and x > 0) <NEW_LINE> constant_length = dict(de...
Set and display the options for Lazy Laurent series. If no parameters are set, then the function returns a copy of the options dictionary. The ``options`` to Lazy Laurent series can be accessed as using :class:`LazyLaurentSeriesRing.options` of :class:`LazyLaurentSeriesRing`. @OPTIONS@ EXAMPLES:: sage: LLS.<z>...
62598ee263b5f9789fe8377e
class Deserializer: <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> raise SerializerDoesNotExist("user_annotation_list is a serialization-only serializer")
Deserialize IIIF Annotation List :raises SerializerDoesNotExist: Not yet implemented.
62598ee291f36d47f22301af
class RPCCoverage(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dir = tempfile.mkdtemp(prefix="coverage") <NEW_LINE> self.flag = '--coveragedir=%s' % self.dir <NEW_LINE> <DEDENT> def report_rpc_coverage(self): <NEW_LINE> <INDENT> uncovered = self._get_uncovered_rpc_commands() <NEW_LINE> if uncover...
Coverage reporting utilities for test_runner. Coverage calculation works by having each test script subprocess write coverage files into a particular directory. These files contain the RPC commands invoked during testing, as well as a complete listing of RPC commands per `deftchain-cli help` (`rpc_interface.txt`). Af...
62598ee2460517430c430aa0
class SEResNeXtBottleneck(Bottleneck): <NEW_LINE> <INDENT> expansion = 4 <NEW_LINE> def __init__(self, inplanes, planes, groups, reduction, stride=1, downsample=None, base_width=4): <NEW_LINE> <INDENT> super(SEResNeXtBottleneck, self).__init__() <NEW_LINE> width = math.floor(planes * (base_width / 64)) * groups <NEW_LI...
ResNeXt bottleneck type C with a Squeeze-and-Excitation module.
62598ee267a9b606de5445e6
class Job_Run_Metric( Base ): <NEW_LINE> <INDENT> __tablename__ = "Job_Run_Metric" <NEW_LINE> __table_args__ = {"schema": "etlite"} <NEW_LINE> id = Column( Integer ,nullable=False ,primary_key=True ) <NEW_LINE> job_run_id = Column( Integer ,nullable=False ) <NEW_LINE> data_set_id = ...
Job Run Metric model.
62598ee2498bea3a75a5614d
class Meta: <NEW_LINE> <INDENT> verbose_name = '教师管理' <NEW_LINE> verbose_name_plural = verbose_name
Meta内部类
62598ee2be8e80087fbbd665
class CNOTEntangler(Entangler): <NEW_LINE> <INDENT> n_params = 12 <NEW_LINE> def apply(self, q, circ, i, j, params): <NEW_LINE> <INDENT> if len(params) == self.n_params: <NEW_LINE> <INDENT> pc = cycle(params) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError('Incorrect number of parameters!') <NEW_LINE> <D...
Like CartanEntangler, but in the middle it just has a CNOT
62598ee2009cb60464cffb67
class StringSetField(models.CharField): <NEW_LINE> <INDENT> description = "A field that holds a set of strings" <NEW_LINE> __metaclass__ = models.SubfieldBase <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> error_messages = kwargs.pop('error_messages', {}) <NEW_LINE> if not 'invalid' in error_messages: <NE...
A field that holds a set of strings. Subclass of CommaSeparatedIntegerField since the internal storage is the same.
62598ee28a43f66fc4bf078a
@registerModel("gaussian") <NEW_LINE> class GaussianModelConfig(lsst.pex.config.Config): <NEW_LINE> <INDENT> radius = lsst.pex.config.Field( "Radius parameter to use for the model, in units of the RMS size (sigma)", dtype=float, default=1.0, ) <NEW_LINE> fixCenter = lsst.pex.config.Field( "Fix the center to the positio...
Config class used to define a simple Gaussian galaxy model.
62598ee232920d7e50bc4645
class InConstraint(LabelConstraint): <NEW_LINE> <INDENT> def __init__(self, label, values, parsed=None): <NEW_LINE> <INDENT> super().__init__(parsed) <NEW_LINE> self.label = label <NEW_LINE> self.values = tuple(values) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f"{self.label} in ({', '.join(self....
Label constraint where the value of a label must be in a set of values. Example: .. code:: python LabelConstraint.parse("location in (DE, SK)")
62598ee2d486a94d0ba2a5f0
class HelloRequestClient(SendCommandConnectClient): <NEW_LINE> <INDENT> def make_hello_base(self): <NEW_LINE> <INDENT> caps = CommandConnectClient.make_hello_base(self) <NEW_LINE> caps.update(self.hello_request()) <NEW_LINE> return caps <NEW_LINE> <DEDENT> def timeout(self, *_args): <NEW_LINE> <INDENT> self.warn_and_qu...
Utility superclass for clients that send a server request as part of the hello packet.
62598ee2adb09d7d5dc08be0
class WinLossOOBRandomForest(CategoricalTransformer): <NEW_LINE> <INDENT> def __init__(self, bid_var_list, prod_var_list): <NEW_LINE> <INDENT> self.bid_var_list = bid_var_list <NEW_LINE> self.prod_var_list = prod_var_list <NEW_LINE> self.inbag = None <NEW_LINE> self.rf_classifier = None <NEW_LINE> self.variable_importa...
Class to create win loss variable
62598ee207f4c71912bada6d
class OpenAIGPTTokenizerFast(PreTrainedTokenizerFast): <NEW_LINE> <INDENT> vocab_files_names = VOCAB_FILES_NAMES <NEW_LINE> pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP <NEW_LINE> max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES <NEW_LINE> def __init__(self, vocab_file, merges_file, unk_token="...
Construct a "Fast" BPE tokenizer for OpenAI GPT (backed by HuggingFace's `tokenizers` library). Peculiarities: - lower case all inputs - uses SpaCy tokenizer and ftfy for pre-BPE tokenization if they are installed, fallback to BERT's BasicTokenizer if not. This tokenizer inherits from :class:`~transformers.PreTraine...
62598ee256b00c62f0fb0ee9
class UpdateExecution(ModelBase): <NEW_LINE> <INDENT> product_firmware = models.ForeignKey("ProductFirmware", models.CASCADE, blank=False) <NEW_LINE> strategy_class = models.CharField(max_length=30) <NEW_LINE> enabled = models.BooleanField(default=False) <NEW_LINE> @classmethod <NEW_LINE> def pre_save(cls, sender, docu...
Stores information about an update strategies application to a set of devices This will store state about the update's progress. Attributes: enabled (bool, True): Whether this update should be triggered or not product_firmware (ProductFirmware): The firmware that is sent in the update strategy_cla...
62598ee276e4537e8c3edbd0
class ElementMaker(ElementMaker): <NEW_LINE> <INDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> _cls = super(ElementMaker, self).__getattr__(name) <NEW_LINE> def __cls_wraper(*args, **kwargs): <NEW_LINE> <INDENT> return _cls( *[ str(arg) if isinstance(arg, int) else arg for arg in args ], **kwargs ) <NEW_LINE> <...
Wrapper around lxml ElementMaker that casts ints as strings.
62598ee24e4d562566370a32
class ShoppingCart(): <NEW_LINE> <INDENT> def __init__(self, items, wallet, price_of_cart): <NEW_LINE> <INDENT> self.items = items <NEW_LINE> self.__wallet = wallet <NEW_LINE> self.price_of_cart = price_of_cart <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> string1 = "Products\n" <NEW_LINE> for key in self....
This class is created as a shopping cart.It contains items(the items that the user wants), wallet(money in the users account) and price_of_cart(the total price)
62598ee20c0af96317c549b6
class ROI(Module): <NEW_LINE> <INDENT> def __init__(self, pix, shift=0): <NEW_LINE> <INDENT> self.cfg = cfg = Record([ ("x0", len(pix.x)), ("x1", len(pix.x)), ("y0", len(pix.y)), ("y1", len(pix.y)), ]) <NEW_LINE> self.out = out = Record([ ("stb", 1), ("ack", 1), ("cnt", len(pix.x) + len(pix.y) + 16 - shift), ]) <NEW_LI...
ROI Engine. For each frame, accumulates pixels values within a region of interest and emits them as messages if the ROI had positive area.
62598ee2442bda511e95aa80
class Message(AttrDict): <NEW_LINE> <INDENT> def __init__(self, folder, id, data): <NEW_LINE> <INDENT> assert is_sha1(id), 'Message id not a SHA1 hash' <NEW_LINE> self.folder = folder <NEW_LINE> self.id = id <NEW_LINE> super(AttrDict, self).__init__(data) <NEW_LINE> self['startTime'] = gmtime(int(self['startTime'])/100...
Wrapper for all call/sms message instances stored in Google Voice Attributes are: * id: SHA1 identifier * isTrash: bool * displayStartDateTime: datetime * star: bool * isSpam: bool * startTime: gmtime * labels: list * displayStartTime: time * children: str * note: str * isRead: bool * displayNumber: str *...
62598ee2fbf16365ca7926bd
class Card: <NEW_LINE> <INDENT> suit_names = ["Clubs", "Diamonds", "Hearts", "Spades"] <NEW_LINE> rank_names = [None, "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"] <NEW_LINE> def __init__(self, suit=0, rank=2): <NEW_LINE> <INDENT> self.suit = suit <NEW_LINE> self.rank = rank <NEW_LINE> <...
Represents a standard playing card. Attributes: suit: integer 0-3 rank: integer 1-13
62598ee24428ac0f6e656b6c
class MobileNetworkRadioEncryption(ExtensionOnlyType_): <NEW_LINE> <INDENT> c_tag = 'MobileNetworkRadioEncryption' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = ExtensionOnlyType_.c_children.copy() <NEW_LINE> c_attributes = ExtensionOnlyType_.c_attributes.copy() <NEW_LINE> c_child_order = ExtensionOnlyType...
The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:MobileNetworkRadioEncryption element
62598ee2cb5e8a47e493b486
class QuantileNormalizer(): <NEW_LINE> <INDENT> def __init__(self, a, axis = 0, q1 = 0.25, q2 = 0.75): <NEW_LINE> <INDENT> assert q1 > 0 and q1 < 1 <NEW_LINE> assert q2 > q1 and q2 < 1 <NEW_LINE> self.data = a <NEW_LINE> self.axis = axis <NEW_LINE> self.reshape_dim = self.data.shape[abs(self.axis-1)] <NEW_LINE> self.IQ...
Scaling using median and quantiles consists of subtracting the median to all the observations and then dividing by the interquartile difference. It Scales features using statistics that are robust to outliers. Default inter-quartile range is 0.25 - 0.75 (q1 - q2).
62598ee2f9cc0f698b1c45db
class QSET(ABCQSet): <NEW_LINE> <INDENT> type = 'QSET' <NEW_LINE> def __init__(self, card=None, data=None, comment=''): <NEW_LINE> <INDENT> ABCQSet.__init__(self, card, data, comment)
Defines generalized degrees-of-freedom (q-set) to be used for dynamic reduction or component mode synthesis. +------+-----+----+-----+------+-----+----+-----+----+ | QSET | ID1 | C1 | ID2 | C2 | ID3 | C3 | ID4 | C4 | +------+-----+----+-----+------+-----+----+-----+----+ | QSET | 16 | 2 | 23 | 3516 | 1 | 4 | +...
62598ee2ac7a0e7691f70b2e
class TestCloudtmp(unittest.TestCase): <NEW_LINE> <INDENT> def test_write_tmp(self): <NEW_LINE> <INDENT> with open('/tmp/hoo-ha.txt', 'w') as fobj: <NEW_LINE> <INDENT> fobj.write("Hello")
/tmp should always be writable.
62598ee27cff6e4e811b4006
class ECDH(object): <NEW_LINE> <INDENT> def __init__(self, curve_params='ecp_256.txt', flip_sign=True): <NEW_LINE> <INDENT> with open(curve_params) as f: <NEW_LINE> <INDENT> self.params = json.load(f) <NEW_LINE> <DEDENT> for k in self.params: <NEW_LINE> <INDENT> if k != 'eq': <NEW_LINE> <INDENT> self.params[k] = int(se...
An implementation of ECDH protocol. This class uses parameters stored in the curve_params file.
62598ee20a50d4780f7039c2
class TestAplazameRefundPaymentPost(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 testAplazameRefundPaymentPost(self): <NEW_LINE> <INDENT> pass
AplazameRefundPaymentPost unit test stubs
62598ee27047854f4633d9ef
class EasyConfigFormatTest(TestCase): <NEW_LINE> <INDENT> def test_parser_version_regex(self): <NEW_LINE> <INDENT> version = {'major': 1, 'minor': 0} <NEW_LINE> txt = FORMAT_VERSION_HEADER_TEMPLATE % version <NEW_LINE> res = FORMAT_VERSION_REGEXP.search(txt).groupdict() <NEW_LINE> self.assertEqual(version['major'], int...
Test the parser
62598ee232920d7e50bc4646
class Text(pygame.font.Font): <NEW_LINE> <INDENT> def __init__(self, text, size=30, color = WHITE, font = 'Good_Morning.ttf', x=0, y=0): <NEW_LINE> <INDENT> pygame.font.Font.__init__(self, font, size) <NEW_LINE> self.text = text <NEW_LINE> self.label = self.render(self.text, 1, color) <NEW_LINE> self.width = self.label...
Tworzy tekst na powierzchni
62598ee2fff4ab517ebcbdfe
class FixedLengthString(MySQLDataType): <NEW_LINE> <INDENT> def __init__(self, size, val = None): <NEW_LINE> <INDENT> super(FixedLengthString, self).__init__() <NEW_LINE> self.val = None <NEW_LINE> self.length = size <NEW_LINE> if val: <NEW_LINE> <INDENT> if len(val) != size: <NEW_LINE> <INDENT> raise ValueError('lolwu...
String of a static length
62598ee2f548e778e5969baf
class Circle: <NEW_LINE> <INDENT> def __init__(self, radius): <NEW_LINE> <INDENT> self.radius = radius <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.radius == other.radius <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"Circle({self.radius})"
A class which that supports == but is not registered
62598ee2236d856c2adc8720
class PageDialogPageIconChangedParams(object): <NEW_LINE> <INDENT> def __init__(self, dialog, pageIcon): <NEW_LINE> <INDENT> self.dialog = dialog <NEW_LINE> self.pageIcon = pageIcon
Set of parameters for the onPageDialogPageIconChanged event
62598ee24a966d76dd5ed4fd
class TaskDetails(View, ToolClass): <NEW_LINE> <INDENT> def get(self, request, uuid): <NEW_LINE> <INDENT> task_model_class = self._get_tool_model(self._get_task_model_name()) <NEW_LINE> task = task_model_class.objects.get(pk=uuid) <NEW_LINE> context = {'task': task} <NEW_LINE> return render(request, "/".join([self._get...
Generate the detals view for the requested task. This is a GET only view, so only the get function is defined. Abstract properties and methods are used to define the required attributes for an implementation. Inheriting OutputList without defining the required abstracted elements will throw an error. Due to some comp...
62598ee224f1403a92684bb1
class lin2(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def process(x, a, b, c): <NEW_LINE> <INDENT> s0 = (b - 1.0) / a <NEW_LINE> s1 = (c - b) / (1 - a) <NEW_LINE> f = x.flatten() <NEW_LINE> return numpy.piecewise( f, (f <= a), (lambda x: 1.0 + (x * s0), lambda x: b + ((x - a) * s1)) ).reshape(x.shape) <NEW_L...
2-segment piecewise linear
62598ee22ae34c7f260a9701
class PersonHandle: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.po = PersonObject() <NEW_LINE> <DEDENT> def get_user_name(self): <NEW_LINE> <INDENT> logging.info(f"获取用户名:{self.po.find_username().text}") <NEW_LINE> return self.po.find_username().text <NEW_LINE> <DEDENT> def click_setting_btn(self): ...
操作层
62598ee263b5f9789fe83780
class Template(TemplatesResource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def get(self, template_id: int): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> template = self.repository.get_by_id(template_id) <NEW_LINE> return { "template": template.to_dict() } <NEW_LINE> <DEDENT> except (TemplateNotFoundException): <NE...
Template resource
62598ee2379a373c97d97615
class OptNode(ConfigNode): <NEW_LINE> <INDENT> INSTANCE_OF = str <NEW_LINE> def get_config_value(self, merged_config: dict, merged_options: dict, current_config: dict) -> Any: <NEW_LINE> <INDENT> keys, is_relative = V.split_config_path(self.raw_value) <NEW_LINE> if is_relative: <NEW_LINE> <INDENT> raise ValueError(f'op...
Get the name of a chosen option from the path to a group.
62598ee2460517430c430aa2