code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class shutdown(ipc): <NEW_LINE> <INDENT> pass
Message used to indicate that the component recieving it should shutdown. Due to legacy mistakes, use shutdownMicroprocess instead.
6259906529b78933be26ac66
class MilestoneNote(AccessControlShortcutMixin, TimestampMixin, models.Model): <NEW_LINE> <INDENT> note = fields.RichTextField(_('note'), blank=True) <NEW_LINE> milestone = models.ForeignKey(Milestone, related_name='note', related_query_name='note', null=True) <NEW_LINE> @property <NEW_LINE> def owner_group(self): <NEW...
Stores a note attached to a milestone object
6259906592d797404e3896ff
class HalfOrc(CharacterRace): <NEW_LINE> <INDENT> def __init__(self, race_name=None): <NEW_LINE> <INDENT> super().__init__(race_name if race_name else Races.HALF_ORC) <NEW_LINE> self._ability_score_increases = [ (Abilities.STRENGTH, 2), (Abilities.CONSTITUTION, 1) ] <NEW_LINE> self._age = Age(75, 14) <NEW_LINE> self._s...
Class docstring.
625990652ae34c7f260ac82c
class IPHandler(BaseHandler): <NEW_LINE> <INDENT> methods_allowed = ('GET',) <NEW_LINE> fields = ('botnettype', 'host', 'longitude', 'latitude', 'botnethashvalue', 'config', 'firstseen', 'lastseen') <NEW_LINE> model = Botnet <NEW_LINE> @throttle(5, 1*60) <NEW_LINE> def read(self, request, ip): <NEW_LINE> <INDENT> ip = ...
Returns information about botnet(s) /api/ip/addr will reply with botnet(s) info for those that have detected an IP with number addr
625990658a43f66fc4bf38d4
class th_buildin_method(ThpyPlugin): <NEW_LINE> <INDENT> title = "methods" <NEW_LINE> description = "Python methods" <NEW_LINE> keyword = { u"นี่":"this", u"กรอก":"input", u"รับ":"input", u"ข้อความ":"str", u"รายการ": "list", u"ตัวเลข":"int", u"จำนวนจริง":"float", u"ความยาว":"len", u"ช่วง":"range", u"ชนิด":"type", u"ช่ว...
python th methods
625990654428ac0f6e659c76
class EventListView(TemplateView): <NEW_LINE> <INDENT> template_name = 'multilingual_events/event_list.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> ctx = super(EventListView, self).get_context_data(**kwargs) <NEW_LINE> upcoming = Event.objects.get_upcoming(self.request) <NEW_LINE> archived...
A view that lists all upcoming events for the current language.
625990657d847024c075db1b
class APIGatewayRequestAuthorizerEvent(TypedDict): <NEW_LINE> <INDENT> type: Literal["REQUEST"] <NEW_LINE> methodArn: str <NEW_LINE> resource: str <NEW_LINE> path: str <NEW_LINE> httpMethod: str <NEW_LINE> headers: Dict[str, str] <NEW_LINE> queryStringParameters: Dict[str, str] <NEW_LINE> pathParameters: Dict[str, str]...
APIGatewayRequestAuthorizerEvent https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html Attributes: ---------- type: Literal['REQUEST'] methodArn: str resource: str path: str httpMethod: str headers: Dict[str, str] queryStringParameters: Dict[str, str] pathParamete...
62599065f7d966606f74945c
class Event(object): <NEW_LINE> <INDENT> def __init__(self, name, source_states, destination_state, callbacks=None): <NEW_LINE> <INDENT> if name is None or len(name) == 0: <NEW_LINE> <INDENT> raise StateMachineEventError(STATE_MACHINE.INVALID_EVENT_IDENTIFIER) <NEW_LINE> <DEDENT> if destination_state is None or not isi...
The class describes an event within a state machine that causes a transition between states. Each event has a descriptive name and specifies the state that the machine will transition into after the event has been fired. Events can optionally be constrained to a set of source states that the machine must be in for ...
625990657d847024c075db1c
class AbstractReducer(metaclass=ABCMeta): <NEW_LINE> <INDENT> ForkingPickler = ForkingPickler <NEW_LINE> register = register <NEW_LINE> dump = dump <NEW_LINE> send_handle = send_handle <NEW_LINE> recv_handle = recv_handle <NEW_LINE> if sys.platform == 'win32': <NEW_LINE> <INDENT> steal_handle = steal_handle <NEW_LINE> ...
Abstract base class for use in implementing a Reduction class suitable for use in replacing the standard reduction mechanism used in multiprocessing_on_dill.
625990653eb6a72ae038bda4
class _TelnetParser: <NEW_LINE> <INDENT> def __init__(self, trace : CoreTrace): <NEW_LINE> <INDENT> self.userData = bytearray() <NEW_LINE> self.currCmd = bytearray() <NEW_LINE> self.currSb = bytearray() <NEW_LINE> self.unparsed = bytearray() <NEW_LINE> self.trace = trace <NEW_LINE> <DEDENT> def __Trace(self, text : str...
Parsing data receiving via Telnet, split it to user data and telnet commands.
62599065009cb60464d02c7d
class TestVolumeDefBindRw(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 testVolumeDefBindRw(self): <NEW_LINE> <INDENT> pass
VolumeDefBindRw unit test stubs
6259906599fddb7c1ca63971
class Sequential(object): <NEW_LINE> <INDENT> def __init__(self, a): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> <DEDENT> def __call__(self, time_scale=1): <NEW_LINE> <INDENT> r = 2 <NEW_LINE> t = map(lambda x: x * time_scale, [1.0, 0.5, 1.5, 2.0]) <NEW_LINE> for identity, sleep in enumerate(t, 1): <NEW_LINE> <INDENT> r ...
Chain activity calls. 10 ---------4| 5 ---16| 15 ------------256| R 20 ---------------65536 Duration: 50 Result: 0
6259906545492302aabfdc21
class StorageArrayChangeablePropertiesTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_storage_array_changeable_properties(self): <NEW_LINE> <INDENT> storage_array_changeable_properties_obj = StorageArrayChangeableProperties() <NEW_LINE> self.assertNotEqual(storage_array_changeable_properties_obj, None)
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
625990654a966d76dd5f063b
class quality_acceptation(osv.osv): <NEW_LINE> <INDENT> _inherit = 'quality.acceptation' <NEW_LINE> _columns = { 'line_ids': fields.one2many('quality.acceptation.line', 'acceptation_id', 'Lines'), }
Acceptation form
625990654f6381625f19a047
class ParamItem(ListItem): <NEW_LINE> <INDENT> _columns = ["name", "value", "on_entry", "on_exit", "on_error", "collect"] <NEW_LINE> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._item_data[0].text <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return self._item_dat...
Represents a parameter in the list
6259906599cbb53fe683262a
class BodyDataStatisticsPass2: <NEW_LINE> <INDENT> def __init__(self, context): <NEW_LINE> <INDENT> self._context = context <NEW_LINE> if (self._context.mean is None) or (self._context.global_mean is None): <NEW_LINE> <INDENT> raise ValueError("Pass 1 need to run first.") <NEW_LINE> <DEDENT> self._context = context <NE...
A helper class that compute the standard deviation and global std for skeleton data.
62599065d486a94d0ba2d70f
class CertificateMergeParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'x509_certificates': {'required': True}, } <NEW_LINE> _attribute_map = { 'x509_certificates': {'key': 'x5c', 'type': '[bytearray]'}, 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, 'tags':...
The certificate merge parameters. All required parameters must be populated in order to send to Azure. :param x509_certificates: Required. The certificate or the certificate chain to merge. :type x509_certificates: list[bytearray] :param certificate_attributes: The attributes of the certificate (optional). :type cert...
62599065adb09d7d5dc0bcb0
class TestUniformMeshComponents(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> random.seed(987324987234) <NEW_LINE> cls.o, cls.r = test_reactors.loadTestReactor( TEST_ROOT, customSettings={"xsKernel": "MC2v2"} ) <NEW_LINE> cls.r.core.lib = isotxs.readBinary(ISOA...
Tests individual operations of the uniform mesh converter Only loads reactor once per suite.
62599065009cb60464d02c7e
class MachineResolver(MethodsMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = 'machineresolver' <NEW_LINE> id = db.Column(db.Integer, primary_key=True, nullable=False) <NEW_LINE> name = db.Column(db.Unicode(255), default=u"", unique=True, nullable=False) <NEW_LINE> rtype = db.Column(db.Unicode(255), default=u"", n...
This model holds the definition to the machinestore. Machines could be located in flat files, LDAP directory or in puppet services or other... The usual MachineResolver just holds a name and a type and a reference to its config
6259906532920d7e50bc778c
class InventorySubRecipeService(Requests): <NEW_LINE> <INDENT> service_url = "/inventory/sub-recipes" <NEW_LINE> model_cls = InventorySubRecipeModel <NEW_LINE> def get_inventory_sub_recipes(self, **kwargs): <NEW_LINE> <INDENT> return self.get_list(**kwargs) <NEW_LINE> <DEDENT> def get_inventory_sub_recipe_by_id(self, p...
Inventory Ingredient service class to allow retrieving inventory SubRecipe related data
625990650c0af96317c57902
class RequestBrokerScrip(Message): <NEW_LINE> <INDENT> def __init__(self, sender, receiver, amount): <NEW_LINE> <INDENT> Message.__init__(self, sender, receiver) <NEW_LINE> self.amount = amount <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return Message.__str__(self) + str(self.amount) <NEW_LINE> <DEDENT>...
A simple message from a customer to broker for buying scrip. Contains customer_ID and value of scrip he wants to buy.
625990658e71fb1e983bd20c
class TestMoveElasticsearchClusterConfiguration(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 testMoveElasticsearchClusterConfiguration(self): <NEW_LINE> <INDENT> pass
MoveElasticsearchClusterConfiguration unit test stubs
6259906556ac1b37e6303888
class PasswordPanel(wx.Panel): <NEW_LINE> <INDENT> def __init__(self, parent, noteBook): <NEW_LINE> <INDENT> wx.Panel.__init__(self, noteBook) <NEW_LINE> self.parent = parent <NEW_LINE> self.frame = self.parent.parent <NEW_LINE> self.fullAccessLabel = wx.StaticText(self, -1, _(u"Full access password")) <NEW_LINE> self....
PasswordPanel builds the panel to configure the access to the application and the corresponding keychain
625990653317a56b869bf0e6
class TruckLikeSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> truck = TruckSerializer(read_only=True) <NEW_LINE> location = serializers.SerializerMethodField() <NEW_LINE> def get_location(self, obj): <NEW_LINE> <INDENT> current_location = services.get_current_truck_location(obj.truck) <NEW_LINE> return cu...
For TruckLikes
6259906597e22403b383c653
class AuthProviderResponseError(Error): <NEW_LINE> <INDENT> pass
Error coming from a provider
6259906516aa5153ce401c21
class _IsInert(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def check(self, verb): <NEW_LINE> <INDENT> def verb_decorated(*args, **kwargs): <NEW_LINE> <INDENT> inert_agent = args[0].inert <NEW_LINE> if inert_agent is True: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return ver...
Decorator method for the verbs of the current Agent. If the agent has been declared inert, all verbs are rendered inactive.
625990650a50d4780f706963
class FieldModelBase: <NEW_LINE> <INDENT> pass
Base field Model class
6259906501c39578d7f142d8
class BTSystemConfigInfo(object): <NEW_LINE> <INDENT> openapi_types = { 'value': 'str', 'name': 'str', 'id': 'str', 'href': 'str', 'view_ref': 'str' } <NEW_LINE> attribute_map = { 'value': 'value', 'name': 'name', 'id': 'id', 'href': 'href', 'view_ref': 'viewRef' } <NEW_LINE> def __init__(self, value=None, name=None, i...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62599065ac7a0e7691f73c2c
class ValidateUtilities(unittest.TestCase): <NEW_LINE> <INDENT> def test_maps_critical(self): <NEW_LINE> <INDENT> actual = logleveler('critical') <NEW_LINE> expected = 50 <NEW_LINE> self.assertEqual(expected, actual) <NEW_LINE> <DEDENT> def test_maps_info(self): <NEW_LINE> <INDENT> actual = logleveler('info') <NEW_LINE...
test the utilities module
625990653539df3088ecd9e5
class BoardSchema(ma.Schema): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> fields = ('bid','subject','uid','created')
Some info
625990654a966d76dd5f063d
class ESEDBPluginTestCase(test_lib.ParserTestCase): <NEW_LINE> <INDENT> def _ParseESEDBFileWithPlugin( self, path_segments, plugin, knowledge_base_values=None): <NEW_LINE> <INDENT> storage_writer = fake_writer.FakeStorageWriter() <NEW_LINE> storage_writer.Open() <NEW_LINE> file_entry = self._GetTestFileEntry(path_segme...
ESE database-based plugin test case.
625990657c178a314d78e790
class RelatedStudentKeyValue(AbstractApplicationKeyValue, AbstractIsAdmin): <NEW_LINE> <INDENT> relatedstudent = models.ForeignKey(RelatedStudent) <NEW_LINE> student_can_read = models.BooleanField( help_text='Specifies if a student can read the value or not.', default=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> u...
Key/value pair tied to a specific RelatedStudent.
625990654e4d562566373b4f
class EMBLTableMotor(AbstractMotor): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> AbstractMotor.__init__(self, name) <NEW_LINE> self.direction = None <NEW_LINE> self.socket = None <NEW_LINE> self.enabled = False <NEW_LINE> atexit.register(self.close) <NEW_LINE> <DEDENT> def init(self): <NEW_LINE> <...
EMBLTableMotor defines socket interface to positioning table
625990653539df3088ecd9e6
@command(server_cmds) <NEW_LINE> class server_delete(_CycladesInit, _ServerWait): <NEW_LINE> <INDENT> arguments = dict( wait=FlagArgument('Wait server to be destroyed', ('-w', '--wait')), cluster=FlagArgument( '(DANGEROUS) Delete all VMs with names starting with the cluster ' 'prefix. Do not use it if unsure. Syntax:' ...
Delete a virtual server
62599065435de62698e9d551
@python_2_unicode_compatible <NEW_LINE> class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
分类表
62599065a8ecb03325872960
class toXLSNode(NodeWithCtrlWidget): <NEW_LINE> <INDENT> nodeName = "Write XLS" <NEW_LINE> uiTemplate = [ {'name': 'Parameters', 'type': 'group', 'children': [ {'name': 'sheet_name', 'type': 'str', 'value': 'Sheet1', 'default': 'Sheet1', 'tip': '<string, default "Sheet1">\nName of sheet which will contain DataFrame'}, ...
Write data to spreadsheet or copy to clipboard
6259906529b78933be26ac68
class TTLedDict(dict): <NEW_LINE> <INDENT> def __init__(self, ttl): <NEW_LINE> <INDENT> self.ttl = ttl <NEW_LINE> super(TTLedDict, self).__init__() <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> return super(TTLedDict, self).__setitem__(key, (time.time(), value)) <NEW_LINE> <DEDENT> def __ge...
A simple TTLed in memory cache. :param ttl: the time-to-leave for records, in seconds. The cache will return an ExpiredValue once the TTL is over for its records, and remove the items from its cache. A ttl of 0 means the record never expires.
6259906592d797404e389701
class Client: <NEW_LINE> <INDENT> __clientId = 0 <NEW_LINE> def __init__(self, name, cnp): <NEW_LINE> <INDENT> self.setName(name) <NEW_LINE> self.setCnp(cnp) <NEW_LINE> self.__Id = Client.__clientId <NEW_LINE> self.__borrowedBooks = list() <NEW_LINE> self.__activity = 0 <NEW_LINE> Client.__clientId += 1 <NEW_LINE> <DED...
This class contains all the information needed to store clients Properties: name (str), cnp (str), id (int, read only), borrowedBooks (list)
6259906556b00c62f0fb4015
class Djs(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'dj' <NEW_LINE> <DEDENT> name = models.CharField( max_length=45, help_text="Public name to be shown for this DJ." ) <NEW_LINE> description = models.TextField( blank=True, help_text="A description to shown on the staff page." ) <...
Table that contains extra information for DJs, it is not required that each user account has one, it's fully optional.
625990657cff6e4e811b718f
class ExponentialIsotropicModel(IsotropicModel): <NEW_LINE> <INDENT> def fit(self, data, mask=None): <NEW_LINE> <INDENT> to_fit = _to_fit_iso(data, self.gtab, mask=mask) <NEW_LINE> nz_idx = to_fit > 0 <NEW_LINE> to_fit[nz_idx] = np.log(to_fit[nz_idx]) <NEW_LINE> to_fit[~nz_idx] = -np.inf <NEW_LINE> p = nanmean(to_fit /...
Representing the isotropic signal as a fit to an exponential decay function with b-values
62599065a17c0f6771d5d74a
class ConversationMessage(object): <NEW_LINE> <INDENT> def __init__(self, sender, convo): <NEW_LINE> <INDENT> self.convo = convo <NEW_LINE> self.sender = sender <NEW_LINE> <DEDENT> def jsonify(self): <NEW_LINE> <INDENT> return {"sender": self.sender, "convo": self.convo}
Represents system events for user's actions inside a conversation
6259906555399d3f05627c68
class Splitter2: <NEW_LINE> <INDENT> def __init__(self, tensors): <NEW_LINE> <INDENT> self.tensors = tensors <NEW_LINE> <DEDENT> def split(self, x): <NEW_LINE> <INDENT> sizes = [int(np.prod(t.shape)) for t in self.tensors] <NEW_LINE> assert sum(sizes) == len(x) <NEW_LINE> split_indices = np.cumsum(sizes)[:-1] <NEW_LINE...
Class for splitting one numpy vector into many tensors and joining back. It is used if you have a tensorflow function of several tensor variables and the optimalization algorithm was designed to work with real functions accepting one numpy vector as an argument. Thi class is meant to replace `splitter.Splitter` in ne...
625990657d847024c075db20
class TunnelIdentity(IanaInterfaceTypeIdentity): <NEW_LINE> <INDENT> _prefix = 'ianaift' <NEW_LINE> _revision = '2014-05-08' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> IanaInterfaceTypeIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.ietf...
Encapsulation interface.
62599065f7d966606f74945e
class ShortInputException(Exception): <NEW_LINE> <INDENT> def __init__(self, length, atleast): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.length = length <NEW_LINE> self.atleast = atleast
Uma classe exceção definida pelo usuário.
625990658e7ae83300eea7d7
class LighthouseAdapter(Adapter): <NEW_LINE> <INDENT> def __init__(self, name='LighthouseAdapter', log_level=logging.INFO, **kwargs): <NEW_LINE> <INDENT> Adapter.__init__(self, name, **kwargs) <NEW_LINE> self._log_level = log_level <NEW_LINE> logging.basicConfig(level=log_level, **kwargs) <NEW_LINE> self._logger = logg...
An Adapter for Lighthouse.
62599065cc0a2c111447c674
class BaseTinyMCEMemoWidget(BaseDashboardPluginWidget): <NEW_LINE> <INDENT> def render(self, request=None): <NEW_LINE> <INDENT> context = {'plugin': self.plugin} <NEW_LINE> return render_to_string('tinymce/render.html', context)
Base TinyMCE memo plugin widget.
6259906556ac1b37e6303889
class TenantFileSystemFinder(FileSystemFinder): <NEW_LINE> <INDENT> def __init__(self, app_names=None, *args, **kwargs): <NEW_LINE> <INDENT> self._locations = {} <NEW_LINE> self._storages = {} <NEW_LINE> <DEDENT> @property <NEW_LINE> def locations(self): <NEW_LINE> <INDENT> if self._locations.get(connection.schema_name...
A static files finder that uses the ``MULTITENANT_STATICFILES_DIRS`` setting to locate files for different tenants. The only difference between this and the standard FileSystemFinder implementation is that we need to keep references to the storage locations of the static files, as well as maps of dir paths to an appro...
625990651f037a2d8b9e540f
class CheckFailed(Exception): <NEW_LINE> <INDENT> pass
raise this when there's at least one check does not pass
625990653eb6a72ae038bda8
class SearchForm(forms.Form): <NEW_LINE> <INDENT> query = forms.CharField(label='Query', max_length=200, required=False) <NEW_LINE> distance = forms.FloatField(label='Distance', max_value=200, required=False, initial=3) <NEW_LINE> title = forms.CharField(label='Title', max_length=200...
Form for all search fields.
6259906599fddb7c1ca63973
class TestDocsModelBT_array_tuple(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.docs_model = docsmodel.DocsModel() <NEW_LINE> self.schema = docsmodel.get_schema_from_file( 'test_schemas/array_tuple.json') <NEW_LINE> <DEDENT> def test_entries_count(self): <NEW_LINE> <INDENT> entries =...
Tests array tuple typing.
62599065f548e778e596ccd3
class RemoveIamPolicyBinding(base.Command): <NEW_LINE> <INDENT> detailed_help = iam_util.GetDetailedHelpForRemoveIamPolicyBinding( 'dataset', '1000') <NEW_LINE> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument('id', type=str, help='The ID of the dataset.') <NEW_LINE> iam_util.AddArgsFo...
Remove IAM policy binding for a dataset. This command removes a policy binding to the IAM policy of a dataset, given a dataset ID and the binding.
62599065e76e3b2f99fda149
@six.add_metaclass(abc.ABCMeta) <NEW_LINE> class ConstrainedMinimizationProblem(object): <NEW_LINE> <INDENT> @abc.abstractproperty <NEW_LINE> def objective(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> def num_constraints(self): <NEW_LINE> <INDENT> constraints_shape = self.constraints.get_sha...
Abstract class representing a `ConstrainedMinimizationProblem`. A ConstrainedMinimizationProblem consists of an objective function to minimize, and a set of constraint functions that are constrained to be nonpositive. In addition to the constraint functions, there may (optionally) be proxy constraint functions: a Con...
625990652c8b7c6e89bd4f38
@keras_export('keras.metrics.CategoricalCrossentropy') <NEW_LINE> class CategoricalCrossentropy(MeanMetricWrapper): <NEW_LINE> <INDENT> def __init__(self, name='categorical_crossentropy', dtype=None, from_logits=False, label_smoothing=0): <NEW_LINE> <INDENT> super(CategoricalCrossentropy, self).__init__( categorical_cr...
Computes the crossentropy metric between the labels and predictions. This is the crossentropy metric class to be used when there are multiple label classes (2 or more). Here we assume that labels are given as a `one_hot` representation. eg., When labels values are [2, 0, 1], `y_true` = [[0, 0, 1], [1, 0, 0], [0, 1, 0...
62599065d6c5a102081e386f
class RichTextSep (BaseWidget): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> BaseWidget.__init__(self) <NEW_LINE> self._sep = gtk.HSeparator() <NEW_LINE> self.add(self._sep) <NEW_LINE> self._size = None <NEW_LINE> self._sep.modify_bg(gtk.STATE_NORMAL, gdk.Color(* DEFAULT_HR_COLOR)) <NEW_LINE> self._sep.m...
Separator widget for a Horizontal Rule
62599065e5267d203ee6cf63
class ChangeEmail(LoginRequiredMixin, FormView): <NEW_LINE> <INDENT> template_name = 'registration/change_email_form.html' <NEW_LINE> form_class = ChangeEmailForm <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> user = self.request.user <NEW_LINE> new_email = form.cleaned_data['email'] <NEW_LINE> current_site...
Change Email address
62599065435de62698e9d552
class GetJobResponse: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'result': 'GetJobResult', 'status': 'str', 'error_message': 'str' } <NEW_LINE> self.result = None <NEW_LINE> self.status = None <NEW_LINE> self.error_message = None
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599065460517430c432bf9
class DownloadRawData(luigi.Task): <NEW_LINE> <INDENT> def requires(self): <NEW_LINE> <INDENT> return FetchFileTask( 'https://data.buenosaires.gob.ar/api/datasets/HJ8rdKWmJl/download', os.path.join(data_dir, 'raw', 'trajectories.zip') ) <NEW_LINE> <DEDENT> def output(self): <NEW_LINE> <INDENT> return luigi.LocalTarget(...
Downloads the trajectories and stations data from https://data.buenosaires.gob.ar/dataset/bicicletas-publicas
62599065796e427e5384fec0
class BilinearSeqAttn(nn.Module): <NEW_LINE> <INDENT> def __init__(self, x_size, y_size, identity=False): <NEW_LINE> <INDENT> super(BilinearSeqAttn, self).__init__() <NEW_LINE> if not identity: <NEW_LINE> <INDENT> self.linear = nn.Linear(y_size, x_size) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.linear = None <...
A bilinear attention layer over a sequence X w.r.t y: * o_i = softmax(x_i'Wy) for x_i in X. Optionally don't normalize output weights.
625990653539df3088ecd9e8
class InverseSparseDiscreteBoundaryOperator(_LinearOperator): <NEW_LINE> <INDENT> class _Solver(object): <NEW_LINE> <INDENT> def __init__(self, operator): <NEW_LINE> <INDENT> from scipy.sparse import csc_matrix <NEW_LINE> if isinstance(operator, SparseDiscreteBoundaryOperator): <NEW_LINE> <INDENT> mat = operator.sparse...
Apply the (pseudo-)inverse of a sparse operator. This class uses a Sparse LU-Decomposition (in the case of a square matrix) or a sparse normal equation to provide the application of an inverse to a sparse operator. This class derives from :class:`scipy.sparse.linalg.interface.LinearOperator` and thereby implements th...
6259906538b623060ffaa3f6
class AttachmentHandler(BaseHandler): <NEW_LINE> <INDENT> @require_permission(BaseHandler.PERMISSION_ALL) <NEW_LINE> def delete(self, task_id, attachment_id): <NEW_LINE> <INDENT> attachment = self.safe_get_item(Attachment, attachment_id) <NEW_LINE> task = self.safe_get_item(Task, task_id) <NEW_LINE> if attachment.task ...
Delete an attachment.
62599065adb09d7d5dc0bcb4
class AUPhoneNumberField(CharField): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': 'Phone numbers must contain 10 digits.', } <NEW_LINE> def clean(self, value): <NEW_LINE> <INDENT> super(AUPhoneNumberField, self).clean(value) <NEW_LINE> if value in EMPTY_VALUES: <NEW_LINE> <INDENT> return '' <NEW_LINE> <DED...
A form field that validates input as an Australian phone number. Valid numbers have ten digits.
625990652ae34c7f260ac831
class SelectCsvGeneratorForm(forms.Form): <NEW_LINE> <INDENT> generator = forms.ModelChoiceField(queryset=CsvGenerator.objects.none()) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> generators = kwargs.pop('generators') <NEW_LINE> super(SelectCsvGeneratorForm, self).__init__(*args, **kwargs) <NEW_L...
Form class for selecting a csv generator
625990657cff6e4e811b7191
class LinearBanditVariableCollection(tf.Module): <NEW_LINE> <INDENT> def __init__(self, context_dim, num_models, use_eigendecomp=False, dtype=tf.float32, name=None): <NEW_LINE> <INDENT> tf.Module.__init__(self, name=name) <NEW_LINE> self.cov_matrix_list = [] <NEW_LINE> self.data_vector_list = [] <NEW_LINE> self.eig_mat...
A collection of variables used by `LinearBanditAgent`.
625990658a43f66fc4bf38da
class LabelAction(Action): <NEW_LINE> <INDENT> TYPE = "label" <NEW_LINE> def __init__(self, label): <NEW_LINE> <INDENT> self.label = label <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_json(cls, json_obj, context): <NEW_LINE> <INDENT> return cls(Label.objects.get(org=context.org, pk=json_obj["label"])) <NEW_LINE...
Adds a label to the message
62599065fff4ab517ebcef66
class SubmittedFile(UrlMixin, models.Model): <NEW_LINE> <INDENT> submission = models.ForeignKey(Submission, verbose_name=_('LABEL_SUBMISSION'), on_delete=models.CASCADE, related_name="files", ) <NEW_LINE> param_name = models.CharField( verbose_name=_('LABEL_PARAM_NAME'), max_length=128, ) <NEW_LINE> file_object = model...
Represents a file submitted by the student as a solution to an exercise. Submitted files are always linked to a certain submission through a foreign key relation. The files are stored on the disk while models are stored in the database.
62599065aad79263cf42ff0a
class ICheckinEvent( IObjectEvent ): <NEW_LINE> <INDENT> baseline = Attribute("The Working Copy's baseline") <NEW_LINE> relation = Attribute("The Working Copy Archetypes Relation Object") <NEW_LINE> checkin_message = Attribute("checkin message")
a working copy is being checked in, event.object is the working copy, this message is sent before any mutation/merge has been done on the objects
625990658e7ae83300eea7d8
class Category(models.Model): <NEW_LINE> <INDENT> category = models.CharField(max_length=100) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.category
Book Categories
625990658e71fb1e983bd210
class UploadFile(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> upload_file = request.FILES.get('img') <NEW_LINE> file_name_last = upload_file.name.split('.').pop() <NEW_LINE> file_name = 'IMG_{}.{}'.format(datetime.now().strftime('%y%m%d%H%M%S'), file_name_last) + '.' <NEW_LINE> with open(sett...
前端表单 必须是POST请求 类型必须是 ENCTYPE=multipart/form-data input type = 'file' 如果发现 request.files 是为空 检查是否是post请求
625990651f037a2d8b9e5410
class UserAndDiscussionViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = UserAndDiscussion.objects.all() <NEW_LINE> serializer_class = UserAndDiscussionSerializer <NEW_LINE> filter_backends = [DjangoFilterBackend] <NEW_LINE> filter_fields = ['agree', 'time_Of_Activity'] <NEW_LINE> ...
API endpoint that allows users to be viewed or edited.
625990653eb6a72ae038bdaa
class PythonAPM(object): <NEW_LINE> <INDENT> def __init__(self, app, surfacers=Surfacers(LogSurfacer(),)): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> self.surfacers = surfacers <NEW_LINE> self.request_time = Histogram( 'pythonapm.http.request.time_microseconds', surfacers=self.surfacers, ) <NEW_LINE> self.rss_diff =...
Instruments flask applications, exposes a number of configurable metrics.
62599065a219f33f346c7f52
@utils.registerPlexObject <NEW_LINE> class Album(Audio): <NEW_LINE> <INDENT> TAG = 'Directory' <NEW_LINE> TYPE = 'album' <NEW_LINE> def __iter__(self): <NEW_LINE> <INDENT> for track in self.tracks(): <NEW_LINE> <INDENT> yield track <NEW_LINE> <DEDENT> <DEDENT> def _loadData(self, data): <NEW_LINE> <INDENT> Audio._loadD...
Represents a single audio album. Attributes: TAG (str): 'Directory' TYPE (str): 'album' art (str): Album artwork (/library/metadata/<ratingkey>/art/<artid>) genres (list): List of :class:`~plexapi.media.Genre` objects this album respresents. key (str): API URL (/library/metadata/<ratingkey>). o...
625990658da39b475be04935
class ImportarCategoriaForm(FlaskForm): <NEW_LINE> <INDENT> submit = SubmitField('Importar')
Formulario para importar as categorias dos produtos categorias do site
62599065462c4b4f79dbd151
class InvertedConstantBias(PhotozNoiseAddition): <NEW_LINE> <INDENT> def __init__(self,bias): <NEW_LINE> <INDENT> self.bias = bias <NEW_LINE> self.can_be_neg = False <NEW_LINE> if bias>0: <NEW_LINE> <INDENT> self.can_be_neg = True <NEW_LINE> <DEDENT> <DEDENT> def __call__(self,zspec,map_id,bin_num): <NEW_LINE> <INDENT>...
Assumes that noise photoz noise is modelled as bph(zs) = bias * (1+zs) This function assumes that we are given the photometric redshift (with only a constant bias) and we want to get the spectroscopic redshift back. zp = bph + zs -> zp = bias*(1+zs) + zs -> zp = bias+(1+bias)*zs zs*(1+bias) = zp - bias zs = (zp-bias...
62599065d268445f2663a702
class ApplicationContext(object): <NEW_LINE> <INDENT> def __init__(self, solvers): <NEW_LINE> <INDENT> self.dijsktra_dist = None <NEW_LINE> self.dijsktra_preds = None <NEW_LINE> self.running = False <NEW_LINE> self.paused = True <NEW_LINE> self.num_ants = 1000 <NEW_LINE> self.show_grid = False <NEW_LINE> self.show_grid...
Holds the whole state necessary for running the simulation
625990651b99ca40022900db
class BatchQuery(object): <NEW_LINE> <INDENT> def __init__(self, sync_cls): <NEW_LINE> <INDENT> self._sync_cls = sync_cls <NEW_LINE> self._qs_collection = defaultdict(list) <NEW_LINE> <DEDENT> @property <NEW_LINE> def qs_collection(self): <NEW_LINE> <INDENT> return self._qs_collection <NEW_LINE> <DEDENT> def __enter__(...
BatchQuery является контекстным менеджером и используется для накопления запросов и их слияния, если это возможно. Т.е. BatchQuery пытается сделать как можно меньше запросов к базе. Запросы будут слиты, если аргументы к функции filter() у них одинаковы.
625990651f5feb6acb164337
class ShareReadWriteVolumeGatewayApiTest(CommonReadWriteVolumeGatewayApiTest): <NEW_LINE> <INDENT> def setup_volume(self): <NEW_LINE> <INDENT> sharer = make_storage_user( username='sharer', max_storage_bytes=2000) <NEW_LINE> self.owner = sharer <NEW_LINE> root = StorageObject.objects.get_root(sharer._user) <NEW_LINE> r...
Test the ReadWriteVolumeGateway API against for a UDF volume. For each type of volume, override setup_volume. This class tests the user's root volume.
62599065cb5e8a47e493cd2a
class Object(Node): <NEW_LINE> <INDENT> def __init__(self, name: str, parent: ParentType = None): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._parent = parent <NEW_LINE> self._children = {} <NEW_LINE> return <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def is_leaf() -> bool: <NEW_LINE> <INDENT> return False <...
Base class for configuration object nodes.
62599065796e427e5384fec2
class GaussFilter(control.Control): <NEW_LINE> <INDENT> def apply_control(self): <NEW_LINE> <INDENT> self.image_out = cv2.GaussianBlur(self.base_image, (25, 25), 0) <NEW_LINE> return self.image_out
GaussFilter a simple Gaussian blur filter control
62599065d7e4931a7ef3d72b
@attr.s <NEW_LINE> class Statusmap(Panel): <NEW_LINE> <INDENT> alert = attr.ib(default=None) <NEW_LINE> cards = attr.ib( default={ 'cardRound': None, 'cardMinWidth': 5, 'cardHSpacing': 2, 'cardVSpacing': 2, }, validator=instance_of(dict)) <NEW_LINE> color = attr.ib( default=attr.Factory(StatusmapColor), validator=insta...
Generates json structure for the flant-statusmap-panel visualisation plugin (https://grafana.com/grafana/plugins/flant-statusmap-panel/). :param alert: Alert :param cards: A statusmap card object: keys 'cardRound', 'cardMinWidth', 'cardHSpacing', 'cardVSpacing' :param color: A StatusmapColor object :param isNew: isNew...
62599065a8370b77170f1b1a
class TestCategory(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.category = Category() <NEW_LINE> <DEDENT> def test_add_category(self): <NEW_LINE> <INDENT> self.assertRaises( RuntimeError, self.category.add_category, "Categoryname") <NEW_LINE> <DEDENT> def test_delete_category(self):...
This class tests the category class
625990653617ad0b5ee0789c
class _ground_state(_state): <NEW_LINE> <INDENT> def __init__(self, ts = '', te = 0.0, prop = {}, contrib = {}): <NEW_LINE> <INDENT> _state.__init__(self, ts, te, prop) <NEW_LINE> if (len(contrib) == 0): <NEW_LINE> <INDENT> self.dict_of_econtrib = { 'hf': te } <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.dict_of_...
Ground state computed using ADC (derived from _state) Additional attributes: - dict_of_econtrib - Dictionary of energy contributions (in a.u.)
625990658a43f66fc4bf38dc
class Notebook: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.notes = [] <NEW_LINE> <DEDENT> def new_note(self, memo, tags=''): <NEW_LINE> <INDENT> self.notes.append(Note(memo, tags)) <NEW_LINE> <DEDENT> def _find_note(self, note_id): <NEW_LINE> <INDENT> for note in self.notes: <NEW_LINE> <INDENT> if...
Represent a collection of notes that can be tagged, modified, and searched.
625990655fdd1c0f98e5f6d0
class CreateWithInlinesView(SingleObjectTemplateResponseMixin, BaseCreateWithInlinesView): <NEW_LINE> <INDENT> template_name_suffix = '_form'
View for creating a new object instance with related model instances, with a response rendered by template.
62599065379a373c97d9a76a
class ToNumpy: <NEW_LINE> <INDENT> def __call__(self, data): <NEW_LINE> <INDENT> data['audio'] = np.array(data['audio']) <NEW_LINE> return data
Transform to make numpy array
62599065f548e778e596ccd6
class TestLogicNotConvert(OPConvertAutoScanTest): <NEW_LINE> <INDENT> def sample_convert_config(self, draw): <NEW_LINE> <INDENT> input1_shape = draw( st.lists( st.integers( min_value=10, max_value=20), min_size=2, max_size=4)) <NEW_LINE> dtype = "bool" <NEW_LINE> config = { "op_names": ["logical_not"], "test_data_shape...
api: logical_not ops OPset version: 7, 9, 15
6259906591f36d47f2231a35
class ECHO(object): <NEW_LINE> <INDENT> def __init__(self, pin, temp=20, IO_mode=IO.BCM): <NEW_LINE> <INDENT> self.pin = pin <NEW_LINE> self.temp = temp <NEW_LINE> self.IO_mode = IO_mode <NEW_LINE> self.t_start = 0 <NEW_LINE> self.TOF = 0 <NEW_LINE> self.dist = 0 <NEW_LINE> self.speed_of_sound = 331.3 * math.sqrt(1+(se...
ECHO class will catch hardware changes ie the echo. Parameters: (2) pin (int) : help= give pin number (4) temp (sec) : default = 20, help= temperature in celsius (5) IO_mode : default = IO.BCM, help= BCM or BOARD
6259906555399d3f05627c6d
class Entity: <NEW_LINE> <INDENT> def __init__( self, x: int, y: int, char: str, color: Tuple[int, int, int], renderer, font_size=20, tile_size=20, ): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.char = char <NEW_LINE> self.color = sdl2.ext.Color(*color) <NEW_LINE> self.font_size = font_size <NE...
A generic object to represent players, enemies, items, etc.
625990658e7ae83300eea7da
class SignalingNaNException(object): <NEW_LINE> <INDENT> def __init__(self, snan): <NEW_LINE> <INDENT> self.snan = snan <NEW_LINE> <DEDENT> def default_handler(self, attributes): <NEW_LINE> <INDENT> attributes.flag_set.add(invalid) <NEW_LINE> return self.snan <NEW_LINE> <DEDENT> def signal(self, attributes): <NEW_LINE>...
InvalidOperation exception signaled as a result of an arithmetic operation encountering a signaling NaN.
6259906563d6d428bbee3e2f
class Senz(hmm.HMM): <NEW_LINE> <INDENT> def __init__(self, model = model.SenzModel()): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.hidden_state = model.mDefaultHiddenStateSet <NEW_LINE> self.visible_output_obj = model.mDefaultVisibleOutputSet <NEW_LINE> hmm.HMM.__init__(self, self.visible_output_obj, self.h...
SENZ
625990653eb6a72ae038bdac
class GraphKeys(object): <NEW_LINE> <INDENT> VARIABLES = "variables" <NEW_LINE> TRAINABLE_VARIABLES = "trainable_variables" <NEW_LINE> LOCAL_VARIABLES = "local_variables" <NEW_LINE> MODEL_VARIABLES = "model_variables" <NEW_LINE> SUMMARIES = "summaries" <NEW_LINE> QUEUE_RUNNERS = "queue_runners" <NEW_LINE> TABLE_INITIAL...
Standard names to use for graph collections. The standard library uses various well-known names to collect and retrieve values associated with a graph. For example, the `tf.Optimizer` subclasses default to optimizing the variables collected under `tf.GraphKeys.TRAINABLE_VARIABLES` if none is specified, but it is also ...
625990650a50d4780f706966
class CoursesViewSet(ModelViewSet): <NEW_LINE> <INDENT> queryset = Courses.objects.all() <NEW_LINE> serializer_class = CourseSerializer
Вывод списка курсов
625990658da39b475be04936
class TP_Tileable_Add_Vertices_Offset(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "tp_ops.add_vertices_offset" <NEW_LINE> bl_label = "Offset Vertices" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> bpy.types.Scene.tp_verts_offset = bpy.props.EnumProperty( items=[("tp_verts_x" ,"X Axis" ,"X Axis")...
Add single vertices to correct array offset
625990653cc13d1c6d466e90
class TweetModel(Base, BaseModelMixin): <NEW_LINE> <INDENT> __tablename__ = 'tweets' <NEW_LINE> uid = Column(Integer, primary_key=True) <NEW_LINE> update_date = Column(DateTime) <NEW_LINE> title_text = Column(String) <NEW_LINE> main_text = Column(String) <NEW_LINE> stream_id = Column(String) <NEW_LINE> video_url = Colu...
The category SQL Alchemy model.
62599065ac7a0e7691f73c32
class NSNitroNserrWiSiteInvalStaurl(NSNitroSslvpnAaaErrors): <NEW_LINE> <INDENT> pass
Nitro error code 2665 Invalid staURL
62599065e76e3b2f99fda14d
class CSArgParser(argparse.ArgumentParser): <NEW_LINE> <INDENT> def error(self, message, exit=False): <NEW_LINE> <INDENT> sys.stderr.write('Error: {}\n'.format(message)) <NEW_LINE> self.print_help() <NEW_LINE> if exit: <NEW_LINE> <INDENT> sys.exit(2)
Argument parser that shows help if there is an error
625990651b99ca40022900dc
class Bocca(object): <NEW_LINE> <INDENT> def __init__(self, bocca=None): <NEW_LINE> <INDENT> self._bocca = bocca or which('bocca') <NEW_LINE> if self._bocca is None: <NEW_LINE> <INDENT> raise RuntimeError('unable to find bocca') <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def bocca(self): <NEW_LINE> <INDENT> retu...
Build babel projects with bocca.
625990651f5feb6acb164339
class FakeLock(object): <NEW_LINE> <INDENT> def __init__(self, path, identifier=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.identifier = identifier
A fake Lock for testing.
62599065435de62698e9d556
class FocalMechanism(__FocalMechanism): <NEW_LINE> <INDENT> pass
This class describes the focal mechanism of an event. It includes different descriptions like nodal planes, principal axes, and a moment tensor. The moment tensor description is provided by objects of the class MomentTensor which can be specified as child elements of FocalMechanism. :type resource_id: :class:`~obspy.c...
62599065460517430c432bfb
class Popen(Process): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__subproc = subprocess32.Popen(*args, **kwargs) <NEW_LINE> self._init(self.__subproc.pid, _ignore_nsp=True) <NEW_LINE> <DEDENT> def __dir__(self): <NEW_LINE> <INDENT> return sorted(set(dir(Popen) + dir(subprocess32.P...
A more convenient interface to stdlib subprocess32 module. It starts a sub process and deals with it exactly as when using subprocess32.Popen class but in addition also provides all the properties and methods of psutil.Process class as a unified interface: >>> import psutil >>> from ambari_...
62599065a8370b77170f1b1c
class Jezail(Rifle, FullyImplemented): <NEW_LINE> <INDENT> Name: str = "Jezail Musket" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__(caliber=Caliber.BB, action=FiringAction.SingleShot, capacity=1, range_falloff=.3, base_damage=20, name=self.Name, weightlb=12)
Based on the Jezail Musket https://en.wikipedia.org/wiki/Jezail
62599065d486a94d0ba2d717