code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TemperatureMonitor(pypot.primitive.LoopPrimitive): <NEW_LINE> <INDENT> def __init__(self, robot, freq=0.5, temp_limit=55, player=None, sound=None): <NEW_LINE> <INDENT> pypot.primitive.LoopPrimitive.__init__(self, robot, freq) <NEW_LINE> self.temp_limit = temp_limit <NEW_LINE> self.sound = sound <NEW_LINE> self.wa...
This primitive raises an alert by playing a sound when the temperature of one motor reaches the "temp_limit". On GNU/Linux you can use "aplay" for player On MacOS "Darwin" you can use "afplay" for player On windows vista+, you can maybe use "start wmplayer"
625990582ae34c7f260ac68a
class Quad: <NEW_LINE> <INDENT> def __init__(self, x0: Union[int, float], y0: Union[int, float], x1: Union[int, float], y1: Union[int, float], x2: Union[int, float], y2: Union[int, float], x3: Union[int, float], y3: Union[int, float]): <NEW_LINE> <INDENT> self.x0 = x0 <NEW_LINE> self.y0 = y0 <NEW_LINE> self.x1 = x1 <NE...
(x_0, y_0) --------- (x_3, y_3) . . . . . . . . (x_1, y_1) ---------- (x_2, y_2)
62599058498bea3a75a590c9
class Queue(object): <NEW_LINE> <INDENT> def __init__(self, config, queue): <NEW_LINE> <INDENT> self.connection = pika.BlockingConnection( pika.URLParameters(config['queue_url'])) <NEW_LINE> self.config = config <NEW_LINE> self.channel = self.connection.channel() <NEW_LINE> self.channel.queue_declare(queue=queue) <NEW_...
Wrapper class for queue
6259905832920d7e50bc75e9
class UConverter(object): <NEW_LINE> <INDENT> default_encodings = ['utf-8', 'ascii', 'utf-16'] <NEW_LINE> def __init__(self, hint_encodings=None): <NEW_LINE> <INDENT> if hint_encodings: <NEW_LINE> <INDENT> self.encodings = hint_encodings <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.encodings = self.default_encodi...
Simple converter to unicode Create instance with specified list of encodings to be used to try to convert value to unicode Example:: ustr = UConverter(['utf-8', 'cp-1251']) my_unicode_str = ustr(b'hello - привет')
625990580a50d4780f706890
class VisitScheduleMethodsModelMixin(models.Model): <NEW_LINE> <INDENT> @property <NEW_LINE> def visit(self) -> Visit: <NEW_LINE> <INDENT> return self.visit_from_schedule <NEW_LINE> <DEDENT> @property <NEW_LINE> def visit_from_schedule(self: VisitScheduleStub) -> Visit: <NEW_LINE> <INDENT> visit = self.schedule.visits....
A model mixin that adds methods used to work with the visit schedule. Declare with VisitScheduleFieldsModelMixin or the fields from VisitScheduleFieldsModelMixin
625990587d847024c075d97f
class RemoveRoleFromInstanceProfileInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSSecretKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSSecretKeyId', value) <NEW_LINE...
An InputSet with methods appropriate for specifying the inputs to the RemoveRoleFromInstanceProfile Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62599058d99f1b3c44d06c44
class SearchForm(Form): <NEW_LINE> <INDENT> query = StringField()
docstring for SearchForm
625990588e71fb1e983bd06d
class InlineResponse20011D(object): <NEW_LINE> <INDENT> def __init__(self, results=None): <NEW_LINE> <INDENT> self.swagger_types = { 'results': 'list[Project]' } <NEW_LINE> self.attribute_map = { 'results': 'results' } <NEW_LINE> self._results = results <NEW_LINE> <DEDENT> @property <NEW_LINE> def results(self): <NEW_L...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599058d7e4931a7ef3d623
class decoratorbase(object): <NEW_LINE> <INDENT> def __init__(self, *iargs, **ikwargs): <NEW_LINE> <INDENT> self._iargs = iargs <NEW_LINE> self._ikwargs = ikwargs <NEW_LINE> self._cargs = None <NEW_LINE> self._fargs = None <NEW_LINE> self._fkwargs = None <NEW_LINE> if len(iargs) > 0: <NEW_LINE> <INDENT> raise ImportErr...
Decorator base. Works for functions as well as methods. Parenthesis are mandatory, like this: @num_retries() You can use any parameters of the constructor in the linked object, like this: @num_retries(max_tries=4,retry_seconds=[1.0,2.0],exc_types=[TimeoutError])
6259905821bff66bcd724208
class XenElf64CoreDump(addrspace.PagedReader): <NEW_LINE> <INDENT> order = 30 <NEW_LINE> __name = "xenelf64" <NEW_LINE> __image = True <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(XenElf64CoreDump, self).__init__(**kwargs) <NEW_LINE> self.check_file() <NEW_LINE> self.offset = 0 <NEW_LINE> self.fna...
An Address space to support XEN memory dumps. https://xenbits.xen.org/docs/4.8-testing/misc/dump-core-format.txt
6259905845492302aabfda7c
class VarComp(Term): <NEW_LINE> <INDENT> def __init__(self, name, values, prior=None, metadata=None): <NEW_LINE> <INDENT> super(VarComp, self).__init__(name, values, categorical=True, prior=prior, metadata=metadata) <NEW_LINE> self.index_vec = self.dummies_to_vec(values) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def...
Represents a variance component/random effect. Parameters ---------- name : str The name of the variance component. values : iterable A 2d binary array identifying the observations that belong to the levels of the variance component. Has dimension n x k, where n is the number of observed rows in the da...
6259905873bcbd0ca4bcb837
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA) <NEW_LINE> class ListBeta(ListGA): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> AddFlags(parser, False)
List Google Compute Engine operations.
625990582ae34c7f260ac68b
class StudentTestAdd(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.c = Client() <NEW_LINE> <DEDENT> def test_create(self): <NEW_LINE> <INDENT> response = self.c.post('/opencmis/student/add/', { 'status': 14, 'title': 1, 'first_name': 'Jacob', 'last_name': 'Green', 'date_of_birth': '12/03/1996...
Test to see if we can add a student via simulated form post
625990584e4d5625663739ab
class ClimbHab2(CommandGroup): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("ClimbHab2") <NEW_LINE> self.logger = logging.getLogger("ClimbHab2") <NEW_LINE> self.addParallel(ChassisStop()) <NEW_LINE> self.addSequential(LiftSet(Position.CLIMB2)) <NEW_LINE> self.addSequential(LiftDrive2(0.5...
CommandGroup for climbing Hab 2
6259905816aa5153ce401a88
@dataclass <NEW_LINE> class P157IsAtRestRelativeTo: <NEW_LINE> <INDENT> URI = "http://erlangen-crm.org/current/P157_is_at_rest_relative_to"
Scope note: This property associates an instance of E53 Place with the instance of E18 Physical Thing that determines a reference space for this instance of E53 Place by being at rest with respect to this reference space. The relative stability of form of an instance of E18 Physical Thing defines its default reference ...
6259905891f36d47f2231962
class NL_TSTL_TakensEstimator(HCTSASuper): <NEW_LINE> <INDENT> KNOWN_OUTPUTS_SIZES = (1,) <NEW_LINE> TAGS = ('crptool', 'dimension', 'nonlinear', 'scaling', 'takens', 'tstool') <NEW_LINE> def __init__(self, Nref=-1.0, rad=0.05, past=0.05, embedParams=('mi', 3), randomSeed=None): <NEW_LINE> <INDENT> super(NL_TSTL_Takens...
Matlab doc: ---------------------------------------- % % cf. "Detecting strange attractors in turbulence", F. Takens. % Lect. Notes Math. 898 p366 (1981) % %---INPUTS: % y, the input time series % Nref, the number of reference points (can be -1 to use all points) % rad, the maximum search radius (as a proportion of the...
6259905824f1403a926863a1
class NewAccountRequest(namedtuple('NewAccountRequest', [ 'user_name', 'real_name', 'is_group', 'calnet_uid', 'callink_oid', 'email', 'encrypted_password', 'handle_warnings', ])): <NEW_LINE> <INDENT> WARNINGS_WARN = 'warn' <NEW_LINE> WARNINGS_SUBMIT = 'submit' <NEW_LINE> WARNINGS_CREATE = 'create' <NEW_LINE> def to_dic...
Request for account creation. :param user_name: :param real_name: :param is_group: :param calnet_uid: uid (or None) :param callink_oid: oid (or None) :param email: :param encrypted_password: :param handle_warnings: one of WARNINGS_WARN, WARNINGS_SUBMIT, WARNINGS_CREATE WARNINGS_WARN: don't ...
62599058004d5f362081fabf
class JobStartedEvent(Event): <NEW_LINE> <INDENT> pass
event
62599058b5575c28eb71379e
class UniversalCodeCounter(list): <NEW_LINE> <INDENT> def __init__(self, parsed_code, filename): <NEW_LINE> <INDENT> self.NLOC = 0 <NEW_LINE> self.current_function = None <NEW_LINE> self.filename = filename <NEW_LINE> self.functionInfos = [] <NEW_LINE> for fun in self._functions(parsed_code.process()): <NEW_LINE> <INDE...
UniversalCode is the code that is unrelated to any programming languages. The code could be: START_NEW_FUNCTION ADD_TO_FUNCTION_NAME ADD_TO_LONG_FUNCTION_NAME PARAMETER CONDITION TOKEN END_OF_FUNCTION A TokenTranslator will generate UniversalCode.
625990586e29344779b01bf0
class AssertDesignspaceRoundtrip(object): <NEW_LINE> <INDENT> def assertDesignspacesEqual(self, expected, actual, message=''): <NEW_LINE> <INDENT> directory = tempfile.mkdtemp() <NEW_LINE> def git(*args): <NEW_LINE> <INDENT> return subprocess.check_output(["git", "-C", directory] + list(args)) <NEW_LINE> <DEDENT> def c...
Check UFOs + designspace -> .glyphs -> UFOs + designspace
6259905801c39578d7f14209
class BaseOptions(object): <NEW_LINE> <INDENT> def __init__(self, **kwds): <NEW_LINE> <INDENT> self.debug = False <NEW_LINE> self.log_level = logging.WARN <NEW_LINE> self.service_name = determine_service_name() <NEW_LINE> self.extra_http_headers = None <NEW_LINE> if "INSTANA_DEBUG" in os.environ: <NEW_LINE> <INDENT> se...
Base class for all option classes. Holds items common to all
62599058d6c5a102081e36c5
class RegistryNameCheckRequest(Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': '^[a-zA-Z0-9]*$'}, 'type': {'required': True, 'constant': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'st...
A request to check whether a container registry name is available. Variables are only populated by the server, and will be ignored when sending a request. :param name: The name of the container registry. :type name: str :ivar type: The resource type of the container registry. This field must be set to 'Microsoft.Con...
62599058be8e80087fbc0628
class GdalHandlesCollection(object): <NEW_LINE> <INDENT> def __init__(self, inRats, outRats): <NEW_LINE> <INDENT> self.gdalHandlesDict = {} <NEW_LINE> self.inputRatList = [] <NEW_LINE> for ratHandleName in outRats.getRatList(): <NEW_LINE> <INDENT> ratHandle = getattr(outRats, ratHandleName) <NEW_LINE> if ratHandle not ...
A set of all the GdalHandles objects
62599058e5267d203ee6ce93
class DeviceCombinationRow(DatabaseRow): <NEW_LINE> <INDENT> TABLE_NAME = "DEVICECOMBINATION" <NEW_LINE> FIELDS = { "DeviceCombinationPK": PrimaryKey(int, auto_increment=True), "RuleID": int, "SensorID": str, "SensorGroupID": int, "DeviceID": str, "DeviceGroupID": int, }
Row schema for the DEVICECOMBINATION table.
62599058507cdc57c63a634b
class EuroMapping(IdentityMapping): <NEW_LINE> <INDENT> def __init__(self, from_field=None, default=0): <NEW_LINE> <INDENT> self.default = default <NEW_LINE> super(EuroMapping, self).__init__(from_field) <NEW_LINE> <DEDENT> def map_value(self, old_value): <NEW_LINE> <INDENT> old_value = super(EuroMapping, self).map_val...
Return an amount with default 0
62599058f7d966606f74938b
class MapNav(TileDir): <NEW_LINE> <INDENT> format,ext,input,output='mapnav','.mapnav',True,True <NEW_LINE> dir_pattern='Z[0-9]*/*/*.pic' <NEW_LINE> forced_ext = '.pic' <NEW_LINE> tile_class = FileTileNoExt <NEW_LINE> def path2coord(self,tile_path): <NEW_LINE> <INDENT> z,y,x=path2list(tile_path)[-4:-1] <NEW_LINE> return...
MapNav (Global Mapper - compatible)
62599058cc0a2c111447c592
class TiffStack_pil(FramesSequence): <NEW_LINE> <INDENT> def __init__(self, fname, dtype=None): <NEW_LINE> <INDENT> self.im = Image.open(fname) <NEW_LINE> self.im.seek(0) <NEW_LINE> if dtype is None: <NEW_LINE> <INDENT> res = self.im.tag[0x102][0] <NEW_LINE> self._dtype = _dtype_map.get(res, np.int16) <NEW_LINE> <DEDEN...
Class for wrapping tiff stacks (that is single file with many frames) that depends on PIL/PILLOW Parameters ---------- fname : str Fully qualified file name dtype : `None` or `numpy.dtype` If `None`, use the native type of the image, other wise coerce into the specified dtype.
62599058dd821e528d6da453
class Bst: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root = None <NEW_LINE> self.size = 0 <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return tree_string(self.root) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.__str__() <NEW_LINE> <DEDENT> def add(self, n)...
A BST that does not contain duplicates.
6259905891f36d47f2231963
class Production(object): <NEW_LINE> <INDENT> def __init__(self, lhs, *rhs, annotations=list()): <NEW_LINE> <INDENT> self.lhs = lhs <NEW_LINE> self.rhs = rhs <NEW_LINE> self.annotations = annotations <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def with_annotations(cls, lhs, annotations, *rhs): <NEW_LINE> <INDENT> retur...
Represents a production in a grammar.
6259905823849d37ff85266c
class ComboboxFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, master, label, vals, wdt, lbl_wdt=0): <NEW_LINE> <INDENT> Frame.__init__(self, master) <NEW_LINE> self.rowconfigure(0, minsize=5) <NEW_LINE> self.columnconfigure(0, minsize=5) <NEW_LINE> self.columnconfigure(1, minsize=lbl_wdt) <NEW_LINE> self.columncon...
GUI element containing a combobox and a label.
625990583cc13d1c6d466ce6
class Lap(): <NEW_LINE> <INDENT> def __init__(self, stats, lap_id, trackpoints=None): <NEW_LINE> <INDENT> self.lap_id = lap_id <NEW_LINE> self.stats = stats <NEW_LINE> self.trackpoints = [] if trackpoints is None else trackpoints <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> s = "Lap\n" <NEW_LINE> s += "La...
Represents a lap in a workout. Lap contains some data (averages and maximums) and a list of trackpoints. Public attributes: - lap_id: Lap id, must be unique only within a workout (integer, typically starts with 0 and increments). - stats: Workout statistics, typically averages and maximums (dictionary; keys a...
6259905801c39578d7f1420a
class PsCmpScatter(PsCmpObservation): <NEW_LINE> <INDENT> lats = List.T(Float.T(), optional=True, default=[10.4, 10.5]) <NEW_LINE> lons = List.T(Float.T(), optional=True, default=[12.3, 13.4]) <NEW_LINE> def string_for_config(self): <NEW_LINE> <INDENT> srows = [] <NEW_LINE> for lat, lon in zip(self.lats, self.lons): <N...
Scattered observation points.
62599058adb09d7d5dc0bb11
class GenericSerializer(APISerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = self.model <NEW_LINE> fields = "__all__"
Placeholder for the serializer we will create dynamically below.
625990587047854f46340966
class SubmissionFileHandler(FileHandler): <NEW_LINE> <INDENT> @require_permission(BaseHandler.AUTHENTICATED) <NEW_LINE> def get(self, file_id): <NEW_LINE> <INDENT> sub_file = self.safe_get_item(File, file_id) <NEW_LINE> submission = sub_file.submission <NEW_LINE> real_filename = sub_file.filename <NEW_LINE> if submissi...
Shows a submission file.
62599058d486a94d0ba2d56f
class GroceryData(BaseData, Auxiliary): <NEW_LINE> <INDENT> def __init__( self, split_dataset, config=None, intersect=True, binarize=True, bin_thld=0.0, normalize=False, ): <NEW_LINE> <INDENT> BaseData.__init__( self, split_dataset=split_dataset, intersect=intersect, binarize=binarize, bin_thld=bin_thld, normalize=norm...
A Grocery Data object, which consist one more order/basket column than the BaseData. Re-index all the users and items from raw dataset. Args: split_dataset (train,valid,test): the split dataset, a tuple consisting of training (DataFrame), validate/list of validate (DataFrame), testing/list of testing (Dat...
6259905891af0d3eaad3b3cf
class GeneralTest(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> call_command('create_fake_users', 10) <NEW_LINE> <DEDENT> def test_index(self): <NEW_LINE> <INDENT> client = Client() <NEW_LINE> response = client.get('/') <NEW_LINE> self.assertEqual(response.status_code, ...
A really minimal set of smoketests to make sure things at least look OK on the surface.
625990587d847024c075d983
class DummySlideA(object): <NEW_LINE> <INDENT> def get_tags(self): <NEW_LINE> <INDENT> return {1, 3, 5, 7, 9}
Dummy Slide class for testing.
6259905863d6d428bbee3d5b
class baseCrud(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def add(self, obj): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def reload(self, obj): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def save(self, obj): <NEW_LINE> <INDENT> pass <NEW_...
Base class for CRUD operations and persistence
6259905899cbb53fe6832486
class MockWebDriver(IWebDriver): <NEW_LINE> <INDENT> attr_dict={} <NEW_LINE> js_dict={ "location.href":"http://www.test.com", "document.title":"testtitle", "document.cookie":{"Test":"test"}, "document.readyState":"complete", "close()":"closePage", } <NEW_LINE> rect=[0,1,2,3] <NEW_LINE> def __init__(self, webview): <NEW...
Mock WebDriver
62599058f7d966606f74938c
class LedsService: <NEW_LINE> <INDENT> class State: <NEW_LINE> <INDENT> none, waking_up, standby, listening, loading, notify, error = range(7) <NEW_LINE> <DEDENT> def __init__(self, thread_handler): <NEW_LINE> <INDENT> self.thread_handler = thread_handler <NEW_LINE> led_device = USB.get_boards() <NEW_LINE> if led_devic...
Leds service for handling visual feedback for various states of the system.
625990583eb6a72ae038bc07
class Schwefel20(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=2): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self._bounds = list(zip([-100.0] * self.N, [100.0] * self.N)) <NEW_LINE> self.global_optimum = [[0.0 for _ in range(self.N)]] <NEW_LINE> self.fglob = 0.0 <NEW_LINE> self...
Schwefel 20 objective function. This class defines the Schwefel 20 [1]_ global optimization problem. This is a unimodal minimization problem defined as follows: .. math:: f_{\text{Schwefel20}}(x) = \sum_{i=1}^n \lvert x_i \rvert Here, :math:`n` represents the number of dimensions and :math:`x_i \in [-100, 100]`...
6259905856b00c62f0fb3e73
class CompetenceAPI(MethodView): <NEW_LINE> <INDENT> @admin_required <NEW_LINE> def patch(self, compt_id): <NEW_LINE> <INDENT> competence = Competence.query.get_or_404(compt_id) <NEW_LINE> in_schema = CompetenceSchema(exclude=('id',)) <NEW_LINE> try: <NEW_LINE> <INDENT> updated_competence = in_schema.load(request.json,...
REST views for a particular instance of a Competence model.
62599058cc0a2c111447c594
class Email(FolioApi): <NEW_LINE> <INDENT> def get_emails(self, **kwargs): <NEW_LINE> <INDENT> return self.call("GET", "/organizations-storage/emails", query=kwargs) <NEW_LINE> <DEDENT> def set_email(self, email: dict): <NEW_LINE> <INDENT> return self.call("POST", "/organizations-storage/emails", data=email) <NEW_LINE>...
**Deprecated.** Emails CRUD APIs used to manage emails. **These APIs are not currently in use and may at some point be removed or resurrected**
625990587b25080760ed87b3
class Afirmation(Text): <NEW_LINE> <INDENT> def __init__(self, request, intent, is_found): <NEW_LINE> <INDENT> super().__init__(request, intent) <NEW_LINE> self.is_found = is_found <NEW_LINE> <DEDENT> @cs.inject() <NEW_LINE> async def rank(self, context) -> float: <NEW_LINE> <INDENT> if "frame_analyzer" not in context:...
This trigger interpret the user reply as yes or no, but also detect if the frame is found in order to pass to final state :param request: Request provided by bernard :type request: class `bernard.engine.request.Request` :param user_reply: User reply if the roacket is launched or not :type user_reply: str :param is_fou...
625990582ae34c7f260ac68f
class Event(object): <NEW_LINE> <INDENT> def __init__(self, source, name, data=None): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> self.name = name <NEW_LINE> self.data = data if data is not None else {}
Event being dispatched by the observable. Parameters ---------- source : Observable The observable instance. name : str The name of the event. data : dict The information to be send.
62599058097d151d1a2c2614
class BaseConfig: <NEW_LINE> <INDENT> DEBUG = False <NEW_LINE> TESTING = False <NEW_LINE> SQLALCHEMY_TRACK_MODIFICATIONS = False <NEW_LINE> UPLOAD_FOLDER = os.path.join( current_app.root_path, 'uploads' ) <NEW_LINE> ALLOWED_EXTENSIONS = {'txt', 'json'} <NEW_LINE> DEFAULT_LIST_INFO = {'shortname': '_feed', 'longname': '...
Base configuration
625990584e4d5625663739af
class S(Fd): <NEW_LINE> <INDENT> def __init__(self, k, t, name=''): <NEW_LINE> <INDENT> if k < 0: <NEW_LINE> <INDENT> raise ValueError("invalid negative order k") <NEW_LINE> <DEDENT> self.k, self.t, self.name = k, t, name <NEW_LINE> if self.n <= 0: <NEW_LINE> <INDENT> raise ValueError("invalid knot sequence") <NEW_LINE...
Class representing the function space populated by Bsplines of polynomial order *k* and knot sequence :math:`\vec{t}`. :Example: >>> S0 = S(4,[1., 1., 2., 3., 4., 4.]) >>> print S0 S_{ k=4, t }, with t = [1.000,1.000,2.000,3.000,4.000,4.000]
62599058baa26c4b54d5084c
class subteamSelectWidget(forms.Select): <NEW_LINE> <INDENT> def __init__(self, attrs={'class': 'form-control'}, choices=()): <NEW_LINE> <INDENT> super(subteamSelectWidget, self).__init__(attrs, choices) <NEW_LINE> <DEDENT> def render_option(self, selected_choices, option_value, option_label): <NEW_LINE> <INDENT> resul...
Modification of Select widget: add the team's parent Employer via a data-parent attribute on rendering <option>
625990583539df3088ecd845
class OrganizationCreateEvent(TestCase, Utilities): <NEW_LINE> <INDENT> def test_create_event(self): <NEW_LINE> <INDENT> organization_dict = { "email": "testorgemail5@gmail.com", "password": "testpassword123", "name": "testOrg1", "street_address": "1 IU st", "city": "Bloomington", "state": "Indiana", "phone_number": "7...
Test the endpoint to create event
625990588e71fb1e983bd072
class RotatingFileHandler(BaseRotatingHandler): <NEW_LINE> <INDENT> def __init__(self, filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=0): <NEW_LINE> <INDENT> if maxBytes > 0: <NEW_LINE> <INDENT> mode = 'a' <NEW_LINE> <DEDENT> BaseRotatingHandler.__init__(self, filename, mode, encoding, delay) <NEW_...
Handler for logging to a set of files, which switches from one file to the next when the current file reaches a certain size.
6259905801c39578d7f1420b
class HuntingGrounds(ResourceField): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ResourceField.__init__(self) <NEW_LINE> self.resource = Resource.food <NEW_LINE> self.name = "Hunting grounds (f)" <NEW_LINE> self.abreviation = 'f' <NEW_LINE> <DEDENT> def freeSlots(self): <NEW_LINE> <INDENT> return 10 <NE...
Class to represent a food Resource field on the board.
625990581b99ca400229000c
class XMLError(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message
Exception raised by XML validation.
625990587d847024c075d985
class RecentUnits(list): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> list.__init__(self) <NEW_LINE> self.options = options <NEW_LINE> self.updateQuantity() <NEW_LINE> self.loadList() <NEW_LINE> <DEDENT> def updateQuantity(self): <NEW_LINE> <INDENT> self.numEntries = self.options.intData('Recent...
A list of recent unit combo names
62599058097d151d1a2c2615
class CartoDBBase(object): <NEW_LINE> <INDENT> MAX_GET_QUERY_LEN = 2048 <NEW_LINE> def __init__(self, cartodb_domain, host='cartodb.com', protocol='https', api_version=None, proxy_info=None, sql_api_version='v2', import_api_version='v1'): <NEW_LINE> <INDENT> if api_version is None: <NEW_LINE> <INDENT> api_version = sql...
basic client to access cartodb api
62599058d7e4931a7ef3d629
class IPanel(IColumn, IContained): <NEW_LINE> <INDENT> layout = Attribute("Assigned layout.")
A portlet panel. Register a portlet for this portlet manager type to enable them only for the panel (and not for the regular portlet column manager).
6259905899cbb53fe6832489
class PremierAddOn(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'location': {'required': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'kind': {'key': 'kind', 'type': ...
Premier add-on. 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: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :ivar kind: Kind of resource. :vartype kind: str :ivar loc...
62599058cc0a2c111447c596
class Value(object): <NEW_LINE> <INDENT> __slots__ = ["value", "modifiers"] <NEW_LINE> def __init__(self, value, modifiers=()): <NEW_LINE> <INDENT> self.value = str(value) <NEW_LINE> if modifiers: <NEW_LINE> <INDENT> self.modifiers = tuple(modifiers) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.modifiers = None <...
Class representing a value and its modifiers in the OBO file This class has two member variables. `value` is the value itself, `modifiers` are the corresponding modifiers in a tuple. Currently the modifiers are not parsed in any way, but this might change in the future.
62599058ac7a0e7691f73a8b
class Book(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=200) <NEW_LINE> author = models.ForeignKey('Author', on_delete=models.SET_NULL, null=True) <NEW_LINE> summary = models.TextField(max_length=1000, help_text="Enter a brief description of the book") <NEW_LINE> isbn = models.CharField('ISBN'...
Model representing a book (but not a specific copy of a book).
625990588e71fb1e983bd074
class WebsitePinger: <NEW_LINE> <INDENT> _ERROR_RESULT = """Result: ({}, {} - {})""" <NEW_LINE> def ping_websites(self, websites): <NEW_LINE> <INDENT> errors = [] <NEW_LINE> for website in websites: <NEW_LINE> <INDENT> connection = httplib2.Http(".cache") <NEW_LINE> response, _ = connection.request(website, "GET") <NEW...
Website Pinger
6259905823849d37ff852670
class Formatter(object): <NEW_LINE> <INDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return self.format(*args, **kwargs) <NEW_LINE> <DEDENT> def format(self, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError("Subclasses are expected to implement " "the format() method")
Empty class for the time being. Currently used only for finding all built-in subclasses
625990581b99ca400229000d
class MSIXImageURI(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'uri': {'key': 'uri', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, uri: Optional[str] = None, **kwargs ): <NEW_LINE> <INDENT> super(MSIXImageURI, self).__init__(**kwargs) <NEW_LINE> self.uri = uri
Represents URI referring to MSIX Image. :param uri: URI to Image. :type uri: str
625990587047854f4634096a
class NATPMPError(Exception): <NEW_LINE> <INDENT> pass
Generic exception state. May be used to represent unknown errors.
62599058460517430c432b27
class FilePublisher(publisher.PublisherBase): <NEW_LINE> <INDENT> def __init__(self, parsed_url): <NEW_LINE> <INDENT> super(FilePublisher, self).__init__(parsed_url) <NEW_LINE> self.publisher_logger = None <NEW_LINE> path = parsed_url.path <NEW_LINE> if not path or path.lower() == 'file': <NEW_LINE> <INDENT> LOG.error(...
Publisher metering data to file. The publisher which records metering data into a file. The file name and location should be configured in ceilometer pipeline configuration file. If a file name and location is not specified, this File Publisher will not log any meters other than log a warning in Ceilometer log file. ...
625990582c8b7c6e89bd4d99
class Config_DjangoCMSExtended(Config_DjangoCMSCascade): <NEW_LINE> <INDENT> additional_apps = ( 'djangocms_snippet', 'cmsplugin_filer_file', 'cmsplugin_filer_link', 'cmsplugin_filer_folder', 'cmsplugin_filer_image', 'cmsplugin_filer_teaser', 'cmsplugin_filer_video', 'easy_thumbnails', 'filer', 's3_folder_storage', 'al...
more CMS plugins configuration for Django CMS 3.2.5 with Django 1.7
6259905830dc7b76659a0d55
class BasicFieldCell2(RNNCell): <NEW_LINE> <INDENT> def __init__(self, input_size, num_units, fields, hidden_size, n_inter=0, keep_prob=1., activation=tanh, state_is_tuple=True): <NEW_LINE> <INDENT> if not state_is_tuple: <NEW_LINE> <INDENT> logging.warn("%s: Using a concatenated state is slower and will soon be " "dep...
Basic Field recurrent network cell. The implementation is based on: Ian Gemp
62599058a79ad1619776b593
class WebEngineSearch(browsertab.AbstractSearch): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self._flags = QWebEnginePage.FindFlags(0) <NEW_LINE> <DEDENT> def _find(self, text, flags, cb=None): <NEW_LINE> <INDENT> if cb is None: <NEW_LINE> <INDENT> self....
QtWebEngine implementations related to searching on the page.
6259905882261d6c527309a0
class BottleneckBlockV1(Module): <NEW_LINE> <INDENT> def __init__(self, n_in_channels, n_out_channels): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.conv1 = Conv2d( in_channels=n_in_channels, out_channels=n_out_channels, kernel_size=(1, 1), stride=(1, 1), bias=False ) <NEW_LINE> self.bn1 = BatchNorm2d(num_fea...
Bottleneck Residual Block As implemented in 'Deep Learning for Image Recognition', the original ResNet paper (https://arxiv.org/abs/1512.03385).
6259905863d6d428bbee3d5d
class CustomEncoder(AbstractTransformer): <NEW_LINE> <INDENT> def __init__(self, encode='onehot', **other): <NEW_LINE> <INDENT> super().__init__(**other) <NEW_LINE> self.encode = encode <NEW_LINE> <DEDENT> def _create_encoder(self): <NEW_LINE> <INDENT> import category_encoders as ce <NEW_LINE> _dict = { "onehot": ce.On...
encode: "onehot", "binary", "backward", "ordinal", "sum", "poly", "helmert", "hash"
6259905816aa5153ce401a8f
class TranspositionPipeline(pipeline.Pipeline): <NEW_LINE> <INDENT> def __init__(self, transposition_range, name=None): <NEW_LINE> <INDENT> super(TranspositionPipeline, self).__init__( input_type=music_pb2.NoteSequence, output_type=music_pb2.NoteSequence, name=name) <NEW_LINE> self._transposition_range = transposition_...
Creates transposed versions of the input NoteSequence.
62599058d7e4931a7ef3d62b
class BasicMatchString(object): <NEW_LINE> <INDENT> def __init__(self, rule: Rule, extra: dict, match: dict): <NEW_LINE> <INDENT> self.rule = rule <NEW_LINE> self.extra = extra <NEW_LINE> self.match = match <NEW_LINE> <DEDENT> def _add_custom_alert_text(self): <NEW_LINE> <INDENT> missing = self.rule.conf('alert_missing...
Creates a string containing fields in match for the given rule.
62599058e64d504609df9ea5
class StructureStructure(orm.Model): <NEW_LINE> <INDENT> _inherit = 'structure.structure' <NEW_LINE> _columns = { 'block_ids': fields.one2many( 'structure.block', 'structure_id', 'Block'), }
Model name: StructureStructure inherited for add 2many relation fields
6259905873bcbd0ca4bcb83f
class StandardGCMCSystemSampler(GCMCSystemSampler): <NEW_LINE> <INDENT> def __init__(self, system, topology, temperature, adams=None, excessChemicalPotential=-6.09*unit.kilocalories_per_mole, standardVolume=30.345*unit.angstroms**3, adamsShift=0.0, boxVectors=None, ghostFile="gcmc-ghost-wats.txt", log='gcmc.log', dcd=N...
Class to carry out instantaneous GCMC moves in OpenMM
6259905856ac1b37e63037bc
class Hypernode(object): <NEW_LINE> <INDENT> def __init__(self, label): <NEW_LINE> <INDENT> self.label = label <NEW_LINE> self.witness = {} <NEW_LINE> self.outs = [] <NEW_LINE> self.ins = [] <NEW_LINE> <DEDENT> def update_witness(self, nt): <NEW_LINE> <INDENT> if nt in self.witness: <NEW_LINE> <INDENT> del self.witness...
The hypernode class representing an item in the hypergraph. Attributes ---------- label : tuple(int) The cover of the hypernode as the label. witness : dict(str, (Hyperedge, double)) The witnesses (ingoing hyperedge) for each nonterminal with their prob. outs : list(Hyperedge) The list of outgoing hyperedg...
62599058b7558d5895464a01
class getRasAttributes(Handler): <NEW_LINE> <INDENT> def control(self): <NEW_LINE> <INDENT> self.is_valid(self.ras_ip, str) <NEW_LINE> self.is_valid_content(self.ras_ip, self.IP_PATTERN) <NEW_LINE> <DEDENT> def setup(self, ras_ip): <NEW_LINE> <INDENT> self.ras_ip = ras_ip
Get ras attributes method class.
62599058baa26c4b54d50850
@STRICT_MATCH(generic_ids="channel_0x042e") <NEW_LINE> @STRICT_MATCH(channel_names="voc_level") <NEW_LINE> class VOCLevel(Sensor): <NEW_LINE> <INDENT> SENSOR_ATTR = "measured_value" <NEW_LINE> _decimals = 0 <NEW_LINE> _multiplier = 1e6 <NEW_LINE> _unit = CONCENTRATION_MICROGRAMS_PER_CUBIC_METER
VOC Level sensor.
6259905891f36d47f2231966
class ScoreMatrixTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_matrix(self): <NEW_LINE> <INDENT> known_matrix = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2, 1, 2, 1, 2, 1, 0, 2], [0, 1, 1, 1, 1, 1, 1, 0, 1], [0, 0, 3, 2, 3, 2, 3, 2, 1], [0, 2, 2, 5, 4, 5, 4, 3, 4], [0, 1, 4, 4...
Compare the matrix produced by create_score_matrix() with a known matrix.
62599058d6c5a102081e36cd
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> print_symbol = '#' <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> Rectangle.number_of_instances += 1 <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> pri...
Represents a rectangle.
6259905832920d7e50bc75f3
class VerifyUserToken(graphene.Mutation): <NEW_LINE> <INDENT> class Arguments: <NEW_LINE> <INDENT> userToken = graphene.String() <NEW_LINE> <DEDENT> User = graphene.Field(User) <NEW_LINE> token = graphene.String() <NEW_LINE> ok = graphene.Boolean() <NEW_LINE> def mutate(self, info, userToken): <NEW_LINE> <INDENT> query...
Verify user token
625990587047854f4634096c
class JSONWriter(TrainingMonitor): <NEW_LINE> <INDENT> FILENAME = 'stat.json' <NEW_LINE> def __new__(cls): <NEW_LINE> <INDENT> if logger.LOG_DIR: <NEW_LINE> <INDENT> return super(JSONWriter, cls).__new__(cls) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> logger.warn("logger directory was not set. Ignore JSONWriter.") <...
Write all scalar data to a json file under ``logger.LOG_DIR``, grouped by their global step. This monitor also attemps to recover the epoch number during setup, if an existing json file is found at the same place.
62599058be8e80087fbc0630
class BeerListDetailedView(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = BeerList.objects.all() <NEW_LINE> serializer_class = BeerListSerializer
RetrieveUpdateDestroyAPIView handles the http GET, PUT and DELETE requests.
62599058baa26c4b54d50851
class Target: <NEW_LINE> <INDENT> def __init__(self, cluster): <NEW_LINE> <INDENT> self._id = self.__class__._counter <NEW_LINE> self.__class__._counter += 1 <NEW_LINE> self.cluster = cluster <NEW_LINE> self.tracks = {} <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def initial(cluster, filter): <...
Class to represent a single MHT target.
625990587cff6e4e811b6ff0
class FileGetter(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, url, start): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.result = None <NEW_LINE> self.starttime = start <NEW_LINE> threading.Thread.__init__(self) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> self.result = [0] <NEW_LINE> try: <...
Thread class for retrieving a URL
625990580a50d4780f706895
class TypedSchemaStrategy(SchemaStrategy): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def match_schema(cls, schema): <NEW_LINE> <INDENT> return schema.get('type') == cls.JS_TYPE <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def match_object(cls, obj): <NEW_LINE> <INDENT> return isinstance(obj, cls.PYTHON_TYPE) <NEW_LINE...
base schema strategy class for scalar types. Subclasses define these two class constants: * `JS_TYPE`: a valid value of the `type` keyword * `PYTHON_TYPE`: Python type objects - can be a tuple of types
62599058a79ad1619776b594
class event: <NEW_LINE> <INDENT> __metaclass__ = metavent <NEW_LINE> callbacks = defaultdict(list) <NEW_LINE> counter = defaultdict(int) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> raise TypeError("You can't construct event.") <NEW_LINE> <DEDENT> def register(self, callback, to=[]): <NEW_LINE> <INDENT> for item ...
This helper class provides an easy mechanism to give user feedback of created, changed or deleted files. As side-effect every non-destructive call will add the given path to the global tracking list and makes it possible to remove unused files (e.g. after you've changed your permalink scheme or just reworded your titl...
625990581f037a2d8b9e5342
class HtmlHyperlink(object): <NEW_LINE> <INDENT> swagger_types = { 'anchortext': 'str', 'url': 'str' } <NEW_LINE> attribute_map = { 'anchortext': 'Anchortext', 'url': 'Url' } <NEW_LINE> def __init__(self, anchortext=None, url=None): <NEW_LINE> <INDENT> self._anchortext = None <NEW_LINE> self._url = None <NEW_LINE> self...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259905899cbb53fe683248d
class StickerUpdateView(PermissionRequiredMixin, UpdateView): <NEW_LINE> <INDENT> form_class = StickerForm <NEW_LINE> model = Sticker <NEW_LINE> template_name = 'sticker/sticker_update.html' <NEW_LINE> success_url = reverse_lazy('sticker_list') <NEW_LINE> permission_required = 'sticker.can_make_sticker'
Update sticker when need
6259905823e79379d538daa9
class Transformer(six.with_metaclass(ABCMeta, TransformerMixin)): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def describe(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def transform(self, X): <NEW_LINE> <INDENT> if isinstance(X, np.ndarray): <NEW_LINE> <INDENT> if X.ndim == 2: <NEW_LINE...
A transformer takes data and transforms it
62599058627d3e7fe0e0843b
class TagPlaceObject(DisplayListTag): <NEW_LINE> <INDENT> TYPE = 4 <NEW_LINE> hasClipActions = False <NEW_LINE> hasClipDepth = False <NEW_LINE> hasName = False <NEW_LINE> hasRatio = False <NEW_LINE> hasColorTransform = False <NEW_LINE> hasMatrix = False <NEW_LINE> hasCharacter = False <NEW_LINE> hasMove = False <NEW_LI...
The PlaceObject tag adds a character to the display list. The CharacterId identifies the character to be added. The Depth field specifies the stacking order of the character. The Matrix field species the position, scale, and rotation of the character. If the size of the PlaceObject tag exceeds the end of the transforma...
62599058379a373c97d9a5d2
class RainforestTree(ProceduralTree): <NEW_LINE> <INDENT> branchslope = 1 <NEW_LINE> foliage_shape = [3.4, 2.6] <NEW_LINE> def prepare(self, world): <NEW_LINE> <INDENT> self.species = 3 <NEW_LINE> self.height = randint(10, 20) <NEW_LINE> self.trunkradius = randint(5, 15) <NEW_LINE> ProceduralTree.prepare(self, world) <...
A big rainforest tree.
625990583c8af77a43b68a17
class ParserTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.parser = generate.create_parser() <NEW_LINE> <DEDENT> def test_output(self): <NEW_LINE> <INDENT> namespace = self.parser.parse_args(("--output", "a.txt")) <NEW_LINE> self.assertEqual(namespace.output, "a.txt") <NEW_LI...
Новые тесты так и не были придуманны...
6259905807f4c71912bb09e8
class DetectedBreak(proto.Message): <NEW_LINE> <INDENT> class BreakType(proto.Enum): <NEW_LINE> <INDENT> UNKNOWN = 0 <NEW_LINE> SPACE = 1 <NEW_LINE> SURE_SPACE = 2 <NEW_LINE> EOL_SURE_SPACE = 3 <NEW_LINE> HYPHEN = 4 <NEW_LINE> LINE_BREAK = 5 <NEW_LINE> <DEDENT> type_ = proto.Field( proto.ENUM, number=1, enum="TextAnnot...
Detected start or end of a structural component. Attributes: type_ (google.cloud.vision_v1p2beta1.types.TextAnnotation.DetectedBreak.BreakType): Detected break type. is_prefix (bool): True if break prepends the element.
6259905821a7993f00c6751b
class UnsupportedPlatform(Exception): <NEW_LINE> <INDENT> def __init__(self, distro, codename, release): <NEW_LINE> <INDENT> self.distro = distro <NEW_LINE> self.codename = codename <NEW_LINE> self.release = release <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '{doc}: {distro} {codename} {release}'...
Platform is not supported.
62599058cc0a2c111447c59a
class Read_DAQ(Driver): <NEW_LINE> <INDENT> def __init__(self, device_name): <NEW_LINE> <INDENT> self._daq = Device(device_name) <NEW_LINE> self._tasks = dict() <NEW_LINE> <DEDENT> @Action() <NEW_LINE> def new_task(self, task_name, channels): <NEW_LINE> <INDENT> if task_name in self._tasks: <NEW_LINE> <INDENT> self.cle...
This is a simplified version of a daq drivers which can be used when where only standard read on the daq is necessary
6259905873bcbd0ca4bcb841
class SignInView(TemplateView): <NEW_LINE> <INDENT> template_name = 'signin.html' <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> username = request.POST.get('username') <NEW_LINE> password = request.POST.get('password') <NEW_LINE> user = authenticate(username=username, password=password) <NEW_...
TemplateView for the user's login
6259905807f4c71912bb09e9
class gmsk_py_cc(gr.sync_block): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> gr.sync_block.__init__(self, name="gmsk_py_cc", in_sig=[numpy.float32], out_sig=[numpy.complex64]) <NEW_LINE> <DEDENT> def gaussian(self,in_signal): <NEW_LINE> <INDENT> filtered=numpy.array([]) <NEW_LINE> filters.gaussian_filte...
docstring for block gmsk_py_cc
625990582ae34c7f260ac695
class ElementListResource(ListFilterResource): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ElementListResource, self).__init__(*args, **kwargs) <NEW_LINE> self.filters = [('name', str, ['exact']), ('symbol', str, ['exact']), ('group', str, ['exact', 'contains', 'icontains']), ('mo...
Element List Resource
625990583539df3088ecd84a
class ImplicitAllowedMethods(Resource): <NEW_LINE> <INDENT> def render_GET(self, request): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def render_PUT(self, request): <NEW_LINE> <INDENT> pass
A L{Resource} which implicitly defines its allowed methods by defining renderers to handle them.
62599059b57a9660fecd3029
class Role(Base): <NEW_LINE> <INDENT> __tablename__ = "role" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String) <NEW_LINE> persons = relationship("Person", secondary=person_and_role, back_populates="roles") <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "Role(id=%r, name=%r, n...
人的角色。例如导演, 编剧, 演员。 - 一个Role可能有很多个Person与之关联
6259905891f36d47f2231967
class KeywordSwitchCompleter(ArgSwitchCompleter): <NEW_LINE> <INDENT> baseclass() <NEW_LINE> def complete(self, token, parsed, parser, display=False, **kwargs): <NEW_LINE> <INDENT> return [('[%s=]' if display and not action.was_required else '%s=') % (option[1:]) for action_group in parser._action_groups for action in ...
Completes key=value argument switches based on the argparse grammar exposed for a command. TODO: probably more can be shared with ArgSwitchCompleter.
625990596e29344779b01bfa
class cached_property(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.__doc__ = getattr(func, '__doc__') <NEW_LINE> self.func = func <NEW_LINE> <DEDENT> def __get__(self, obj, cls): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> value = obj.__dict...
A property that is only computed once per instance and then replaces itself with an ordinary attribute. Deleting the attribute resets the property.
625990593cc13d1c6d466cee