code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class BaseWebTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.app = webtest.TestApp("config:conf/tests.ini", relative_to='.') <NEW_LINE> self.app.RequestClass = PrefixedRequestClass <NEW_LINE> self.db = self.app.app.registry.backend <NEW_LINE> self.indexer = self.app.app.registry.i...
Base Web Test to test your cornice service. It setups the database before each test and delete it after.
62598faf009cb60464d01548
class RFile: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'meta', (RFileMetadata, RFileMetadata.thrift_spec), None, ), (2, TType.STRING, 'content', None, None, ), ) <NEW_LINE> def __init__(self, meta=None, content=None,): <NEW_LINE> <INDENT> self.meta = meta <NEW_LINE> self.content = content <NEW_LINE> <...
Attributes: - meta - content
62598faf097d151d1a2c1052
class array_element: <NEW_LINE> <INDENT> def __init__(self, arr, popped): <NEW_LINE> <INDENT> self.arr = arr <NEW_LINE> self.popped = popped <NEW_LINE> self.left = None <NEW_LINE> self.mid = None <NEW_LINE> self.right = None <NEW_LINE> self.consume() <NEW_LINE> <DEDENT> def consume(self): <NEW_LINE> <INDENT> temp = val...
Arguments: arr: This should be a pointer (mutable object) to the string that the parser is parsing. popped: This should be a pointer (mutable object) to the string that the parser has parsed. Attributes: arr: A list of the characters that have been popped within the parser popped: A list of the characters ...
62598fafd7e4931a7ef3c0bc
class MAVLink_array_test_3_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_ARRAY_TEST_3 <NEW_LINE> name = 'ARRAY_TEST_3' <NEW_LINE> fieldnames = ['v', 'ar_u32'] <NEW_LINE> ordered_fieldnames = [ 'ar_u32', 'v' ] <NEW_LINE> format = '<4IB' <NEW_LINE> native_format = bytearray('<IB', 'ascii') <NEW_LINE> ...
Array test #3.
62598faf498bea3a75a57b47
class Jsonifier: <NEW_LINE> <INDENT> def __init__(self, json_=json, **kwargs): <NEW_LINE> <INDENT> self.json = json_ <NEW_LINE> self.dumps_args = kwargs <NEW_LINE> <DEDENT> def dumps(self, data, **kwargs): <NEW_LINE> <INDENT> for k, v in self.dumps_args.items(): <NEW_LINE> <INDENT> kwargs.setdefault(k, v) <NEW_LINE> <D...
Central point to serialize and deserialize to/from JSon in Connexion.
62598faf5166f23b2e243401
class AttributeBasedElementClassLookup(FallbackElementClassLookup): <NEW_LINE> <INDENT> def __init__(self, attribute_name, class_mapping, fallback=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __new__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> __pyx_vtable__ = None
AttributeBasedElementClassLookup(self, attribute_name, class_mapping, fallback=None) Checks an attribute of an Element and looks up the value in a class dictionary. Arguments: - attribute name - '{ns}name' style string - class mapping - Python dict mapping attribute values to Element classes ...
62598faf30bbd7224646998c
class ContentViewFilterSearchTestCase(APITestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(ContentViewFilterSearchTestCase, cls).setUpClass() <NEW_LINE> cls.content_view = entities.ContentView().create() <NEW_LINE> <DEDENT> @tier1 <NEW_LINE> @skip_if_bug_open('bugzill...
Tests that search through content view filters.
62598faf56ac1b37e6302213
class TestInlineResponse2002DatasetResources(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 testInlineResponse2002DatasetResources(self): <NEW_LINE> <INDENT> pass
InlineResponse2002DatasetResources unit test stubs
62598faf8e7ae83300ee90ca
class MedicinalProductNameNamePart(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = Field("MedicinalProductNameNamePart", const=True) <NEW_LINE> part: fhirtypes.String = Field( None, alias="part", title="A fragment of a product name", description=None, element_property=True, element_required=True, ...
Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Coding words or phrases of the name.
62598faf99fddb7c1ca62dfd
class OneDataAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> def has_add_permission(self, request): <NEW_LINE> <INDENT> return False if self.model.objects.count() > 0 else True
DBに1つだけデータを格納したいモデルは、これを使う.
62598faf2ae34c7f260ab109
class ListEnvironmentsAsyncPager: <NEW_LINE> <INDENT> def __init__( self, method: Callable[..., Awaitable[environment.ListEnvironmentsResponse]], request: environment.ListEnvironmentsRequest, response: environment.ListEnvironmentsResponse, *, metadata: Sequence[Tuple[str, str]] = () ): <NEW_LINE> <INDENT> self._method ...
A pager for iterating through ``list_environments`` requests. This class thinly wraps an initial :class:`google.cloud.dialogflow_v2beta1.types.ListEnvironmentsResponse` object, and provides an ``__aiter__`` method to iterate through its ``environments`` field. If there are more pages, the ``__aiter__`` method will ma...
62598faf8a43f66fc4bf21a2
class GhostscriptFonts(Package): <NEW_LINE> <INDENT> homepage = "http://ghostscript.com/" <NEW_LINE> url = "https://www.imagemagick.org/download/delegates/ghostscript-fonts-std-8.11.tar.gz" <NEW_LINE> version('8.11', sha256='0eb6f356119f2e49b2563210852e17f57f9dcc5755f350a69a46a0d641a0c401') <NEW_LINE> def install(self,...
Ghostscript Fonts
62598faf7d847024c075c3eb
class FeedPlaceholderViewServiceServicer(object): <NEW_LINE> <INDENT> def GetFeedPlaceholderView(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!')
Proto file describing the FeedPlaceholderView service. Service to fetch feed placeholder views.
62598faf4a966d76dd5eeeff
class DesignateAdminClient(BaseDesignateClient): <NEW_LINE> <INDENT> def _get_noauth_auth_provider(self): <NEW_LINE> <INDENT> creds = KeystoneV2Credentials( tenant_id=cfg.CONF.noauth.tenant_id, ) <NEW_LINE> return NoAuthAuthProvider(creds, cfg.CONF.noauth.designate_endpoint) <NEW_LINE> <DEDENT> def _get_keystone_auth_p...
Client with admin user
62598faf66656f66f7d5a418
class League(BaseDonbestResponse): <NEW_LINE> <INDENT> def __init__(self, node, donbest): <NEW_LINE> <INDENT> super().__init__(node=node, donbest=donbest) <NEW_LINE> self.id = None <NEW_LINE> self.name = None <NEW_LINE> self.abbreviation = None <NEW_LINE> self.information = None <NEW_LINE> self.sport = None <NEW_LINE> ...
Returns a League
62598faf7d43ff2487427416
class SoftmaxDistribution(CategoricalDistribution): <NEW_LINE> <INDENT> def __init__(self, logits, beta=1.0, min_prob=0.0): <NEW_LINE> <INDENT> self.logits = logits <NEW_LINE> self.beta = beta <NEW_LINE> self.min_prob = min_prob <NEW_LINE> self.n = logits.shape[1] <NEW_LINE> assert self.min_prob * self.n <= 1.0 <NEW_LI...
Softmax distribution. Args: logits (ndarray or chainer.Variable): Logits for softmax distribution. beta (float): inverse of the temperature parameter of softmax distribution min_prob (float): minimum probability across all labels
62598fafa219f33f346c683e
class SphericalCircle(Polygon): <NEW_LINE> <INDENT> def __init__(self, center, radius, resolution=100, vertex_unit=u.degree, **kwargs): <NEW_LINE> <INDENT> longitude, latitude = center <NEW_LINE> lon = np.linspace(0., 2 * np.pi, resolution + 1)[:-1] * u.radian <NEW_LINE> lat = np.repeat(0.5 * np.pi - radius.to_value(u....
Create a patch representing a spherical circle - that is, a circle that is formed of all the points that are within a certain angle of the central coordinates on a sphere. Here we assume that latitude goes from -90 to +90 This class is needed in cases where the user wants to add a circular patch to a celestial image, ...
62598fafcc0a2c111447b03a
class ExpRand(UGen): <NEW_LINE> <INDENT> __documentation_section__ = 'Noise UGens' <NEW_LINE> __slots__ = () <NEW_LINE> _ordered_input_names = ( 'minimum', 'maximum', ) <NEW_LINE> _valid_calculation_rates = None <NEW_LINE> def __init__( self, calculation_rate=None, minimum=0., maximum=1., ): <NEW_LINE> <INDENT> UGen.__...
An exponential random distribution. :: >>> exp_rand = ugentools.ExpRand.ir() >>> exp_rand ExpRand.ir()
62598faf5fc7496912d48295
class StudentViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Student.objects.all() <NEW_LINE> serializer_class = StudentSerializer
A simple ViewSet for viewing and editing the s.
62598faf3317a56b869be55f
class ContentPointer(): <NEW_LINE> <INDENT> content = None <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.content.__str__() <NEW_LINE> <DEDENT> def tag_id(self): <NEW_LINE> <INDENT> return self.content.tag_id() <NEW_LINE> <DEDENT> def details(self): <NEW_LINE> <INDENT> return self.content.details <NEW_LI...
Abstract manager for accessing and agregating the theory's points. Usage: This class can also be used to construct dummy Contents that will not show up in the database. Attributes: content (Content): The theory dependency. saved_true_points (float): Cache for the true points. saved_false_points (float...
62598faf8e7ae83300ee90cb
class FloatRangeField(models.FloatField): <NEW_LINE> <INDENT> def __init__(self, verbose_name=None, name=None, min_value=None, max_value=None, **kwargs): <NEW_LINE> <INDENT> self.min_value, self.max_value = min_value, max_value <NEW_LINE> models.FloatField.__init__(self, verbose_name, name, **kwargs) <NEW_LINE> <DEDENT...
Model for restricting float field range
62598fafd486a94d0ba2bff9
class AuditConfig(_messages.Message): <NEW_LINE> <INDENT> auditLogConfigs = _messages.MessageField('AuditLogConfig', 1, repeated=True) <NEW_LINE> exemptedMembers = _messages.StringField(2, repeated=True) <NEW_LINE> service = _messages.StringField(3)
Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two Au...
62598faf99cbb53fe6830f02
class MiniMaxPlayer(ComputerizedPlayer): <NEW_LINE> <INDENT> def __init__(self, color: str, max_depth=3): <NEW_LINE> <INDENT> super().__init__(color=color, name='MiniMaxPlayer') <NEW_LINE> self.next_move = None <NEW_LINE> self.MAX_DEPTH = max_depth <NEW_LINE> <DEDENT> def best_move(self, board: object) -> object: <NEW_...
A 'MiniMaxPlayer' is a computerized player and inherits from 'ComputerizedPlayer'. He chooses the best own move.
62598faf10dbd63aa1c70bdd
class Battery(): <NEW_LINE> <INDENT> def __init__(self, battery_size=70): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size) + "-kWh battery.") <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDE...
A simple attempt to model a battery for an electric car.
62598faf85dfad0860cbfa88
class Output(object): <NEW_LINE> <INDENT> def __init__(self, output): <NEW_LINE> <INDENT> self.beta = output[0] <NEW_LINE> self.sd_beta = output[1] <NEW_LINE> self.cov_beta = output[2] <NEW_LINE> if len(output) == 4: <NEW_LINE> <INDENT> self.__dict__.update(output[3]) <NEW_LINE> self.stopreason = _report_error(self.inf...
The Output class stores the output of an ODR run. Takes one argument for initialization, the return value from the function `odr`. Attributes ---------- beta : ndarray Estimated parameter values, of shape (q,). sd_beta : ndarray Standard errors of the estimated parameters, of shape (p,). cov_beta : ndarray ...
62598faf7c178a314d78d4c6
class HexesToStringTest(TestCase): <NEW_LINE> <INDENT> def test_stringing(self): <NEW_LINE> <INDENT> stringed = COLOR_CONVERTER.hexes_to_string(["80", "80", "80"]) <NEW_LINE> self.assertEqual(stringed, "808080") <NEW_LINE> <DEDENT> def test_rgba(self): <NEW_LINE> <INDENT> stringed = COLOR_CONVERTER.hexes_to_string(["80...
This test guerentees that a proper string conversion .
62598faf283ffb24f3cf38b6
class ImageResult(EqualityMixin): <NEW_LINE> <INDENT> def __init__(self, ndarray, properties, bandinfo, geocontext): <NEW_LINE> <INDENT> self.ndarray = ndarray <NEW_LINE> self.properties = properties <NEW_LINE> self.bandinfo = collections.OrderedDict(**bandinfo) <NEW_LINE> self.geocontext = geocontext <NEW_LINE> <DEDEN...
Result of calling `~.models.compute` on an `~.geospatial.Image`. Examples -------- >>> from descarteslabs.workflows import Image >>> my_img = Image.from_id("sentinel-2:L1C:2019-05-04_13SDV_99_S2B_v1") >>> my_img.compute(my_geoctx) # my_geoctx is an arbitrary geocontext for 'my_img' # doctest: +SKIP ImageResult: * nd...
62598faf7d847024c075c3ed
class TransportException(RPCException): <NEW_LINE> <INDENT> code = 300
Exceptions in transport layer
62598faf4a966d76dd5eef01
class Command(BaseCommand): <NEW_LINE> <INDENT> help = 'Retrieve information about experiments from the catalog' <NEW_LINE> def add_arguments(self, parser): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> if args: <NEW_LINE> <INDENT> raise CommandError("infocatalog t...
Retrieve information about experiments from the catalog.
62598faf1b99ca400228f545
class UserArticleCategory(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'user_article_categories' <NEW_LINE> id = db.Column(db.String, primary_key=True) <NEW_LINE> user_id = db.Column(db.String, db.ForeignKey(u'users.id')) <NEW_LINE> category_id = db.Column(db.Integer) <NEW_LINE> category_name = db.Column(db.String) <...
docstring for UserArticleCategory
62598faf442bda511e95c482
class InternalLogger(BaseLogger): <NEW_LINE> <INDENT> __slots__ = ['output'] <NEW_LINE> def __init__(self, output, fields=None, options=None, min_level=None): <NEW_LINE> <INDENT> super(InternalLogger, self).__init__(fields, options, min_level) <NEW_LINE> self.output = output <NEW_LINE> <DEDENT> def _clone(self): <NEW_L...
Special-purpose logger for internal uses Sends messages directly to output, bypassing :data:`.emitters`. :ivar `Output` output: an output to write to
62598faf23849d37ff8510de
class FailError(Exception): <NEW_LINE> <INDENT> pass
This error class is the base for all errors that cause the current test case fails.
62598fafff9c53063f51a677
class Escenarios: <NEW_LINE> <INDENT> parametros_default = {'prob_40_creditos': 0.1, 'prob_50_creditos': 0.7, 'prob_55_creditos': 0.15, 'prob_60_creditos': 0.05, 'prob_visitar_profesor': 0.2, 'prob_atraso_notas_Mavrakis': 0.1, 'porcentaje_progreso_tarea_mail': 0.5, 'fiesta_mes': 1/30, 'partido_futbol_mes': 1/70, 'nivel...
Esta clase contiene los datos de escenarios.csv guardados en su atributo escenarios.
62598faf2ae34c7f260ab10c
class StraightFlush(Event): <NEW_LINE> <INDENT> def __call__(self, d, cards): <NEW_LINE> <INDENT> cards = d.reduce(cards) <NEW_LINE> cards = d.unique(cards) <NEW_LINE> cards = d.sort(cards) <NEW_LINE> cards_dict = d.separate(cards) <NEW_LINE> cards_dict = d.collapse(cards_dict) <NEW_LINE> for key in cards_dict.keys(): ...
check if there is a straight flush at hand without considering wild cards
62598faf4527f215b58e9f00
@dbus_error("PayloadNotSetError", namespace=PAYLOADS_NAMESPACE) <NEW_LINE> class PayloadNotSetError(AnacondaError): <NEW_LINE> <INDENT> pass
Payload is not set.
62598faf92d797404e388b79
class WhoisRu(WhoisEntry): <NEW_LINE> <INDENT> regex = { 'domain_name': 'domain: *(.+)', 'registrar': 'registrar: *(.+)', 'creation_date': 'created: *(.+)', 'expiration_date': 'paid-till: *(.+)', 'updated_date': None, 'name_servers': 'nserver: *(.+)', 'status': 'state: *(.+)', 'emails': EMAIL_REGEX, 'registrant_org': '...
Whois parser for .ru domains
62598faf26068e7796d4c980
class NGramFeatureSpace: <NEW_LINE> <INDENT> def __init__(self, alphabet, n, Y, is_normalized): <NEW_LINE> <INDENT> self.feature_space = build_feature_space_without_positions(alphabet, n, Y) <NEW_LINE> self._normalize(is_normalized, self.feature_space) <NEW_LINE> <DEDENT> def _normalize(self, is_normalized, feature_spa...
Output feature space for the N-Gram Kernel Creates a sparse matrix representation of the n-grams in each training string. This is used to compute the weights of the graph during the inference phase. Attributes ---------- feature_space : sparse matrix, shape = [n_samples, len(alphabet)**n] Sparse matrix representa...
62598faf460517430c432073
class ExpressRouteCircuitPeeringConfig(Model): <NEW_LINE> <INDENT> _attribute_map = { 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, 'customer_asn': {'key': 'customerASN', 'type': 'int'}, 'r...
Specifies the peering configuration. :param advertised_public_prefixes: The reference of AdvertisedPublicPrefixes. :type advertised_public_prefixes: list of str :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configur...
62598fb001c39578d7f12daa
class CustomerDao: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def save(cls, customer): <NEW_LINE> <INDENT> print("Saving customer {} with {} years".format(customer.name, customer.age))
Customer's DataAccess class
62598fb0baa26c4b54d4f2df
class RisParser(BaseParser): <NEW_LINE> <INDENT> START_TAG = "TY" <NEW_LINE> PATTERN = r"^[A-Z][A-Z0-9] - |^ER -\s*$" <NEW_LINE> DEFAULT_MAPPING = TAG_KEY_MAPPING <NEW_LINE> DEFAULT_LIST_TAGS = LIST_TYPE_TAGS <NEW_LINE> counter_re = re.compile("^[0-9]+.") <NEW_LINE> def get_content(self, line): <NEW_LINE> <INDENT> re...
Subclass of Base for reading base RIS files.
62598fb0d7e4931a7ef3c0c0
class ManagerDeploymentsInsertRequest(_messages.Message): <NEW_LINE> <INDENT> deployment = _messages.MessageField('Deployment', 1) <NEW_LINE> projectId = _messages.StringField(2, required=True) <NEW_LINE> region = _messages.StringField(3, required=True)
A ManagerDeploymentsInsertRequest object. Fields: deployment: A Deployment resource to be passed as the request body. projectId: A string attribute. region: A string attribute.
62598fb0f548e778e596b5cf
class RankType: <NEW_LINE> <INDENT> Max = 'max' <NEW_LINE> Min = 'min' <NEW_LINE> Same = 'same' <NEW_LINE> Sink = 'sink' <NEW_LINE> Source = 'source'
These values can be used for Dotter.rank()
62598fb0dd821e528d6d8f60
class TestBankAccess(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 testBankAccess(self): <NEW_LINE> <INDENT> pass
BankAccess unit test stubs
62598fb099cbb53fe6830f04
class _Integrator: <NEW_LINE> <INDENT> def __init__(self, image, geometry, angles, radii, intensities): <NEW_LINE> <INDENT> self._image = image <NEW_LINE> self._geometry = geometry <NEW_LINE> self._angles = angles <NEW_LINE> self._radii = radii <NEW_LINE> self._intensities = intensities <NEW_LINE> self._i_range = range...
Base class that supports different kinds of pixel integration methods. Parameters ---------- image : 2D `~numpy.ndarray` The image array. geometry : `~photutils.isophote.EllipseGeometry` instance Object that encapsulates geometry information about current ellipse. angles : list Output list; contains...
62598fb0e1aae11d1e7ce839
class SensorForce(Element): <NEW_LINE> <INDENT> def __init__( self, site, cutoff: float=None, name: str=None, noise: float=None, user: str="0 0 ...", ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.site = site <NEW_LINE> self.cutoff = cutoff <NEW_LINE> self.name = name <NEW_LINE> self.noise = noise <NEW_LINE>...
This element creates a 3-axis force sensor. The sensor outputs three numbers, which are the interaction force between a child and a parent body, expressed in the site frame defining the sensor. The convention is that the site is attached to the child body, and the force points from the child towards the parent. To...
62598fb01f5feb6acb162c4a
class ResultIter(object): <NEW_LINE> <INDENT> def __init__(self, result_proxies, row_type=dict): <NEW_LINE> <INDENT> if not isgenerator(result_proxies): <NEW_LINE> <INDENT> result_proxies = iter((result_proxies, )) <NEW_LINE> <DEDENT> self.result_proxies = result_proxies <NEW_LINE> self.row_type = row_type <NEW_LINE> s...
SQLAlchemy ResultProxies are not iterable to get a list of dictionaries. This is to wrap them.
62598fb021bff66bcd722c92
class FileConsentCard(Model): <NEW_LINE> <INDENT> _attribute_map = { "description": {"key": "description", "type": "str"}, "size_in_bytes": {"key": "sizeInBytes", "type": "long"}, "accept_context": {"key": "acceptContext", "type": "object"}, "decline_context": {"key": "declineContext", "type": "object"}, } <NEW_LINE> d...
File consent card attachment. :param description: File description. :type description: str :param size_in_bytes: Size of the file to be uploaded in Bytes. :type size_in_bytes: long :param accept_context: Context sent back to the Bot if user consented to upload. This is free flow schema and is sent back in Value field...
62598fb0851cf427c66b82e7
class KlassRescheduleView(KlassStartView): <NEW_LINE> <INDENT> template_name = 'teachers/clients/klass_reschedule.html' <NEW_LINE> form_class = forms.KlassRescheduleForm <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> self.klass.program_usage.delete() <NEW_LINE> self.client = self.klass.contract.client <NEW_...
Same as the klass start but don't deal with students, just reset the already existent users passwords.
62598fb0a8370b77170f0407
class Extraction: <NEW_LINE> <INDENT> def __init__(self, sent, pred, args, probs, calc_prob = lambda probs: 1.0 / (reduce(lambda x, y: x * y, probs) + 0.001)): <NEW_LINE> <INDENT> self.sent = sent <NEW_LINE> self.calc_prob = calc_prob <NEW_LINE> self.probs = probs <NEW_LINE> self.prob = self.calc_prob(self.probs) <NEW_...
Store and print an OIE extraction
62598fb0796e427e5384e7c0
class Pin: <NEW_LINE> <INDENT> def __init__(self,pin_number,frequency=50,duty_cycle=100,as_input=False,initial_pull=None): <NEW_LINE> <INDENT> self.pin_number = pin_number <NEW_LINE> self.duty_cycle = duty_cycle <NEW_LINE> self.frequency = frequency <NEW_LINE> self.as_input = as_input <NEW_LINE> self._pwm = None <NEW_L...
Class that controls a raspberry pi GPIO pin.
62598fb04c3428357761a2e5
class DeleteVariantOperator(Operator): <NEW_LINE> <INDENT> bl_idname = "angel.delete_variant" <NEW_LINE> bl_label = "Delete Variant" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> scene = context.scene <NEW_LINE> angel = scene.angel <NEW_LINE> if angel.selected_v...
Deletes the currently selected variant
62598fb07c178a314d78d4c8
class ReallocateTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dojo = Dojo() <NEW_LINE> <DEDENT> def test_check_which_room_person_is(self): <NEW_LINE> <INDENT> dict_a = { 'Mandela': ['David', 'Samuel', 'Turi'], 'Machel':['Anne', 'Linet', 'Turi'] } <NEW_LINE> dict_b = { 'Nyerere':...
Test the dojo module
62598fb04f6381625f1994d5
class SyncLogModel(S3Model): <NEW_LINE> <INDENT> names = ("sync_log", ) <NEW_LINE> def model(self): <NEW_LINE> <INDENT> T = current.T <NEW_LINE> s3 = current.response.s3 <NEW_LINE> crud_strings = s3.crud_strings <NEW_LINE> s3_datetime_represent = lambda dt: S3DateTime.datetime_represent(d...
Model for the Sync log
62598fb04527f215b58e9f01
class DescribeListPacketFilterConfigResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Total = None <NEW_LINE> self.ConfigList = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Total = params.get("Total") <NEW_LINE...
DescribeListPacketFilterConfig返回参数结构体
62598fb07047854f4633f406
class _BatchLoaderFromDisk(_BatchLoader): <NEW_LINE> <INDENT> def update_parameters(self): <NEW_LINE> <INDENT> path = self.parameters["path"].get() <NEW_LINE> should_reload = False <NEW_LINE> if self.path != path: <NEW_LINE> <INDENT> self.path = path <NEW_LINE> should_reload = True <NEW_LINE> <DEDENT> return super().up...
Base element for loading data from disk. Deriving elements should contain path parameter.
62598fb07d43ff2487427418
class Rodenticide(CharField): <NEW_LINE> <INDENT> def to_python(self, value): <NEW_LINE> <INDENT> return unmangle(super(Rodenticide, self).to_python(value))
Undo the text mangling done by TinyMCE
62598fb0aad79263cf42e800
class OrganisationRepos(UserRepos): <NEW_LINE> <INDENT> def get_repos(self): <NEW_LINE> <INDENT> org_name = self.kwargs['name'] <NEW_LINE> org = self.gh.gh.organization(org_name) <NEW_LINE> return self.gh.org_repos(org)
Retrieve an organisation's repos from github. The organisation name is kwarg ``name`` in the URL pattern.
62598fb05fc7496912d48297
class Environment(object): <NEW_LINE> <INDENT> def __init__(self, gym_env, action_repeat): <NEW_LINE> <INDENT> self.env = gym_env <NEW_LINE> self.timespan = action_repeat <NEW_LINE> self.gym_actions = 2 <NEW_LINE> self.state_buffer = deque() <NEW_LINE> <DEDENT> def get_action_size(self): <NEW_LINE> <INDENT> return self...
Environment Helper Class (Multiple State Buffer) for Continuous Action Environments (MountainCarContinuous-v0, LunarLanderContinuous-v2, etc..), and MujuCo Environments
62598fb016aa5153ce40052f
class BaseASpaceClient(requests.Session): <NEW_LINE> <INDENT> def __init__(self, api_host: str = constants.DEFAULT_API_HOST, username: str = constants.DEFAULT_USERNAME, password: str = constants.DEFAULT_PASSWORD, auto_auth=True): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.aspace_api_host = api_host.strip() ...
Extends the Session class from the requests Python library, adding methods that abstract ArchivesSpace-specific functionality.
62598fb0baa26c4b54d4f2e1
class PadMaker: <NEW_LINE> <INDENT> def __init__(self, module): <NEW_LINE> <INDENT> self.module = module <NEW_LINE> <DEDENT> def THPad(self, w, l, drill, shape=pcbnew.PAD_OVAL): <NEW_LINE> <INDENT> pad = pcbnew.D_PAD(self.module) <NEW_LINE> pad.SetSize(pcbnew.wxSize(l, w)) <NEW_LINE> pad.SetShape(shape) <NEW_LINE> pad....
Useful construction functions for common types of pads
62598fb0d58c6744b42dc2ee
class Topic(Base): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = u'专题' <NEW_LINE> verbose_name_plural = u'专题'
专题 Model
62598fb055399d3f05626551
class ServiceIntro(ServiceDescriptionDirective): <NEW_LINE> <INDENT> def generate_rst(self, d, api_version): <NEW_LINE> <INDENT> rawtext = "" <NEW_LINE> scalar = {} <NEW_LINE> for key in d.description: <NEW_LINE> <INDENT> if isinstance(d[key], str) or isinstance(d[key], unicode): <NEW_LINE> <INDENT> scalar[key] = d[key...
Creates a service introduction to inject into a document
62598fb08e7ae83300ee90d0
class ParallelPyBGEN(PyBGEN): <NEW_LINE> <INDENT> def __init__(self, fn, prob_t=0.9, cpus=2, probs_only=False, max_variants=1000): <NEW_LINE> <INDENT> super(ParallelPyBGEN, self).__init__( fn, mode="r", prob_t=prob_t, probs_only=probs_only, ) <NEW_LINE> self.cpus = cpus <NEW_LINE> self._max_variants = max_variants <NEW...
Reads BGEN files in parallel. Args: fn (str): The name of the BGEN file. prob_t (float): The probability threshold (optional). cpus (int): The number of CPUs (default is 2). probs_only (boolean): Return only the probabilities instead of dosage. max_variants (int): The maximal number of variants in ...
62598fb0cc0a2c111447b03f
class GeneralError(ExitCodeError): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError("Please use the constructor taking an error message describing what is wrong!") <NEW_LINE> <DEDENT> def __init__(self, message, *args): <NEW_LINE> <INDENT> super(CommandLineArgumentError, self).__ini...
Exception that is raised, if an error occurs that cannot be specified any further. Attributes: message (str) : Explanation of the error.
62598fb0851cf427c66b82e9
class Client(tcp.Client): <NEW_LINE> <INDENT> implementsOnly(interfaces.ISSLTransport, *[i for i in implementedBy(tcp.Client) if i != interfaces.ITLSTransport]) <NEW_LINE> def __init__(self, host, port, bindAddress, ctxFactory, connector, reactor=None): <NEW_LINE> <INDENT> self.ctxFactory = ctxFactory <NEW_LINE> tcp.Cl...
I am an SSL client.
62598fb0bd1bec0571e150d9
class ReleaseCustomName(Item): <NEW_LINE> <INDENT> @property <NEW_LINE> def title(self): <NEW_LINE> <INDENT> if hasattr(self, 'projecttitle') and hasattr(self, 'releasenumber'): <NEW_LINE> <INDENT> if self.projecttitle is None: <NEW_LINE> <INDENT> self.projecttitle = '' <NEW_LINE> <DEDENT> return self.projecttitle + ' ...
Custom name for a release and linked release from the title and the release number
62598fb04e4d562566372454
class BatchDescription: <NEW_LINE> <INDENT> def __init__(self, dict): <NEW_LINE> <INDENT> for k, v in dict.items(): <NEW_LINE> <INDENT> setattr(self, "_" + k, v) <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self, attribute): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def bestBeforeDescription(self): <NEW_LINE>...
Attributes: _bestBeforeDescription (string, optional): "best before" date range for the batch _bestBeforeDate (string, optional): "best before" date (or dates) for the batch _useByDescription (string, optional): "use by" date range for the batch _useByDate (string, optional): "use by" date (or dates) f...
62598fb0a05bb46b3848a899
class Backend(BaseBackend): <NEW_LINE> <INDENT> can_detect_close = False <NEW_LINE> def __init__(self, push=None, feedback=None, **options): <NEW_LINE> <INDENT> super(Backend, self).__init__(**options) <NEW_LINE> self.push_results = push <NEW_LINE> self.push_result_pos = -1 <NEW_LINE> self.feedback_results = feedback <...
Dummy backend designed for testing without performing real IO. Serves as an exmple for your custom backends.
62598fb0fff4ab517ebcd813
class OneMayorCollegeProjectCreated(MayorCollegeCondition): <NEW_LINE> <INDENT> def evaluate(self): <NEW_LINE> <INDENT> mayor_events = self.licence.getAllMayorColleges() <NEW_LINE> if not mayor_events: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> for event in mayor_events: <NEW_LINE> <INDENT> if api.content.get...
At least one MayorCollege project is created
62598fb01b99ca400228f547
class TestLoginApi(unittest.TestCase): <NEW_LINE> <INDENT> def test_login_api(self): <NEW_LINE> <INDENT> url = "http://sytest.54315.com/login" <NEW_LINE> querystring = {"mobile": "13727086330", "password": "qwe123"} <NEW_LINE> headers = { 'Cache-Control': "no-cache", 'Postman-Token': "167d7ea0-c440-4bfb-9f40-08d7169599...
登陆接口测试
62598fb04a966d76dd5eef05
class WebsiteMiddleware(PageMiddleware): <NEW_LINE> <INDENT> def process_response_text(self, response): <NEW_LINE> <INDENT> url: str = response.url <NEW_LINE> text: str = response.text <NEW_LINE> text = self.replace_to_real_link(url, text) <NEW_LINE> return text <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def replace_...
只把非 html 的链接替换了,html 的保持不变
62598fb0cb5e8a47e493c190
class Opposite(PrimaryVisibility): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> PrimaryVisibility.__init__(self) <NEW_LINE> self._name = "Opposite" <NEW_LINE> self._message = "{0} mesh(es) are set to opposite" <NEW_LINE> self._attribute = ".opposite" <NEW_LINE> self._errorBool = True
Meshes will be checked to see if they are set to opposite. When fixing this error opposite state will be turned off.
62598fb001c39578d7f12dad
class Producer: <NEW_LINE> <INDENT> def producer(self): <NEW_LINE> <INDENT> print("Producer is working hard") <NEW_LINE> <DEDENT> def meet(self): <NEW_LINE> <INDENT> print("producer has time to meet you now")
Define the 'resource-intensive' object to instantiate
62598fb0aad79263cf42e802
class ProductionConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = False
This class sets the PRODUCTION environment variables
62598fb032920d7e50bc6083
class Catalog(BaseMunkiModel): <NEW_LINE> <INDENT> package_names = db.StringListProperty() <NEW_LINE> PLIST_LIB_CLASS = plist_lib.MunkiPlist <NEW_LINE> @classmethod <NEW_LINE> def Generate(cls, name, delay=0): <NEW_LINE> <INDENT> if delay: <NEW_LINE> <INDENT> now = datetime.datetime.utcnow() <NEW_LINE> now_str = '%s-%d...
Munki catalog. These will be automatically generated on App Engine whenever an admin uploads a pkginfo file. Note: There is also an "all" catalog that includes all packages.
62598fb04428ac0f6e658554
class IntegerTypeMixin: <NEW_LINE> <INDENT> def getName(self): <NEW_LINE> <INDENT> return 'i' + str(self.getBits()) <NEW_LINE> <DEDENT> def key(self): <NEW_LINE> <INDENT> return (self.typeId(), self.getBits()) <NEW_LINE> <DEDENT> def isAssignable(self, value): <NEW_LINE> <INDENT> return isinstance(value, (int, float))
Mixin methods for integer type.
62598fb04e4d562566372455
class DispersingGhost( ghostAgents.GhostAgent ): <NEW_LINE> <INDENT> def __init__( self, index, spreadProb=0.5): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> self.spreadProb = spreadProb <NEW_LINE> <DEDENT> def getDistribution( self, state ): <NEW_LINE> <INDENT> ghostState = state.getGhostState( self.index ) <NEW_...
Chooses an action that distances the ghost from the other ghosts with probability spreadProb.
62598fb03539df3088ecc2e1
@attributes( [ Attribute(name="index", default_value=lib.CV_CAP_ANY), ], ) <NEW_LINE> class Camera(object): <NEW_LINE> <INDENT> def frames(self): <NEW_LINE> <INDENT> capture = lib.cvCreateCameraCapture(self.index) <NEW_LINE> if capture == ffi.NULL: <NEW_LINE> <INDENT> raise InitializationError(self) <NEW_LINE> <DEDENT>...
A camera device.
62598fb0baa26c4b54d4f2e3
class ClassificationProvider: <NEW_LINE> <INDENT> def __init__(self, class_data, folds, batch_size): <NEW_LINE> <INDENT> self.queue = Queue(10) <NEW_LINE> proc = Process( target=_fill_queue, args=(self.queue, class_data, folds, batch_size)) <NEW_LINE> proc.daemon = True <NEW_LINE> proc.start() <NEW_LINE> <DEDENT> def g...
Class for generating batches of balanced classification sequences.
62598fb001c39578d7f12dae
class Legend(TypedDict, total=False): <NEW_LINE> <INDENT> mime_type: str <NEW_LINE> href: str <NEW_LINE> max_resolution: float <NEW_LINE> min_resolution: float <NEW_LINE> width: int <NEW_LINE> height: int
Legend fields.
62598fb05fdd1c0f98e5dfbb
class TestLookmlModelExploreSupportedMeasureType(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 testLookmlModelExploreSupportedMeasureType(self): <NEW_LINE> <INDENT> pass
LookmlModelExploreSupportedMeasureType unit test stubs
62598fb0d58c6744b42dc2ef
class TreeAdaptor(object): <NEW_LINE> <INDENT> def createWithPayload(self, payload): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def dupTree(self, tree): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def dupNode(self, treeNode): <NEW_LINE> <INDENT> raise NotImplementedError <NE...
@brief Abstract baseclass for tree adaptors. How to create and navigate trees. Rather than have a separate factory and adaptor, I've merged them. Makes sense to encapsulate. This takes the place of the tree construction code generated in the generated code in 2.x and the ASTFactory. I do not need to know the type ...
62598fb0090684286d5936f4
class MsanV8Builder(V8Builder): <NEW_LINE> <INDENT> def setup_gn_args(self): <NEW_LINE> <INDENT> super(MsanV8Builder, self).setup_gn_args() <NEW_LINE> args_hash = self.deserialize_gn_args(self.gn_args) <NEW_LINE> msan_track_origins_value = (int(args_hash['msan_track_origins']) if 'msan_track_origins' in args_hash else ...
Build a MSAN V8 build.
62598fb063b5f9789fe85197
class updateIdcForm(forms.ModelForm): <NEW_LINE> <INDENT> module = models.Idc <NEW_LINE> fields = ('virIP',)
更新业务验证
62598fb08da39b475be03215
class FtwDashboardPortletManagerRenderer(DashboardPortletManagerRenderer): <NEW_LINE> <INDENT> adapts( INavigationRoot, IDashboardLayer, IBrowserView, IDashboard) <NEW_LINE> template = ViewPageTemplateFile('templates/dashboard-column.pt') <NEW_LINE> def isEditable(self, portlet): <NEW_LINE> <INDENT> if queryMultiAdapte...
Render a column of the dashboard
62598fb0d486a94d0ba2bffe
class InvalidBallotException(ValueError): <NEW_LINE> <INDENT> pass
The provided ballot is invalid for this election
62598fb056ac1b37e630221b
class ReverseList(): <NEW_LINE> <INDENT> def __init__(self, l=None): <NEW_LINE> <INDENT> self.index = 0 <NEW_LINE> self.l = l <NEW_LINE> if l is not None: <NEW_LINE> <INDENT> self.num_elements = len(l) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.num_elements = 0 <NEW_LINE> <DEDENT> <DEDENT> def __repr__(self): <...
Iterator that outputs the list in reverse.
62598fb05166f23b2e243409
class DomainSpecificString( namedtuple("DomainSpecificString", ("localpart", "domain")) ): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> raise ValueError("Attempted to iterate a %s" % (type(self).__name__,)) <NEW_LINE> <DEDENT> def __copy__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __...
Common base class among ID/name strings that have a local part and a domain name, prefixed with a sigil. Has the fields: 'localpart' : The local part of the name (without the leading sigil) 'domain' : The domain part of the name
62598fb01f5feb6acb162c4e
class Lecture(db.Model, ModelMixin): <NEW_LINE> <INDENT> __tablename__ = 'lecture' <NEW_LINE> LECTURE_STATE_VALUES = ('published', 'recording', 'coming', 'deleted') <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(20)) <NEW_LINE> description = db.Column(db.Text) <NEW_LINE> c...
Model of Course
62598fb056b00c62f0fb28e5
class FakeLog(object): <NEW_LINE> <INDENT> def __init__(self, prefix): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> self.messages = [] <NEW_LINE> <DEDENT> def exception(self): <NEW_LINE> <INDENT> info = sys.exc_info() <NEW_LINE> self.messages.append(info)
Fake logger that allows us to pick the log messages out from within unit tests.
62598fb03346ee7daa33765f
class Widget(CountableWidget): <NEW_LINE> <INDENT> widget_type = 'intselect' <NEW_LINE> widget_label = _('Int Select') <NEW_LINE> groups = ( DefaultSchemata, LayoutSchemata, CountableSchemata, DisplaySchemata ) <NEW_LINE> index = ViewPageTemplateFile('widget.pt') <NEW_LINE> @property <NEW_LINE> def default(self): <NEW_...
Widget
62598fb08a43f66fc4bf21ab
class UserQuestRelationship(models.Model): <NEW_LINE> <INDENT> task = models.ForeignKey(Task) <NEW_LINE> user = models.ForeignKey(User) <NEW_LINE> views = models.ManyToManyField('document.View', help_text='The 10 (5 Quests * 2 Sections) Viewable blocks of text that are part of the Quest') <NEW_LINE> completed = models....
Describes a User's Status on a specific ER Quest We use this to track if a User has completed a Quest * Technically this can be inferred by if they'ved completed all of the documents within the quest, but was originally made to separate if a PMID appears in multiple Quests
62598fb0d7e4931a7ef3c0c4
class Motorcycle(Vehicle): <NEW_LINE> <INDENT> base_sale_price = 2000 <NEW_LINE> wheels = 2 <NEW_LINE> def vehicle_type(self): <NEW_LINE> <INDENT> return 'motorcycle' <NEW_LINE> <DEDENT> def is_motorcycle(self): <NEW_LINE> <INDENT> if self.wheels == 2: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else: <NEW_LINE...
A motorcycle for sale.
62598fb07047854f4633f40a
class ClustersPerLaneHandler(SafeHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> names= self.application.flowcells_db.view("lanes/clusters") <NEW_LINE> start=names.rows[0].key[0][:6] <NEW_LINE> end=names.rows[-1].key[0][:6] <NEW_LINE> start=start[:4]+'01' <NEW_LINE> end=end[:4]+'31' <NEW_LINE> t = self...
Serves a page with a plot of distribution of lane read production for a provided time interval.
62598fb0379a373c97d99044
class AuthorViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Author.objects.all() <NEW_LINE> serializer_class = AuthorSerializer <NEW_LINE> ordering_fields = '__all__' <NEW_LINE> ordering = ('-email',) <NEW_LINE> http_method_names = ['get', 'head']
API endpoint for Author.
62598fb02ae34c7f260ab112
class SleepTotalsChildReport(PermissionRequiredMixin, DetailView): <NEW_LINE> <INDENT> model = Child <NEW_LINE> permission_required = ('core.view_child',) <NEW_LINE> template_name = 'reports/sleep_totals.html' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(SleepTotalsChildReport, self).__init__() <NEW_LINE> s...
Graph of total sleep by day.
62598fb099cbb53fe6830f09
class EntropyEpochMetric(Metric): <NEW_LINE> <INDENT> def __init__(self, output_transform, sizes, iters): <NEW_LINE> <INDENT> self.sizes = sizes.cpu().numpy() <NEW_LINE> self.iters = iters <NEW_LINE> self.num_layers = len(self.sizes) <NEW_LINE> self._layers = np.zeros((self.num_layers, self.iters)) <NEW_LINE> self._num...
Entropy metric per epoch Entropy per layer per routing iter and entropy average correct for capsule size per routing iter.
62598fb0ff9c53063f51a67d
class Input(object): <NEW_LINE> <INDENT> def __init__(self, type='text'): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> <DEDENT> def render(self, field, rargs): <NEW_LINE> <INDENT> rargs.setdefault('type', self.type) <NEW_LINE> return Tag('input', name=field.name, value=field.cvalue, **rargs).render()
<input type="<type>">
62598fb04428ac0f6e658556
class DeltaSizeInfo(BaseSizeInfo): <NEW_LINE> <INDENT> __slots__ = ( 'before', 'after', ) <NEW_LINE> def __init__(self, before, after, section_sizes, raw_symbols): <NEW_LINE> <INDENT> super(DeltaSizeInfo, self).__init__(section_sizes, raw_symbols) <NEW_LINE> self.before = before <NEW_LINE> self.after = after
What you get when you Diff() two SizeInfo objects. Fields: before: SizeInfo for "before". after: SizeInfo for "after".
62598fb07047854f4633f40b
class SecretKey(object): <NEW_LINE> <INDENT> def __init__(self, secret=None): <NEW_LINE> <INDENT> if secret is None: <NEW_LINE> <INDENT> self.secret = [[8, 6, 9, 5], [6, 9, 5, 10], [5, 8, 4, 9], [10, 6, 11, 4]] <NEW_LINE> self.secret_inverse = [[-3, 20, -21, 1], [2, -41, 44, 1], [2, -6, 6, -1], [-1, 28, -30, -1]] <NEW_...
SecretKey for Hill's Cipher encryption is a square matrix. Decryption requires its inverse. SecretKey class member vars are secret key square matrix and inverse. Arbitrary 4x4 invertible matrix provided as default secret. If a matrix is provided, its inverse is calculated via LU factorization on GPU.
62598fb05fdd1c0f98e5dfbc