code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class MiriFringeFlatfieldModel(MiriFlatfieldModel): <NEW_LINE> <INDENT> schema_url = "miri_flatfield.schema" <NEW_LINE> _default_dq_def = flat_reference_flags <NEW_LINE> def __init__(self, init=None, data=None, dq=None, err=None, dq_def=None, detector=None, **kwargs): <NEW_LINE> <INDENT> super(MiriFringeFlatfieldModel,...
A variation of MiriFlatfieldModel used to maintain FRINGE flats. The structure is identical to MiriFlatfieldModel, except the REFTYPE is defined as 'FRINGE'. See MIRI-RP-00510-NLC for information on fringing. :Parameters: init: shape tuple, file path, file object, pyfits.HDUList, numpy array An optional initiali...
62598f908e71fb1e983bb6d6
class Overpass(object): <NEW_LINE> <INDENT> default_read_chunk_size = 4096 <NEW_LINE> def __init__(self, read_chunk_size=None, xml_parser=XML_PARSER_SAX, url="http://overpass-api.de/api/interpreter"): <NEW_LINE> <INDENT> self.url = url.rstrip('/') <NEW_LINE> self._regex_extract_error_msg = re.compile(b"\<p\>(?P<msg>\<s...
Class to access the Overpass API
62598f908e71fb1e983bb6d7
class MagicBulb(object): <NEW_LINE> <INDENT> red_uuid = "0000ffe6-0000-1000-8000-00805f9b34fb" <NEW_LINE> green_uuid = "0000ffe7-0000-1000-8000-00805f9b34fb" <NEW_LINE> blue_uuid = "0000ffe8-0000-1000-8000-00805f9b34fb" <NEW_LINE> white_uuid = "0000ffea-0000-1000-8000-00805f9b34fb" <NEW_LINE> def __init__(self, bulb_ad...
A simple chinese magic bulb with bluetooth control Attributes: bulb: btle.Peripheral object, connected to the bulb bulb_addr: MAC addr of connected bulb red_uuid: uuid of service to set red color of bulb red_serivce: service instance to control red color green_uuid: uuid of service to set green col...
62598f90d7e4931a7ef3bcc4
class FireAnt(Ant): <NEW_LINE> <INDENT> name = 'Fire' <NEW_LINE> damage = 3 <NEW_LINE> food_cost = 5 <NEW_LINE> armor = 1 <NEW_LINE> damage = 3 <NEW_LINE> implemented = True <NEW_LINE> def reduce_armor(self, amount): <NEW_LINE> <INDENT> "*** YOUR CODE HERE ***" <NEW_LINE> self.armor -= amount <NEW_LINE> if (self.armor<...
FireAnt cooks any Bee in its Place when it expires.
62598f905f7d997b871f91ec
class C00(BaseAttAvModel): <NEW_LINE> <INDENT> x_range = x_range_C00 <NEW_LINE> Rv = 4.05 <NEW_LINE> def k_lambda(self, x): <NEW_LINE> <INDENT> with u.add_enabled_equivalencies(u.spectral()): <NEW_LINE> <INDENT> x_quant = u.Quantity(x, u.micron, dtype=np.float64) <NEW_LINE> <DEDENT> x = x_quant.value <NEW_LINE> _test_v...
Attenuation curve of Calzetti et al. (2000) Parameters ---------- Av: float attenuation in V band Raises ------ InputParameterError Input Av values outside of defined range Notes ----- From Calzetti (2000, ApJ, Volume 533, Issue 2, pp. 682-695) Example: .. plot:: :include-source: import numpy as n...
62598f90f7d966606f747c05
class PatternCollection(object): <NEW_LINE> <INDENT> def __init__(self, total_items=None, items=None): <NEW_LINE> <INDENT> self.swagger_types = { 'total_items': 'int', 'items': 'list[Pattern]' } <NEW_LINE> self.attribute_map = { 'total_items': 'totalItems', 'items': 'items' } <NEW_LINE> self._total_items = total_items ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f904e696a045264dc19
class SpiNNaker(AbstractSpinnakerBase): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __init__( self, executable_finder, graph_label=None, database_socket_addresses=(), n_chips_required=None, n_boards_required=None, time_scale_factor=None, machine_time_step=None): <NEW_LINE> <INDENT> setup_configs() <NEW_LINE> supe...
The implementation of the SpiNNaker simulation interface. .. note:: You should not normally instantiate this directly from user code. Call :py:func:`~spinnaker_graph_front_end.setup` instead.
62598f9021a7993f00c65b9e
class DualHexGraph(DualVoronoiGraph): <NEW_LINE> <INDENT> def __init__(self, shape, spacing=1., origin=(0., 0.), orientation='horizontal', node_layout='rect'): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> spacing = float(spacing) <NEW_LINE> <DEDENT> except TypeError: <NEW_LINE> <INDENT> raise TypeError('spacing must be...
Graph of a structured grid of triangles. Examples -------- >>> import numpy as np >>> from landlab.graph import HexGraph >>> graph = DualHexGraph((3, 2), node_layout='hex') >>> graph.number_of_nodes 7 >>> graph.number_of_corners 6 >>> np.round(graph.y_of_node * 2. / np.sqrt(3)) ... # doctest: +NORMALIZE_WHITESPA...
62598f908da39b475be02e04
class Star: <NEW_LINE> <INDENT> def __init__(self, node): <NEW_LINE> <INDENT> self.node = node <NEW_LINE> self.medges = Star.get_missing_edges_of_node(node) <NEW_LINE> self.num_medges = len(self.medges) <NEW_LINE> self.weight = self.compute_weight() <NEW_LINE> <DEDENT> def __lt__(self, other): <NEW_LINE> <INDENT> if se...
A Star contains a focus node and some extra information about edges of its neighboring nodes. Since it is "centered" on one node, we call it a star. (PBNT calls this class an InducedCluster). In our terminology, once one adds the missing edges to a star, it becomes a preclique. If a preclique is maximal (meaning that t...
62598f90507cdc57c63a49b6
class RecordingView(Recording): <NEW_LINE> <INDENT> def __init__(self, rec, start, stop): <NEW_LINE> <INDENT> self._parent_rec = rec <NEW_LINE> self._view_slice = (start, stop) <NEW_LINE> chans = OrderedDict([(k, rec[k]) for k in rec.channels]) <NEW_LINE> meta = rec.meta.copy() <NEW_LINE> Recording.__init__(self, chann...
A time-slice of a multi channel recording
62598f90d4950a0f3b110c49
class WatodayExtractorPipeline(RawExtractorPipeline): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> RawExtractorPipeline.__init__(self) <NEW_LINE> self._title_x = "//article/header/h1[@itemprop='name headline']/text()" <NEW_LINE> self._text_paragraph_x = "//article/div[@class='article__body']/p/text() | /...
XPaths/custom logic for item extraction specific to this website. Prepares twitter urls.
62598f90d486a94d0ba2bbf6
class IronicScenario(scenario.OpenStackScenario): <NEW_LINE> <INDENT> @atomic.action_timer("ironic.create_node") <NEW_LINE> def _create_node(self, **kwargs): <NEW_LINE> <INDENT> if "name" not in kwargs: <NEW_LINE> <INDENT> kwargs["name"] = utils.generate_random_name( prefix="rally", choice=string.ascii_lowercase + stri...
Base class for Ironic scenarios with basic atomic actions.
62598f90b57a9660fecd16a4
class MinSumSegmentTree(object): <NEW_LINE> <INDENT> def __init__( self, sum_tree, min_tree, capacity, ): <NEW_LINE> <INDENT> self.sum_segment_tree = sum_tree <NEW_LINE> self.min_segment_tree = min_tree <NEW_LINE> self.capacity = capacity <NEW_LINE> <DEDENT> def insert(self, index, element): <NEW_LINE> <INDENT> index +...
This class merges two segment trees' operations for performance reasons to avoid unnecessary duplication of the insert loops.
62598f9001c39578d7f129ab
class caemToolValidator(BaseValidators.ProportionsValidator): <NEW_LINE> <INDENT> filterList = caemConstants.optionalFilter <NEW_LINE> overrideAttributeName = lccConstants.XmlAttributeCaemField <NEW_LINE> fieldPrefix = caemConstants.fieldPrefix <NEW_LINE> fieldSuffix = caemConstants.fieldSuffix <NEW_LINE> metricShortNa...
ToolValidator for CoreAndEdgeMetrics
62598f903cc13d1c6d46538f
class BotConfig(yaml.YAMLObject): <NEW_LINE> <INDENT> yaml_tag = u'BotConfig' <NEW_LINE> def __init__(self, token, prefix, presence): <NEW_LINE> <INDENT> self.token = token <NEW_LINE> self.prefix = prefix <NEW_LINE> self.presence = presence
Container for bot-specific settings read from config.yml Attributes ----------- token: The bots discord token prefix: The command prefix presence: The bots discord presence
62598f90eab8aa0e5d30b9a3
class VirtualMachineScaleSetIdentity(Model): <NEW_LINE> <INDENT> _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'R...
Identity for the virtual machine scale set. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The principal id of virtual machine scale set identity. :vartype principal_id: str :ivar tenant_id: The tenant id associated with the virtual machine scale set. :va...
62598f90a17c0f6771d5be5f
class BlackBody(ArithmeticModel): <NEW_LINE> <INDENT> def __init__(self, name='blackbody'): <NEW_LINE> <INDENT> self.refer = Parameter(name, 'refer', 5000., tinyval, hard_min=tinyval, frozen=True, units="angstroms") <NEW_LINE> self.ampl = Parameter(name, 'ampl', 1., tinyval, hard_min=tinyval, units="angstroms") <NEW_LI...
Blackbody model.
62598f90b57a9660fecd16a5
class FillInAlternativeIdMixin(ConvertToDBMixin): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._db_map_alt_lookup = dict() <NEW_LINE> <DEDENT> def build_lookup_dictionary(self, db_map_data): <NEW_LINE> <INDENT> super().build_lookup_dictio...
Fills in alternative names.
62598f9094891a1f408b9502
class AtomException(Exception): <NEW_LINE> <INDENT> pass
Base exception
62598f901f037a2d8b9e3d03
class Config: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data = {} <NEW_LINE> <DEDENT> def read(self, f_path): <NEW_LINE> <INDENT> with open(f_path) as f: <NEW_LINE> <INDENT> for line in f: <NEW_LINE> <INDENT> line = line.rstrip('\n') <NEW_LINE> if len(line)>0 and line[0]!='#': <NEW_LINE> <INDENT>...
This class reads game settings from config.txt
62598f9030dc7b766599f480
class Wawrite(Expression): <NEW_LINE> <INDENT> def __init__(self, first, second, third): <NEW_LINE> <INDENT> super().__init__(first, Expression(second, third, type_=WAWRITE), type_=WAWRITE)
A WAWRITE node.
62598f908e71fb1e983bb6d8
class hr_payslip(osv.osv): <NEW_LINE> <INDENT> _inherit = 'hr.payslip' <NEW_LINE> _description = 'Pay Slip' <NEW_LINE> _columns = { 'indicadores_id': fields.many2one('hr.indicadores', 'Indicadores',states={'draft': [('readonly', False)]}, readonly=True, required=True), } <NEW_LINE> def create(self, cr, uid, vals, conte...
Pay Slip
62598f90b830903b9686e286
class GETFH4resok(BaseObj): <NEW_LINE> <INDENT> _strfmt1 = "FH:{0:crc32}" <NEW_LINE> _attrlist = ("fh",) <NEW_LINE> def __init__(self, unpack): <NEW_LINE> <INDENT> self.fh = nfs_fh4(unpack) <NEW_LINE> self.set_global("nfs4_fh", self.fh)
struct GETFH4resok { nfs_fh4 fh; };
62598f90e5267d203ee6b53f
class SMSCodeTokenView(GenericAPIView): <NEW_LINE> <INDENT> def get(self, request, account): <NEW_LINE> <INDENT> user = get_user_by_account(account) <NEW_LINE> if user is None: <NEW_LINE> <INDENT> return Response({"message": "用户不存在!"}, status=status.HTTP_404_NOT_FOUND) <NEW_LINE> <DEDENT> access_token = user.generate_s...
通过账号获取临时访问票据[access_token]
62598f90a4f1c619b294e210
class MessTestCase(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.h1 = Hostel.objects.create(name="Hostel 1") <NEW_LINE> self.h2 = Hostel.objects.create(name="Hostel 2") <NEW_LINE> self.h1m1 = MenuEntry.objects.create(day=1, hostel=self.h1) <NEW_LINE> <DEDENT> def test_mess_other(self): <NE...
Check mess menu endpoints.
62598f9026068e7796d4c585
class ETFScheduler(SchedulerBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("ETF", "0", task_start_notification=True) <NEW_LINE> self.b_level = {} <NEW_LINE> <DEDENT> def schedule(self, update): <NEW_LINE> <INDENT> if update.graph_changed: <NEW_LINE> <INDENT> self.b_level = compute_b...
Implementation of the ETF (Earliest Time First) scheduler from Scheduling Precedence Graphs in Systems with Interprocessor Communication Times (1989) The scheduler prioritizes (worker, task) pairs with the earliest possible start time. Ties are broken with static B-level.
62598f90f7d966606f747c07
class Wallet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._private_key = PrivateKey(secret=random.randint(1, P-1)) <NEW_LINE> self._public_key = self._private_key.point <NEW_LINE> self._blockchain_address = self._public_key.address() <NEW_LINE> <DEDENT> @property <NEW_LINE> def private_key(...
変更点などのメモ generate_blockchainaddress()は削除 公開鍵生成の過程でアドレスも生成するため アドレス長が従来と異なる もともと65文字で変更後は34文字 一般的にアドレスは27〜35文字に収まるのでOK
62598f908da39b475be02e06
class tzinfo(object): <NEW_LINE> <INDENT> def dst(self, date_time): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def fromutc(self, date_time): <NEW_LINE> <INDENT> return datetime(1, 1, 1) <NEW_LINE> <DEDENT> def tzname(self, date_time): <NEW_LINE> <INDENT> return "" <NEW_LINE> <DEDENT> def utcoffset(self, date_time...
Abstract base class for time zone info objects.
62598f90a17c0f6771d5be60
class db(Inmessage): <NEW_LINE> <INDENT> def initfromfile(self): <NEW_LINE> <INDENT> botsglobal.logger.debug('Read edi file "%(filename)s".',self.ta_info) <NEW_LINE> self.root = botslib.readdata_pickled(filename=self.ta_info['filename']) <NEW_LINE> <DEDENT> def nextmessage(self): <NEW_LINE> <INDENT> yield self
For database connector: reading from database. Communication script delivers a file with a pickled object; File is read, object is unpickled, object is passed to the mapping script as inn.root.
62598f90507cdc57c63a49b8
@type_checked <NEW_LINE> class CreateAccountResultCode(IntEnum): <NEW_LINE> <INDENT> CREATE_ACCOUNT_SUCCESS = 0 <NEW_LINE> CREATE_ACCOUNT_MALFORMED = -1 <NEW_LINE> CREATE_ACCOUNT_UNDERFUNDED = -2 <NEW_LINE> CREATE_ACCOUNT_LOW_RESERVE = -3 <NEW_LINE> CREATE_ACCOUNT_ALREADY_EXIST = -4 <NEW_LINE> def pack(self, packer: Pa...
XDR Source Code:: enum CreateAccountResultCode { // codes considered as "success" for the operation CREATE_ACCOUNT_SUCCESS = 0, // account was created // codes considered as "failure" for the operation CREATE_ACCOUNT_MALFORMED = -1, // invalid destination CREATE_ACCOU...
62598f90b57a9660fecd16a6
class Order(object): <NEW_LINE> <INDENT> def __init__(self, quote, order_list): <NEW_LINE> <INDENT> self.timestamp = int(quote['timestamp']) <NEW_LINE> self.quantity = Decimal(quote['quantity']) <NEW_LINE> self.price = Decimal(quote['price']) <NEW_LINE> self.order_id = int(quote['order_id']) <NEW_LINE> self.trade_id = ...
Orders represent the core piece of the exchange. Every bid/ask is an Order. Orders are doubly linked and have helper functions (next_order, prev_order) to help the exchange fullfill orders with quantities larger than a single existing Order.
62598f90442bda511e95c088
class TrainingMode(Enum): <NEW_LINE> <INDENT> epoch = auto() <NEW_LINE> step = auto()
An enum for the training mode.
62598f90596a8972361278a2
class Node: <NEW_LINE> <INDENT> def __init__(self, value, next=None): <NEW_LINE> <INDENT> self.val = value <NEW_LINE> self._next = next
Simple node structure.
62598f90009cb60464d01154
class ParamContentCheckList(ParamContent): <NEW_LINE> <INDENT> def __init__(self, parent, name): <NEW_LINE> <INDENT> ParamContent.__init__(self, parent, name) <NEW_LINE> <DEDENT> def OnButtonEdit(self, evt): <NEW_LINE> <INDENT> if self.textModified: <NEW_LINE> <INDENT> self.value = self.GetValue() <NEW_LINE> <DEDENT> d...
Editing of content check list attribute.
62598f9007f4c71912baf06f
class Restaurant: <NEW_LINE> <INDENT> def __init__(self, restaurant_name, cuisine_type): <NEW_LINE> <INDENT> self.restaurant_name = restaurant_name <NEW_LINE> self.cuisine_type = cuisine_type <NEW_LINE> <DEDENT> def describe_restaurant(self): <NEW_LINE> <INDENT> print("restaurant name: " + self.restaurant_name) <NEW_LI...
模拟餐馆
62598f90b5575c28eb712adf
class SavingsAccount(Account): <NEW_LINE> <INDENT> deposit_fee = 2 <NEW_LINE> def deposit(self, amount): <NEW_LINE> <INDENT> return Account.deposit(self, amount - self.deposit_fee)
Банковский счет с комиссией за пополнение.
62598f9023849d37ff850ce9
class TileAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ( 'course_id', 'site', 'enabled', 'change_date', 'changed_by', )
List displayed when Tiles are listed.
62598f900a50d4780f704ff9
class SSHDAnalysisJob(interface.TurbiniaJob): <NEW_LINE> <INDENT> evidence_input = [ExportedFileArtifact] <NEW_LINE> evidence_output = [ReportText] <NEW_LINE> NAME = 'SSHDAnalysisJob' <NEW_LINE> def create_tasks(self, evidence): <NEW_LINE> <INDENT> tasks = [] <NEW_LINE> for evidence_item in evidence: <NEW_LINE> <INDENT...
Filter input based on regular expression patterns.
62598f90ec188e330fdf84c8
class CoreTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.path = os.path.join(os.path.dirname(__file__), 'data') <NEW_LINE> self.filename_css = os.path.join(self.path, 'test_css.wfdisc') <NEW_LINE> self.filename_nnsa = os.path.join(self.path, 'test_nnsa.wfdisc') <NEW_LINE> hea...
Test cases for css core interface
62598f90a17c0f6771d5be61
class TestDependChainError(unittest.TestCase): <NEW_LINE> <INDENT> test1 = 'Parent' <NEW_LINE> test2 = 'Child' <NEW_LINE> test3 = 'Grandchild' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> ctrl_d1 = ControlFile() <NEW_LINE> ctrl_d1.settings['Name'] = self.test1 <NEW_LINE> ctrl_d1.settings['Provides'] = 'Parent' <NEW_...
Error case 2: dependency chain broken Expected outcome: all packages installed, dependees not configured
62598f9063d6d428bbee23e2
class EventsView(generic.ListView): <NEW_LINE> <INDENT> template_name = 'events/events.html' <NEW_LINE> model = Calendar <NEW_LINE> context_object_name = 'calendar' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Calendar.objects.all()[:1].get()
Events Index
62598f90bde94217f370747b
class Transport(NamedTuple): <NEW_LINE> <INDENT> problem: Any = None <NEW_LINE> solver_output: Any = None <NEW_LINE> @property <NEW_LINE> def linear(self): <NEW_LINE> <INDENT> return isinstance(self.problem, problems.LinearProblem) <NEW_LINE> <DEDENT> @property <NEW_LINE> def geom(self): <NEW_LINE> <INDENT> return self...
Implements a core.problems.Transport interface to transport solutions.
62598f903eb6a72ae038a25f
class RepeatDict(dict): <NEW_LINE> <INDENT> __slots__ = "__setitem__", "__getitem__" <NEW_LINE> def __init__(self, d): <NEW_LINE> <INDENT> self.__setitem__ = d.__setitem__ <NEW_LINE> self.__getitem__ = d.__getitem__ <NEW_LINE> <DEDENT> def __getattr__(self,key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[...
Repeat dictionary implementation. >>> repeat = RepeatDict({}) >>> iterator, length = repeat('numbers', range(5)) >>> length 5 >>> repeat['numbers'] <chameleon.tal.RepeatItem object at ...> >>> repeat.numbers <chameleon.tal.RepeatItem object at ...> >>> getattr(repeat, 'missing_key', None) is None True >>> try:...
62598f9015fb5d323ce7e957
class DateUtils(): <NEW_LINE> <INDENT> __ISO_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S%z" <NEW_LINE> @staticmethod <NEW_LINE> def is_outdated(date_1, date_2, delta_ms): <NEW_LINE> <INDENT> return (date_1 - date_2) > timedelta(milliseconds=delta_ms) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def to_iso_date(str_date): <NEW_LIN...
Date utilities for Blueliv API
62598f908c0ade5d55dc34a0
class Post(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=70) <NEW_LINE> body = models.TextField() <NEW_LINE> created_time = models.DateTimeField() <NEW_LINE> modified_time = models.DateTimeField() <NEW_LINE> excerpt = models.CharField(max_length=200,blank=True) <NEW_LINE> category = models.Fore...
文章的数据库表稍微复杂一点,主要是涉及的字段更多。
62598f9063b5f9789fe84d9c
class KohonenMap(ind.KohonenMap): <NEW_LINE> <INDENT> def __init__(self, attribs): <NEW_LINE> <INDENT> super(KohonenMap, self).__init__() <NEW_LINE> self.coord1 = None <NEW_LINE> self.coord2 = None <NEW_LINE> self.coord3 = None <NEW_LINE> for key, value in attribs.items(): <NEW_LINE> <INDENT> setattr(self, key, value) ...
Represents a <KohonenMap> tag in v4.1 and provides methods to convert to PFA.
62598f9023e79379d538c12a
class AgentUpdateView(OrganizerAndLoginRequiredMixin, generic.UpdateView): <NEW_LINE> <INDENT> template_name = "agents/agent_update.html" <NEW_LINE> queryset = Agent.objects.all() <NEW_LINE> context_object_name = "agent" <NEW_LINE> form_class = AgentModelForm <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> re...
Agent update view
62598f907b25080760ed70d6
class Role(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255, help_text="job title, degree program, or other position name") <NEW_LINE> slug = models.SlugField(help_text="url-friendly name for this Role") <NEW_LINE> order = models.IntegerField(default=0, help_text="integer indicating order withi...
Roles are jobs, degree programs, volunteer positions and other occupations that make up your career history. They serve a dual function. 1. Roles can be linked to zero or more Projects. This link is bi-directional: the Projects serve as examples of your work in that Role, and the Role provides additional cont...
62598f904e696a045264dc1b
class logger: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def __init__(): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def log_variables(self, member): <NEW_LINE> <INDENT> attributes = self.get_attributes(member) <NEW_LINE> with open("attributes.log", "w") as f: <NEW_LINE> <INDENT> for key, va...
Message logger functions.
62598f90dc8b845886d531e4
class gTTSPlugin(TTS): <NEW_LINE> <INDENT> def __init__(self, lang, config): <NEW_LINE> <INDENT> if lang.lower() not in supported_langs and lang[:2].lower() in supported_langs: <NEW_LINE> <INDENT> lang = lang[:2] <NEW_LINE> <DEDENT> super(gTTSPlugin, self).__init__(lang, config, Goog...
Interface to google TTS.
62598f90fbf16365ca793cd9
class NuSVR(SparseBaseLibSVM, RegressorMixin): <NEW_LINE> <INDENT> def __init__(self, nu=0.5, C=1.0, kernel='rbf', degree=3, gamma=0.0, coef0=0.0, shrinking=True, epsilon=0.1, probability=False, tol=1e-3, cache_size=200): <NEW_LINE> <INDENT> SparseBaseLibSVM.__init__(self, 'nu_svr', kernel, degree, gamma, coef0, tol, C...
NuSVR for sparse matrices (csr) See :class:`sklearn.svm.NuSVC` for a complete list of parameters Notes ----- For best results, this accepts a matrix in csr format (scipy.sparse.csr), but should be able to convert from any array-like object (including other sparse representations). Examples -------- >>> from sklearn....
62598f90a8ecb03325870e2d
class EventFIBCDpStatus(EventFIBCBase): <NEW_LINE> <INDENT> pass
FIBC Dp status event
62598f90d4950a0f3b110c4b
class MainTests(UbuntuTouchAppTestCase): <NEW_LINE> <INDENT> test_qml_file = "%s/%s.qml" % (os.path.dirname(os.path.realpath(__file__)),"../../../../ucMagic") <NEW_LINE> def test_0_can_select_mainView(self): <NEW_LINE> <INDENT> mainView = self.get_mainview() <NEW_LINE> self.assertThat(mainView.visible,Eventually(Equals...
Generic tests for the Hello World
62598f90d486a94d0ba2bbf9
class UniformRandomPolicy(Policy): <NEW_LINE> <INDENT> def __init__(self, num_actions): <NEW_LINE> <INDENT> assert num_actions >= 1 <NEW_LINE> self.num_actions = num_actions <NEW_LINE> <DEDENT> def select_action(self, q_value, **kwargs): <NEW_LINE> <INDENT> return np.random.randint(0, self.num_actions) <NEW_LINE> <DEDE...
Chooses a discrete action with uniform random probability. This is provided as a reference on how to use the policy class. Parameters ---------- num_actions: int Number of actions to choose from. Must be > 0. Raises ------ ValueError: If num_actions <= 0
62598f90cb5e8a47e493bf85
class HiddenField(InputField): <NEW_LINE> <INDENT> type = 'hidden'
A hidden field.
62598f903617ad0b5ee05d70
class SolicitudCambioManager(flask.views.MethodView): <NEW_LINE> <INDENT> @login_required <NEW_LINE> def get(self): <NEW_LINE> <INDENT> return flask.render_template('solicitudCambioManager.html') <NEW_LINE> <DEDENT> @login_required <NEW_LINE> def post(self): <NEW_LINE> <INDENT> result = eval(flask.request.form['express...
Clase que es utilizada para servir a las peticiones de la pagina html usuarioManager, relacionada a cuestiones de mantenimiento de usuarios del sistema
62598f9007d97122c42168d5
class ImageFrame(JavaValue): <NEW_LINE> <INDENT> def __init__(self, jvalue, bigdl_type="float"): <NEW_LINE> <INDENT> self.value = jvalue <NEW_LINE> self.bigdl_type = bigdl_type <NEW_LINE> if self.is_local(): <NEW_LINE> <INDENT> self.image_frame = LocalImageFrame(jvalue=self.value) <NEW_LINE> <DEDENT> else: <NEW_LINE> <...
ImageFrame wraps a set of ImageFeature
62598f90009cb60464d01156
class ServerPrivateEndpointConnectionProperties(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, 'private_link_service_connection_state': {'key': '...
Properties of a private endpoint connection. Variables are only populated by the server, and will be ignored when sending a request. :param private_endpoint: Private endpoint which the connection belongs to. :type private_endpoint: ~azure.mgmt.rdbms.mariadb.models.PrivateEndpointProperty :param private_link_service_c...
62598f9073bcbd0ca4bc9e7d
class GitLabWebhookView(WebhookMixin, APIView): <NEW_LINE> <INDENT> integration_type = Integration.GITLAB_WEBHOOK <NEW_LINE> def handle_webhook(self): <NEW_LINE> <INDENT> event = self.request.data.get('object_kind', GITLAB_PUSH) <NEW_LINE> webhook_gitlab.send( Project, project=self.project, data=self.request.data, even...
Webhook consumer for GitLab. Accepts webhook events from GitLab, 'push' events trigger builds. Expects the following JSON:: { "before": "95790bf891e76fee5e1747ab589903a6a1f80f22", "after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", "object_kind": "push", "ref": "branch-name", ...
62598f90cc0a2c111447ac39
class PatternNode(ASTNode): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._add_named_children(['identifier', 'pattern'])
`Pattern[identifier_, pattern_]`
62598f900a50d4780f704ffc
class SimAttn3(nn.Module): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> super(SimAttn3, self).__init__() <NEW_LINE> self.V = args.num_embeddings <NEW_LINE> self.L = args.L <NEW_LINE> self.D = args.D <NEW_LINE> self.C = args.C <NEW_LINE> self.Ci = args.Ci <NEW_LINE> self.layers = args.rnn_layers <NE...
sims --> attention probability distribution
62598f9076d4e153a661c843
class CardType(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50, help_text='Name of the card type.') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
Represents a type of card players can get punished with. Todo: hard coded?
62598f9024f1403a926856c4
class PixelPointRegion(PointRegion, PixelCoordinate, PixelRegion): <NEW_LINE> <INDENT> def __init__(self, x, y, **kwargs): <NEW_LINE> <INDENT> PointRegion.__init__(self, **kwargs) <NEW_LINE> PixelCoordinate.__init__(self, x, y, **kwargs) <NEW_LINE> <DEDENT> @property <NEW_LINE> def axis1(self): <NEW_LINE> <INDENT> retu...
This class ...
62598f9063d6d428bbee23e4
class MultiPropertyScoringFunction(BatchScoringFunction): <NEW_LINE> <INDENT> def __init__(self, scoring_functions: List[ScoringFunction], weights=None) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.scoring_functions = scoring_functions <NEW_LINE> number_scoring_functions = len(scoring_functions) <NEW...
Scoring function that combines linearly multiple scoring functions.
62598f90baa26c4b54d4eee0
class GroupSoftThresholdingLayer(Layer): <NEW_LINE> <INDENT> @interfaces.legacy_prelu_support <NEW_LINE> def __init__(self, size_groups, theta_initializer='zeros', theta_regularizer=None, theta_constraint=None, **kwargs): <NEW_LINE> <INDENT> super(GroupSoftThresholdingLayer, self).__init__(**kwargs) <NEW_LINE> self.sup...
Parametric Rectified Linear Unit. It follows: `f(x) = alpha * x for x < 0`, `f(x) = x for x >= 0`, where `alpha` is a learned array with the same shape as x. # Input shape Arbitrary. Use the keyword argument `input_shape` (tuple of integers, does not include the samples axis) when using this layer as the fi...
62598f9071ff763f4b5e739d
class AssetsPlugin(unittest.TestCase): <NEW_LINE> <INDENT> @patch('avocado.plugins.assets.FetchAssetHandler') <NEW_LINE> def test_fetch_assets_sucess_fail(self, mocked_fetch_asset_handler): <NEW_LINE> <INDENT> mocked_fetch_asset_handler.return_value.calls = [ {'name': 'success.tar.gz', 'locations': 'https://localhost/s...
Unit tests for Assets Plugin
62598f90a219f33f346c6443
class Main: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.config() <NEW_LINE> sys.exit(self.run()) <NEW_LINE> <DEDENT> except (EOFError, KeyboardInterrupt): <NEW_LINE> <INDENT> sys.exit(114) <NEW_LINE> <DEDENT> except SystemExit as exception: <NEW_LINE> <INDENT> sys.e...
Main class
62598f908c0ade5d55dc34a1
class Client(object): <NEW_LINE> <INDENT> def __init__(self, loop, remote_hub_frontend, identity): <NEW_LINE> <INDENT> self.loop = loop <NEW_LINE> self.remote_hub_frontend = remote_hub_frontend <NEW_LINE> self.identity = identity <NEW_LINE> <DEDENT> async def connect(self, remote_identity): <NEW_LINE> <INDENT> address,...
The Socket Client implementation. Provide a Client that knowns how to connect to a Proxy service send and recv data. :param multiplex_endpoint: Mutliplex service address to connect. :type multiplex_endpoint: str :param identity: Unique client identification. If not set uuid1 will be used. :type identity: str Usage::...
62598f90e76e3b2f99fd865e
class DiscoveredHostsDeleteDialog(DiscoveredHostsActionDialog): <NEW_LINE> <INDENT> title = Text("//h4[text()='Delete - The following hosts are about to be changed']")
Discovered hosts Delete dialog action view
62598f90fbf16365ca793cdb
class coloredOutput: <NEW_LINE> <INDENT> def __init__(self, r, g=None, b=None, foreground=True, curColor=Colors.DEFAULT): <NEW_LINE> <INDENT> color, bg = parseColorParams(r, g, b, bg=foreground) <NEW_LINE> self.fg = bg <NEW_LINE> self.r, self.g, self.b = color <NEW_LINE> self.doneColor = curColor <NEW_LINE> <DEDENT> de...
A class to be used with the 'with' command to print colors. Resets after it's done. @Parameters: Takes either a 3 or 4 list/tuple of color arguements, 3 seperate color arguements, or 1 color id between 0-5 representing a distinct color. Set the curColor parameter (must be a 3 or 4 item list/tuple) to ha...
62598f9021a7993f00c65ba4
class RelationsComponent(ServiceComponent): <NEW_LINE> <INDENT> def read(self, identity, record=None): <NEW_LINE> <INDENT> record.relations.dereference()
Base service component.
62598f900c0af96317c55fad
class NoThumbnail(Exception): <NEW_LINE> <INDENT> pass
The raw file does not contain a thumbnail.
62598f90d53ae8145f9180b5
class TreeKernelTests(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> T1_str = "( ( A:0.5, B:0.25 )E:0.5, ( C:0.25, D:0.25 )F:0.5 )G;" <NEW_LINE> T2_str = "( ( ( A:0.25, B:0.25 )E:0.5, C:0.25 )F:0.5, D:0.25 )G;" <NEW_LINE> self.T1 = Phylo.read(StringIO(T1_str), "newick") <NEW_LINE> self.T2 ...
Tests for the tree kernel
62598f9096565a6dacd2cd8e
class ClientConfigurationError(Exception): <NEW_LINE> <INDENT> pass
Raised when a client is misconfigured
62598f90596a8972361278a5
class PlatformSailfishOS(PlatformModule): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(PlatformSailfishOS, self).__init__() <NEW_LINE> <DEDENT> @property <NEW_LINE> def platform_id(self): <NEW_LINE> <INDENT> return "jolla" <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_name(self): <NEW_LINE> <...
A Sailfish OS platform module.
62598f908da39b475be02e0a
class EdgeHLEmptyTestCase(EdgeHLBaseTestCase): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> self._edge.move() <NEW_LINE> self._edge.stop() <NEW_LINE> self._edge.pause() <NEW_LINE> self._edge.resume()
test for setting empty list
62598f90b7558d5895463257
class BadNetmaskTypeError(Error): <NEW_LINE> <INDENT> pass
Used to report on duplicate symbol names found while parsing.
62598f90dd821e528d6d8b5d
class HTTPRequest: <NEW_LINE> <INDENT> def __init__(self, ip, use_ssl=False, hostname=None, url_path='/', port=None, timeout=5): <NEW_LINE> <INDENT> self.use_ssl = use_ssl <NEW_LINE> self.ip = ip <NEW_LINE> self.url_path = url_path <NEW_LINE> if not self.url_path.startswith('/'): <NEW_LINE> <INDENT> self.url_path = '/{...
HTTP request
62598f9001c39578d7f129b0
class Payments(object): <NEW_LINE> <INDENT> openapi_types = { 'invoice': 'str' } <NEW_LINE> attribute_map = { 'invoice': 'invoice' } <NEW_LINE> def __init__(self, invoice=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> local_vars_configuration = Configu...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598f903c8af77a43b67d4e
class Agent(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.url = 'http://www.xicidaili.com/nn/' <NEW_LINE> self.headers = { 'User-Agent': self.get_random_agent()[0] } <NEW_LINE> pass <NEW_LINE> ip_list = self.get_ip_list(self.url, self.headers) <NEW_LINE> ip = self.get_random_ip(ip_list) <NEW...
爬虫代理IP
62598f90a79ad16197769c8c
class BlogPostDetailView(generic.DetailView): <NEW_LINE> <INDENT> model = BlogPost
View for particular blog detail
62598f9073bcbd0ca4bc9e7f
class Particle(_particle): <NEW_LINE> <INDENT> def __init__(self, particle=None, **kwargs): <NEW_LINE> <INDENT> _particle.__init__(self) <NEW_LINE> if particle: <NEW_LINE> <INDENT> for name in self.__dataclass_fields__: <NEW_LINE> <INDENT> setattr(self, name, getattr(particle, name)) <NEW_LINE> <DEDENT> <DEDENT> for na...
A particle. Note that a - b indicates removing b from a, whereas a + -b indicates adding an antiparticle.
62598f90009cb60464d01158
class RootStoreFetchException(Exception): <NEW_LINE> <INDENT> pass
Exception thrown when a RootStoreFetcher is in an invalid state
62598f90090684286d5934ec
class RequestHandler(BaseHTTPRequestHandler): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.callback = kwargs.pop("callback") <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def do_GET(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.callback(self.path) <NEW_...
A request handler for the embedded HTTP server.
62598f9060cbc95b06363f70
class UserReleaseStatRange(pydantic.BaseModel): <NEW_LINE> <INDENT> to_ts: int <NEW_LINE> from_ts: int <NEW_LINE> count: int <NEW_LINE> releases: List[UserReleaseRecord]
Model for user's most listened-to releases for a particular time range. Currently supports week, month, year and all-time
62598f90379a373c97d98c44
class SamplerFileLoader(FileLoader): <NEW_LINE> <INDENT> def __init__(self, f, batch_size): <NEW_LINE> <INDENT> batch_meta = { "base_name": f.base_name, "label": f.label, "no_preprocess": f.no_preprocess, "pattern": f.pattern, "root": f.root, "weight": f.weight, } <NEW_LINE> if f.oversample_as_weights: <NEW_LINE> <INDE...
SamplerFileLoader class creates TUs from a SamplerFile object.
62598f904428ac0f6e658152
class SynapseWorkspaceSqlPoolTableDataSetMapping(DataSetMapping): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'system_data': {'readonly': True}, 'type': {'readonly': True}, 'kind': {'required': True}, 'data_set_id': {'required': True}, 'data_set_mapping_status': {'readonly'...
A Synapse Workspace Sql Pool Table data set mapping. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar id: The resource id of the azure resource. :vartype id: str :ivar name: Name of the azure resource. :...
62598f90b57a9660fecd16ab
class ExactInference(InferenceModule): <NEW_LINE> <INDENT> def initializeUniformly(self, gameState): <NEW_LINE> <INDENT> self.beliefs = util.Counter() <NEW_LINE> for p in self.legalPositions: self.beliefs[p] = 1.0 <NEW_LINE> self.beliefs.normalize() <NEW_LINE> <DEDENT> def observe(self, observation, gameState): <NEW_LI...
The exact dynamic inference module should use forward-algorithm updates to compute the exact belief function at each time step.
62598f9045492302aabfc101
class AbServiceSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> labels = ServiceLabelSerializer(many=True, required=False) <NEW_LINE> resources = ServiceResourceRelatedField(read_only=True, many=True) <NEW_LINE> def create(self, validated_data): <NEW_LINE> <INDENT> labels = validated_data.pop('labels', []) ...
抽象service serializer
62598f9024f1403a926856c5
class RegistrationProxy(RegistrationEntry): <NEW_LINE> <INDENT> def add_schedule_item(self, schedule_item): <NEW_LINE> <INDENT> section_list = schedule_item.sections <NEW_LINE> sections = {} <NEW_LINE> sections['MainSec'] = section_list[0] <NEW_LINE> for i in range(1, len(section_list)): <NEW_LINE> <INDENT> sections['R...
Proxy class which handles actually doing the registration in a system of a :model:`registrator.RegistrationEntry`
62598f90656771135c4892aa
class Path(TikZItem): <NEW_LINE> <INDENT> name = 'path' <NEW_LINE> def __init__(self, path_type: str, points: Sequence[Union[Tuple[float, float], 'Node', 'Shape']], draw_type: str = '--', options: Optional[List[str]] = None, overlay: Optional['Overlay'] = None): <NEW_LINE> <INDENT> self.points = points <NEW_LINE> self....
Lower-level class for drawing individual lines or shapes, should only be needed to be used for very custom graphics
62598f9030dc7b766599f486
class Window(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.root = utils.get_root_from_file(path) <NEW_LINE> <DEDENT> def get_controls(self, control_type): <NEW_LINE> <INDENT> for node in self.root.xpath(".//control[@type='%s']" % control_type): <NEW_LINE> <INDENT> yield node <NEW_LINE>...
Class representing a Kodi Window
62598f906e29344779b00282
class LayoutForeignObjectRel(ForeignObjectRel): <NEW_LINE> <INDENT> def __init__(self, field, related_name=None, limit_choices_to=None, parent_link=False, on_delete=None, related_query_name=None): <NEW_LINE> <INDENT> self.field = field <NEW_LINE> self.related_name = related_name <NEW_LINE> self.related_query...
Returns a :class:`~django.db.models.fields.related.ForeignObjectRel` subclass that understands that it's related field will be dynamic and that it can't cache certain things about the model being referenced by this relation. The main difference between the returned class and ForeignObjectRel externally is that it's con...
62598f90e5267d203ee6b545
class FSMField(models.Field): <NEW_LINE> <INDENT> descriptor_class = FSMFieldDescriptor <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.protected = kwargs.pop('protected', False) <NEW_LINE> kwargs.setdefault('max_length', 50) <NEW_LINE> super(FSMField, self).__init__(*args, **kwargs) <NEW_LINE>...
State Machine support for Django model
62598f90cad5886f8bdc4ea2
class KLDivLoss(_Loss): <NEW_LINE> <INDENT> def __init__(self, size_average=True, reduce=True): <NEW_LINE> <INDENT> super(KLDivLoss, self).__init__(size_average) <NEW_LINE> self.reduce = reduce <NEW_LINE> <DEDENT> def forward(self, input, target): <NEW_LINE> <INDENT> _assert_no_grad(target) <NEW_LINE> return F.kl_div(i...
The `Kullback-Leibler divergence`_ Loss KL divergence is a useful distance measure for continuous distributions and is often useful when performing direct regression over the space of (discretely sampled) continuous output distributions. As with `NLLLoss`, the `input` given is expected to contain *log-probabilities*,...
62598f90e76e3b2f99fd8660
class SimplePayException(Exception): <NEW_LINE> <INDENT> pass
Raised when a resource could not be retrieved
62598f90d7e4931a7ef3bccc
class PruebasMaliciaInsalubridad(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.p = Pension() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.p = None <NEW_LINE> <DEDENT> def test_IntroduceInsalubridadNegativa(self): <NEW_LINE> <INDENT> self.assertRaises(ValueError, s...
Conjunto de pruebas de malicia y casos invalidos del argumento anhos de insalubridad para la funcion recibe_pension
62598f908e71fb1e983bb6de
class VoteCreateView(SRViewMixin, CreateView): <NEW_LINE> <INDENT> model = Vote <NEW_LINE> template_name = "vote_form.html" <NEW_LINE> fields = ["rating", "vote", "comment"] <NEW_LINE> permission_required = "review.add_vote" <NEW_LINE> def get_form(self): <NEW_LINE> <INDENT> form = super().get_form() <NEW_LINE> form.fi...
This view allows the user to add new votes to an existing review.
62598f9023e79379d538c12f
class HighLight(TimeStampedBaseModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=100, ) <NEW_LINE> image = models.ImageField(null=True, blank=True) <NEW_LINE> available = models.BooleanField(default=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> class Meta:...
Specifying HighLights. Eg: Wifi Available, Parking not available
62598f90507cdc57c63a49be
class BaseUser: <NEW_LINE> <INDENT> def __init__(self, username: str): <NEW_LINE> <INDENT> self.username = username
A base for users. Attributes: username: The name of the user.
62598f908da39b475be02e0c