code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class RestFrameworkTaggableManager(TaggableManager): <NEW_LINE> <INDENT> def m2m_reverse_field_name(self): <NEW_LINE> <INDENT> return self.through._meta.get_field_by_name("tag")[0].name | Subclass to fix "'TaggableManager' object has no attribute
'm2m_reverse_field_name'" errors when using Taggit with Rest Framework. | 62598f32627d3e7fe0e05ecf |
class UpdateAttributeSchema(BaseSchema): <NEW_LINE> <INDENT> id = fields.String(missing='None', validate=(validate_attribute_exists)) <NEW_LINE> label = fields.String( validate=(string_length_60_validator, name_validator)) <NEW_LINE> is_required = fields.Boolean(load_from='isRequired', dump_to='isRequired') <NEW_LINE> ... | Update Attribute model schema | 62598f32ad47b63b2c5a6857 |
class ImportExport(object, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> methods = dict() <NEW_LINE> @staticmethod <NEW_LINE> def register(importerexporter): <NEW_LINE> <INDENT> if not isinstance(importerexporter, ImportExport): <NEW_LINE> <INDENT> t = str(type(importerexporter)) <NEW_LINE> error_msg = (f"Given importere... | Class for registering new import/export methods (via static methods). Also
the base class that should be extended for such methods
(`ImportExport.export_data`, `ImportExport.import_data`, and
`ImportExport.name` have to be overwritten).
See Also
--------
VariableOwner.get_states, VariableOwner.set_states | 62598f32187af65679d29429 |
class BaseConfig(object): <NEW_LINE> <INDENT> SECRET_KEY = 'jobplus-6-14' <NEW_LINE> SQLALCHEMY_TRACK_MODIFICATIONS = False <NEW_LINE> INDEX_PER_PAGE = 9 <NEW_LINE> ADMIN_PER_PAGE = 15 | 配置基类 | 62598f324c3428357761931c |
class Person(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(Person, self).__init__() <NEW_LINE> self.name = name <NEW_LINE> self.mail = None <NEW_LINE> self.cardId = None <NEW_LINE> self.creditLeft = None <NEW_LINE> self.preferredRu = [] <NEW_LINE> self.timeSlot = [] | gather daily prefences and constraints from a team member | 62598f32c4546d3d9def6a8a |
class Episode(object): <NEW_LINE> <INDENT> def __init__(self, _episode, _manager): <NEW_LINE> <INDENT> self._episode = _episode <NEW_LINE> self._manager = _manager <NEW_LINE> self.title = self._episode.title <NEW_LINE> self.url = self._episode.url <NEW_LINE> self.is_new = (self._episode.state == gpodder.STATE_NORMAL an... | API interface of gPodder episodes
This is the API specification of episode objects that
are returned from API functions.
Public attributes:
title
url
is_new
is_downloaded
is_deleted | 62598f32627d3e7fe0e05ed1 |
class TestIsWithinMacadamLimits(unittest.TestCase): <NEW_LINE> <INDENT> def test_is_within_macadam_limits(self): <NEW_LINE> <INDENT> self.assertTrue( is_within_macadam_limits(np.array([0.3205, 0.4131, 0.5100]), "A") ) <NEW_LINE> self.assertFalse( is_within_macadam_limits(np.array([0.0005, 0.0031, 0.0010]), "A") ) <NEW_... | Define :func:`colour.volume.macadam_limits.is_within_macadam_limits`
definition unit tests methods. | 62598f32187af65679d2942b |
class Coord: <NEW_LINE> <INDENT> def __init__(self, x: int, y: int): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def from_json(json: Any): <NEW_LINE> <INDENT> return Coord(json[0], json[1]) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"Coord({... | Coordinate in the world | 62598f3215fb5d323ce7dd74 |
class Pesetacoin(Bitcoin): <NEW_LINE> <INDENT> name = 'pesetacoin' <NEW_LINE> symbols = ('PTC', ) <NEW_LINE> seeds = ('dnsseed.pesetacoin.info', ) <NEW_LINE> port = 16639 <NEW_LINE> message_start = b'\xc0\xc0\xc0\xc0' <NEW_LINE> base58_prefixes = { 'PUBKEY_ADDR': 47, 'SCRIPT_ADDR': 22, 'SECRET_KEY': 175 } | Class with all the necessary Pesetacoin (PTC) network information based on
https://github.com/FundacionPesetacoin/Pesetacoin-0.9.1-Oficial/blob/master/src/chainparams.cpp
(date of access: 02/16/2018) | 62598f3215fb5d323ce7dd76 |
class TestExercise03CalcClass(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.x = calc() <NEW_LINE> <DEDENT> def test_calc(self): <NEW_LINE> <INDENT> print("unittest module by Nikolay Melnik") <NEW_LINE> self.assertIsNotNone(self.x) <NEW_LINE> self.assertEqual(self.x.addition(2, 2), 4,... | Testing integrity of Exercise03 Calculator class
Ideas are taken from here https://docs.python.org/3/library/unittest.html | 62598f32627d3e7fe0e05ed7 |
class DescribeCatLogsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TaskId = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> self.BeginTime = None <NEW_LINE> self.EndTime = None <NEW_LINE> self.SortType = None <NEW_LINE> <DEDENT> def _deserialize(self... | DescribeCatLogs请求参数结构体
| 62598f333cc13d1c6d4647c1 |
class Parameters: <NEW_LINE> <INDENT> lines = DatasetParameter('linestrings', type='input') <NEW_LINE> output = DatasetParameter('points along line', type='output') <NEW_LINE> distance = LiteralParameter('distance between points') <NEW_LINE> def __init__(self, axis=None): <NEW_LINE> <INDENT> self.distance = 10e3 <NEW_L... | Points generation parameters | 62598f33187af65679d2942d |
class TransientReplicaUpdateError(ReplicaUpdateError): <NEW_LINE> <INDENT> pass | Failed to update a replica, update should be retried. | 62598f33187af65679d2942e |
class Validate(BrowserView): <NEW_LINE> <INDENT> def __call__(self, consumer, consumer_key, consumer_secret, oauth_token, oauth_token_secret, pincode): <NEW_LINE> <INDENT> logger.info("Validate Twitter token.") <NEW_LINE> logger.info("consumer=%s" % consumer) <NEW_LINE> logger.info("consumer_key=%s" % consumer_key) <NE... | View used to validate the provided token | 62598f33ad47b63b2c5a6865 |
class Karyawan: <NEW_LINE> <INDENT> jumlah_karyawan = 0 <NEW_LINE> def __init__(self, nama, gaji): <NEW_LINE> <INDENT> self.nama = nama <NEW_LINE> self.gaji = gaji <NEW_LINE> Karyawan.jumlah_karyawan += 1 <NEW_LINE> <DEDENT> def tampilkan_jumlah(self): <NEW_LINE> <INDENT> print("Total karyawan:", Karyawan.jumlah_karyaw... | Dasar Kelas Untuk Semua Karyawan | 62598f333cc13d1c6d4647c7 |
class TokenStatusCode(BaseStatusCode): <NEW_LINE> <INDENT> TOKEN_NOT_FOUND = StatusCodeField(409001, 'Token Not Found', description=u'票据不存在') | 4090xx 票据相关错误码 | 62598f3326238365f5fabbe4 |
class ArgumentsView(HeaderView): <NEW_LINE> <INDENT> knowledge = None <NEW_LINE> def _process_parsed(self, entry, parsed): <NEW_LINE> <INDENT> return [self._process_pair(entry, d) for d in parsed] <NEW_LINE> <DEDENT> def _process_pair(self, entry, pair): <NEW_LINE> <INDENT> name, argument = pair <NEW_LINE> if argument ... | For a header whose parsed value contains some sort of ``name[=argument]``
pairs, and the argument needs to be parsed depending on the name. | 62598f33091ae35668703c64 |
class QKeyGrab(QDialog): <NEW_LINE> <INDENT> modkey_names = PLATFORM_MODKEY_NAMES[PLATFORM] <NEW_LINE> def __init__(self, parent): <NEW_LINE> <INDENT> QDialog.__init__(self, parent=parent) <NEW_LINE> self.parent = parent <NEW_LINE> self.active = 0 <NEW_LINE> self._resetDialog() <NEW_LINE> self._setupUI() <NEW_LINE> <DE... | Simple key combination grabber for hotkey assignments
Based in part on ImageResizer by searene
(https://github.com/searene/Anki-Addons) | 62598f3315fb5d323ce7dd82 |
class BaseModel: <NEW_LINE> <INDENT> def __init__(self, name: str, properties: dict = None, relations: dict = None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.properties = properties or dict() <NEW_LINE> self.relations = relations or dict() <NEW_LINE> self.type = self.get_type() <NEW_LINE> self._hash = md5('... | Base class for schema.org-based models | 62598f333cc13d1c6d4647cf |
class InputInterceptionDataHandler(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def prepare_input_for_recording(self, interception_key, result, args, kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def restore_input_from_recording(self, reco... | A class that act as a pluggable hook that can be used during input interception when recording and playing the data | 62598f3326238365f5fabbee |
class ActividadCreate(CreateView): <NEW_LINE> <INDENT> model = Actividad <NEW_LINE> form_class = ActividadForm <NEW_LINE> template_name = 'configuracion/agregar_actividad.html' <NEW_LINE> success_url = reverse_lazy('actividades') <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> messages.success(self.request, ... | Clase que permite registrar un actividad macro | 62598f33627d3e7fe0e05eec |
class Gaussian(Prior): <NEW_LINE> <INDENT> domain = _REAL <NEW_LINE> _instances = [] <NEW_LINE> def __new__(cls, mu=0, sigma=1): <NEW_LINE> <INDENT> if cls._instances: <NEW_LINE> <INDENT> cls._instances[:] = [instance for instance in cls._instances if instance()] <NEW_LINE> for instance in cls._instances: <NEW_LINE> <I... | Implementation of the univariate Gaussian probability function, coupled with random variables.
:param mu: mean
:param sigma: standard deviation
.. Note:: Bishop 2006 notation is used throughout the code | 62598f3315fb5d323ce7dd8d |
class AnosimTests(TestCase): <NEW_LINE> <INDENT> pass | Nothing to test. | 62598f33eab8aa0e5d30ade0 |
class DropUnderscoreHeaderReader(HeaderReader): <NEW_LINE> <INDENT> def _allow_header(self, key_name): <NEW_LINE> <INDENT> orig = super(DropUnderscoreHeaderReader, self)._allow_header(key_name) <NEW_LINE> return orig and '_' not in key_name | Custom HeaderReader to exclude any headers with underscores in them. | 62598f33627d3e7fe0e05eee |
class Node(object): <NEW_LINE> <INDENT> __slots__= ('key', 'val', 'red', 'left', 'right', 'pos', 'off') <NEW_LINE> def __init__(self, pos, offset, node): <NEW_LINE> <INDENT> self.key = node["key"] <NEW_LINE> self.val = node["val"] <NEW_LINE> self.red = node["red"] <NEW_LINE> self.left = NodePointer(pos, node["left"]) <... | A red-black tree node.
The node is red if `red` is true, otherwise it is black. The left and
right children are provided by the `left` and `right` fields. | 62598f33c4546d3d9def6a99 |
class UploadCommand(Command): <NEW_LINE> <INDENT> description = 'Build and publish the package.' <NEW_LINE> user_options = [] <NEW_LINE> @staticmethod <NEW_LINE> def status(s): <NEW_LINE> <INDENT> print('\033[1m{0}\033[0m'.format(s)) <NEW_LINE> <DEDENT> def initialize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> ... | Support `setup.py upload`. | 62598f3315fb5d323ce7dd91 |
class Command(BaseCommand): <NEW_LINE> <INDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> deploy_cmds = settings.IX_DEPLOY_CMDS <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> deploy_cmds = [] <NEW_LINE> <DEDENT> if isinstance(deploy_cmds, str): <NEW_LINE> <INDENT> ... | This command is a simple aggregate command to allow us (the devs) to
easily add deployment steps to our release process e.g. to add a JS minify
step without needing to add steps to the puppet release manifest.
See http://redmine.office.infoxchange.net.au/issues/7854 | 62598f334c3428357761933d |
class AutocompleteView(object): <NEW_LINE> <INDENT> def __init__(self, name='autocomplete', app_name='autocomplete'): <NEW_LINE> <INDENT> self.settings = {} <NEW_LINE> self.paths = {} <NEW_LINE> self.name = name <NEW_LINE> self.app_name = app_name <NEW_LINE> <DEDENT> def has_settings(self, id): <NEW_LINE> <INDENT> retu... | >>> from django.contrib.auth.models import User
>>> autocomplete = AutocompleteView()
>>> class UserAutocomplete(AutocompleteSettings):
... queryset = User.objects.all()
... search_fields = ('^username', 'email')
...
>>> autocomplete.register('myapp.user', UserAutocomplete)
>>> autocomplete.get_settings(Messa... | 62598f33627d3e7fe0e05ef2 |
class Critic(object): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.build_model() <NEW_LINE> <DEDENT> def build_model(self): <NEW_LINE> <INDENT> states = layers.Input(shape=(self.state_size,), n... | Critic (Value) Model. | 62598f333cc13d1c6d4647dd |
class ResNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, block, layers): <NEW_LINE> <INDENT> self.inplanes = 128 <NEW_LINE> super(ResNet, self).__init__() <NEW_LINE> self.conv1 = conv3x3(3, 64, stride=1, dilation=2, padding=2) <NEW_LINE> self.bn1 = BatchNorm2d(64) <NEW_LINE> self.relu1 = nn.ReLU(inplace=False) <... | Basic ResNet101. | 62598f33627d3e7fe0e05ef6 |
class Comp(object): <NEW_LINE> <INDENT> OPERATORS = { u'==': u'EQUAL', u'!=': u'NOT_EQUAL', u'>': u'GREATER', u'<': u'LESS', } <NEW_LINE> def __init__(self, key, compare): <NEW_LINE> <INDENT> if type(key) != six.binary_type: <NEW_LINE> <INDENT> raise TypeError('key must be bytes type, not {}'.format(type(key))) <NEW_LI... | Base class for representing comparisons against a KV item.
:ivar key: The subject key for the comparison operation.
:vartype key: bytes
:ivar compare: The comparison operator to apply.
:vartype compare: str | 62598f3315fb5d323ce7dd97 |
class AsyncOperation(object): <NEW_LINE> <INDENT> def __init__( self, partial, max_retries=-1, auto_invoke=True, retry_conflict=False): <NEW_LINE> <INDENT> self._partial = partial <NEW_LINE> self._retry_count = 0 <NEW_LINE> self._max_retries = max_retries <NEW_LINE> self._retry_conflict = retry_conflict <NEW_LINE> self... | Async Operation handler with automatic retry | 62598f334c34283577619343 |
class TextInput(TethysGizmoOptions): <NEW_LINE> <INDENT> gizmo_name = "text_input" <NEW_LINE> def __init__(self, name, display_text='', initial='', placeholder='', prepend='', append='', icon_prepend='', icon_append='', disabled=False, error='', attributes={}, classes=''): <NEW_LINE> <INDENT> super(TextInput, self).__i... | The text input gizmo makes it easy to add text inputs to your app that are styled similarly to the other input snippets.
Attributes:
display_text(str): Display text for the label that accompanies select input
name(str, required): Name of the input element that will be used for form submission
initial(str):... | 62598f3426238365f5fabc00 |
class PyBson(BsonTools): <NEW_LINE> <INDENT> def encode_cstring(self, s: str) -> bytes: <NEW_LINE> <INDENT> return bson.encode_cstring(s) <NEW_LINE> <DEDENT> def decode_cstring(self, b: Union[io.BytesIO, bytes]) -> str: <NEW_LINE> <INDENT> if isinstance(b, io.BytesIO): <NEW_LINE> <INDENT> length = int.from_bytes(b.read... | BsonTool implementation for bson package | 62598f340a366e3fb87dba48 |
class ExtraTreesRegressor(ForestRegressor): <NEW_LINE> <INDENT> def __init__(self, n_estimators=10, criterion="mse", max_depth=10, min_split=1, min_density=0.1, max_features=None, bootstrap=True, random_state=None): <NEW_LINE> <INDENT> super(ExtraTreesRegressor, self).__init__( base_estimator=ExtraTreeRegressor(), n_es... | An extra-trees regressor.
This class implements a meta estimator that fits a number of
randomized decision trees (a.k.a. extra-trees) on various sub-samples
of the dataset and use averaging to improve the predictive accuracy
and control over-fitting.
Parameters
----------
n_estimators : integer, optional (default=10)... | 62598f344c34283577619349 |
class IndexView(tables.DataTableView): <NEW_LINE> <INDENT> table_class = policies_tables.PoliciesTable <NEW_LINE> template_name = 'admin/policies/index.html' <NEW_LINE> def get_data(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> policies = congress.policies_list(self.request) <NEW_LINE> <DEDENT> except Exception a... | List policies. | 62598f3426238365f5fabc04 |
class CounterStructuredName(_messages.Message): <NEW_LINE> <INDENT> class OriginValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> SYSTEM = 0 <NEW_LINE> USER = 1 <NEW_LINE> <DEDENT> class PortionValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> ALL = 0 <NEW_LINE> KEY = 1 <NEW_LINE> VALUE = 2 <NEW_LINE> <DEDENT> co... | Identifies a counter within a per-job namespace. Counters whose
structured names are the same get merged into a single value for the job.
Enums:
OriginValueValuesEnum: One of the standard Origins defined above.
PortionValueValuesEnum: Portion of this counter, either key or value.
Fields:
componentStepName: Name... | 62598f34187af65679d29441 |
class CreateGenerationCommand(Command): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> return self._obj.create_generation() | Command to create King Shan and Queen Anga Generation Tree. | 62598f3426238365f5fabc06 |
class AbsoluteMonthlyPattern(Pattern): <NEW_LINE> <INDENT> ELEMENT_NAME = "AbsoluteMonthlyRecurrence" <NEW_LINE> interval = IntegerField(field_uri="Interval", min=1, max=99, is_required=True) <NEW_LINE> day_of_month = IntegerField(field_uri="DayOfMonth", min=1, max=31, is_required=True) <NEW_LINE> def __str__(self): <N... | MSDN:
https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/absolutemonthlyrecurrence | 62598f34091ae35668703c84 |
class FloatPreference(BasePreferenceType): <NEW_LINE> <INDENT> field_class = forms.FloatField <NEW_LINE> serializer = FloatSerializer | A preference type that stores a float. | 62598f340a366e3fb87dba4e |
class Console(virtio.Driver): <NEW_LINE> <INDENT> virtio_driver = "console" | A Virtio serial/console device. | 62598f34ad47b63b2c5a688b |
class ProgramCertificateFactory(DjangoModelFactory): <NEW_LINE> <INDENT> program = factory.SubFactory(ProgramFactory) <NEW_LINE> user = factory.SubFactory(UserFactory) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = ProgramCertificate | Factory for ProgramCertificate | 62598f34627d3e7fe0e05f04 |
class PlacementGroupIdValidator(Validator): <NEW_LINE> <INDENT> def _validate(self, placement_group_id: str): <NEW_LINE> <INDENT> if placement_group_id: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> AWSApi.instance().ec2.describe_placement_group(placement_group_id) <NEW_LINE> <DEDENT> except AWSClientError as e: <NEW_LI... | Placement group id validator. | 62598f34ad47b63b2c5a688d |
class Datetime(datetime, BaseModel): <NEW_LINE> <INDENT> def __new__(cls, value): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> raise ValueError("cannot instantiate a Datetime with a null value") <NEW_LINE> <DEDENT> if value.endswith("Z"): <NEW_LINE> <INDENT> return datetime.strptime(value, "%Y-%m-%dT%H:%M:... | Our replacement for the ``datetime`` object that deals with the various
datetime formats the api returns. | 62598f344c34283577619351 |
class ChDir(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.old_dir = os.getcwd() <NEW_LINE> self.new_dir = path <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> os.chdir(self.new_dir) <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> os.chdir(self.old_dir) | Step into a directory temporarily | 62598f34c4546d3d9def6aa5 |
class XXPlugin(object): <NEW_LINE> <INDENT> def __init__(self, runner): <NEW_LINE> <INDENT> self.sys_stderr = sys.stderr <NEW_LINE> self.needs_db = False <NEW_LINE> self.started = False <NEW_LINE> self._registry = set() <NEW_LINE> <DEDENT> def begin(self): <NEW_LINE> <INDENT> self.add_apps = set() <NEW_LINE> <DEDENT> d... | Only sets up databases if a single class inherits from
``django.test.testcases.TransactionTestCase``.
Also ensures you don't run the same test case multiple times. | 62598f34187af65679d29445 |
@testcase.eden_repo_test <NEW_LINE> class CasingTest(testcase.EdenRepoTest): <NEW_LINE> <INDENT> is_case_insensitive: bool <NEW_LINE> def populate_repo(self) -> None: <NEW_LINE> <INDENT> self.is_case_insensitive = sys.platform == "win32" <NEW_LINE> self.repo.write_file("adir1/adir2/a", "Hello!\n") <NEW_LINE> self.repo.... | Verify that EdenFS behave properly when configured to be case
insensitive and case preserving. | 62598f34627d3e7fe0e05f08 |
class BrowserAgent: <NEW_LINE> <INDENT> driver = None <NEW_LINE> def __init__(self, capture_browser: str): <NEW_LINE> <INDENT> self.using = capture_browser <NEW_LINE> self.driver = self._set_browser() <NEW_LINE> <DEDENT> def _set_browser(self): <NEW_LINE> <INDENT> if self.using == "firefox": <NEW_LINE> <INDENT> options... | As a backup solution.
To capture web page via Selenium with webdriver.
The class will allow you to use your browser as the agent to take a screenshot from it. | 62598f34091ae35668703c90 |
class CreateSystematicView(APIView): <NEW_LINE> <INDENT> class body2(serializers.Serializer): <NEW_LINE> <INDENT> title = serializers.CharField() <NEW_LINE> work = serializers.CharField() <NEW_LINE> responsible = serializers.CharField() <NEW_LINE> is_organizer = serializers.BooleanField() <NEW_LINE> is_co_organizer = s... | DELETE | 62598f340a366e3fb87dba5a |
class ListCreateChildMixin(ListChildMixin): <NEW_LINE> <INDENT> def get_serializer(self, *args, **kwargs): <NEW_LINE> <INDENT> if "data" in kwargs: <NEW_LINE> <INDENT> mapping = self._get_parent_mapping() <NEW_LINE> kwargs["data"][mapping.keys()[0]] = mapping[mapping.keys()[0]].uuid <NEW_LINE> <DEDENT> return super(Lis... | This is a base APIView mixin for views that want to both list and create new child objects for
parent objects. | 62598f3426238365f5fabc14 |
class ApplicationGatewaySslPredefinedPolicy(SubResource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str... | An Ssl predefined policy.
:param id: Resource ID.
:type id: str
:param name: Name of the Ssl predefined policy.
:type name: str
:param cipher_suites: Ssl cipher suites to be enabled in the specified order for application
gateway.
:type cipher_suites: list[str or
~azure.mgmt.network.v2020_05_01.models.ApplicationGate... | 62598f340a366e3fb87dba5c |
class _ResetFileHandleServerHandler(SFTPServerHandler): <NEW_LINE> <INDENT> async def recv_packet(self): <NEW_LINE> <INDENT> self._next_handle = 0 <NEW_LINE> return await super().recv_packet() | Reset file handle counter on each request to test handle-in-use check | 62598f34eab8aa0e5d30ae00 |
class ShowDBLoadTestCase(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.testdir = os.path.join(os.path.expanduser('~'), 'showtest1') <NEW_LINE> if os.path.exists(os.path.join(cls.testdir, '.showdb.json')): <NEW_LINE> <INDENT> os.remove(os.path.join(cls.testd... | Test case for loading from a saved ShowDatabase | 62598f34c4546d3d9def6aaa |
class Synonym(AbstractPropertyValue): <NEW_LINE> <INDENT> predmap = dict( label='label', hasExactSynonym='exact', hasBroadSynonym='broad', hasNarrowSynonym='narrow', hasRelatedSynonym='related') <NEW_LINE> def __init__(self, class_id, val=None, pred='hasRelatedSynonym', lextype=None, xrefs=None, ontology=None, confiden... | Represents a synonym using the OBO model | 62598f34091ae35668703c94 |
class DCATdePlugin(p.SingletonPlugin): <NEW_LINE> <INDENT> pass | for now, this class does nothing | 62598f34627d3e7fe0e05f12 |
class ActionCopyTTLOut(ActionHeader): <NEW_LINE> <INDENT> pad = Pad(4) <NEW_LINE> _allowed_types = (ActionType.OFPAT_COPY_TTL_OUT,) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__(action_type=ActionType.OFPAT_COPY_TTL_OUT, length=8) | Action structure for OFPAT_COPY_TTL_OUT. | 62598f34ad47b63b2c5a689c |
class LFUCache: <NEW_LINE> <INDENT> def __init__(self, capacity: int): <NEW_LINE> <INDENT> self.capacity = capacity <NEW_LINE> self.key_node = {} <NEW_LINE> self.freq = {} <NEW_LINE> self.min_freq = 0 <NEW_LINE> <DEDENT> def get(self, key: int) -> int: <NEW_LINE> <INDENT> if key in self.key_node: <NEW_LINE> <INDENT> no... | hash+双向链表 实现 LFU缓存结构,get和put的时间复杂度均为O(1) | 62598f34c4546d3d9def6aad |
class Messages(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'messages' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> uid = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False) <NEW_LINE> phone = db.Column(db.String(40), nullable=False) <NEW_LINE> content = db.Column(db.Text, nullable=... | 메시지 테이블 | 62598f34eab8aa0e5d30ae08 |
class InAppProduct(UUIDModelMixin, ModelBase): <NEW_LINE> <INDENT> active = models.BooleanField(default=True, db_index=True) <NEW_LINE> guid = models.CharField(max_length=255, unique=True, null=True, blank=True) <NEW_LINE> webapp = models.ForeignKey('webapps.WebApp', null=True, blank=True) <NEW_LINE> price = models.For... | An item which is purchasable from within a marketplace app. | 62598f354c34283577619365 |
class LutronSwitch(LutronDevice, SwitchDevice): <NEW_LINE> <INDENT> def __init__(self, area_name, lutron_device, controller): <NEW_LINE> <INDENT> self._prev_state = None <NEW_LINE> super().__init__(area_name, lutron_device, controller) <NEW_LINE> <DEDENT> def turn_on(self, **kwargs): <NEW_LINE> <INDENT> self._lutron_de... | Representation of a Lutron Switch. | 62598f35187af65679d2944e |
class MediaUploadResponseDataMedia(object): <NEW_LINE> <INDENT> swagger_types = { 'media_id': 'str' } <NEW_LINE> attribute_map = { 'media_id': 'media_id' } <NEW_LINE> def __init__(self, media_id=None): <NEW_LINE> <INDENT> self._media_id = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.media_id = media_id <NE... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f35c4546d3d9def6aaf |
class SpannerProjectsInstancesDatabasesGetDdlRequest(_messages.Message): <NEW_LINE> <INDENT> database = _messages.StringField(1, required=True) | A SpannerProjectsInstancesDatabasesGetDdlRequest object.
Fields:
database: Required. The database whose schema we wish to get. | 62598f350a366e3fb87dba68 |
class RecordTypeServer(BaseModel, ResolutionModel): <NEW_LINE> <INDENT> __tablename__ = 'bk_record_type' <NEW_LINE> Id = Column('fi_id', Integer, primary_key=True) <NEW_LINE> RecordType = Column('fs_record_type', String(50)) <NEW_LINE> def toDict(self): <NEW_LINE> <INDENT> return { 'Id': self.Id, 'RecordType': self.Rec... | record type | 62598f35c4546d3d9def6ab0 |
class RulesResultsInput(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'latest_scan': {'key': 'latestScan', 'type': 'bool'}, 'results': {'key': 'results', 'type': '{[[str]]}'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(RulesResultsInput, self).__init__(**kwargs) <NEW_LI... | Rules results input.
:param latest_scan: Take results from latest scan.
:type latest_scan: bool
:param results: Expected results to be inserted into the baseline.
Leave this field empty it LatestScan == true.
:type results: dict[str, list[list[str]]] | 62598f354c34283577619369 |
class StrokeGroup(ColoredGroup): <NEW_LINE> <INDENT> def __init__(self, options, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(options, *args, **kwargs) <NEW_LINE> self.width = options.get("stroke_width", DEFAULT_STROKE_WIDTH) <NEW_LINE> self.color = options.get("stroke", DEFAULT_STROKE) <NEW_LINE> <DEDENT> de... | The stroke group styles points and lines drawn with it | 62598f3526238365f5fabc24 |
class SMIRNOFFAromaticityError(OpenFFToolkitException): <NEW_LINE> <INDENT> pass | Exception thrown when an incompatible SMIRNOFF aromaticity model is checked for compatibility. | 62598f35187af65679d29451 |
class tekDefaultCharacter(baseDefaultCharacter): <NEW_LINE> <INDENT> def basetype_posthook_setup( self ) : <NEW_LINE> <INDENT> super( tekDefaultCharacter, self ).basetype_posthook_setup( ) <NEW_LINE> doObjectName_atCreate( self ) <NEW_LINE> <DEDENT> def at_rename( self, oldname, newname ): <NEW_LINE> <INDENT> super( te... | The Character defaults to reimplementing some of base Object's hook methods with the
following functionality:
at_basetype_setup - always assigns the DefaultCmdSet to this object type
(important!)sets locks so character cannot be picked up
and its commands only be called by itself, not a... | 62598f354c3428357761936b |
class Paginator(object): <NEW_LINE> <INDENT> def __init__(self, results, perpage = 10): <NEW_LINE> <INDENT> self.results = results <NEW_LINE> self.perpage = perpage <NEW_LINE> <DEDENT> def from_to(self, pagenum): <NEW_LINE> <INDENT> lr = len(self.results) <NEW_LINE> perpage = self.perpage <NEW_LINE> lower = (pagenum - ... | Helper class that divides search results into pages, for use in
displaying the results. | 62598f353cc13d1c6d46480a |
class API(object): <NEW_LINE> <INDENT> def __init__(self, client_id, client_secret, access_token=None): <NEW_LINE> <INDENT> self.session = OAuth2Session(client_id=client_id, client_secret=client_secret, access_token=access_token) <NEW_LINE> <DEDENT> @property <NEW_LINE> def access_token(self): <NEW_LINE> <INDENT> retur... | Small and clean class that embrace all basic
operations with the buffer app | 62598f3526238365f5fabc28 |
class TestPeople(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.person = Person('Test Person') <NEW_LINE> self.fellow = Fellow('Test Fellow') <NEW_LINE> self.staff = Staff('Test Staff') <NEW_LINE> <DEDENT> def test_fellow_inherits_person(self): <NEW_LINE> <INDENT> self.assertTrue(issu... | Class to test the people module | 62598f35187af65679d29452 |
class Delegation(SubResource): <NEW_LINE> <INDENT> _validation = { 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'service_name': {'key': 'properties.serviceName', 'type': 'str'... | Details the service to which the subnet is delegated.
Variables are only populated by the server, and will be ignored when sending a request.
:param id: Resource ID.
:type id: str
:param name: The name of the resource that is unique within a subnet. This name can be used to
access the resource.
:type name: str
:para... | 62598f35eab8aa0e5d30ae12 |
class GroupContainer(object): <NEW_LINE> <INDENT> def __init__(self, group_class, weight, name): <NEW_LINE> <INDENT> self.__group_class = group_class <NEW_LINE> self.__weight = weight <NEW_LINE> self.__name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.__name <NEW_LINE>... | Container for group class.
Major task is lazy instantiation for group object. | 62598f354c3428357761936e |
class AdBlockNetwork(QObject): <NEW_LINE> <INDENT> def block(self, request): <NEW_LINE> <INDENT> url = request.url() <NEW_LINE> urlString = bytes(url.toEncoded()).decode() <NEW_LINE> urlDomain = url.host() <NEW_LINE> urlScheme = url.scheme() <NEW_LINE> refererHost = QUrl.fromEncoded(request.rawHeader("Referer")).host()... | Class implementing a network block. | 62598f353cc13d1c6d46480e |
class MOVED_SRC(EVENT): <NEW_LINE> <INDENT> def __init__(self,fs,path,destination=None): <NEW_LINE> <INDENT> super(MOVED_SRC,self).__init__(fs,path) <NEW_LINE> if destination is not None: <NEW_LINE> <INDENT> destination = abspath(normpath(destination)) <NEW_LINE> <DEDENT> self.destination = destination <NEW_LINE> <DEDE... | Event fired when a file or directory is the source of a move. | 62598f3526238365f5fabc2c |
class Shot(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, position, facing): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.life = 60 <NEW_LINE> self.state = "still" <NEW_LINE> self.image, self.rect = load_png('bullet.png') <NEW_LINE> screen = pygame.display.get_surface() <NEW_LI... | This is the bullet from the hero | 62598f35eab8aa0e5d30ae16 |
class AQError(Error): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.message = "Automated Queries Check Detected." | Exception raised for auto-query detection.
Attributes:
message -- explanation of the error (non-solvable). | 62598f35ad47b63b2c5a68ae |
class Present(Validator): <NEW_LINE> <INDENT> missing = N_(u'%(label)s may not be blank.') <NEW_LINE> def validate(self, element, state): <NEW_LINE> <INDENT> if element.u == u'': <NEW_LINE> <INDENT> return self.note_error(element, state, 'missing') <NEW_LINE> <DEDENT> return True | Validates that a value is present.
**Messages**
.. attribute:: missing
Emitted if the :attr:`~flatland.schema.base.Element.u` string
value of the element is empty, as in the case for an HTML form
submitted with an input box left blank. | 62598f3526238365f5fabc32 |
class SELU(object): <NEW_LINE> <INDENT> def __init__(self, scale=1, scale_neg=1): <NEW_LINE> <INDENT> self.scale = scale <NEW_LINE> self.scale_neg = scale_neg <NEW_LINE> <DEDENT> def __call__(self, x): <NEW_LINE> <INDENT> return self.scale * tensor.switch( x > 0.0, x, self.scale_neg * (tensor.expm1(x))) | Scaled Exponential Linear Unit
:math:`\varphi(x)=\lambda \left[(x>0) ? x : \alpha(e^x-1)\right]`
The Scaled Exponential Linear Unit (SELU) was introduced in [1]_
as an activation function that allows the construction of
self-normalizing neural networks.
Parameters
----------
scale : float32
The scale parameter :m... | 62598f3515fb5d323ce7ddcc |
class UnitBornEvent(TrackerEvent): <NEW_LINE> <INDENT> def __init__(self, frames, data, build): <NEW_LINE> <INDENT> super(UnitBornEvent, self).__init__(frames) <NEW_LINE> self.unit_id_index = data[0] <NEW_LINE> self.unit_id_recycle = data[1] <NEW_LINE> self.unit_id = self.unit_id_index << 18 | self.unit_id_recycle <NEW... | Generated when a unit is created in a finished state in the game. Examples include the Marine,
Zergling, and Zealot (when trained from a gateway). Units that enter the game unfinished (all
buildings, warped in units) generate a :class:`UnitInitEvent` instead.
Unfortunately, units that are born do not have events marki... | 62598f353cc13d1c6d464816 |
class TestIn718(unittest.TestCase): <NEW_LINE> <INDENT> def test_load(self): <NEW_LINE> <INDENT> in718_bar = load('In718', 'bar', 'solution treated and aged') <NEW_LINE> in718_am_renishaw = load('In718', 'additive, Renishaw', 'solution treated and aged') <NEW_LINE> in718_am_eos = load('In718', 'additive, EOS', 'solutio... | Unit tests for In718. | 62598f35627d3e7fe0e05f2e |
class Message(object): <NEW_LINE> <INDENT> channel = None <NEW_LINE> text = None <NEW_LINE> timestamp = None <NEW_LINE> user = None <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> bot_ref = kwargs.get('bot_ref', '') <NEW_LINE> self.channel = kwargs.get('channel') <NEW_LINE> self.text = kwargs.get('text')[l... | Message Class | 62598f350a366e3fb87dba7c |
@StreamAlertApp <NEW_LINE> class GSuiteTokenReports(GSuiteReportsApp): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _type(cls): <NEW_LINE> <INDENT> return 'token' | G Suite Token Activity Report app integration | 62598f3515fb5d323ce7ddd0 |
class OpenNebula_3_0_NodeDriver(OpenNebula_2_0_NodeDriver): <NEW_LINE> <INDENT> def ex_node_set_save_name(self, node, name): <NEW_LINE> <INDENT> compute_node_id = str(node.id) <NEW_LINE> compute = ET.Element('COMPUTE') <NEW_LINE> compute_id = ET.SubElement(compute, 'ID') <NEW_LINE> compute_id.text = compute_node_id <NE... | OpenNebula.org node driver for OpenNebula.org v3.0. | 62598f354c3428357761937d |
class Deck(list): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> suits = [0, 1, 2, 3] <NEW_LINE> for j in suits: <NEW_LINE> <INDENT> suit = suits[j] <NEW_LINE> for i in range(1,14): <NEW_LINE> <INDENT> rank = i <NEW_LINE> card... | This class represents a Deck of Cards.
It inherits from list - it is a list
Cards are added at the end of the list: Use append
Cards are dealt from the end of the list: Use pop() | 62598f353cc13d1c6d46481b |
class ListBuilder: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def build_list(data, collection, year=None, sort=False): <NEW_LINE> <INDENT> if data == "volume": <NEW_LINE> <INDENT> volume_list = [] <NEW_LINE> results = Db.Query().query(collection) <NEW_LINE> for item in results: <NEW_LINE> <INDENT> volume_list.append(... | Queries the database and generates a list containing the user specified data | 62598f350a366e3fb87dba80 |
class MeshParser(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> @abc.abstractmethod <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.edges = None <NEW_LINE> self.elements = None <NEW_LINE> self.nodes = None <NEW_LINE> return <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def _parse_secti... | Properties
----------
* elements : Array listing the node numbers of every element; for
example,
print(t.elements)
=> [[1 9 4 10 11 8]
[1 2 9 5 12 10]
[2 3 9 6 13 12]
[3 4 9 7 11 13]]
for a quadratic mesh with four elements.
* nodes : Array of every node's ... | 62598f35187af65679d2945b |
class INonStructuralFolder(Interface): <NEW_LINE> <INDENT> pass | Marker for folderish content types that are folderish as an
implementation detail only.
By declaring support for this interface, a content type will not be
considered folderish by the catalog's is_folderish index/metadata, meaning
that it will not be treated as folderish by the navigation tree, portal tab
generation a... | 62598f3515fb5d323ce7ddd6 |
class Edge: <NEW_LINE> <INDENT> def __init__(self, lane_0_id, lane_1_id): <NEW_LINE> <INDENT> self.lane_0_id = lane_0_id <NEW_LINE> self.lane_1_id = lane_1_id <NEW_LINE> self.update() <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> self.lane_0_status = self.get_lane_status(self.lane_0_id) <NEW_LINE> self.lane... | Class Edge is an edge has one direction, two lanes | 62598f354c34283577619381 |
class LighttpdCGIRootFix(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> if 'SERVER_SOFTWARE' not in environ or environ['SERVER_SOFTWARE'] < 'lighttpd/1.4.28': <NEW_LINE> <INDENT> envi... | Wrap the application in this middleware if you are using lighttpd
with FastCGI or CGI and the application is mounted on the URL root.
:param app: the WSGI application | 62598f3526238365f5fabc3e |
class BatchGradientDescent(Regressor): <NEW_LINE> <INDENT> def __init__(self, parameters = {}): <NEW_LINE> <INDENT> self.params = {'regwgt': 0.5} <NEW_LINE> self.reset(parameters) <NEW_LINE> self.length = 0 <NEW_LINE> self.numberofRuns = 0 <NEW_LINE> self.errMSE = {} <NEW_LINE> self.errMSE = np.zeros(1001) <NEW_LINE> <... | Batch Gradient Descent
Implement according to pseudo code in notes | 62598f35ad47b63b2c5a68c0 |
class _AllCompletedWaiter(_Waiter): <NEW_LINE> <INDENT> def __init__(self, num_pending_calls, stop_on_exception): <NEW_LINE> <INDENT> self.num_pending_calls = num_pending_calls <NEW_LINE> self.stop_on_exception = stop_on_exception <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> super(_AllCompletedWaiter, self).__ini... | Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED). | 62598f36c4546d3d9def6abe |
class MemLog: <NEW_LINE> <INDENT> def __init__(self, lid, level, msg): <NEW_LINE> <INDENT> self.timestamp = time.time() <NEW_LINE> self.lid = lid <NEW_LINE> self.level = level <NEW_LINE> self.msg = msg <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def create_ml(param_list): <NEW_LINE> <INDENT> assert(type(param_list) ==... | This represents one memory log message.
It contains some deep information about the file and line number.
Also it contains a unique log message. | 62598f360a366e3fb87dba86 |
class ApplicationStyler: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__logger = logging.getLogger(__file__) <NEW_LINE> self.__logger.setLevel(logging.INFO) <NEW_LINE> app = QGuiApplication.instance() <NEW_LINE> QApplication.setStyle("Fusion") <NEW_LINE> p = QApplication.palette() <NEW_LINE> raisinB... | :class:`~nodedge.application_styler.ApplicationStyler` class . | 62598f36eab8aa0e5d30ae2a |
class Transcript(models.Model): <NEW_LINE> <INDENT> name = models.CharField(verbose_name='副本名', max_length=10, null=False) <NEW_LINE> introduction = models.CharField(verbose_name='副本介绍', max_length=200, null=False) <NEW_LINE> start_time = models.DateTimeField(verbose_name='副本开始时间') <NEW_LINE> end_time = models.DateTime... | 副本表 | 62598f36c4546d3d9def6ac0 |
class RECINTERMODRQ(Aggregate): <NEW_LINE> <INDENT> recsrvrtid = String(10, required=True) <NEW_LINE> recurrinst = SubAggregate(RECURRINST, required=True) <NEW_LINE> interrq = SubAggregate(INTERRQ, required=True) <NEW_LINE> modpending = Bool(required=True) | OFX section 11.10.5.1 | 62598f36091ae35668703cc1 |
class ReadLine(object): <NEW_LINE> <INDENT> def __init__(self, file_path, mode='r'): <NEW_LINE> <INDENT> self.fd = open(file_path, mode) <NEW_LINE> return <NEW_LINE> <DEDENT> def readline(self): <NEW_LINE> <INDENT> return self.fd.readline() <NEW_LINE> <DEDENT> def read(self, size=-1): <NEW_LINE> <INDENT> return self.fd... | A class for reading a file line by line | 62598f3615fb5d323ce7ddde |
class PlaceholderHub: <NEW_LINE> <INDENT> def __init__(self, host): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> <DEDENT> async def authenticate(self, username, password) -> bool: <NEW_LINE> <INDENT> return True | Placeholder class to make tests pass.
TODO Remove this placeholder class and replace with things from your PyPI package. | 62598f364c34283577619389 |
class RandomStreams(raw_random.RandomStreamsBase): <NEW_LINE> <INDENT> def updates(self): <NEW_LINE> <INDENT> return list(self.state_updates) <NEW_LINE> <DEDENT> def __init__(self, seed=None): <NEW_LINE> <INDENT> super(RandomStreams, self).__init__() <NEW_LINE> self.state_updates = [] <NEW_LINE> self.default_instance_s... | Module component with similar interface to numpy.random
(numpy.random.RandomState)
Parameters
----------
seed: None or int
A default seed to initialize the RandomState
instances after build. See `RandomStreamsInstance.__init__`
for more details. | 62598f36ad47b63b2c5a68c8 |
class Robotiq(object): <NEW_LINE> <INDENT> def __init__(self, namespace=''): <NEW_LINE> <INDENT> self.ns = solve_namespace(namespace) <NEW_LINE> action_server = self.ns + 'gripper/gripper_action_controller' <NEW_LINE> self._client = actionlib.SimpleActionClient(action_server, CModelCommandAction) <NEW_LINE> self._goal ... | Interface class to control the Robotiq gripper using ROS action client.
It connects to the C{gripper/gripper_action_controller} action server. | 62598f36187af65679d29461 |
class UserProfileManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, name, password=None): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('User must have an email address') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email, na... | Manager for user profiles | 62598f36eab8aa0e5d30ae30 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.