code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ManualTlsSni01(common.TLSSNI01): <NEW_LINE> <INDENT> def perform(self): <NEW_LINE> <INDENT> for achall in self.achalls: <NEW_LINE> <INDENT> self._setup_challenge_cert(achall)
TLS-SNI-01 authenticator for the Manual plugin :ivar configurator: Authenticator object :type configurator: :class:`~certbot.plugins.manual.Authenticator` :ivar list achalls: Annotated class:`~certbot.achallenges.KeyAuthorizationAnnotatedChallenge` challenges :param list indices: Meant to hold indices of cha...
6259904c07d97122c42180b6
class Kusto_Client(object): <NEW_LINE> <INDENT> _DEFAULT_CLIENTID = "db662dc1-0cfe-4e1c-a843-19a68e65be58" <NEW_LINE> def __init__(self, conn_kv): <NEW_LINE> <INDENT> kusto_cluster = "https://{0}.kusto.windows.net".format(conn_kv["cluster"]) <NEW_LINE> if all([conn_kv.get("username"), conn_kv.get("password")]): <NEW_LI...
Kusto client wrapper for Python. KustoClient works with both 2.x and 3.x flavors of Python. All primitive types are supported. KustoClient takes care of ADAL authentication, parsing response and giving you typed result set, and offers familiar Python DB API. Test are run using nose. Examples -------- To use KustoCli...
6259904cdc8b845886d549d0
class SSMSStyle(Style): <NEW_LINE> <INDENT> background_color = "#ffffff" <NEW_LINE> default_style = "" <NEW_LINE> styles = { Comment: "#008000", Keyword: "#0000ff", Operator: "#808080", Name: "#000000", Name.Function: "#ff00ff", Name....
A Pygments style inspired by Microsoft SSMS.
6259904cbe383301e0254c2e
class SingleUseTokenizer(DelimiterTokenizer): <NEW_LINE> <INDENT> def __init__(self, context: TokenizationContext, opening_delimiter:str, opening_delimiter_position:StreamPosition, opening_delimiter_position_after:StreamPosition): <NEW_LINE> <INDENT> Tokenizer.__init__(self, context) <NEW_LINE> self.opening_delimiter =...
Like a normal delimiter, but for equal opening and closing delimiter tokens. Inside the delimiter, no further uses are allowed.
6259904c7cff6e4e811b6e4e
class TestEnlightener(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.device1 = '99000512002151' <NEW_LINE> self.sheet_values = [ ['99000512002128', '1'], ['99000512000619', '2'] ] <NEW_LINE> self.new_values = [ ['99000512000621', '256'], ['99000512000648', '512'] ] <NEW_LINE> self.tes...
Test connections.
6259904c50485f2cf55dc39f
class AU(AST, namedtuple('AU', ['left', 'right'])): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'A[{left} U {right}]'.format(left=str(self.left), right=str(self.right))
The "strong until" operator (for all paths).
6259904c009cb60464d0294a
class INAC(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.preproVars = Preprocessing() <NEW_LINE> self.Model = Model(self.preproVars) <NEW_LINE> <DEDENT> def main(self): <NEW_LINE> <INDENT> loadOrCreate = '' <NEW_LINE> predictBool = '' <NEW_LINE> newOrOld = '' <NEW_LINE> while loadOrCreate not in (...
Given a dataset of .wav files you can create, train, save, load and use an AI model.
6259904c462c4b4f79dbce13
class TestAuthorsFile(TempDirTest): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> authors = os.path.join(self.dir, "authors") <NEW_LINE> with open(authors, "w") as file: <NEW_LINE> <INDENT> file.write( "user = Some Body <whoever@where.ever>\n" "tricky = E = mc squared\n" ) <NEW_LINE> <DEDENT> output = os.p...
Parsing authors file
6259904cd99f1b3c44d06aad
@implementer(IAfterTransition) <NEW_LINE> class AfterTransition(object): <NEW_LINE> <INDENT> def __init__(self, object, old_state, new_state, transition): <NEW_LINE> <INDENT> self.object = object <NEW_LINE> self.old_state = old_state <NEW_LINE> self.new_state = new_state <NEW_LINE> self.transition = transition
Event sent after any workflow transition happens
6259904cd6c5a102081e3530
class LatticeOpNode(OperandSetNode): <NEW_LINE> <INDENT> _optimize_new = False <NEW_LINE> def __init__(self, operands, *args, **why_kwargs): <NEW_LINE> <INDENT> why_therefore = why_kwargs.pop( 'why_identity_implies_all_operands_identity', None) <NEW_LINE> why_becauseof = why_kwargs.pop( 'why_all_operands_identity_impli...
An operation with the following properties: - Associative: op(op(A, B), C) == op(A, op(B, C)) - Commutative: op(A, B) == op(B, A) - Idempotent: op(A, A) == op(A) == A Neutral elements: - Identity: op(Identity, A) == A; op() == Identity - Zero: op(Zero, A) == Zero
6259904cb830903b9686ee84
@python_2_unicode_compatible <NEW_LINE> class Expection(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(verbose_name=_('User'), to=User) <NEW_LINE> title = models.CharField(verbose_name=_('Title'), max_length=15) <NEW_LINE> description = models.TextField(verbose_name=_('Description')) <NEW_LINE> def __str__...
期望,用于在期望
6259904c30c21e258be99c19
class Docs(): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.pids = list(self.data.keys()) <NEW_LINE> self.i = 0 <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> self.i += 1 <NEW_LINE> ...
Document iterator
6259904c29b78933be26aacc
class ClassInstance(object): <NEW_LINE> <INDENT> def __init__(self, class_entity, namespace): <NEW_LINE> <INDENT> self.class_entity = class_entity <NEW_LINE> self.namespace = namespace
Represents an instance of a user-defined class.
6259904c23849d37ff8524d1
class ConditionalCategoricalDistribution(object): <NEW_LINE> <INDENT> def __init__(self, size, interval, hidden_layer_sizes, hidden_activation_fn=tf.nn.tanh, initializers=None, fcnet=None, bias_init=0.0, name="conditional_categorical_distribution"): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.interval = interv...
A Categorical distribution conditioned on Tensor inputs via a fc net.
6259904c96565a6dacd2d993
class MethodGroup(object): <NEW_LINE> <INDENT> def __init__(self, group_name, exception_list): <NEW_LINE> <INDENT> self._group_name = group_name <NEW_LINE> self._exception_list = exception_list <NEW_LINE> <DEDENT> def group_name(self): <NEW_LINE> <INDENT> return self._group_name <NEW_LINE> <DEDENT> def __str__(self): <...
Base class containing common behaviour for MethodGroups.
6259904c0a50d4780f7067c7
class AbstractQueueDataset(AbstractDataset): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, data_dir, dataset_size, input_shape, target_shape, min_examples_in_queue=1024, queue_capacitiy=2048, num_threads=8): <NEW_LINE> <INDENT> self._min_examples_in_queue = min_examples_in_queue <NEW_LINE> s...
Dataset base class, used for datasets with input queue.
6259904c76e4537e8c3f0999
class BrepRegion(object): <NEW_LINE> <INDENT> def BoundaryBrep(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetFaceSides(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> BoundingBox=property(lambda self: object(),lambda self,v: None,lambda self: None) <NEW_LINE> Brep=property(lambda self: object(),lambda ...
Represents a brep topological region that has sides.
6259904c23e79379d538d912
class EveryValue(Tube): <NEW_LINE> <INDENT> def __init__(self, values, **kwargs): <NEW_LINE> <INDENT> self.index = -1 <NEW_LINE> self.values = list(values) <NEW_LINE> self.length = len(self.values) <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> if self.length == 0: <NEW_LINE> <INDENT> raise StopIteration <NEW_...
Yields values from the passed iterable in order, looping into infinity.
6259904cd53ae8145f919875
class CreateView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = todo.objects.all() <NEW_LINE> serializer_class = TodoSerializer
This class defines the create behavior of our rest api.
6259904cd7e4931a7ef3d48c
class CreditCourseAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> search_fields = ("course_key",)
Admin for credit courses.
6259904cbaa26c4b54d506bf
class Label(InstallerMixin, widgets.DOMWidget): <NEW_LINE> <INDENT> _view_name = Unicode('LabelView', sync=True) <NEW_LINE> _view_module = Unicode('nbextensions/ipbs/js/widget_label', sync=True) <NEW_LINE> value = CUnicode(sync=True) <NEW_LINE> html = Bool(False, sync=True) <NEW_LINE> lead = Bool(False, sync=True) <NEW...
Just some text...
6259904cec188e330fdf9cb3
class HttxOption(object): <NEW_LINE> <INDENT> __slots__ = ['name', 'defvalue', 'storage', '__weakref__'] <NEW_LINE> def __init__(self, name, defvalue): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.defvalue = defvalue <NEW_LINE> self.storage = dict() <NEW_LINE> <DEDENT> def __get__(self, instance, owner): <NEW_L...
A class representing an individual option. The class is implemented as a descriptor. The class locks access automatically on access (read/write) to the storage by using the lock from the instance object accessing the option. @ivar name: Name of the option @type name: str @ivar defvalue: Default value of the option @t...
6259904c07d97122c42180b8
class Test_get_job_or_promise(TransactionTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.q = Queue(scheduled=True) <NEW_LINE> self.timeout = 60 <NEW_LINE> future = now() + timedelta(seconds=self.timeout/2) <NEW_LINE> self.job = self.q.schedule_call(future, do_nothing) <NEW_LINE> <DEDENT> def te...
Test the Job._get_job_or_promise classmethod
6259904cb57a9660fecd2e92
class TGetSchemasReq(object): <NEW_LINE> <INDENT> def __init__(self, sessionHandle=None, catalogName=None, schemaName=None,): <NEW_LINE> <INDENT> self.sessionHandle = sessionHandle <NEW_LINE> self.catalogName = catalogName <NEW_LINE> self.schemaName = schemaName <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <IN...
Attributes: - sessionHandle - catalogName - schemaName
6259904cbe383301e0254c30
class Place: <NEW_LINE> <INDENT> def __init__(self, name, exit=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.exit = exit <NEW_LINE> self.bees = [] <NEW_LINE> self.ant = None <NEW_LINE> self.entrance = None <NEW_LINE> if self.exit!= None: <NEW_LINE> <INDENT> exit.entrance = self <NEW_LINE> <DEDENT> <DEDENT...
A Place holds insects and has an exit to another Place.
6259904c8e05c05ec3f6f865
class Body: <NEW_LINE> <INDENT> def __init__(self, mass, rx, ry, vx=0, vy=0, fx=0, fy=0, L=0, color='k'): <NEW_LINE> <INDENT> self.m = mass <NEW_LINE> self.r = np.array([rx,ry]) <NEW_LINE> self.v = np.array([vx,vy]) <NEW_LINE> self.f = np.array([fx,fy]) <NEW_LINE> self.L = L <NEW_LINE> self.c = color <NEW_LINE> <DEDENT...
definition for object with mass
6259904c16aa5153ce401903
class AudioUnit(object): <NEW_LINE> <INDENT> def __init__(self, ah_audiounit): <NEW_LINE> <INDENT> self._ah_au = ah_audiounit <NEW_LINE> self._desc = None <NEW_LINE> self._ah_parameters = {} <NEW_LINE> self._ah_parameters_dicts = {} <NEW_LINE> self._last_aupreset = '' <NEW_LINE> <DEDENT> def get_parameters(self, scope ...
Represents an AudioUnit. Should not be created directly, but instead be taken from an AHTrack.
6259904c3c8af77a43b68948
class TensorBoardBmode(tf.keras.callbacks.TensorBoard): <NEW_LINE> <INDENT> def __init__(self, val_data, *args, **kwargs): <NEW_LINE> <INDENT> self.val_data = val_data <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def set_model(self, *args, **kwargs): <NEW_LINE> <INDENT> super().set_model(*args, **kw...
TensorBoardBmode extends tf.keras.callbacks.TensorBoard, adding custom processing upon setup and after every epoch to store properly processed ultrasound images.
6259904c24f1403a926862d8
class HistorialPagosPDF(PDFTemplateView): <NEW_LINE> <INDENT> filename = 'recibo_de_entrega.pdf' <NEW_LINE> show_content_in_browser = True <NEW_LINE> template_name = 'historial_pagos.html' <NEW_LINE> footer_template = 'footerpdf.html' <NEW_LINE> paciente = None <NEW_LINE> cmd_options = { 'margin-top': 20, 'margin-botto...
pdf que hace posible entrgar un estado de cuenta del paciente
6259904c097d151d1a2c2484
class LetterIter: <NEW_LINE> <INDENT> def __init__(self, start='a', end='e'): <NEW_LINE> <INDENT> self.next_letter = start <NEW_LINE> self.end = end <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> if self.next_letter == self.end: <NEW_L...
An iterator over letters of the alphabet in ASCII order.
6259904cb830903b9686ee85
class Bars(Weapon): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> atk = random.uniform(2.0,2.4) <NEW_LINE> name = "Chocolate Bars" <NEW_LINE> uses = 4 <NEW_LINE> super().__init__(name,atk,uses)
Weapon of player with 4 uses
6259904cb5575c28eb7136d4
class ActivityTypeView(mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> authentication_classes = (authentication.SessionAuthentication, JSONWebTokenAuthentication) <NEW_LINE> permission_classes = (IsAuthenticated, IsOwnerOrReadOnly) <NEW_LINE> queryset = ActivityTypeModel....
获取全部活动分类
6259904c0fa83653e46f62f4
class SubjectOfInvestigation(YAMLRoot): <NEW_LINE> <INDENT> _inherited_slots: ClassVar[List[str]] = [] <NEW_LINE> class_class_uri: ClassVar[URIRef] = CSOLINK.SubjectOfInvestigation <NEW_LINE> class_class_curie: ClassVar[str] = "csolink:SubjectOfInvestigation" <NEW_LINE> class_name: ClassVar[str] = "subject of investiga...
An entity that has the role of being studied in an investigation, study, or experiment
6259904ca8ecb03325872628
class TensorBoardStepCallback(Callback): <NEW_LINE> <INDENT> def __init__(self, log_dir, logging_per_steps=100, step=0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.step = step <NEW_LINE> self.logging_per_steps = logging_per_steps <NEW_LINE> self.writer = tf.summary.FileWriter(log_dir) <NEW_LINE> <DEDENT> de...
Tensorboard basic visualizations by step.
6259904c3cc13d1c6d466b4f
class NoramalizeMinMaxFixWindow(object): <NEW_LINE> <INDENT> def __init__(self, sampleWindowSize, cliping=False): <NEW_LINE> <INDENT> self._cliping = cliping <NEW_LINE> self._sampleWindowSize = sampleWindowSize <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> data = sample['data'] <NEW_LINE> low = -1...
Normalize data using min max technique
6259904c3617ad0b5ee07555
@pyblish.api.log <NEW_LINE> class IntegrateMasterRig(pyblish.api.InstancePlugin): <NEW_LINE> <INDENT> order = pyblish.api.IntegratorOrder <NEW_LINE> families = ['scene'] <NEW_LINE> label = 'Master Rig' <NEW_LINE> def process(self, instance): <NEW_LINE> <INDENT> sourcePath = os.path.normpath(instance.context.data('curre...
Copies asset to it's final location
6259904c6e29344779b01a58
class Section(object): <NEW_LINE> <INDENT> def __init__(self, name, lon, lat, dire): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.lat = np.array(lat) <NEW_LINE> self.lon = np.array(lon) <NEW_LINE> self.dire = np.array(dire) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> output = 'Section %s\n' % sel...
Section endpoint object.
6259904c45492302aabfd8ea
class exact_length(): <NEW_LINE> <INDENT> def __init__(self, L=101): <NEW_LINE> <INDENT> self.L = L + 1 <NEW_LINE> self.failures = 0 <NEW_LINE> <DEDENT> def __call__(self, r1, r2): <NEW_LINE> <INDENT> predicate = (len(r1) == self.L) and (len(r2) == self.L) <NEW_LINE> if not predicate: <NEW_LINE> <INDENT> self.failures ...
Filter any read that does not have length ``L`` :param L: Read filter length
6259904c711fe17d825e16a9
class Meta(object): <NEW_LINE> <INDENT> get_latest_by = 'created_at' <NEW_LINE> ordering = ['-promoted', '-created_at'] <NEW_LINE> permissions = ( ('can_promote_image', 'Can promote an image'), ('can_access_admin_gallery', 'Can access the admin gallery') )
Meta options for Image model.
6259904cd10714528d69f099
class IGcsLayer(Interface): <NEW_LINE> <INDENT> pass
Theme layer.
6259904c73bcbd0ca4bcb6a0
class TestTierPermission(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 testTierPermission(self): <NEW_LINE> <INDENT> pass
TierPermission unit test stubs
6259904c8e05c05ec3f6f866
class SingleProduct(Resource, Product): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @jwt_required <NEW_LINE> @token_required <NEW_LINE> def get(self, product_id): <NEW_LINE> <INDENT> return product.get_single_product(product_id) <NEW_LINE> <DEDENT> @jwt_required <NEW_LINE> @admi...
This resource will be used to retrieves a single product
6259904c462c4b4f79dbce17
class SDRCallback(MetricCallback): <NEW_LINE> <INDENT> def __init__( self, input_key: str = "targets", output_key: str = "logits", prefix: str = "sdr", mixed_audio_key: str = "input_audio", ): <NEW_LINE> <INDENT> self.mixed_audio_key = mixed_audio_key <NEW_LINE> super().__init__(prefix=prefix, metric_fn=snr, input_key=...
SDR callback. Args: input_key (str): input key to use for dice calculation; specifies our y_true. output_key (str): output key to use for dice calculation; specifies our y_pred.
6259904c596a897236128fba
class ChunkedSimplePeakFinder(IPeakFinder): <NEW_LINE> <INDENT> def __init__(self, threshold=0.05, nchunks=10): <NEW_LINE> <INDENT> self.threshold = threshold <NEW_LINE> self.nchunks = nchunks <NEW_LINE> <DEDENT> def find(self, data): <NEW_LINE> <INDENT> peaks = [] <NEW_LINE> pf = SimplePeakFinder(threshold=self.thresh...
Breaks the spectrum up into nchunks applying the threshold relative to that chunk
6259904c15baa723494633a4
class PatientDataPayload(models.Model): <NEW_LINE> <INDENT> STATUS_CHOICES = ( ('received', 'Received'), ('error', 'Error'), ('success', 'Success'), ) <NEW_LINE> raw_data = models.TextField() <NEW_LINE> submit_date = models.DateTimeField() <NEW_LINE> status = models.CharField(max_length=16, default='received', choices=...
Dumping area for incoming patient data XML snippets
6259904c96565a6dacd2d995
class Theme(object): <NEW_LINE> <INDENT> Format = flags( "NONE", "CENTER_HORZ", "CENTER_VERT", "PAD_HORZ", "PAD_VERT", ) <NEW_LINE> Format.CENTER_FULL = Format.CENTER_HORZ | Format.CENTER_VERT <NEW_LINE> Format.PAD_FULL = Format.PAD_HORZ | Format.PAD_VERT <NEW_LINE> DEFAULT_FONT_COLOR = pg.Color(255, 255, 255) <NEW_LIN...
Base Theme acting as a Base Class for all other themes.
6259904c76e4537e8c3f099d
class HttpTestServer(object): <NEW_LINE> <INDENT> def __init__(self, use_ssl=False): <NEW_LINE> <INDENT> self.use_ssl = use_ssl <NEW_LINE> self.responses = [] <NEW_LINE> <DEDENT> def add_response(self, httptestresponse): <NEW_LINE> <INDENT> assert isinstance(httptestresponse, HttpTestResponse), httptestresponse <NEW_LI...
Super simple builtin HTTP test server.
6259904cd6c5a102081e3535
class PyFuncBatchEnv(InGraphBatchEnv): <NEW_LINE> <INDENT> def __init__(self, batch_env): <NEW_LINE> <INDENT> self._batch_env = batch_env <NEW_LINE> observ_shape = utils.parse_shape(self._batch_env.observation_space) <NEW_LINE> observ_dtype = utils.parse_dtype(self._batch_env.observation_space) <NEW_LINE> self.action_s...
Batch of environments inside the TensorFlow graph. The batch of environments will be stepped and reset inside of the graph using a tf.py_func(). The current batch of observations, actions, rewards, and done flags are held in according variables.
6259904c07f4c71912bb084c
class UntrashInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(UntrashInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_ClientID(self, value): <NEW_LINE> <INDENT> super(UntrashInputSet, self)._set_input('ClientID', value) <NEW_LINE> <DEDENT> d...
An InputSet with methods appropriate for specifying the inputs to the Untrash Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
6259904c10dbd63aa1c71ff5
class BiasResNetAddUpNoNorm2(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_init_features, args): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> num_layers = args.num_layers <NEW_LINE> kernel_size = args.kernel_size <NEW_LINE> num_features = num_init_features <NEW_LINE> self.reduce_channels = Linear(num_feat...
A network of residual convolutional layers
6259904c6e29344779b01a5a
class UptimeRobotSensor(UptimeRobotEntity, SensorEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def native_value(self) -> str: <NEW_LINE> <INDENT> return SENSORS_INFO[self.monitor.status]["value"] <NEW_LINE> <DEDENT> @property <NEW_LINE> def icon(self) -> str: <NEW_LINE> <INDENT> return SENSORS_INFO[self.monitor.sta...
Representation of a UptimeRobot sensor.
6259904c8e71fb1e983bcede
class ListingCAsTestCase(CATestCommon): <NEW_LINE> <INDENT> def test_list_and_get_cas(self): <NEW_LINE> <INDENT> (resp, cas, total, next_ref, prev_ref) = self.ca_behaviors.get_cas() <NEW_LINE> self.assertGreater(total, 0) <NEW_LINE> for item in cas: <NEW_LINE> <INDENT> ca = self.ca_behaviors.get_ca(item) <NEW_LINE> sel...
Tests for listing CAs. Must be in a separate class so that we can deselect them in the parallel CA tests, until we can deselect specific tests using a decorator.
6259904c435de62698e9d220
@admin.register(Teacher) <NEW_LINE> class TeacherAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('id', 'get_full_name', 'code')
Creates admin interface for maintaining teachers.
6259904c50485f2cf55dc3a4
class InstanceActionsTestV2(integrated_helpers._IntegratedTestBase): <NEW_LINE> <INDENT> def test_get_instance_actions(self): <NEW_LINE> <INDENT> server = self._create_server() <NEW_LINE> actions = self.api.get_instance_actions(server['id']) <NEW_LINE> self.assertEqual('create', actions[0]['action']) <NEW_LINE> <DEDENT...
Tests Instance Actions API
6259904cac7a0e7691f738f3
class PhreeqcInputLog(object): <NEW_LINE> <INDENT> def __init__(self, filename, dbpath): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.pq_input = open(self.filename,'w') <NEW_LINE> self.pq_input.truncate() <NEW_LINE> self._preamble() <NEW_LINE> self.pq_input.write("\nDATABASE %s" % dbpath) <NEW_LINE> sel...
Logs IPhreeqc input to a text file. PhreeqcInputLog is a utility class used by caves.Simulator objects to log iphreeqc input strings to a .phr text file. The resulting file is useful for understanding how the code runs and debugging failed models. The log file is also valid phreeqc input and can be run directly as a...
6259904ccb5e8a47e493cb93
class Node(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.next = None
The basic building block for the linked list. Attributes: data: Contain the list item. next (Node): Reference to the next Node.
6259904c7cff6e4e811b6e54
class GetMaximumLevelWithData(TestMixins.GetWithDataMixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> PID = 'MAXIMUM_LEVEL'
Get MAXIMUM_LEVEL with extra data.
6259904c8e05c05ec3f6f867
class chi_gen(rv_continuous): <NEW_LINE> <INDENT> def _rvs(self, df): <NEW_LINE> <INDENT> sz, rndm = self._size, self._random_state <NEW_LINE> return np.sqrt(chi2.rvs(df, size=sz, random_state=rndm)) <NEW_LINE> <DEDENT> def _pdf(self, x, df): <NEW_LINE> <INDENT> return np.exp(self._logpdf(x, df)) <NEW_LINE> <DEDENT> de...
A chi continuous random variable. %(before_notes)s Notes ----- The probability density function for `chi` is: .. math:: f(x, k) = \frac{1}{2^{k/2-1} \Gamma \left( k/2 \right)} x^{k-1} \exp \left( -x^2/2 \right) for :math:`x >= 0` and :math:`k > 0` (degrees of freedom, denoted ``df`` in the imple...
6259904c30dc7b76659a0c4e
class TestCrossBorderQuotesErrors(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 CrossBo...
CrossBorderQuotesErrors unit test stubs
6259904c3eb6a72ae038ba75
class CheckEqualExceptFor(PfTestBase): <NEW_LINE> <INDENT> def test_equal_except_for(self): <NEW_LINE> <INDENT> from pyfusion.utils.debug import equal_except_for <NEW_LINE> d1 = Dummy(a=1, b=2, abc=3) <NEW_LINE> d2 = Dummy(a=1, b=2) <NEW_LINE> self.assertFalse(equal_except_for(d1, d2)) <NEW_LINE> self.assertTrue(equal_...
Test custom object comparison, which allows specified attributed to be ignored
6259904c63b5f9789fe86587
class OpenAIGPTLMHead(nn.Module): <NEW_LINE> <INDENT> def __init__(self, model_embeddings_weights, config): <NEW_LINE> <INDENT> super(OpenAIGPTLMHead, self).__init__() <NEW_LINE> self.n_embd = config.n_embd <NEW_LINE> self.vocab_size = config.vocab_size <NEW_LINE> self.predict_special_tokens = config.predict_special_to...
Language Model Head for the transformer
6259904c3c8af77a43b6894a
class PayLogicMiyu(object): <NEW_LINE> <INDENT> def init_info(self, config, is_sandbox): <NEW_LINE> <INDENT> self.is_sandbox = is_sandbox <NEW_LINE> <DEDENT> def calc_order_info(self, user_id, server_id, order, order_number, now, value): <NEW_LINE> <INDENT> price = int(order.truePrice) <NEW_LINE> product_id = order.pro...
Miyu
6259904c30c21e258be99c1f
class TwitterDialogRedirect(views.OAuthDialogRedirectView): <NEW_LINE> <INDENT> client_class = TwitterClient
View that handles the redirects for the Twitter authorization dialog.
6259904c15baa723494633a6
class Angle: <NEW_LINE> <INDENT> dtype = 'angle' <NEW_LINE> def __init__(self, body=None): <NEW_LINE> <INDENT> self.body = body if body!=None else [] <NEW_LINE> self.buf = [] <NEW_LINE> <DEDENT> def addline(self): <NEW_LINE> <INDENT> line = self.buf <NEW_LINE> if len(line)>2: <NEW_LINE> <INDENT> self.body.append(line) ...
Define the class with line drawing fucntions
6259904c96565a6dacd2d996
class PSF(): <NEW_LINE> <INDENT> @property <NEW_LINE> def pixel_scale(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self._pixel_scale <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> <DEDENT> @pixel_scale.setter <NEW_LINE> def pixel_scale(self, pixel_scale): <N...
Abstract base class representing a 2D point spread function. Used to calculate pixelated version of the PSF and associated parameters useful for point source signal to noise and saturation limit calculations.
6259904c3cc13d1c6d466b53
class Symbolizer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.stats = [] <NEW_LINE> <DEDENT> def add_stats(self, val): <NEW_LINE> <INDENT> self.stats.append(val) <NEW_LINE> <DEDENT> def load(self, data): <NEW_LINE> <INDENT> for dat in data: <NEW_LINE> <INDENT> self.add_stats(dat[2])
separator based method
6259904c71ff763f4b5e8bc0
class RangeCounter(object): <NEW_LINE> <INDENT> def __init__(self, n): <NEW_LINE> <INDENT> if not n > 0: <NEW_LINE> <INDENT> raise ValueError("the number of counters must be positive.") <NEW_LINE> <DEDENT> trees = [] <NEW_LINE> offsets = [] <NEW_LINE> self._n = n <NEW_LINE> base = 1 <NEW_LINE> offset = 0 <NEW_LINE> whi...
:type _trees: [_FCTree] :type _offsets: [int] :type _n: n
6259904c26068e7796d4dd5f
@magics_class <NEW_LINE> class MagicClassWithHelpers(Magics): <NEW_LINE> <INDENT> _parser_store = {} <NEW_LINE> @property <NEW_LINE> def Context(self): <NEW_LINE> <INDENT> if self.shell is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return self.shell.user_ns <NEW_LINE> <DEDENT> def add_context(self, conte...
Provides some functions reused in others classes inherited from *Magics*. The class should not be registered as it is but should be used as an ancestor for another class. It can be registered this way:: def register_file_magics(): from IPython import get_ipython ip = get_ipython() ip.regist...
6259904ccb5e8a47e493cb94
class TxtSettingsDto(object): <NEW_LINE> <INDENT> swagger_types = { 'tag_regexp': 'str', 'translatable_text_regexp': 'str' } <NEW_LINE> attribute_map = { 'tag_regexp': 'tagRegexp', 'translatable_text_regexp': 'translatableTextRegexp' } <NEW_LINE> def __init__(self, tag_regexp=None, translatable_text_regexp=None): <NEW_...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259904cdc8b845886d549d8
class RawDataReport(Report): <NEW_LINE> <INDENT> __name__ = 'health_disease_notification.rawdata' <NEW_LINE> @classmethod <NEW_LINE> def parse(cls, report, records, data, localcontext): <NEW_LINE> <INDENT> symptoms = [("R19.7", "Diarrhoea, unspecified"), ("R53.1", "Asthenia (generalized weakness)"), ("R29.5", "Joint pa...
Disease Notification Spreadsheet Export
6259904c30dc7b76659a0c50
class List(MiniLinq): <NEW_LINE> <INDENT> def __init__(self, items): <NEW_LINE> <INDENT> self.items = items <NEW_LINE> <DEDENT> def eval(self, env): <NEW_LINE> <INDENT> return [item.eval(env) for item in self.items] <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return isinstance(other, List) and self...
A list of expressions, embeds the [ ... ] syntax into the MiniLinq meta-leval
6259904c4428ac0f6e65994d
class IQTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.outlist = [] <NEW_LINE> authenticator = xmlstream.ConnectAuthenticator('otherhost') <NEW_LINE> authenticator.namespace = 'testns' <NEW_LINE> self.xmlstream = xmlstream.XmlStream(authenticator) <NEW_LINE> self.xmlstream.transp...
Tests both IQ and the associated IIQResponseTracker callback.
6259904cb5575c28eb7136d7
class PolicyActions(elements.BaseElement): <NEW_LINE> <INDENT> _FIELDS = ("config", "action") <NEW_LINE> def __init__(self, policy_result="ACCEPT_ROUTE"): <NEW_LINE> <INDENT> super(PolicyActions, self).__init__("actions") <NEW_LINE> self.config = PolicyActionsConfig(policy_result) <NEW_LINE> self.action = None
policy-definition actions element
6259904c23849d37ff8524d9
class AutoNoEmbed: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> print('Addon "{}" loaded'.format(self.__class__.__name__)) <NEW_LINE> <DEDENT> async def on_member_join(self, member): <NEW_LINE> <INDENT> await self.bot.add_roles(Viewers, self.bot.noembed_role)
Logs join and leave messages.
6259904c1f037a2d8b9e527a
@declare_messagetype("ninchat.com/info/channel") <NEW_LINE> class ChannelInfoMessage(Message): <NEW_LINE> <INDENT> __slots__ = Message.__slots__
Stub for the ninchat.com/info/channel message type.
6259904cd6c5a102081e3539
class MCRefreshVertexGroups(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.mc_refresh_vertex_groups" <NEW_LINE> bl_label = "MC Refresh Vertex Groups" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> ob = MC_data['recent_object'] <NEW_LINE> if ob is No...
Refresh Vertex Group Weights To Cloth Settings
6259904c004d5f362081f9f6
class Date: <NEW_LINE> <INDENT> def __init__(self, date, event): <NEW_LINE> <INDENT> self._date = date <NEW_LINE> self._event = event <NEW_LINE> self._event_list = [] <NEW_LINE> <DEDENT> def add_event(self): <NEW_LINE> <INDENT> self._event_list.append(self._event) <NEW_LINE> <DEDENT> def get_event_list(self): <NEW_LINE...
This a Date class and it makes each canoncial date its own object you can get the event with this date, the events and the date itself also adds events to event list Parameters: date which is the canonical date and the string event Returns: the date, the events list on that date Pre-conditions: date is the canci...
6259904cf7d966606f7492c6
class WARPBatchUpdate: <NEW_LINE> <INDENT> def __init__(self, batch_size, d): <NEW_LINE> <INDENT> self.u = np.zeros(batch_size, dtype='int32') <NEW_LINE> self.dU = np.zeros((batch_size, d), order='F') <NEW_LINE> self.v_pos = np.zeros(batch_size, dtype='int32') <NEW_LINE> self.dV_pos = np.zeros((batch_size, d)) <NEW_LIN...
Collection of arrays to hold a batch of WARP sgd updates.
6259904cbaa26c4b54d506c7
class Plugin(object): <NEW_LINE> <INDENT> entry_point = None <NEW_LINE> @class_lazy <NEW_LINE> def extra_entry_points(cls): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _load_class_entry_point(cls, entry_point): <NEW_LINE> <INDENT> class_ = entry_point.load() <NEW_LINE> setattr(class_, ...
Base class for a system that uses entry_points to load plugins. Implementing classes are expected to have the following attributes: `entry_point`: The name of the entry point to load plugins from.
6259904c0c0af96317c5776f
class ContatoViolencia(models.Model): <NEW_LINE> <INDENT> id_contato = models.AutoField(primary_key=True) <NEW_LINE> nome_contato = models.CharField(max_length=200, null=False, blank=False) <NEW_LINE> numero_contato = models.CharField(max_length=50, null=False, blank=False) <NEW_LINE> ds_contato = models.TextField(null...
Legenda: id: Identidicador único; ds_contato: Descrição; nome_contato: Nome categoria: Categoria Campos: id_contato: Identidicador único contato; nome_contato: Nome do contato; ds_contato: Descrição do contato; categoria: Tipo de contato (Ong, Psicólogos órgãos competentes)
6259904ce64d504609df9dde
@add_attribute_self('iterable') <NEW_LINE> class flist(FilterMixin, list): <NEW_LINE> <INDENT> root = list <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> if len(args) == 1 and isinstance(args[0], Iterable): <NEW_LINE> <INDENT> list.__init__(self, args[0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> list.__...
Replacement class for list, with better API and many useful methods. In place methods return 'self' instead of None, better for chaining and returning Many new methods have been added, they are classified as immutable, muttable and helpers
6259904c73bcbd0ca4bcb6a6
class ITimeSlot(IContained): <NEW_LINE> <INDENT> tstart = zope.schema.Time( title=u"Time of the start of the event", required=True) <NEW_LINE> duration = zope.schema.Timedelta( title=u"Timedelta of the duration of the event", required=True) <NEW_LINE> activity_type = zope.schema.Choice( title=_("Activity type"), requir...
Time slot designated for an activity.
6259904cb57a9660fecd2e9a
class CommaFile(object): <NEW_LINE> <INDENT> _header = None <NEW_LINE> _params = None <NEW_LINE> _primary_key = None <NEW_LINE> def __init__( self, header: comma.typing.OptionalHeaderType = None, primary_key: typing.Optional[str] = None, params: typing.Optional[comma.typing.CommaInfoParamsType] = None, ): <NEW_LINE> <I...
Store the metadata associated with a CSV/DSV file. This includes the `header` (a list of column names) if it exists; the `primary_key` (that is, whether one of the columns should function as an index for rows); and the internal parameters, such as dialect and encoding, that are detetcted when the table data was loaded.
6259904c3c8af77a43b6894c
class Hashable(object): <NEW_LINE> <INDENT> def __init__(self, wrapped, tight=False): <NEW_LINE> <INDENT> self.__tight = tight <NEW_LINE> if isinstance(wrapped, list): <NEW_LINE> <INDENT> wrapped = array(wrapped) <NEW_LINE> <DEDENT> self.__wrapped = array(wrapped) if tight else wrapped <NEW_LINE> self.__hash = hash(wra...
Hashable wrapper for ndarray objects. Instances of ndarray are not hashable, meaning they cannot be added to sets, nor used as keys in dictionaries. This is by design - ndarray objects are mutable, and therefore cannot reliably implement the __hash__() method. The hashable class allows a way around this limitation. I...
6259904c0a366e3fb87dde03
class ReadOnlyFileSystemException(PermissionsException): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> ApiException.__init__(self) <NEW_LINE> self.path = path <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if self.path: <NEW_LINE> <INDENT> return _("Could not complete the operation on {0...
Used to indicate that the operation was attempted on a read-only filesystem
6259904c4e696a045264e82f
class UserLogout(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> if 'username' in session: <NEW_LINE> <INDENT> session.pop('username') <NEW_LINE> config.pop('admin_session') <NEW_LINE> print(session) <NEW_LINE> print(config) <NEW_LINE> return {"logout": "success"} <NEW_LINE> <DEDENT> else: <NEW_LINE> ...
user logout
6259904c1f037a2d8b9e527b
class IgnoredTasksTest(fixtures.TestCaseWithNamespace): <NEW_LINE> <INDENT> def test_ignore_future_task(self): <NEW_LINE> <INDENT> future_task = todotxt.Task("(A) 9999-01-01 Start preparing for five-digit years") <NEW_LINE> regular_task = todotxt.Task("(B) Look busy") <NEW_LINE> self.assertEqual([regular_task], pick_ac...
Test that certain tasks are ignored when picking the next action.
6259904cd6c5a102081e353b
class RconError(Exception): <NEW_LINE> <INDENT> pass
Generic RCON error
6259904c287bf620b6273007
class WikipediaCa(Platform): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.platformName = "Wikipedia_ca" <NEW_LINE> self.tags = ["education", "wiki"] <NEW_LINE> self.isValidMode = {} <NEW_LINE> self.isValidMode["phonefy"] = False <NEW_LINE> self.isValidMode["usufy"] = True <NEW_LINE> self.isValidMode...
A <Platform> object for WikipediaCa
6259904cd53ae8145f91987f
class Coordinate(object): <NEW_LINE> <INDENT> def __init__(self, lat, lng): <NEW_LINE> <INDENT> self.lat = lat <NEW_LINE> self.lon = lng <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.lat == other.lat and self.lon == other.lon <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT...
A geolocation representation.
6259904c507cdc57c63a61be
class SimpleImputerTransformer(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, features_df, target=None): <NEW_LINE> <INDENT> self.features_df = features_df <NEW_LINE> <DEDENT> def fit(self, features_df, target=None): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def transform(self, featu...
This transformer imputes missing values
6259904c498bea3a75a58f3e
class Katakana(unicode_set): <NEW_LINE> <INDENT> _ranges = [ (0x3099, 0x309C), (0x30A0, 0x30FF), (0x31F0, 0x31FF), (0x32D0, 0x32FE), (0xFF65, 0xFF9F), (0x1B000,), (0x1B164, 0x1B167), (0x1F201, 0x1F202), (0x1F213,), ]
Unicode set for Katakana Unicode Character Range
6259904c07d97122c42180c2
class StellarAccountNotExists(Exception): <NEW_LINE> <INDENT> pass
A stellar account not exist.
6259904ccb5e8a47e493cb96
class ISERTestCase(ISCSITestCase): <NEW_LINE> <INDENT> driver_name = "cinder.volume.drivers.lvm.LVMISERDriver" <NEW_LINE> base_driver = driver.ISERDriver <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(ISERTestCase, self).setUp() <NEW_LINE> self.configuration = mox.MockObject(conf.Configuration) <NEW_LINE> self.c...
Test Case for ISERDriver.
6259904c50485f2cf55dc3ab
class SpynnerPageError(Exception): <NEW_LINE> <INDENT> pass
Error loading page.
6259904c8e71fb1e983bcee5
class Function(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'functions' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String) <NEW_LINE> code = db.Column(db.String) <NEW_LINE> private = db.Column(db.Boolean) <NEW_LINE> def __init__(self, name, code): <NEW_LINE> <INDENT> self.n...
Model for User Defined Functions
6259904c23e79379d538d91d
class MonomorphizationResource(Partializable): <NEW_LINE> <INDENT> def __init__(self, resources): <NEW_LINE> <INDENT> self.resources = resources <NEW_LINE> self.engine = resources.inferrer.engine <NEW_LINE> self.manager = resources.opt_manager <NEW_LINE> self.mono = Monomorphizer(resources, self.engine) <NEW_LINE> <DED...
Performs monomorphization.
6259904c30dc7b76659a0c53
class TestRunnerSimple(): <NEW_LINE> <INDENT> name = 'test_runner_simple' <NEW_LINE> @pytest.fixture(scope="class") <NEW_LINE> def runner( self, atomic_data_fname, tardis_ref_data, generate_reference): <NEW_LINE> <INDENT> config = Configuration.from_yaml( 'tardis/io/tests/data/tardis_configv1_verysimple.yml') <NEW_LINE...
Very simple run
6259904c6fece00bbacccdd8
class Reader: <NEW_LINE> <INDENT> def __init__(self, file_obj): <NEW_LINE> <INDENT> self._file_obj = file_obj <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> line = self._file_obj.readline() <NEW_LINE> if line == '': <NEW_LINE> <INDENT>...
Class to read and parse a text file with a single JSON object per readline Provides an iterator that will iterate over the lines in the file and yield a dict of fields.
6259904c596a897236128fbe
class UserRetrieveAPIView(RetrieveAPIView): <NEW_LINE> <INDENT> serializer_class = UserDetailSerializer <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> queryset = User.objects.none() <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return self.request.user
Retrieve authenticated user
6259904c16aa5153ce40190d