code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class QPinchGesture(QGesture): <NEW_LINE> <INDENT> def centerPoint(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def changeFlags(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def childEvent(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def connectNotify(self, *args, **kwargs): <NEW_LI...
QPinchGesture(parent: QObject = None)
62598fca4428ac0f6e6588b6
class InfoRequestMessage(InfoMessage): <NEW_LINE> <INDENT> def __init__(self, info_type=InfoMessage.INFO_PROFILE): <NEW_LINE> <INDENT> InfoMessage.__init__(self, Message.TYPE_INFO_REQUEST, info_type) <NEW_LINE> <DEDENT> def get_body_fields(self): <NEW_LINE> <INDENT> return [self.FIELD_INFOTYPE] <NEW_LINE> <DEDENT> def ...
An info request can be a request for a profile, or for a list of friends
62598fca283ffb24f3cf3c14
class WinRMListener(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'protocol': {'key': 'protocol', 'type': 'str'}, 'certificate_url': {'key': 'certificateUrl', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, protocol: Optional[Union[str, "ProtocolTypes"]] = None, certificate_url: Optional[str] ...
Describes Protocol and thumbprint of Windows Remote Management listener. :ivar protocol: Specifies the protocol of listener. :code:`<br>`:code:`<br>` Possible values are: :code:`<br>`\ **http** :code:`<br>`:code:`<br>` **https**. Possible values include: "Http", "Https". :vartype protocol: str or ~azure.mgmt.compute...
62598fca63b5f9789fe85505
class enlace(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.fisica = fisica(name) <NEW_LINE> self.rx = RX(self.fisica) <NEW_LINE> self.tx = TX(self.fisica) <NEW_LINE> self.connected = False <NEW_LINE> <DEDENT> def enable(self): <NEW_LINE> <INDENT> self.fisica.open() <NEW_LINE> self.rx.t...
This class implements methods to the interface between Enlace and Application
62598fcaa05bb46b3848abfa
class User: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get(cls, user_id: int): <NEW_LINE> <INDENT> user = UserModel.find_by_id(user_id) <NEW_LINE> if not user: <NEW_LINE> <INDENT> return {"message": gettext("user_not_found")}, 404 <NEW_LINE> <DEDENT> return user_schema.dump(user), 200 <NEW_LINE> <DEDENT> @classmet...
Resource to be used for testing purposes only. Do not expose in routes.
62598fca5fdd1c0f98e5e31b
class DescribeCloneListRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.InstanceId = params.get("InstanceId") <NEW_LINE> self....
DescribeCloneList请求参数结构体
62598fca60cbc95b063646cc
class deck_2(deck): <NEW_LINE> <INDENT> deck_2_list = [0] <NEW_LINE> def __init__(self, x, y): <NEW_LINE> <INDENT> deck.__init__(self, x, y) <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.hidden = [] <NEW_LINE> <DEDENT> def extend_list(self, lst): <NEW_LINE> <INDENT> for i in lst: <NEW_LINE> <INDENT> deck_...
pile of cards
62598fca851cf427c66b8643
class AlphaBetaPlayer(IsolationPlayer): <NEW_LINE> <INDENT> def get_move(self, game, time_left): <NEW_LINE> <INDENT> self.time_left = time_left <NEW_LINE> best_move = (-1, -1) <NEW_LINE> depth = self.search_depth <NEW_LINE> try: <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> best_move = self.alphabeta(game, depth)...
Game-playing agent that chooses a move using iterative deepening minimax search with alpha-beta pruning. You must finish and test this player to make sure it returns a good move before the search time limit expires.
62598fca9f28863672818a44
class DummymailCommand(TestCase): <NEW_LINE> <INDENT> def _call_dummymail(self, *args, **kwargs): <NEW_LINE> <INDENT> mock_process = mock.Mock() <NEW_LINE> mock_time = mock.Mock() <NEW_LINE> mock_time.sleep.side_effect = KeyboardInterrupt <NEW_LINE> with mock.patch.multiple(u'poleno.dummymail.management.commands.dummym...
Tests ``dummymail`` management command. Only checks if ``localmail`` processes are spawned with ``multiprocessing`` module. Does not chech if ``localmail`` works.
62598fca283ffb24f3cf3c15
class WnliProcessor(DataProcessor): <NEW_LINE> <INDENT> def get_example_from_tensor_dict(self, tensor_dict): <NEW_LINE> <INDENT> return InputExample( tensor_dict["idx"].numpy(), tensor_dict["sentence1"].numpy().decode("utf-8"), tensor_dict["sentence2"].numpy().decode("utf-8"), str(tensor_dict["label"].numpy()), ) <NEW_...
Processor for the WNLI data set (GLUE version).
62598fca3d592f4c4edbb244
class TraditionalBorda(BordaBase): <NEW_LINE> <INDENT> def __init__(self, fieldsize): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.fieldsize = fieldsize <NEW_LINE> <DEDENT> def transform(self, response): <NEW_LINE> <INDENT> transformed = dict() <NEW_LINE> points = self.fieldsize - 1 <NEW_LINE> for choice in r...
In a field of N choices, the highest-ranked is awarded N-1 points, next highest-ranked N-2 points, ..., and lowest or unranked are awarded 0.
62598fcabe7bc26dc9252023
class Serial(object): <NEW_LINE> <INDENT> def __init__(self, clb): <NEW_LINE> <INDENT> self.clb = clb <NEW_LINE> self.comm = serial.Serial(port='/dev/ttyUSB0', baudrate=9600, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=None, xonxoff=False, rtscts=False, writeTimeout=None,...
Serial duplex communication.
62598fca63b5f9789fe85507
class Question(Environment): <NEW_LINE> <INDENT> pass
Base class for all question environments.
62598fca7cff6e4e811b5db7
class FastTextTrainner: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.train_data_path = "content/text.txt" <NEW_LINE> self.model_path = "model/ft.model.bin" <NEW_LINE> <DEDENT> def train(self): <NEW_LINE> <INDENT> print(f'Build sentences from {self.train_data_path}') <NEW_LINE> sentences = word2vec.T...
FastText model's trinner.
62598fca851cf427c66b8645
class PretrainingConfig(object): <NEW_LINE> <INDENT> def __init__(self, model_name, data_dir, **kwargs): <NEW_LINE> <INDENT> self.model_name = model_name <NEW_LINE> self.debug = False <NEW_LINE> self.do_train = True <NEW_LINE> self.do_eval = False <NEW_LINE> self.mask_prob = 0.15 <NEW_LINE> self.learning_rate = 5e-4 <N...
Defines pre-training hyperparameters.
62598fca4c3428357761a64f
class Message: <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.raw_message = message <NEW_LINE> self._data = OrderedDict() <NEW_LINE> self.log = logging.getLogger('Katari') <NEW_LINE> if message: <NEW_LINE> <INDENT> self.method_line, self.headers = message.decode().split("\r\n", 1) <NEW_LINE> ...
Base message
62598fca60cbc95b063646ce
class TestBuildCommand(TestCase): <NEW_LINE> <INDENT> def test_command_env(self): <NEW_LINE> <INDENT> env = {'FOOBAR': 'foobar', 'BIN_PATH': 'foobar'} <NEW_LINE> cmd = BuildCommand('echo', environment=env) <NEW_LINE> for key in list(env.keys()): <NEW_LINE> <INDENT> self.assertEqual(cmd.environment[key], env[key]) <NEW_...
Test build command creation
62598fcaaad79263cf42eb60
class namedPersonIdType (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'namedPersonIdType') <NEW_L...
Complex type {http://www.ech.ch/xmlns/eCH-0044/1}namedPersonIdType with content type ELEMENT_ONLY
62598fca50812a4eaa620dad
class XRef: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.xref = 0 <NEW_LINE> self.xref_str = None <NEW_LINE> <DEDENT> def __call__(self, s): <NEW_LINE> <INDENT> value = s.strip() <NEW_LINE> if value.isdigit() and int(value): <NEW_LINE> <INDENT> self.xref = int(value) <NEW_LINE> self.xref_str = value...
This can be turned into a simple parse in Info
62598fca7b180e01f3e49219
class QueueBindOK(Method): <NEW_LINE> <INDENT> method_type = (50, 21) <NEW_LINE> field_info = () <NEW_LINE> synchronous = True
This method confirms that the bind was successful.
62598fca956e5f7376df5847
class Transform(Result): <NEW_LINE> <INDENT> _data = delegate_ro('transform') <NEW_LINE> def transform(self, data): <NEW_LINE> <INDENT> return self._data.transform(data)
Array sub-type that represents the result of an scikit learn transform object.
62598fcabe7bc26dc9252024
class QStyleOptionTitleBar(QStyleOptionComplex): <NEW_LINE> <INDENT> def __init__(self, QStyleOptionTitleBar=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> Type = 983045 <NEW_LINE> Version = 1
QStyleOptionTitleBar() QStyleOptionTitleBar(QStyleOptionTitleBar)
62598fcaa05bb46b3848abfe
class IterationTimer(HookBase): <NEW_LINE> <INDENT> def __init__(self, warmup_iter=3): <NEW_LINE> <INDENT> self._warmup_iter = warmup_iter <NEW_LINE> self._step_timer = Timer() <NEW_LINE> self._start_time = time.perf_counter() <NEW_LINE> self._total_timer = Timer() <NEW_LINE> <DEDENT> def before_train(self): <NEW_LINE>...
Track the time spent for each iteration (each run_step call in the trainer). Print a summary in the end of training. This hook uses the time between the call to its :meth:`before_step` and :meth:`after_step` methods. Under the convention that :meth:`before_step` of all hooks should only take negligible amount of time,...
62598fca4c3428357761a650
class ServiceEndpointPolicyDefinitionListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ServiceEndpointPolicyDefinition]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ServiceEndpo...
Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition that belongs to a service endpoint policy. :param value: The service endpoint policy definition in a service endpoint policy. :type value: list[~azure.mgmt.network.v2019_04_01.models.ServiceEndpointPolic...
62598fca4527f215b58ea263
class PositiveNaiveBayesClassifier(NLTKClassifier): <NEW_LINE> <INDENT> nltk_class = nltk.classify.PositiveNaiveBayesClassifier <NEW_LINE> def __init__(self, positive_set, unlabeled_set, feature_extractor=contains_extractor, positive_prob_prior=0.5, **kwargs): <NEW_LINE> <INDENT> self.feature_extractor = feature_extrac...
A variant of the Naive Bayes Classifier that performs binary classification with partially-labeled training sets, i.e. when only one class is labeled and the other is not. Assuming a prior distribution on the two labels, uses the unlabeled set to estimate the frequencies of the features. Example usage: :: >>> fro...
62598fca283ffb24f3cf3c1a
class ResourceSerializer(NsotSerializer): <NEW_LINE> <INDENT> attributes = JSONDictField( required=False, help_text='Dictionary of attributes to set.' ) <NEW_LINE> def create(self, validated_data, commit=True): <NEW_LINE> <INDENT> attributes = validated_data.pop('attributes', {}) <NEW_LINE> obj = super(ResourceSerializ...
For any object that can have attributes.
62598fcad486a94d0ba2c367
class Gmetric: <NEW_LINE> <INDENT> type = ('', 'string', 'uint16', 'int16', 'uint32', 'int32', 'float', 'double', 'timestamp') <NEW_LINE> protocol = ('udp', 'multicast') <NEW_LINE> def __init__(self, host, port, protocol): <NEW_LINE> <INDENT> if protocol not in self.protocol: <NEW_LINE> <INDENT> raise ValueError("Proto...
Class to send gmetric/gmond 3.X packets Thread safe
62598fca851cf427c66b8649
class _module(ModuleType): <NEW_LINE> <INDENT> def __getattr__(self, name: str) -> Any: <NEW_LINE> <INDENT> if name in object_origins: <NEW_LINE> <INDENT> module = __import__( object_origins[name], None, None, [name]) <NEW_LINE> for extra_name in all_by_module[module.__name__]: <NEW_LINE> <INDENT> setattr(self, extra_n...
Customized Python module.
62598fcafbf16365ca79444f
class _ModerationBase: <NEW_LINE> <INDENT> def _make_resource(self, request_id): <NEW_LINE> <INDENT> requests = IListRequests(self._mlist) <NEW_LINE> results = requests.get_request(request_id) <NEW_LINE> if results is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> key, data = results <NEW_LINE> resource = di...
Common base class.
62598fca23849d37ff851447
class MatrixCalculus(MatrixCommon): <NEW_LINE> <INDENT> def diff(self, *args, **kwargs): <NEW_LINE> <INDENT> from sympy.tensor.array.array_derivatives import ArrayDerivative <NEW_LINE> kwargs.setdefault('evaluate', True) <NEW_LINE> deriv = ArrayDerivative(self, *args, evaluate=True) <NEW_LINE> if not isinstance(self, B...
Provides calculus-related matrix operations.
62598fca3346ee7daa337812
class DagsterTypeLoader(ABC): <NEW_LINE> <INDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def schema_type(self) -> ConfigType: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> def loader_version(self) -> Optional[str]: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def compute_loaded_input...
Dagster type loaders are used to load unconnected inputs of the dagster type they are attached to. The recommended way to define a type loader is with the :py:func:`@dagster_type_loader <dagster_type_loader>` decorator.
62598fca0fa83653e46f527c
class SVM(): <NEW_LINE> <INDENT> def __init__(self, C=1, kernel="rbf", gamma=1.0, num_iters=100): <NEW_LINE> <INDENT> self.kernel = kernel <NEW_LINE> self.gamma = gamma <NEW_LINE> self.alpha = None <NEW_LINE> self.bias = 0 <NEW_LINE> self.kernel_matrix = None <NEW_LINE> self.C = C <NEW_LINE> self.tol= 0.001 <NEW_LINE> ...
Support Vector Machine
62598fca50812a4eaa620daf
class Player(Actuator): <NEW_LINE> <INDENT> class States(Enum): <NEW_LINE> <INDENT> playing = 0, <NEW_LINE> stopped = 1, <NEW_LINE> paused = 2, <NEW_LINE> unknown = None <NEW_LINE> <DEDENT> __COMMAND_LIST = ("toggle", "activate", "deactivate", "set_volume", "play", "stop", "pause", "next", "prev", "seek") <NEW_LINE> de...
Плеер. Объект, который проигрывает медиафайлы
62598fca63b5f9789fe8550d
class TaskItem(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=200) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
読書、勉強、執筆等
62598fca71ff763f4b5e7b17
class customerProp(SchemaProperty): <NEW_LINE> <INDENT> _prop_schema = 'customer' <NEW_LINE> _expected_schema = 'Organization' <NEW_LINE> _enum = False <NEW_LINE> _format_as = "ForeignKey"
SchemaField for customer Usage: Include in SchemaObject SchemaFields as your_django_field = customerProp() schema.org description:Party placing the order or paying the invoice. prop_schema returns just the property without url# format_as is used by app templatetags based upon schema.org datatype used to reference Or...
62598fca377c676e912f6f42
class UrlPostHandler(webapp2.RequestHandler): <NEW_LINE> <INDENT> form_fields = { 'first_name': 'Albert', 'last_name': 'Johnson', } <NEW_LINE> def get(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> form_data = urllib.urlencode(UrlPostHandler.form_fields) <NEW_LINE> headers = {'Content-Type': 'application/x-www-for...
Demonstrates an HTTP POST form query using urlfetch
62598fcb283ffb24f3cf3c1d
class DictAction(Action): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _parse_int_float_bool(val): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return int(val) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> return float(val) <NEW_LINE> <DEDENT> except Va...
argparse action to split an argument into KEY=VALUE form on the first = and append to a dictionary. List options should be passed as comma separated values, i.e KEY=V1,V2,V3
62598fcb0fa83653e46f527e
class Handler: <NEW_LINE> <INDENT> async def get_all_records(self, request) -> Response: <NEW_LINE> <INDENT> offset = request.rel_url.query.get('offset', 0) <NEW_LINE> limit = request.rel_url.query.get('limit', 10) <NEW_LINE> async with request.app['pool'].acquire() as connection: <NEW_LINE> <INDENT> result = await mod...
handler to routes
62598fcbdc8b845886d53954
class AnyURLScheme(object): <NEW_LINE> <INDENT> def __contains__(self, item): <NEW_LINE> <INDENT> if not item or not re.match(r'^[a-z][0-9a-z+\-.]*$', item.lower()): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return True
A fake URL list which "contains" all scheme names abiding by the syntax defined in RFC 3986 section 3.1
62598fcb71ff763f4b5e7b19
class AttrsMixin(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def node_attributes_dict(self, x): <NEW_LINE> <INDENT> return dict(self.node_attributes(x)) <NEW_LINE> <DEDENT> def edge_attributes_dict(self, x): <NEW_LINE> <INDENT> return dict(self.edge_attributes(x)) <NEW_LINE> ...
Attributes common to both the hypergraph and directed graph representation of discourse structure
62598fcbadb09d7d5dc0a913
class PyupgradeRunner(ToolRunner): <NEW_LINE> <INDENT> def _validate_config(self: PyupgradeRunner) -> None: <NEW_LINE> <INDENT> if "min_version" in self.config and not re.match( r"^[0-9].[0-9]", self.config["min_version"] ): <NEW_LINE> <INDENT> raise ValueError("min_version must be a valid Python version!") <NEW_LINE> ...
Runs Pyupgrade. Pyupgrade automatically upgrades Python syntax to the latest for the specified Python version.
62598fcbcc40096d6161a3a4
class ConfigureForm(form.PageForm): <NEW_LINE> <INDENT> base_template = form.EditForm.template <NEW_LINE> template = ViewPageTemplateFile('configure.pt') <NEW_LINE> subforms = [] <NEW_LINE> form_fields = form.Fields( schema.List(__name__=u'pluginNames', title=u'Plugin Names', value_type=schema.Choice( __name__=u'plugin...
Configurator Plugin form
62598fcb5fc7496912d48446
class OrderModelTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.mockTable = mommy.make("table.Table") <NEW_LINE> self.mockFood = mommy.make("menu.Food") <NEW_LINE> self.validOrder = Order(table=self.mockTable, food=self.mockFood) <NEW_LINE> <DEDENT> def testConstructor(self): <NEW_LINE> <...
Unit tests for the Booking model class.
62598fcb63b5f9789fe85511
class insertManufacturer_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, error=None, error2=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.error = error <NEW_LINE> self.error2 = error2 <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not No...
Attributes: - success - error - error2
62598fcba05bb46b3848ac06
class SpecialException01(Exception): <NEW_LINE> <INDENT> pass
Special exception type.
62598fcb55399d3f056268b4
class RPolspline(RPackage): <NEW_LINE> <INDENT> homepage = "https://cloud.r-project.org/package=polspline" <NEW_LINE> url = "https://cloud.r-project.org/src/contrib/polspline_1.1.18.tar.gz" <NEW_LINE> list_url = "https://cloud.r-project.org/src/contrib/Archive/polspline" <NEW_LINE> version('1.1.19', sha256='953e3c...
Polynomial Spline Routines Routines for the polynomial spline fitting routines hazard regression, hazard estimation with flexible tails, logspline, lspec, polyclass, and polymars, by C. Kooperberg and co-authors.
62598fcb3346ee7daa337815
class RatingStar(models.Model): <NEW_LINE> <INDENT> value = models.SmallIntegerField('Значение', default=0) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return f'{self.value}' <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Звезда рейтинга' <NEW_LINE> verbose_name_plural = 'Звезды рейтинга' <NE...
Звезды рейтинга
62598fcb8a349b6b436865dc
class TestTlogRec: <NEW_LINE> <INDENT> orig_hostname = socket.gethostname() <NEW_LINE> tempdir = mkdtemp(prefix='/tmp/TestTlogRec.') <NEW_LINE> user1 = TLOG_TEST_LOCAL_USER <NEW_LINE> admin1 = TLOG_TEST_LOCAL_ADMIN <NEW_LINE> os.chmod(tempdir, stat.S_IRWXU + stat.S_IRWXG + stat.S_IRWXO + stat.S_ISUID + stat.S_ISGID + s...
tlog-rec tests
62598fcbab23a570cc2d4f3c
class RecruitSpider(scrapy.Spider): <NEW_LINE> <INDENT> name = "tencent" <NEW_LINE> allowed_domains = ["hr.tencent.com"] <NEW_LINE> start_urls = [ "https://hr.tencent.com/position.php?&start=0#a", ] <NEW_LINE> def parse(self,response): <NEW_LINE> <INDENT> for sel in response.xpath('//*[@class="even"]'): <NEW_LINE> <IND...
创建一个Spider,继承自scrapy.Spider
62598fcb3617ad0b5ee064e4
class GenericTest(TestCase): <NEW_LINE> <INDENT> def test_version(self): <NEW_LINE> <INDENT> self.assertEqual(sys.modules['postman'].__version__, "2.1.1")
Usual generic tests.
62598fcb283ffb24f3cf3c22
class Student: <NEW_LINE> <INDENT> def __init__(self, line): <NEW_LINE> <INDENT> studentInfo = line.split(",") <NEW_LINE> if len(studentInfo) != 6: <NEW_LINE> <INDENT> sys.exit("Error: Invalid student file format") <NEW_LINE> <DEDENT> self.line = line <NEW_LINE> self.stLastName = studentInfo[0] <NEW_LINE> self.stFirstN...
class for student object
62598fcb377c676e912f6f45
class TestXmlRpc(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> from django.core.files.base import ContentFile <NEW_LINE> self.dummy_file = ContentFile("gibberish") <NEW_LINE> self.dummy_user = User.objects.create(username='bobby', password='tables', email='bobby@tables.com') <NEW_LINE> se...
Test that the server responds to xmlrpc requests
62598fcb4c3428357761a65a
class EchoError(Exception): <NEW_LINE> <INDENT> pass
Something wrong connecting to echobox
62598fcb5fdd1c0f98e5e32a
class GetFxNBP(GetFX): <NEW_LINE> <INDENT> def __init__(self, currency=DEFAULT_CURRENCY, date=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._get_response(currency, date) <NEW_LINE> <DEDENT> def _delete(self): <NEW_LINE> <INDENT> print("--Teardown--") <NEW_LINE> <DEDENT> def _get_request_url(self, curren...
Subclass of :py:class:`~getfx.getfx.GetFX` class to implement NBP specific FX retrieval logic. It does not provide public methods, instead it is assumed when instance is created, NBP API is invoked and FX rate retrieved. Access to retrieved rate is achieved via printing the instance using overridden: :py:meth:`.__str_...
62598fcbfbf16365ca794457
class Debugger(nn.Module): <NEW_LINE> <INDENT> def forward(self,x:Tensor) -> Tensor: <NEW_LINE> <INDENT> set_trace() <NEW_LINE> return x
A module to debug inside a model
62598fcb5fc7496912d48448
class SPI(object): <NEW_LINE> <INDENT> __LOCK_TIMEOUT = 10.0 <NEW_LINE> def __init__(self, bus, device, mode, max_speed): <NEW_LINE> <INDENT> self.__bus = bus <NEW_LINE> self.__device = device <NEW_LINE> self.__mode = mode <NEW_LINE> self.__max_speed = max_speed <NEW_LINE> self.__connection = None <NEW_LINE> <DE...
classdocs
62598fcb7b180e01f3e4921e
class MethodRequest(_urllib.request.Request): <NEW_LINE> <INDENT> def set_method(self, method): <NEW_LINE> <INDENT> self.method = method.upper() <NEW_LINE> <DEDENT> def get_method(self): <NEW_LINE> <INDENT> return getattr(self, 'method', _urllib.request.Request.get_method(self))
Used to create HEAD/PUT/DELETE/... requests with urllib
62598fcb50812a4eaa620db3
class TestCSUpdateOrganisationResponse(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 testCSUpdateOrganisationResponse(self): <NEW_LINE> <INDENT> pass
CSUpdateOrganisationResponse unit test stubs
62598fcb8a349b6b436865de
class DeleteDigitsTestSuite(unittest.TestCase): <NEW_LINE> <INDENT> def test_clean_string(self): <NEW_LINE> <INDENT> string = "this is a clean string" <NEW_LINE> expected = "this is a clean string" <NEW_LINE> res = textprocessor.convert_caps(string) <NEW_LINE> self.assertEqual(res, expected, "Strings do not match") <NE...
Test cases for Delete Punctuation Signs
62598fcba05bb46b3848ac0a
class AllowTokenAnnotation(AllowCorrections): <NEW_LINE> <INDENT> def annotations(self,Class,set=None): <NEW_LINE> <INDENT> found = False <NEW_LINE> for e in self.select(Class,set,True,default_ignore_annotations): <NEW_LINE> <INDENT> found = True <NEW_LINE> yield e <NEW_LINE> <DEDENT> if not found: <NEW_LINE> <INDENT> ...
Elements that allow token annotation (including extended annotation) must inherit from this class
62598fcbec188e330fdf8c36
class BoxOfficeSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> movie = BoxOfficeDetailSerializer(read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = BoxOfficeMovie <NEW_LINE> fields = ( 'rank', 'movie', 'movie_title', 'release_date', 'ticketing_rate', )
박스오피스 직렬화 영화정보 nested
62598fcb63b5f9789fe85517
class ExcludeAlert(object): <NEW_LINE> <INDENT> def __init__(self, row): <NEW_LINE> <INDENT> self._row = row <NEW_LINE> self.alert_source = row[ALERT_SOURCE] <NEW_LINE> self.alert_search = row[ALERT_SEARCH] <NEW_LINE> return None
Information about alerts that exist to exclude results from our search results. These searches exist to identify pubs we don't want. Why? Because it was just easier and shorter to create separate, *negative* alerts for things we kept seeing as false positives. The alternative was to include the excluded terms in all s...
62598fcb3617ad0b5ee064e8
class JournalListView(LoginRequiredMixin, generic.ListView): <NEW_LINE> <INDENT> template_name = 'journal/entry_list.html' <NEW_LINE> model = JournalEntry <NEW_LINE> context_object_name = 'entries' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return (JournalEntry.objects.filter(author=self.request.user) .orde...
View a list of recent journal entries.
62598fcbab23a570cc2d4f3e
class DeepLook_STIS(DeepLook): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DeepLook_STIS, self).__init__()
Generic class for all STIS rules
62598fcb283ffb24f3cf3c26
class NoAddressesError(ApiError): <NEW_LINE> <INDENT> pass
The device name has no addresses associated with it.
62598fcbd486a94d0ba2c373
class SetEnumPattern(VdmslNode): <NEW_LINE> <INDENT> _fields = ('ptn_list',) <NEW_LINE> def __init__(self, ptn_list, lineno, lexpos): <NEW_LINE> <INDENT> self.ptn_list = ptn_list <NEW_LINE> self.__setattr__('lineno', lineno) <NEW_LINE> self.__setattr__('lexpos', lexpos) <NEW_LINE> <DEDENT> def toPy(self): <NEW_LINE> <I...
集合列挙パターン
62598fcbcc40096d6161a3a8
class Handle_Rawebp(Data_Handler): <NEW_LINE> <INDENT> def __init__(self, always_load_color=True, QUALITY=95): <NEW_LINE> <INDENT> if always_load_color: <NEW_LINE> <INDENT> self.cv2_IMREAD_FLAG = cv2.IMREAD_COLOR <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.cv2_IMREAD_FLAG = cv2.IMREAD_UNCHANGED <NEW_LINE> <DEDEN...
Webp format for storage. In comparison to the lossless compression of PNG, or lossy compression of JPEG, Webp has noticeably advantage. QUALITY from 0 to 100 (the higher is the better). Default value is 95.
62598fcb0fa83653e46f5288
class IndividualReportsTestForms(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> self.user = User.objects.create_user('test', 'test@test.com', 'testpassword') <NEW_LINE> self.client.force_login(self.user) <NEW_LINE> Tag.objects.create(name='Test tag') <NEW_LINE> <DE...
Тесты форм.
62598fcb5fcc89381b26631e
class CreateFolderBatchLaunch(async_.LaunchResultBase): <NEW_LINE> <INDENT> _catch_all = 'other' <NEW_LINE> other = None <NEW_LINE> @classmethod <NEW_LINE> def complete(cls, val): <NEW_LINE> <INDENT> return cls('complete', val) <NEW_LINE> <DEDENT> def is_complete(self): <NEW_LINE> <INDENT> return self._tag == 'complete...
Result returned by :meth:`dropbox.dropbox.Dropbox.files_create_folder_batch` that may either launch an asynchronous job or complete synchronously. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` ...
62598fcbbe7bc26dc925202c
class ShowSwitchDetailSchema(MetaParser): <NEW_LINE> <INDENT> schema = { 'switch': { 'mac_address': str, Optional('mac_persistency_wait_time'): str, 'stack': { Any(): { 'role': str, 'mac_address': str, 'priority': str, Optional('hw_ver'): str, 'state': str, 'ports': { Any(): { 'stack_port_status': str, 'neighbors_num':...
Schema for show switch detail
62598fcb23849d37ff851455
class Task(object): <NEW_LINE> <INDENT> def __init__(self, delay,priority,action,argument): <NEW_LINE> <INDENT> self.delay = delay <NEW_LINE> self.priority = priority <NEW_LINE> self.action = action <NEW_LINE> self.argument = argument <NEW_LINE> <DEDENT> def set_scheduler(self,scheduler): <NEW_LINE> <INDENT> self.sched...
docstring for task
62598fcb283ffb24f3cf3c29
class SSA(BaseEvent): <NEW_LINE> <INDENT> pass
Training Sessions held by EESTEC Trainers .
62598fcb5fc7496912d4844b
class RouteFilter(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type...
Route Filter Resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param location: Resource location. :type location: str :param tags: A set of...
62598fcb7b180e01f3e49221
class CovidModel(BaseModel): <NEW_LINE> <INDENT> country: str = Field(..., alias="Country,Other") <NEW_LINE> confirmed: int = Field(0, alias="TotalCases") <NEW_LINE> new_cases: int = Field(0, alias="NewCases") <NEW_LINE> deaths: int = Field(0, alias="TotalDeaths") <NEW_LINE> recovered: int = Field(0, alias="TotalRecove...
Dataclass acts as a Model for Covid data
62598fcb9f28863672818a4e
class Command(RunserverMixin, StaticfilesRunserverCommand): <NEW_LINE> <INDENT> pass
Subclass the RunserverCommand from Staticfiles to set up our gulp environment.
62598fcb0fa83653e46f528a
class ProgressWithEvents(AnimatedProgressBar): <NEW_LINE> <INDENT> def __init__(self, start=0, end=10, width=12, fill=unichr(0x25C9).encode("utf-8"), blank=unichr(0x25CC).encode("utf-8"), marker=unichr(0x25CE).encode("utf-8"), format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', incremental=True, stdout=sys.stdout): ...
Extends AnimatedProgressBar to allow you to track a set of events that cause the progress to move. For instance, in a deletion progress bar, you can track files that were nuked and files that the user doesn't have access to
62598fcb63b5f9789fe8551b
class AlphaBetaPlayer(IsolationPlayer): <NEW_LINE> <INDENT> def get_move(self, game, time_left): <NEW_LINE> <INDENT> self.time_left = time_left <NEW_LINE> legal_moves = game.get_legal_moves(self) <NEW_LINE> if len(legal_moves) : <NEW_LINE> <INDENT> best_move = legal_moves[random.randint(0,len(legal_moves)-1)] <NEW_LINE...
Game-playing agent that chooses a move using iterative deepening minimax search with alpha-beta pruning. You must finish and test this player to make sure it returns a good move before the search time limit expires.
62598fcb283ffb24f3cf3c2a
class VideoDirectPageSet(VideoPageSet): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(VideoDirectPageSet, self).__init__('direct') <NEW_LINE> <DEDENT> def _AddUserStoryForURL(self, url): <NEW_LINE> <INDENT> self.AddUserStory(VideoPage(url, self, False))
Chrome proxy video tests: direct fetch.
62598fcbadb09d7d5dc0a91f
class DecoderCat(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_size, hidden_size, n_cat, n_layers, c_z=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.input_size = input_size <NEW_LINE> self.hidden_size = hidden_size <NEW_LINE> self.n_cat = n_cat <NEW_LINE> self.n_layers = n_layers <NEW_LINE> s...
Class implementing a decoder with a Categorical distribution for, categorical biomarkers (APOE)
62598fcb4a966d76dd5ef27c
class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ["username", "password"]
유저 명과 패스워드 fields 만 제공.
62598fcb7cff6e4e811b5dcb
class Adagrad(Optimizer): <NEW_LINE> <INDENT> def __init__(self, learning_rate=0.01, **kwargs): <NEW_LINE> <INDENT> self.initial_decay = kwargs.pop('decay', 0.0) <NEW_LINE> self.epsilon = kwargs.pop('epsilon', K.epsilon()) <NEW_LINE> learning_rate = kwargs.pop('lr', learning_rate) <NEW_LINE> super(Adagrad, self).__init...
Adagrad optimizer. Adagrad is an optimizer with parameter-specific learning rates, which are adapted relative to how frequently a parameter gets updated during training. The more updates a parameter receives, the smaller the learning rate. It is recommended to leave the parameters of this optimizer at their default v...
62598fcb099cdd3c636755b4
class Field: <NEW_LINE> <INDENT> def __init__(self,max_animals,max_crops): <NEW_LINE> <INDENT> self._crops = [] <NEW_LINE> self._animals = [] <NEW_LINE> self._max_animals = max_animals <NEW_LINE> self._max_crops = max_crops <NEW_LINE> <DEDENT> def plant_crop(self, crop): <NEW_LINE> <INDENT> if len(self._crops) < self._...
Simulate a field that can contain animals and crops
62598fcb9f28863672818a4f
class APIException(Exception): <NEW_LINE> <INDENT> def __init__(self, code: int, message: str, reason: str, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.code = code <NEW_LINE> self.message = message <NEW_LINE> self.reason = reason <NEW_LINE> <DEDENT> def __str__(self): <NEW_LI...
Custom Exception that is raised from the Requests when an API call goes wrong, meaning the API did not return a status code of 200. Attributes ---------- code : int The code of the Error that was returned message : str The error message as returned by the API reason : str The reason as specified by the AP...
62598fcb4c3428357761a664
class ReflexAgent(Agent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> legalMoves = gameState.getLegalActions() <NEW_LINE> scores = [self.evaluationFunction(gameState, action) for action in legalMoves] <NEW_LINE> bestScore = max(scores) <NEW_LINE> bestIndices = [index for index in range(len(s...
A reflex agent chooses an action at each choice point by examining its alternatives via a state evaluation function. The code below is provided as a guide. You are welcome to change it in any way you see fit, so long as you don't touch our method headers.
62598fcb4a966d76dd5ef27e
class Population: <NEW_LINE> <INDENT> def __init__(self, problem, population_size=POPULATION_SIZE): <NEW_LINE> <INDENT> self._problem = problem <NEW_LINE> self._solutions = [Solution(problem) for _ in range(population_size)] <NEW_LINE> self._population_size = population_size <NEW_LINE> <DEDENT> def _select_one_parent(s...
Class defining the population of solution. One population contains one generation.
62598fcb97e22403b383b2ad
class TrafficLightParams: <NEW_LINE> <INDENT> def __init__(self, baseline=False): <NEW_LINE> <INDENT> self.__tls_properties = dict() <NEW_LINE> self.baseline = baseline <NEW_LINE> <DEDENT> def add(self, node_id, tls_type="static", programID=10, offset=None, phases=None, maxGap=None, detectorGap=None, showDetectors=None...
Base traffic light. This class is used to place traffic lights in the network and describe the state of these traffic lights. In addition, this class supports modifying the states of certain lights via TraCI.
62598fcb60cbc95b063646e5
class _DecodeStep(pt.nn.Module): <NEW_LINE> <INDENT> def __init__(self, embedding_target: encoder.Embedding, decoder: decoder.Decoder, output_layer: layers.OutputLayer, factor_output_layers: pt.nn.ModuleList): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.embedding_target = embedding_target <NEW_LINE> self.dec...
Auxiliary module that wraps computation for a single decode step for a SockeyeModel. End-to-end traceable. Return values are put into a flat list to avoid return type constraints for traced modules.
62598fcbf9cc0f698b1c54a7
class HubIsExistedSerializer(serializers.Serializer): <NEW_LINE> <INDENT> hub = serializers.ListField( required=True, min_length=1, child=serializers.PrimaryKeyRelatedField( queryset=Hub.objects.filter_by(), error_messages={ 'does_not_exist': _("hub [{pk_value}] does not exist.") } ) )
验证列表中的集控是否存在
62598fcbec188e330fdf8c3e
class LXDInstallationError(LXDError): <NEW_LINE> <INDENT> def __init__( self, reason: str, *, details: Optional[str] = None, ) -> None: <NEW_LINE> <INDENT> brief = f"Failed to install LXD: {reason}." <NEW_LINE> resolution = "Please visit https://linuxcontainers.org/lxd/getting-started-cli/ for instructions on installin...
LXD Installation Error. :param reason: Reason for install failure. :param details: Optional details to include.
62598fcb167d2b6e312b7320
@dataclasses.dataclass <NEW_LINE> class LayoutTreeNode: <NEW_LINE> <INDENT> domNodeIndex: int <NEW_LINE> boundingBox: dom.Rect <NEW_LINE> layoutText: Optional[str] = None <NEW_LINE> inlineTextNodes: Optional[list[InlineTextBox]] = None <NEW_LINE> styleIndex: Optional[int] = None <NEW_LINE> paintOrder: Optional[int] = N...
Details of an element in the DOM tree with a LayoutObject. Attributes ---------- domNodeIndex: int The index of the related DOM node in the `domNodes` array returned by `getSnapshot`. boundingBox: dom.Rect The bounding box in document coordinates. Note that scroll offset of the document is ignored. lay...
62598fcb63b5f9789fe8551f
class SNICallbackTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> from letsencrypt.plugins.standalone.authenticator import StandaloneAuthenticator <NEW_LINE> self.authenticator = StandaloneAuthenticator(config=CONFIG, name=None) <NEW_LINE> self.cert = achallenges.DVSNI( chall...
Tests for sni_callback() method.
62598fcb3617ad0b5ee064f0
class UserType(DjangoObjectType): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model()
Class UserType to loads user model
62598fcb3d592f4c4edbb25c
class DealActionsAPIView(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> serializer_class = DealSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> user = self.request.user <NEW_LINE> current_merchant = get_object_or_404(Merchant, ...
Authenticated merchant can see a deal's details, update or delete it.
62598fcb5fc7496912d4844e
class VerKey(BlsEntity): <NEW_LINE> <INDENT> new_handler = 'indy_crypto_bls_ver_key_new' <NEW_LINE> from_bytes_handler = 'indy_crypto_bls_ver_key_from_bytes' <NEW_LINE> as_bytes_handler = 'indy_crypto_bls_ver_key_as_bytes' <NEW_LINE> free_handler = 'indy_crypto_bls_ver_key_free' <NEW_LINE> @classmethod <NEW_LINE> def n...
BLS verification key.
62598fcb0fa83653e46f5290
class ToggleButton(Button): <NEW_LINE> <INDENT> __groups = {} <NEW_LINE> group = ObjectProperty(None, allownone=True) <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._previous_group = None <NEW_LINE> super(ToggleButton, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def on_group(self, *largs): <NEW_LINE...
Toggle button class, see module documentation for more information.
62598fcb9f28863672818a51
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') <NEW_LINE> class BaseCoursewareTests(SharedModuleStoreTestCase): <NEW_LINE> <INDENT> MODULESTORE = TEST_DATA_SPLIT_MODULESTORE <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super().setUpClass() <NEW_LINE> c...
Base class for courseware API tests
62598fcb50812a4eaa620db9
class ValueSequenceMethodMocker(MethodMocker): <NEW_LINE> <INDENT> def __init__(self, retvals): <NEW_LINE> <INDENT> super(ValueSequenceMethodMocker, self).__init__() <NEW_LINE> self._retvals = retvals if retvals is not None else [] <NEW_LINE> <DEDENT> def get_method(self): <NEW_LINE> <INDENT> def mockmethod(mmself, *ar...
Provides mock method returning a sequence of values. Note: All objects share the sequence of values, i.e., the n-th call to the method will return the n-th value, independent of on which object the method is called.
62598fcbf9cc0f698b1c54a8
class NoEncoder(BaseEncoder): <NEW_LINE> <INDENT> def __init__(self, random_state: Optional[Union[np.random.RandomState, int]] = None ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.random_state = random_state <NEW_LINE> <DEDENT> def fit(self, X: Dict[str, Any], y: Any = None) -> BaseEncoder: <NEW_LINE> <INDE...
Don't perform encoding on categorical features
62598fcb63b5f9789fe85521
class IntAttribute(Attribute): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def redoc(cls) -> None: <NEW_LINE> <INDENT> super(IntAttribute, cls).redoc() <NEW_LINE> cls.__doc__ += "\n:type: int" <NEW_LINE> <DEDENT> def post_get(self, value: SupportsInt) -> int: <NEW_LINE> <INDENT> return int(value)
Class for attributes with integers values.
62598fcb283ffb24f3cf3c30
class lazy_property: <NEW_LINE> <INDENT> def __init__(self, fget): <NEW_LINE> <INDENT> self.fget = fget <NEW_LINE> self.func_name = fget.__name__ <NEW_LINE> <DEDENT> def __get__(self, obj, cls): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> value = self.fget(obj) <NEW_LINE> set...
Allows lazy evaluation of properties of non-mutable data. Useful when these are expensive to compute and are immutable. The data must not be mutable because the method gets replaced with the computed value in the original object.
62598fcbbe7bc26dc9252030