code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class MotorBase: <NEW_LINE> <INDENT> def __init__(self, webot: Robot, motor_name: str) -> None: <NEW_LINE> <INDENT> self.motor_name = motor_name <NEW_LINE> self.webot_motor = get_robot_device(webot, motor_name, Motor) <NEW_LINE> self.max_speed = self.webot_motor.getMaxVelocity()
A base class for any type of motor as these are common attributes
62598ee9baa26c4b54d4d9bb
class ConfirmedServiceError(GXIntEnum): <NEW_LINE> <INDENT> INITIATE_ERROR = 1 <NEW_LINE> READ = 5 <NEW_LINE> WRITE = 6
Confirmed service error tells when error has occurred.
62598ee94e4d562566370b06
class HistoryListResource(Resource): <NEW_LINE> <INDENT> method_decorators = [login_required] <NEW_LINE> def get(self): <NEW_LINE> <INDENT> ret = cache_user.UserSearchingHistoryStorage(g.user_id).get() <NEW_LINE> return {'keywords': ret} <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> cache_user.UserSearching...
搜索历史
62598ee921bff66bcd721340
class AccessoryEncoder(object): <NEW_LINE> <INDENT> def persist(self, fp, acc): <NEW_LINE> <INDENT> paired_clients = {str(client): tohex(key) for client, key in acc.paired_clients.items()} <NEW_LINE> config_state = { "mac": acc.mac, "config_version": acc.config_version, "paired_clients": paired_clients, "private_key": ...
This class defines the Accessory encoder interface. The AccessoryEncoder is used by the AccessoryDriver to persist and restore the state of an Accessory between restarts. This is needed in order to allow iOS clients to see the same MAC, public key, etc. of the Accessory they paired with, thus allowing an Accessory to ...
62598ee9498bea3a75a5621e
class XmlNs0HelpMenuItem(object): <NEW_LINE> <INDENT> swagger_types = { 'index': 'float', 'name': 'str', 'show_admin_only': 'bool', 'url': 'str' } <NEW_LINE> attribute_map = { 'index': 'index', 'name': 'name', 'show_admin_only': 'showAdminOnly', 'url': 'url' } <NEW_LINE> def __init__(self, index=None, name=None, show_a...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee97d43ff2487426772
class OutputProcessor(): <NEW_LINE> <INDENT> def __init__(self, *,step, id, req): <NEW_LINE> <INDENT> self.step = step <NEW_LINE> self.id = id <NEW_LINE> self.req = req <NEW_LINE> <DEDENT> def writeOutput(self, *, writeformat, writefile, req): <NEW_LINE> <INDENT> vlog("Generating output of step: " + str(self.id) +" " +...
Class to process
62598ee960cbc95b06362a2b
class GitHubOrganization(GitHubMixin, Organization): <NEW_LINE> <INDENT> @property <NEW_LINE> def web_url(self): <NEW_LINE> <INDENT> return '{}/{}'.format(GH_INSTANCE_URL, self.name) <NEW_LINE> <DEDENT> def __init__(self, token, name): <NEW_LINE> <INDENT> self._token = token <NEW_LINE> self._name = name <NEW_LINE> self...
Represents an organization on GitHub.
62598ee967a9b606de5446bb
class TaskTest(shared_test_lib.BaseTestCase): <NEW_LINE> <INDENT> def testCopyToDict(self): <NEW_LINE> <INDENT> session_identifier = '{0:s}'.format(uuid.uuid4().hex) <NEW_LINE> task = tasks.Task(session_identifier=session_identifier) <NEW_LINE> self.assertIsNotNone(task.identifier) <NEW_LINE> self.assertIsNotNone(task....
Tests for the task attribute container.
62598ee97047854f4633dac1
class Section(object): <NEW_LINE> <INDENT> def __init__(self, elt): <NEW_LINE> <INDENT> attr = elt.get('name') <NEW_LINE> if attr is None or len(attr.strip()) == 0: <NEW_LINE> <INDENT> raise RuntimeError('<section> element has missing or empty name attribute') <NEW_LINE> <DEDENT> self.name = attr.strip() <NEW_LINE> att...
A documentation section; contains information about a group/category of UDFs, possibly including worked examples. The following attributes are available: name: Section name, must not contain spaces title: Section title content: XHTML section content in string form. examples: A list of Example objects in the se...
62598ee98a43f66fc4bf0860
class Permission(Enum): <NEW_LINE> <INDENT> Read = 1 <NEW_LINE> Write = 2 <NEW_LINE> ReadWrite = 3
Permission enumeration
62598ee963d6d428bbee0ebb
class Do(_IterationFunction): <NEW_LINE> <INDENT> allow_loopcontrol = True <NEW_LINE> summary_text = "evaluate an expression looping over a variable" <NEW_LINE> def get_result(self, items): <NEW_LINE> <INDENT> return Symbol("Null")
<dl> <dt>'Do[$expr$, {$max$}]' <dd>evaluates $expr$ $max$ times. <dt>'Do[$expr$, {$i$, $max$}]' <dd>evaluates $expr$ $max$ times, substituting $i$ in $expr$ with values from 1 to $max$. <dt>'Do[$expr$, {$i$, $min$, $max$}]' <dd>starts with '$i$ = $max$'. <dt>'Do[$expr$, {$i$, $min$, $max$, $step$}]' ...
62598ee930dc7b766599df76
class Cart(BaseModel): <NEW_LINE> <INDENT> passport = models.ForeignKey('df_user.Passport', verbose_name='账户') <NEW_LINE> goods = models.ForeignKey('df_goods.Goods', verbose_name='商品') <NEW_LINE> goods_count = models.IntegerField(default=1, verbose_name='商品总数') <NEW_LINE> objects = CartManager() <NEW_LINE> class Meta: ...
购物车模型类
62598ee93539df3088eca9a0
class WebTestPropertiesConfiguration(Model): <NEW_LINE> <INDENT> _attribute_map = { 'web_test': {'key': 'WebTest', 'type': 'str'}, } <NEW_LINE> def __init__(self, web_test=None): <NEW_LINE> <INDENT> super(WebTestPropertiesConfiguration, self).__init__() <NEW_LINE> self.web_test = web_test
An XML configuration specification for a WebTest. :param web_test: The XML specification of a WebTest to run against an application. :type web_test: str
62598ee91b99ca400228e884
class BaseStopOptions(usage.Options): <NEW_LINE> <INDENT> synopsis = '[options]' <NEW_LINE> def postOptions(self): <NEW_LINE> <INDENT> if len(sys.argv) == 3 and sys.argv[2] == '--help': <NEW_LINE> <INDENT> print(self)
Base Stop command options
62598ee9b7558d5895461d33
class TestSyncJobExtended(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 testSyncJobExtended(self): <NEW_LINE> <INDENT> pass
SyncJobExtended unit test stubs
62598ee907f4c71912badb43
class HFBadToken(HFErr): <NEW_LINE> <INDENT> pass
Authentication token is not currently valid
62598ee92ae34c7f260a97d5
class TestDmsdocument(unittest.TestCase, BaseTest): <NEW_LINE> <INDENT> layer = DMS_TESTS_PROFILE_FUNCTIONAL <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(TestDmsdocument, self).setUp() <NEW_LINE> self.portal = self.layer['portal'] <NEW_LINE> <DEDENT> def test_RecipientGroupsVocabulary(self): <NEW_LINE> <INDENT...
Tests adapters
62598ee9796e427e5384ce86
class APIError(UserFeedback): <NEW_LINE> <INDENT> pass
An exception raised by a remote API.
62598ee98e71fb1e983ba15a
@override_settings(FEATURES=FEATURES_WITH_ENTERPRISE_ENABLED) <NEW_LINE> @skip_unless_lms <NEW_LINE> class EnterpriseMiddlewareTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(EnterpriseMiddlewareTest, self).setUp() <NEW_LINE> self.user = UserFactory.create(username='username', password='p...
Test for `EnterpriseMiddleware`.
62598ee901c39578d7f11498
class AddressBook(): <NEW_LINE> <INDENT> def __init__(self, results=10): <NEW_LINE> <INDENT> self.results = results <NEW_LINE> <DEDENT> def get_payload(self): <NEW_LINE> <INDENT> payload={"results": self.results} <NEW_LINE> return payload <NEW_LINE> <DEDENT> def get_address(self): <NEW_LINE> <INDENT> payload = self.get...
docstring for OpenWeatherAPI
62598ee9236d856c2adc878c
class Security(object): <NEW_LINE> <INDENT> def __init__(self, key): <NEW_LINE> <INDENT> self.key = hashlib.sha256(key.encode('utf-8')).digest() <NEW_LINE> <DEDENT> def encrypt(self, raw): <NEW_LINE> <INDENT> raw = pad(raw) <NEW_LINE> iv = Random.new().read(AES.block_size) <NEW_LINE> cipher = AES.new(self.key, AES.MODE...
Class for string encryption and decryption
62598ee999cbb53fe682f5a0
class EllipticalSlice(ArrayStep): <NEW_LINE> <INDENT> default_blocked = True <NEW_LINE> def __init__(self, vars=None, prior_cov=None, prior_chol=None, model=None, **kwargs): <NEW_LINE> <INDENT> self.model = modelcontext(model) <NEW_LINE> chol = get_chol(prior_cov, prior_chol) <NEW_LINE> self.prior_chol = tt.as_tensor_v...
Multivariate elliptical slice sampler step. Elliptical slice sampling (ESS) [1]_ is a variant of slice sampling that allows sampling from distributions with multivariate Gaussian prior and arbitrary likelihood. It is generally about as fast as regular slice sampling, mixes well even when the prior covariance might oth...
62598ee9bd1bec0571e14442
class Options(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.emb_dim = FLAGS.emb_dim <NEW_LINE> self.train_data = FLAGS.train_data <NEW_LINE> self.test_data = FLAGS.test_data <NEW_LINE> self.save_path = FLAGS.save_path <NEW_LINE> self.max_epoch = FLAGS.max_epoch <NEW_LINE> self.lr = FLAGS.lr
options used by CSDK model.
62598ee9442bda511e95ab50
class MesoArrays(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.data = MesoFile(filename).read() <NEW_LINE> self.year = MesoFile(filename).year <NEW_LINE> <DEDENT> def MetArray(self): <NEW_LINE> <INDENT> meso2 = self.data <NEW_LINE> groups = meso2.groupby(0) <NEW_LINE> met = meso2.i...
For pulling out the meteorological, agricultural or Reese-only data from the raw mesonet data files, correctly index those arrays and correct the station pressure measurement
62598ee999fddb7c1ca6217c
class configuration(py_config): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> py_config.__init__(self, 'antlr3', '3.1.3', dependencies=['antlr'], debug=False) <NEW_LINE> <DEDENT> def download(self, environ, version, strict=False): <NEW_LINE> <INDENT> if version is None: <NEW_LINE> <INDENT> version = self....
Find/install ANTLR3 Python runtime
62598ee96fb2d068a769319c
class TestAdminRefreshTokenInfo(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return AdminRefr...
AdminRefreshTokenInfo unit test stubs
62598ee90c0af96317c54a8c
class LeNetEncoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LeNetEncoder, self).__init__() <NEW_LINE> self.restored = False <NEW_LINE> self.encoder = nn.Sequential( nn.Linear(5000,1024), nn.ReLU(), nn.Dropout(), nn.Linear(1024,mid_dim), ) <NEW_LINE> <DEDENT> def forward(self, input)...
LeNet encoder model for ADDA.
62598ee94e4d562566370b08
class ParticleFilter(InferenceModule): <NEW_LINE> <INDENT> def __init__(self, ghostAgent, numParticles=300): <NEW_LINE> <INDENT> InferenceModule.__init__(self, ghostAgent); <NEW_LINE> self.setNumParticles(numParticles) <NEW_LINE> <DEDENT> def setNumParticles(self, numParticles): <NEW_LINE> <INDENT> self.numParticles = ...
A particle filter for approximately tracking a single ghost. Useful helper functions will include random.choice, which chooses an element from a list uniformly at random, and util.sample, which samples a key from a Counter by treating its values as probabilities.
62598ee93d592f4c4edb95e5
class CheckUserInRoom(APIView): <NEW_LINE> <INDENT> def post(self, request, format=None): <NEW_LINE> <INDENT> username = self.request.session['username'] <NEW_LINE> queryset = Member.objects.filter(username=username) <NEW_LINE> host = queryset[0] <NEW_LINE> code = request.data.get('code') <NEW_LINE> queryset = Room.obj...
take username from session varbiable -code as post request -return true if user in room -else false
62598ee92c8b7c6e89bd1eaf
class AddTicketForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Ticket <NEW_LINE> fields = ("category", "title", "text")
Форма добавления тикетов
62598ee9a79ad1619776870b
class ClusterStatusSnmp(StatusCodeDescSnmp): <NEW_LINE> <INDENT> dsName = 'Cluster' <NEW_LINE> eventKey = 'ClusterStatus' <NEW_LINE> eventClassKey = 'VsCluster' <NEW_LINE> def onSuccess(self, result, config): <NEW_LINE> <INDENT> data = super(ClusterStatusSnmp, self).onSuccess(result, config) <NEW_LINE> getData, _ = res...
Datasource plugin for monitoring Virtual System - Cluster Status
62598ee9f548e778e5969c7a
class updateSearch_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'authenticationToken', None, None, ), (2, TType.STRUCT, 'search', (evernote.edam.type.ttypes.SavedSearch, evernote.edam.type.ttypes.SavedSearch.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, authenticationToken=None, se...
Attributes: - authenticationToken - search
62598ee967a9b606de5446bd
class unorderedList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.head = None <NEW_LINE> <DEDENT> def isEmpty(self): <NEW_LINE> <INDENT> return self.head == None <NEW_LINE> <DEDENT> def add(self,item): <NEW_LINE> <INDENT> temp = Node(item) <NEW_LINE> temp.setNext(self.head) <NEW_LINE> self.head = te...
This is class of unordered list. Attributes ---------- head : Each unorderedList object will maintain a single reference to the head object
62598ee97c178a314d78bb81
class GenericCompensationMixin(object): <NEW_LINE> <INDENT> def calculate_tenure(self): <NEW_LINE> <INDENT> hire_date_data = map(int, self.hire_date.split('-')) <NEW_LINE> hire_date = date(hire_date_data[0], hire_date_data[1], hire_date_data[2]) <NEW_LINE> tenure = float((self.DATE_PROVIDED - hire_date).days) / float(3...
Adds a generic ``compensations`` property This expects a single compensation to be present and requires the following properties be available: * ``compensation_type`` # ``description`` * ``hire_date`` * ``compensation`` * ``DATE_PROVIDED`` Expects hire_date to be given as YYYY-MM-DD format. Override calculate_tenure...
62598ee9851cf427c66b69c1
class ForwardMatrix(CompressedMatrix): <NEW_LINE> <INDENT> pass
Class representing a compressed forward matrix.
62598ee9f548e778e5969c7b
class HumanPlayer(Player): <NEW_LINE> <INDENT> _level: int <NEW_LINE> _desired_action: Optional[Tuple[str, Optional[int]]] <NEW_LINE> def __init__(self, player_id: int, goal: Goal) -> None: <NEW_LINE> <INDENT> Player.__init__(self, player_id, goal) <NEW_LINE> self._level = 0 <NEW_LINE> self._desired_action = None <NEW_...
A human player.
62598ee9d486a94d0ba2a6bd
class EmbeddedPandaWindow(wx.Window): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> gsg = None <NEW_LINE> if 'gsg' in kw: <NEW_LINE> <INDENT> gsg = kw['gsg'] <NEW_LINE> del kw['gsg'] <NEW_LINE> <DEDENT> wx.Window.__init__(self, *args, **kw) <NEW_LINE> wp = WindowProperties.getDefault() <NEW_L...
This class implements a Panda3D window that is directly embedded within the frame. It is fully supported on Windows, partially supported on Linux, and not at all on OSX.
62598ee98e7ae83300ee777f
class SubredditRelationship: <NEW_LINE> <INDENT> def __call__(self, redditor=None, **generator_kwargs): <NEW_LINE> <INDENT> Subreddit._safely_add_arguments(generator_kwargs, "params", user=redditor) <NEW_LINE> url = API_PATH["list_{}".format(self.relationship)].format( subreddit=self.subreddit ) <NEW_LINE> return Listi...
Represents a relationship between a redditor and subreddit. Instances of this class can be iterated through in order to discover the Redditors that make up the relationship. For example, banned users of a subreddit can be iterated through like so: .. code-block:: python for ban in reddit.subreddit("redditdev").b...
62598ee916aa5153ce3febee
class SelectMonthYearWidget(Widget): <NEW_LINE> <INDENT> none_value = (0, '---') <NEW_LINE> month_field = '%s_month' <NEW_LINE> year_field = '%s_year' <NEW_LINE> def __init__(self, defaultdate, day, attrs=None, years=None, required=True): <NEW_LINE> <INDENT> self.attrs = attrs or {} <NEW_LINE> self.required = required ...
A Widget that splits date input into two <select> boxes and allow selection of month/year
62598ee95fdd1c0f98e5c692
class RemoveMembers(base_classes.NoOutputAsyncMutator): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument( 'names', metavar='NAME', nargs='+', help='The names of the groups to remove members from.') <NEW_LINE> parser.add_argument( '--members', metavar='USERNAME', req...
Remove a user from a Google Compute Engine group. *{command}* removes a user from a Google Compute Engine group.
62598ee9091ae35668703308
class EigenProblem: <NEW_LINE> <INDENT> def __init__(self, a, b=None, parameters=None, bc=None): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> self.b = b <NEW_LINE> self.bc = bc <NEW_LINE> self.parameters = parameters <NEW_LINE> return <NEW_LINE> <DEDENT> def solve(self, n=None): <NEW_LINE> <INDENT> if self.b is None: <NEW...
EigenProblem(a, b=None, parameters=None) holds the forms for the (generalized eigenvalue problem) Ax = \lambda B x with B = I if B is None.
62598ee9796e427e5384ce88
class TeamFolderMetadata(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_team_folder_id_value', '_name_value', '_status_value', '_is_team_shared_dropbox_value', '_sync_setting_value', '_content_sync_settings_value', ] <NEW_LINE> _has_required_fields = True <NEW_LINE> def __init__(self, team_folder_id=None, name=None, s...
Properties of a team folder. :ivar team.TeamFolderMetadata.team_folder_id: The ID of the team folder. :ivar team.TeamFolderMetadata.name: The name of the team folder. :ivar team.TeamFolderMetadata.status: The status of the team folder. :ivar team.TeamFolderMetadata.is_team_shared_dropbox: True if this team folder ...
62598ee976e4537e8c3edca9
class resumeScan_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(ip...
Attributes: - success
62598ee944b2445a339b5ce1
class RegisterUserForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('username', 'password') <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> for field in self.fields: <NEW_LINE> <INDENT> s...
Форма регистрации пользователя
62598ee976e4537e8c3edcaa
class EigenVectorView(DataTreeView): <NEW_LINE> <INDENT> def __init__(self, store, redraw_plot, add_feature, settings): <NEW_LINE> <INDENT> DataTreeView.__init__(self, store, redraw_plot, add_feature, settings) <NEW_LINE> renderer_dir = Gtk.CellRendererText() <NEW_LINE> renderer_dir.set_property("editable", True) <NEW_...
The EigenVectorView is used for EigenVectorLayer-class layers. This class creates 3 columsn for the dip-direction and dip of the eigenvector and the eigenvalues. The class inherits from the DataTreeView class.
62598ee9f9cc0f698b1c4646
class Sample(_VSOSimpleAttr): <NEW_LINE> <INDENT> @u.quantity_input(value=u.s) <NEW_LINE> def __init__(self, value): <NEW_LINE> <INDENT> super(Sample, self).__init__(value) <NEW_LINE> self.value = value.to(u.s).value
Time interval for data sampling. Parameters ---------- value : `astropy.units.Quantity` A sampling rate convertible to seconds.
62598ee9a8370b77170eead4
class ActionCommand(NamedTuple): <NEW_LINE> <INDENT> name: str <NEW_LINE> help: str <NEW_LINE> func: Callable <NEW_LINE> args: Iterable[Arg] <NEW_LINE> description: Optional[str] = None <NEW_LINE> epilog: Optional[str] = None
Single CLI command
62598ee96aa9bd52df0d35a2
class ImageReader(object): <NEW_LINE> <INDENT> def __init__(self, data_dir, data_list, input_size, is_training): <NEW_LINE> <INDENT> self.data_dir = data_dir <NEW_LINE> self.data_list = data_list <NEW_LINE> self.input_size = input_size <NEW_LINE> self.image_list, self.scores_list, self.mean_std_list = read_labeled_imag...
Generic ImageReader which reads images and corresponding segmentation masks from the disk, and enqueues them into a TensorFlow queue.
62598ee9a17c0f6771d5a944
class BoolCollection(NamedTuple): <NEW_LINE> <INDENT> recursive: bool <NEW_LINE> copy: bool <NEW_LINE> verbose: bool <NEW_LINE> unknown: bool <NEW_LINE> include: bool
Used for putting all boolean value as one object and pass to function
62598ee971ff763f4b5e5e4c
class ExtraOutput(Generic[OutputType]): <NEW_LINE> <INDENT> def __init__( self, type: UFDLType[tuple, Any, OutputType] ): <NEW_LINE> <INDENT> self._name: Optional[str] = None <NEW_LINE> self._type = type <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> if self._name is None: <NEW_LINE...
A descriptor for AbstractJobExecutor which declares an output additional to the contractual outputs, of the given type.
62598ee999cbb53fe682f5a2
class pep(nep): <NEW_LINE> <INDENT> def __init__(self, coeff): <NEW_LINE> <INDENT> if not(type(coeff)==matrix_type): <NEW_LINE> <INDENT> raise NotMatrix <NEW_LINE> <DEDENT> if not(coeff.ndim==3): <NEW_LINE> <INDENT> raise NotTensor <NEW_LINE> <DEDENT> n,n,d=coeff.shape <NEW_LINE> def companion(): <NEW_LINE> <INDENT> B=...
pep is a subclass of nep with as input a three dimensional array containing the coefficients. coeff: is a three dimensional array containing the coefficients defining the polynomial eigenvalue problem companion: is a function that provides as output the standard companion linearization ...
62598ee9e64d504609df8737
class CandidateGenerator(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def generate_candidates(self) -> Iterator[Candidate]: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def generate_candidates_en_bulk(self, num_cands: int) -> List[Candidate]: <NEW_LINE> <INDENT> raise NotImplementedError()
Class to generate candidates from which to start the local minimization, typically random candidate or some form of more uniformly spaced variation, such as latin hypercube or sobol sequence
62598ee96fb2d068a769319d
class Simulator1(CalculatorAlgorithm): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> CalculatorAlgorithm.__init__(self) <NEW_LINE> <DEDENT> def apply(self, data, sample, pop = None): <NEW_LINE> <INDENT> self.params = list(data.keys()) <NEW_LINE> sample.set(**data) <NEW_LINE> for item in ["baseline_effect"...
Updates case control data MAF under baseline_penetrance / odds ratio model
62598ee9bd1bec0571e14443
class TestJaJP(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.fake = Faker('ja') <NEW_LINE> Faker.seed(0) <NEW_LINE> <DEDENT> def test_address(self): <NEW_LINE> <INDENT> country = self.fake.country() <NEW_LINE> assert isinstance(country, str) <NEW_LINE> assert country in JaProvider.co...
Tests addresses in the ja_JP locale
62598ee9fff4ab517ebcbec8
class LeaseTermination(Storm, TransFuncs): <NEW_LINE> <INDENT> __storm_table__ = "lease_termination" <NEW_LINE> id = Int(primary=True) <NEW_LINE> trans_id = Int(validator=intify) <NEW_LINE> sqft = Int(validator=intify) <NEW_LINE> bov_expected_timing = Int(validator=intify) <NEW_LINE> bov_actual_timing = Int(validator=i...
I am a type of transaction
62598ee90c0af96317c54a8e
class Error(Exception): <NEW_LINE> <INDENT> pass
Parent exception class for server module.
62598ee96e29344779afed24
class StringFormatter(EventHandler): <NEW_LINE> <INDENT> class State: <NEW_LINE> <INDENT> AwaitingFirstEdit = 0 <NEW_LINE> AwaitingSecondEdit = 1 <NEW_LINE> ConfirmedChangingCells = 2 <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.start_over() <NEW_LINE> <DEDENT> def start_over(self): <NEW_LINE> <INDE...
StringFormatter autoformats a sequence of edits. Edit - a cell change there previous value is not empty
62598ee960cbc95b06362a2f
class NodeInfo: <NEW_LINE> <INDENT> def __init__(self, coresUsed: float, memoryUsed: float, coresTotal: float, memoryTotal: int, requestedCores: float, requestedMemory: int, workers: int) -> None: <NEW_LINE> <INDENT> self.coresUsed = coresUsed <NEW_LINE> self.memoryUsed = memoryUsed <NEW_LINE> self.coresTotal = coresTo...
The coresUsed attribute is a floating point value between 0 (all cores idle) and 1 (all cores busy), reflecting the CPU load of the node. The memoryUsed attribute is a floating point value between 0 (no memory used) and 1 (all memory used), reflecting the memory pressure on the node. The coresTotal and memoryTotal a...
62598ee90a50d4780f703a9b
class OrderSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> order_items = OrderedItemSerializer(many=True) <NEW_LINE> restaurant_name = serializers.CharField(max_length=30, source='restaurant.name', read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = restaurant_models.Order <NEW_LINE> fields ...
Serializers to handle all the orders
62598ee9adb09d7d5dc08cb9
class RollerBase(object): <NEW_LINE> <INDENT> def extract_options(self, options): <NEW_LINE> <INDENT> self.name = options.get('name') <NEW_LINE> self.documentation = options.get('documentation') <NEW_LINE> self.retention_seconds = options.get('retention_seconds', DEFAULT_RETENTION_PERIOD) <NEW_LINE> self.update_seconds...
Base class used by CounterRoller and HistogramRoller
62598ee9ac7a0e7691f70c09
class UniquePointerPrinter: <NEW_LINE> <INDENT> def __init__ (self, typename, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> <DEDENT> def to_string (self): <NEW_LINE> <INDENT> return self.val['_M_t']
Print a unique_ptr
62598ee966673b3332c2ea99
class CleanupTestCase(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> import matplotlib.units <NEW_LINE> cls.original_units_registry = matplotlib.units.registry.copy() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(cls): <NEW_LINE> <INDENT> _do_cle...
A wrapper for unittest.TestCase that includes cleanup operations
62598ee991f36d47f223021c
class LennardJonesEnergyCapped(Potential): <NEW_LINE> <INDENT> pmiproxydefs = dict( cls = 'espressopp.interaction.LennardJonesEnergyCappedLocal', pmiproperty = ['epsilon', 'sigma', 'cutoff', 'caprad'] )
The Lennard-Jones potential.
62598ee94c342835776189d4
class ModelQuestionTest(TestCase): <NEW_LINE> <INDENT> def test_field_names(self): <NEW_LINE> <INDENT> field_names = [ field.name for field in Question._meta.get_fields() ] <NEW_LINE> expected_field_names = ["choice", "id", "question_text", "pub_date", "lang"] <NEW_LINE> self.assertEqual(expected_field_names, field_nam...
To check mentined field names are same as in the database.
62598ee916aa5153ce3febf0
class MembershipModelSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user = UserModelSerializer(read_only=True) <NEW_LINE> invited_by = serializers.StringRelatedField() <NEW_LINE> joined_at = serializers.DateTimeField(source='created', read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Memb...
Membership model Serializer.
62598ee9fff4ab517ebcbec9
class ProcessFactory: <NEW_LINE> <INDENT> def process(self, pid): <NEW_LINE> <INDENT> __pychecker__ = '--no-returnvalues' <NEW_LINE> handle = open('/proc/%d/stat' % pid) <NEW_LINE> line = handle.read() <NEW_LINE> fields = line.split(' ') <NEW_LINE> cmd = fields[1][1:-1] <NEW_LINE> if cmd == 'flumotion-job': <NEW_LINE> ...
I create a Process instance or subclass.
62598ee9dd821e528d6d7636
class MandelbrotHandler(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> left = float(self.request.get('left', '-2.68')) <NEW_LINE> right = float(self.request.get('right', '1.32')) <NEW_LINE> top = float(self.request.get('top', '-1.5')) <NEW_LINE> bottom = float(self.request.get('bottom',...
Respond to GET requests with an animated mandelbrot GIF.
62598ee92eb69b55b15a0703
class VerifyingDoubleError(AssertionError): <NEW_LINE> <INDENT> def __init__(self, method_name, doubled_obj): <NEW_LINE> <INDENT> self._method_name = method_name <NEW_LINE> self._doubled_obj = doubled_obj <NEW_LINE> self.args = (method_name, doubled_obj) <NEW_LINE> self.message = "Cannot double method '{}' of '{}'." <N...
An exception raised when attempting to double a method that does not exist on the real object.
62598ee9d58c6744b42db62f
class RevisionCompletionEmail(FormView): <NEW_LINE> <INDENT> template_name = 'shared/editable_notification_email.html' <NEW_LINE> form_class = core_forms.CustomEmailForm <NEW_LINE> @method_decorator(login_required) <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.submission = get_object...
Allows authors who have just submitted revisions to customise a notification email to the requester.
62598ee9cc0a2c11144796f6
class TransportMixIn(object): <NEW_LINE> <INDENT> user_agent = config.user_agent <NEW_LINE> _connection = None <NEW_LINE> _timeout = 60 <NEW_LINE> def send_content(self, connection, request_body): <NEW_LINE> <INDENT> connection.putheader('Content-Type', 'application/json-rpc') <NEW_LINE> connection.putheader('Content-L...
Just extends the XMLRPC transport where necessary.
62598ee966656f66f7d58ad3
class JujuStateSingleTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> with open('test/juju-output/juju-status-single-install.yaml') as f: <NEW_LINE> <INDENT> self.juju = JujuState(f.read()) <NEW_LINE> <DEDENT> self.m_one = self.juju.machine("1") <NEW_LINE> self.c_one = self.m_one.contai...
Read the 'juju status' yaml for single post-install
62598ee901c39578d7f1149c
class ValidatingMachine(BatsimScheduler): <NEW_LINE> <INDENT> def __init__(self, scheduler): <NEW_LINE> <INDENT> self.scheduler = scheduler <NEW_LINE> <DEDENT> def onAfterBatsimInit(self): <NEW_LINE> <INDENT> self.nb_res = self.bs.nb_res <NEW_LINE> self.availableResources = SortedSet(range(self.nb_res)) <NEW_LINE> self...
This class tries to do a lot of checks to prevent from stupid and invisible errors. You should use this when you are developping and testing a scheduler. It checks that: - not 2 jobs use the same resource as the same time - a job is only started once - a job is launched after his submit time
62598ee9cc40096d61619551
class VarArgsList(CodeElement): <NEW_LINE> <INDENT> def __init__(self, required_args=None, optional_args=None): <NEW_LINE> <INDENT> self._positional_args = required_args <NEW_LINE> self._optional_args = optional_args <NEW_LINE> <DEDENT> def emit(self, source_file): <NEW_LINE> <INDENT> positional = (", ".join(str(arg) f...
Corresponds to the varargslist grammar variable of Python
62598ee97b25080760ed5b8c
@register_command <NEW_LINE> class HexdumpCommand(GenericCommand): <NEW_LINE> <INDENT> _cmdline_ = "hexdump" <NEW_LINE> _syntax_ = "{:s} (qword|dword|word|byte) LOCATION L[SIZE] [UP|DOWN]".format(_cmdline_) <NEW_LINE> def post_load(self): <NEW_LINE> <INDENT> GefAlias("dq", "hexdump qword") <NEW_LINE> GefAlias("dd", "h...
Display arranged hexdump (according to architecture endianness) of memory range.
62598ee930bbd72246468326
class eInsStatusRtkBase(Enum): <NEW_LINE> <INDENT> INS_STATUS_RTK_BASE_ERR_NO_OBSERV = 0x08000000 <NEW_LINE> INS_STATUS_RTK_BASE_ERR_NO_POSITION = 0x10000000 <NEW_LINE> INS_STATUS_RTK_BASE_POSITION_MOVING = 0x20000000 <NEW_LINE> @staticmethod <NEW_LINE> def from_ins_status(insStatus): <NEW_LINE> <INDENT> INS_STATUS_R...
RTK base portion of INS status
62598ee971ff763f4b5e5e4e
class Settings(dict): <NEW_LINE> <INDENT> def __init__(self, filepath, defaults=None): <NEW_LINE> <INDENT> super(Settings, self).__init__() <NEW_LINE> self._filepath = filepath <NEW_LINE> self._nosave = False <NEW_LINE> if os.path.exists(self._filepath): <NEW_LINE> <INDENT> self._load() <NEW_LINE> <DEDENT> elif default...
A dictionary that saves itself when changed. Dictionary keys & values will be saved as a JSON file at ``filepath``. If the file does not exist, the dictionary (and settings file) will be initialised with ``defaults``. :param filepath: where to save the settings :type filepath: :class:`unicode` :param defaults: dict o...
62598ee90c0af96317c54a8f
class Upper(Rule): <NEW_LINE> <INDENT> def apply(self, value): <NEW_LINE> <INDENT> return value.upper()
Convert a string value to upper-case.
62598ee9d7e4931a7ef3a792
@keras_export('keras.layers.GaussianNoise') <NEW_LINE> class GaussianNoise(Layer): <NEW_LINE> <INDENT> def __init__(self, stddev, **kwargs): <NEW_LINE> <INDENT> super(GaussianNoise, self).__init__(**kwargs) <NEW_LINE> self.supports_masking = True <NEW_LINE> self.stddev = stddev <NEW_LINE> <DEDENT> def call(self, inputs...
Apply additive zero-centered Gaussian noise. This is useful to mitigate overfitting (you could see it as a form of random data augmentation). Gaussian Noise (GS) is a natural choice as corruption process for real valued inputs. As it is a regularization layer, it is only active at training time. Args: stddev: Floa...
62598ee96fb2d068a769319e
class Entry(object): <NEW_LINE> <INDENT> openapi_types = { 'data': 'EntryData' } <NEW_LINE> attribute_map = { 'data': 'data' } <NEW_LINE> def __init__(self, data=None): <NEW_LINE> <INDENT> self._data = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> @property <NEW_LINE> def dat...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598ee956ac1b37e63008e0
class City(Base): <NEW_LINE> <INDENT> __tablename__ = 'cities' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(128), nullable=False) <NEW_LINE> state_id = Column(Integer, ForeignKey('states.id'), nullable=False) <NEW_LINE> state = relationship('State')
This City class inherits from Base @id: Integer, unique, can't be null, primary key @name : String, not null @state_id: Integer, Foreing Key
62598ee9bd1bec0571e14444
class CommitShortHashTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_short_hash_returns_correct_result(self): <NEW_LINE> <INDENT> commit = create_commit(hash='207891db5bddbfb0c7210aca8c76ac6a9c5f9859') <NEW_LINE> self.assertEqual(commit.short_hash(10), '207891db5b')
Tests for `Commit.short_hash()`.
62598ee9e64d504609df8738
class Logger(ColorLoggerMixin, GunicornBaseLogger): <NEW_LINE> <INDENT> def access(self, resp, req, environ, request_time): <NEW_LINE> <INDENT> if not (self.cfg.accesslog or self.cfg.logconfig or self.cfg.syslog): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> atoms = self.atoms(resp, req, environ, request_time) <NEW_L...
Custom gunicorn logger with termcolor capabilities.
62598ee9fff4ab517ebcbeca
class Settings: <NEW_LINE> <INDENT> constant = 0x11 <NEW_LINE> template = "=4BI4BII4B" <NEW_LINE> counter = 0 <NEW_LINE> def __init__(self, copyno=0, seqno=None): <NEW_LINE> <INDENT> if None == seqno: <NEW_LINE> <INDENT> seqno = Eagle.Settings.counter <NEW_LINE> Eagle.Settings.counter += 1 <NEW_LINE> <DEDENT> else: <NE...
A struct that represents ?? settings ??
62598ee985dfad0860cbede1
class Album (LibraryItem): <NEW_LINE> <INDENT> def __init__(self , library_item_id , title , artist="") : <NEW_LINE> <INDENT> self._library_item_id = library_item_id <NEW_LINE> self._title = title <NEW_LINE> self._location = "ON_SHELF" <NEW_LINE> self._checked_out_by = None <NEW_LINE> self._requested_by = None <NEW_LI...
Representing aspects of LibraryItem, specific to Album item
62598ee9925a0f43d25e6721
class TestParseTimespec(unittest.TestCase): <NEW_LINE> <INDENT> def testValidTimes(self): <NEW_LINE> <INDENT> test_data = [ ('1s', 1), ('1', 1), ('1m', 60), ('1h', 60 * 60), ('1d', 60 * 60 * 24), ('1w', 60 * 60 * 24 * 7), ('4h', 4 * 60 * 60), ('61m', 61 * 60), ] <NEW_LINE> for value, expected_result in test_data: <NEW_...
Testing case for ParseTimespec
62598ee94e4d562566370b0c
class ItemInserter(QObject): <NEW_LINE> <INDENT> annotationFinished = pyqtSignal() <NEW_LINE> inserterFinished = pyqtSignal() <NEW_LINE> def __init__(self, labeltool, scene, default_properties=None, prefix="", commit=True): <NEW_LINE> <INDENT> QObject.__init__(self) <NEW_LINE> self._labeltool = labeltool <NEW_LINE> sel...
The base class for all item insertion handlers.
62598ee9a8370b77170eead7
class Solution: <NEW_LINE> <INDENT> def partition(self, head, x): <NEW_LINE> <INDENT> left, right = ListNode(0, head), ListNode(0, head) <NEW_LINE> pre_l, pre_r = left, right <NEW_LINE> while head: <NEW_LINE> <INDENT> if head.val < x: <NEW_LINE> <INDENT> pre_l.next = head <NEW_LINE> pre_l = pre_l.next <NEW_LINE> <DEDEN...
@param: head: The first node of linked list @param: x: An integer @return: A ListNode
62598ee97d43ff2487426775
class cached_property(property): <NEW_LINE> <INDENT> _sentinel = object() <NEW_LINE> def __init__(self, func, name=None, doc=None): <NEW_LINE> <INDENT> self.__name__ = name or func.__name__ <NEW_LINE> self.__module__ = func.__module__ <NEW_LINE> self.__doc__ = doc or func.__doc__ <NEW_LINE> self.func = func <NEW_LINE> ...
A decorator that converts a function into a lazy property. The function wrapped is called the first time to retrieve the result and then that calculated result is used the next time you access the value:: class Foo(object): @cached_property def foo(self): # calculate something importan...
62598ee94e4d562566370b0d
class RobTaskMixin: <NEW_LINE> <INDENT> def get_rob_queryset(self, RiskOfBias): <NEW_LINE> <INDENT> raise NotImplementedError("Abstract method; requires implementation") <NEW_LINE> <DEDENT> def get_review_tasks(self): <NEW_LINE> <INDENT> RiskOfBias = apps.get_model("riskofbias", "RiskOfBias") <NEW_LINE> rob_tasks = sel...
Add risk of bias tasks for a user to task views.
62598ee98da39b475be0189f
class mcxPyBotException(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.parameter = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.parameter)
Common base class for all mcxPyBot exceptions.
62598ee97d847024c075aac1
class VoiceActivityDetector: <NEW_LINE> <INDENT> def __init__(self, sample_rate, window_size): <NEW_LINE> <INDENT> self.cmw = _CMessageWeights(sample_rate, window_size) <NEW_LINE> self.frame_duration = window_size / sample_rate <NEW_LINE> self.window_size = window_size <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def re...
This class detects speech activity in an audio stream
62598ee9adb09d7d5dc08cbb
class HandlerCallDetails(six.with_metaclass(abc.ABCMeta)): <NEW_LINE> <INDENT> pass
Describes an RPC that has just arrived for service. Attributes: method: The method name of the RPC. invocation_metadata: The :term:`metadata` from the invocation side of the RPC.
62598ee97c178a314d78bb85
class Encoding(object): <NEW_LINE> <INDENT> def __init__(self, method, ubm, normalize=['l2g','l2c'], update='wmc', relevance=28): <NEW_LINE> <INDENT> self.method = method <NEW_LINE> self.ubm = ubm <NEW_LINE> self.normalize = normalize <NEW_LINE> self.update = update <NEW_LINE> self.relevance = relevance <NEW_LINE> <DED...
wrapper class around encoding methods
62598ee99c8ee8231303f4d2
class PrepareIP(Transformation): <NEW_LINE> <INDENT> def __init__(self, fpgapart, clk): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.fpgapart = fpgapart <NEW_LINE> self.clk = clk <NEW_LINE> <DEDENT> def apply(self, model): <NEW_LINE> <INDENT> for node in model.graph.node: <NEW_LINE> <INDENT> if is_fpgadataflo...
Call custom implementation to generate code for single custom node and create folder that contains all the generated files. All nodes in the graph must have the fpgadataflow backend attribute and transformation gets additional arguments: * fpgapart (string) * clk in ns (int) Any nodes that already have a code_gen_di...
62598ee98e7ae83300ee7782
class FileSet(set): <NEW_LINE> <INDENT> _dot = re.compile(r"^\.") <NEW_LINE> def __init__(self, path, suffixes=("txt", "sql"), trim_suffixes=True): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if isinstance(suffixes, str): <NEW_LINE> <INDENT> suffixes = (suffixes,) <NEW_LINE> <DEDENT> path = pathlib.Path(path).exp...
Determines names of all files in a directory with matching suffixes. Does not recurse.
62598ee98e7ae83300ee7783
class ConnectionClosedError(CommunicationError): <NEW_LINE> <INDENT> pass
The connection was unexpectedly closed.
62598ee92ae34c7f260a97db
class sayMsg_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.I32, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and...
Attributes: - success
62598ee9aad79263cf42cefe
class AddPrintableRingOperator38(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "addongen.add_printable_ring_operator38" <NEW_LINE> bl_label = "Add 17.75mm (7 1/2)" <NEW_LINE> bl_options = {'REGISTER'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> basicRingFor3DPrint('ring', 64, 17.75) <NEW_LINE> ret...
Add 17.75mm (US 7 1/2 | British P | French 56 1/2 | German 17 3/4 | Japanese 15 | Swiss 16 1/2)
62598ee9eab8aa0e5d30a46e
class Order(object): <NEW_LINE> <INDENT> def __init__(self, resource_id, resource_name, user_id, project_id, type, status): <NEW_LINE> <INDENT> self.resource_id = resource_id <NEW_LINE> self.resource_name = resource_name <NEW_LINE> self.user_id = user_id <NEW_LINE> self.project_id = project_id <NEW_LINE> self.type = ty...
Some field collection that ProductItem will use to get product or to create/update/delete subscription
62598ee9aad79263cf42ceff
class Scoreboard: <NEW_LINE> <INDENT> def __init__(self, ai_game): <NEW_LINE> <INDENT> self.ai_game = ai_game <NEW_LINE> self.screen = ai_game.screen <NEW_LINE> self.screen_rect = self.screen.get_rect() <NEW_LINE> self.settings = ai_game.settings <NEW_LINE> self.stats = ai_game.stats <NEW_LINE> self.text_color = (26, 8...
A class to report scoring information
62598ee98c0ade5d55dc29fc