code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Client(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.http_client = http.HTTPClient(*args, **kwargs) <NEW_LINE> self.chassis = chassis.ChassisManager(self.http_client) <NEW_LINE> self.node = node.NodeManager(self.http_client) <NEW_LINE> self.port = port.PortManager(self... | Client for the Ironic v1 API.
:param string endpoint: A user-supplied endpoint URL for the ironic
service.
:param function token: Provides token for authentication.
:param integer timeout: Allows customization of the timeout for client
http requests. (optional) | 62598faecc0a2c111447b009 |
class WrapAbsZeroScaled0p9LinearFewShotFetchEnv(WrapAbsScaled0p9LinearBasicFewShotFetchEnv): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> return super().reset(task_params={'goal_color_center': np.zeros(3)}, obs_task_params=np.zer... | This is a debug env, do not use! | 62598fae44b2445a339b696c |
class FireWallRule: <NEW_LINE> <INDENT> def __init__(self, items): <NEW_LINE> <INDENT> self.__dict__.update(items) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def create(cls, api_client, ipaddressid=None, protocol=None, cidrlist=None, startport=None, endport=None, projectid=None, vpcid=None, data=None, ipaddress=None):... | Manage Firewall rule | 62598fae23849d37ff8510ab |
class HomeView(BaseView): <NEW_LINE> <INDENT> def index(self, request, template='home/index2.html'): <NEW_LINE> <INDENT> return render(request, template) | 主页试图类 | 62598fae21bff66bcd722c5f |
class PrivateTagsAPITests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = get_user_model().objects.create_user( 'test@test.com', 'password123' ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_tags(self): <NE... | Test the authorized user API | 62598faebe8e80087fbbf05c |
class GetData: <NEW_LINE> <INDENT> def __init__(self, nic): <NEW_LINE> <INDENT> self.nic = nic <NEW_LINE> <DEDENT> def netBytes(self): <NEW_LINE> <INDENT> with open('/proc/net/dev') as fh: <NEW_LINE> <INDENT> net_data = fh.read().split() <NEW_LINE> <DEDENT> interface_index = net_data.index(self.nic + ':') <NEW_LINE> re... | Get system status. | 62598faecb5e8a47e493c175 |
class Boundaries(np.ndarray): <NEW_LINE> <INDENT> def __new__(cls, minimums, maximums, type=np.int): <NEW_LINE> <INDENT> len_minimums = len(minimums) <NEW_LINE> if len_minimums != len(maximums): <NEW_LINE> <INDENT> raise ValueError('Length of minimums and maximums are unequal') <NEW_LINE> <DEDENT> err_indexes = [] <NEW... | Represent the limit of the space for the attribute of a solution.
A boundaries records the minimum and maximum values that a solution
can take for each of its attribute.
These values may be of any numeric type (int or float).
Boundaries can also be used to normalize a solution vector, so that
distance computation is ... | 62598fae627d3e7fe0e06ea6 |
class MinihubLocation(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'minihub_type': 'str', 'channel': 'int', 'controller_slot': 'int', 'tray': 'int' } <NEW_LINE> self.attribute_map = { 'minihub_type': 'minihubType', 'channel': 'channel', 'controller_slot': 'controllerSlot',... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598faea17c0f6771d5c22e |
class RigidConstraint(Constraint): <NEW_LINE> <INDENT> def __init__(self, rejectProbability): <NEW_LINE> <INDENT> super(RigidConstraint, self).__init__() <NEW_LINE> self.set_reject_probability(rejectProbability) <NEW_LINE> FRAME_DATA = [d for d in self.FRAME_DATA] <NEW_LINE> FRAME_DATA.extend(['_RigidConstraint__reject... | A rigid constraint is a constraint that doesn't count into the total
standard error of the stochastic Engine. But it's internal standard error
must monotonously decrease or remain the same from one engine step to
another. If standard error of an rigid constraint increases the
step will be rejected even before engine's ... | 62598fae01c39578d7f12d77 |
class CBORDecodeError(Exception): <NEW_LINE> <INDENT> pass | Raised when an error occurs deserializing a CBOR datastream. | 62598fae56ac1b37e63021e4 |
class Exit(Basic): <NEW_LINE> <INDENT> pass | Basic class for exists. | 62598fae3539df3088ecc2ab |
class PageObject(SafeSelenium): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, ui, browser): <NEW_LINE> <INDENT> super(PageObject, self).__init__(browser) <NEW_LINE> self._ui = ui <NEW_LINE> <DEDENT> @property <NEW_LINE> def ui(self): <NEW_LINE> <INDENT> return self._ui <NEW_LINE> <DEDENT> @a... | Encapsulates user interactions with a specific part
of a web application.
Usually, you will rely on `WebAppInterface`
to instantiate the page object and won't
need to call this method directly.
The most important thing is this:
Page objects encapsulate Selenium.
If you find yourself writing CSS selectors in tests,
m... | 62598faeadb09d7d5dc0a583 |
class TestPhotoEditsURL(TestBaseClass): <NEW_LINE> <INDENT> def test_authenticated_get(self): <NEW_LINE> <INDENT> url = reverse('edit-list') <NEW_LINE> self.login_user() <NEW_LINE> response = self.client.get(url) <NEW_LINE> self.assertEqual(200, response.status_code) <NEW_LINE> self.assertEqual('OK', response.status_te... | Test the '/api/edit/' Django route.
| 62598fae66673b3332c303c5 |
class LrsStyle(LrsObject, LrsAttributes, LrsContainer): <NEW_LINE> <INDENT> def __init__(self, elementName, defaults=None, alsoAllow=None, **overrides): <NEW_LINE> <INDENT> if defaults is None: <NEW_LINE> <INDENT> defaults = {} <NEW_LINE> <DEDENT> LrsObject.__init__(self) <NEW_LINE> LrsAttributes.__init__(self, default... | A mixin class for styles. | 62598faea8370b77170f03d5 |
class JobRelationshipProperties(Model): <NEW_LINE> <INDENT> _validation = { 'pipeline_name': {'max_length': 260}, 'recurrence_id': {'required': True}, 'recurrence_name': {'max_length': 260}, } <NEW_LINE> _attribute_map = { 'pipeline_id': {'key': 'pipelineId', 'type': 'str'}, 'pipeline_name': {'key': 'pipelineName', 'ty... | Job relationship information properties including pipeline information,
correlation information, etc.
:param pipeline_id: the job relationship pipeline identifier (a GUID).
:type pipeline_id: str
:param pipeline_name: the friendly name of the job relationship pipeline,
which does not need to be unique.
:type pipeline... | 62598faee76e3b2f99fd8a30 |
class Comment(models.Model): <NEW_LINE> <INDENT> post = models.ForeignKey(Blog, on_delete=models.CASCADE) <NEW_LINE> author = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> content = models.CharField(max_length=200) <NEW_LINE> date = models.DateTimeField(default=timezone.now()) <NEW_LINE> like = models.In... | Comment for all blog in DEK-COM site. | 62598fae5fdd1c0f98e5df85 |
class HSDescContentEvent(Event): <NEW_LINE> <INDENT> _VERSION_ADDED = stem.version.Requirement.EVENT_HS_DESC_CONTENT <NEW_LINE> _POSITIONAL_ARGS = ('address', 'descriptor_id', 'directory') <NEW_LINE> def _parse(self): <NEW_LINE> <INDENT> if self.address == 'UNKNOWN': <NEW_LINE> <INDENT> self.address = None <NEW_LINE> <... | Provides the content of hidden service descriptors we fetch.
The HS_DESC_CONTENT event was introduced in tor version 0.2.7.1-alpha.
.. versionadded:: 1.4.0
:var str address: hidden service address
:var str descriptor_id: descriptor identifier
:var str directory: hidden service directory servicing the request
:var st... | 62598fae2ae34c7f260ab0db |
class SimpleModelFactory(ModelFactory): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SimpleModelFactory, self).__init__() <NEW_LINE> self.state_factory = State <NEW_LINE> self.route_factory = Route <NEW_LINE> <DEDENT> def create_model(self, parameter_set): <NEW_LINE> <INDENT> self.parameter_set = p... | This factory class creates a simple two-state aggregated
kinetic model. | 62598fae30bbd72246469975 |
class CmdDecrire(Commande): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Commande.__init__(self, "décrire", "describe") <NEW_LINE> self.groupe = "joueur" <NEW_LINE> self.aide_courte = "Ouvre un éditeur pour se décrire." <NEW_LINE> self.aide_longue = "Cette commande permet de manipuler votre de... | Commande 'decrire'.
| 62598faef548e778e596b59d |
@registry.register_audio_modality <NEW_LINE> class SpeechRecognitionModality(modality.Modality): <NEW_LINE> <INDENT> def bottom(self, x): <NEW_LINE> <INDENT> inputs = x <NEW_LINE> p = self._model_hparams <NEW_LINE> num_mel_bins = p.audio_num_mel_bins <NEW_LINE> num_channels = 3 if p.audio_add_delta_deltas else 1 <NEW_L... | Common ASR filterbank processing. | 62598fae44b2445a339b696d |
class OSCall( object, ): <NEW_LINE> <INDENT> def __init__(self, command_list, ): <NEW_LINE> <INDENT> self.command_list = [] <NEW_LINE> self.add_command( command_list ) <NEW_LINE> <DEDENT> def add_command( self, more_command_list ): <NEW_LINE> <INDENT> if more_command_list is None: <NEW_LINE> <INDENT> self.command_list ... | try to call os based on attempts with different utilities
in different operating systems
idea is that a os utility will be used to open a file ( or url, or other argument ) | 62598fae4a966d76dd5eeed0 |
class Fleet(object): <NEW_LINE> <INDENT> def __init__(self, frigates=0, destroyers=0, cruisers=0, battleships=0, dreadnoughts=0, superdreadnoughts=0): <NEW_LINE> <INDENT> global ships <NEW_LINE> self.ships = [] <NEW_LINE> self.ships.append((ships['Frigate'], frigates)) <NEW_LINE> self.ships.append((ships['Destroyer'], ... | Represents a fleet of ships | 62598faecc0a2c111447b00b |
class TestHaversine(TestCase): <NEW_LINE> <INDENT> def assertCloseEnough(self, distance_actual, distance_received, threshold=0.003048): <NEW_LINE> <INDENT> self.assertLessEqual( abs(distance_actual - distance_received), threshold) <NEW_LINE> <DEDENT> def evaluate_inputs(self, input_output_list): <NEW_LINE> <INDENT> for... | Tests the haversine code correctness. | 62598faea8370b77170f03d6 |
class LaCrosseSensor(Entity): <NEW_LINE> <INDENT> _temperature = None <NEW_LINE> _humidity = None <NEW_LINE> _low_battery = None <NEW_LINE> _new_battery = None <NEW_LINE> def __init__(self, hass, lacrosse, device_id, name, expire_after, config): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.entity_id = async_gen... | Implementation of a Lacrosse sensor. | 62598faed268445f26639b80 |
class ShiftLogFormatterMathtext(LogFormatter): <NEW_LINE> <INDENT> def __init__(self, base, sign, zero): <NEW_LINE> <INDENT> LogFormatter.__init__ (self, base) <NEW_LINE> self.sign = sign <NEW_LINE> self.zero = zero <NEW_LINE> <DEDENT> def get_offset (self): <NEW_LINE> <INDENT> usetex = rcParams['text.usetex'] <NEW_LIN... | Format values for log axis; using ``exponent = log_base(value)`` | 62598fae009cb60464d0151a |
@base.vectorize <NEW_LINE> class subs(base.SubBase): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> code = base.opcodes['SUBS'] <NEW_LINE> arg_format = ['sw', 's', 's'] | Secret subtraction s_i=s_j-s_k.
This instruction is vectorizable | 62598faee5267d203ee6b903 |
class HapBlePduResponseHeader(HapBlePduHeader): <NEW_LINE> <INDENT> def __init__(self, status_code: int, transaction_id: int, continuation: bool=False, response: bool=True) -> None: <NEW_LINE> <INDENT> super(HapBlePduResponseHeader, self).__init__( response=response, continuation=continuation) <NEW_LINE> self.transacti... | HAP-BLE PDU Response Header.
Parameters
----------
continuation
indicates the fragmentation status of the HAP-BLE PDU. False
indicates a first fragment or no fragmentation.
response
indicates whether the PDU is a response (versus a request)
transaction_id
Transaction Identifier
status_code
HAP S... | 62598faeac7a0e7691f72503 |
class FeaturedSpeakersForm(messages.Message): <NEW_LINE> <INDENT> speaker = messages.StringField(1, required=True) <NEW_LINE> sessionNames = messages.StringField(2, repeated=True) | FeaturedSpeakersForm::=
speaker
sessions | 62598fae6e29344779b00656 |
class Computer(abstract.ResourceDefinition): <NEW_LINE> <INDENT> name = "Computer" <NEW_LINE> @classmethod <NEW_LINE> def loadAllVersions(cls, registry): <NEW_LINE> <INDENT> registry.add_version(cls, ComputerVersion0, ComputerVersion0.versions) <NEW_LINE> registry.add_version(cls, ComputerVersion1, ComputerVersion1.ver... | The ComputerResource. | 62598fae4f6381625f1994bc |
class DouyinProxyValidator(BaseProxyValidator): <NEW_LINE> <INDENT> items = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__(timeout=5) <NEW_LINE> self.pipeline = DouyinPostgreSQLPipeline() <NEW_LINE> self.pipeline.open_spider(None) <NEW_LINE> <DEDENT> def validate(self, proxy): <NEW_LINE> <INDENT... | 抖音代理校验 | 62598fae5fc7496912d4827e |
class LjbUpdater(Updater): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Updater.__init__(self) <NEW_LINE> self.folder_url = cbv_const.LJB_FOLDER_URL <NEW_LINE> self.files_pattern = cbv_const.LJB_FILES_PATTERN <NEW_LINE> self.version_pattern = cbv_const.LJB_VERSION_PATTERN <NEW_LINE> self.local_... | to check if local LJB DB is up-to-date | 62598fae66673b3332c303c7 |
class JSONEncodedDict(TypeDecorator): <NEW_LINE> <INDENT> impl = VARCHAR <NEW_LINE> def process_bind_param(self, value, dialect): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> value = json.dumps(value) <NEW_LINE> <DEDENT> return value <NEW_LINE> <DEDENT> def process_result_value(self, value, dialect): <... | Represents an immutable structure as a json-encoded string.
Usage::
JSONEncodedDict(255) | 62598fae4e4d562566372421 |
class TestDegenerateEntries(ScreenshotTest): <NEW_LINE> <INDENT> def sgvs(self): <NEW_LINE> <INDENT> s = default_entries('DoubleDown') <NEW_LINE> for i in range(6, 12): <NEW_LINE> <INDENT> del s[i]['sgv'] <NEW_LINE> <DEDENT> s[0]['trend'] = s[0]['direction'] = None <NEW_LINE> return s | Test that "bad" SGV entries don't cause the watchface to crash. | 62598fae99cbb53fe6830ed3 |
class GoodsSKUIndex(indexes.SearchIndex, indexes.Indexable): <NEW_LINE> <INDENT> text = indexes.CharField(document=True, use_template=True) <NEW_LINE> def get_model(self): <NEW_LINE> <INDENT> return GoodsSKU <NEW_LINE> <DEDENT> def index_queryset(self, using=None): <NEW_LINE> <INDENT> return self.get_model().objects.fi... | 建立索引时被使用的类 | 62598fae7cff6e4e811b5a28 |
class ThrowerAnt(Ant): <NEW_LINE> <INDENT> name = 'Thrower' <NEW_LINE> implemented = True <NEW_LINE> damage = 1 <NEW_LINE> food_cost = 3 <NEW_LINE> min_range = 0 <NEW_LINE> max_range = float('inf') <NEW_LINE> def nearest_bee(self, beehive): <NEW_LINE> <INDENT> location = self.place <NEW_LINE> attcak = 0 <NEW_LINE> whil... | ThrowerAnt throws a leaf each turn at the nearest Bee in its range. | 62598fae8e7ae83300ee909d |
class DeviceUtils: <NEW_LINE> <INDENT> FREQ = 62 <NEW_LINE> local_buffer = asyncio.Queue() <NEW_LINE> def get_device_data(self): <NEW_LINE> <INDENT> return next(DataGen.get_message()) <NEW_LINE> <DEDENT> async def push_data_to_buffer(self): <NEW_LINE> <INDENT> freq = self.FREQ <NEW_LINE> while True: <NEW_LINE> <INDENT>... | Collection of utils to access messages from device | 62598fae9c8ee8231304016f |
class App(base.BaseApp): <NEW_LINE> <INDENT> def set_current(self): <NEW_LINE> <INDENT> _tls.current_app = self <NEW_LINE> <DEDENT> def on_init(self): <NEW_LINE> <INDENT> if self.set_as_current: <NEW_LINE> <INDENT> self.set_current() <NEW_LINE> <DEDENT> <DEDENT> def create_task_cls(self): <NEW_LINE> <INDENT> from celer... | Celery Application.
:keyword loader: The loader class, or the name of the loader class to use.
Default is :class:`celery.loaders.app.AppLoader`.
:keyword backend: The result store backend class, or the name of the
backend class to use. Default is the value of the
:s... | 62598fae4428ac0f6e658520 |
class UserTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> APP = create_app(config_name="testing") <NEW_LINE> APP.testing = True <NEW_LINE> self.app = APP.test_client() <NEW_LINE> create_tables() <NEW_LINE> super_user() <NEW_LINE> self.test_user = test_user <NEW_LINE> payload = { "u... | Class for Users testcase | 62598fae30bbd72246469976 |
class UserProfileSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user = UserSerializer() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = UserProfile <NEW_LINE> fields = '__all__' <NEW_LINE> read_only_fields = ('suspended_until', 'last_suspension') <NEW_LINE> <DEDENT> def validate_user(self, value): <NEW... | Serializer class used to validate a custom User object that has a `OneToOne` relatioship with
the default Django user.
Creates and updates a `UserProfile` and Django `User` object | 62598fae5fcc89381b26614a |
class EpochSaver(CallbackAny2Vec): <NEW_LINE> <INDENT> def __init__(self, path_prefix): <NEW_LINE> <INDENT> self.path_prefix = path_prefix <NEW_LINE> self.epoch = 0 <NEW_LINE> os.makedirs(self.path_prefix, exist_ok=True) <NEW_LINE> <DEDENT> def on_epoch_end(self, model): <NEW_LINE> <INDENT> savepath = get_tmpfile( '{}_... | Callback to save model after each epoch. | 62598fae16aa5153ce4004fe |
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.height = height <NEW_LINE> self.width = width <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT> return self.__width <NEW_LINE> <DEDENT> @width.setter <NEW_LINE> def width(self, value): <NEW_L... | Represents a Rectangle | 62598faea05bb46b3848a867 |
class StatsContainer(command.ShowOne): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + ".StatsContainer") <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(StatsContainer, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'container', metavar='<container>', help='ID or name... | Display stats of the container. | 62598faedd821e528d6d8f31 |
class PickleSerialiser(Serialiser): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def serialise(data): <NEW_LINE> <INDENT> serialised = pickle.dumps(data) <NEW_LINE> return serialised <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def deserialise(serialised, dataContainer): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> dat... | PickleSerialiser, Pickle implementation of Serialiser | 62598fae44b2445a339b696e |
class Node(object): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> for n in self.getChildNodes(): <NEW_LINE> <INDENT> yield n <NEW_LINE> <DEDENT> <DEDENT> def getChildren(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getChildNodes(self): <NEW_LINE> <INDENT> return () <NEW_LINE> <DEDENT> def __rep... | Abstract base class for ast nodes. | 62598fae38b623060ffa9096 |
class Engine(object): <NEW_LINE> <INDENT> def __init__(self, left, right): <NEW_LINE> <INDENT> leftState = StateDriver([]) <NEW_LINE> rightState = StateDriver([]) <NEW_LINE> self.left = StateController(left, leftState, rightState) <NEW_LINE> self.right = StateController(right, rightState, leftState) <NEW_LINE> <DEDENT>... | The engine. | 62598fae4f6381625f1994bd |
class PluginMetaFilter(FilterSet): <NEW_LINE> <INDENT> min_creation_date = django_filters.IsoDateTimeFilter(field_name='creation_date', lookup_expr='gte') <NEW_LINE> max_creation_date = django_filters.IsoDateTimeFilter(field_name='creation_date', lookup_expr='lte') <NEW_LINE> name = django_filters.CharFilter(field_name... | Filter class for the PluginMeta model. | 62598fae0c0af96317c5637f |
class BaseAuth(RequestsAuth): <NEW_LINE> <INDENT> site = None <NEW_LINE> def __init__(self, username, password=None, login_url=None): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.password = password <NEW_LINE> self.login_url = login_url <NEW_LINE> self.cookie = None <NEW_LINE> self.digest = None <NEW_LI... | A base interface that all SharePy auth classes should inherit from | 62598fae63d6d428bbee27a8 |
class TemplateLookup(pyramid_mako.PkgResourceTemplateLookup): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if not 'cache_args' in kwargs: <NEW_LINE> <INDENT> cache_args = {} <NEW_LINE> prefix = 'mako.cache_args.' <NEW_LINE> for key in settings.keys(): <NEW_LINE> <INDENT> if key.startswit... | Sets ``cache_args`` if not passed into the lookup constructor. | 62598fae76e4537e8c3ef5aa |
class myLog: <NEW_LINE> <INDENT> log = None <NEW_LINE> mutex = threading.Lock() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def getLog(): <NEW_LINE> <INDENT> if myLog.log == None: <NEW_LINE> <INDENT> myLog.mutex.acquire() <NEW_LINE> myLog.log = Log() <NEW_LINE> m... | This class is used to get log | 62598fae44b2445a339b696f |
class UserStorage(object): <NEW_LINE> <INDENT> def get_users(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def add_user(self, name, token, roles=''): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def remove_user(self, name, token): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def update_user(self, name, key, value... | Manage user information storage. | 62598fae56b00c62f0fb28b3 |
class GOLEvolutionModel: <NEW_LINE> <INDENT> def evolve(self, cellState, neighbourCount): <NEW_LINE> <INDENT> if cellState == CellularGrid.ALIVE and neighbourCount < 2: <NEW_LINE> <INDENT> return CellularGrid.DEAD <NEW_LINE> <DEDENT> elif cellState == CellularGrid.ALIVE and (neighbourCount == 2 or neighbourCount == 3):... | Describes the evolution rules of the cellular grid. | 62598fae1f5feb6acb162c1c |
class BytesWarning(Warning): <NEW_LINE> <INDENT> pass | BytesWarning. | 62598faed268445f26639b82 |
class AddUnlockAction(UpgradeStep): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> self.install_upgrade_profile() | Add unlock action.
| 62598fae30dc7b766599f84a |
class NeutronClient(OpenStackBaseClient): <NEW_LINE> <INDENT> VERSION = '2.3.4' <NEW_LINE> Exceptions = neutron_exceptions <NEW_LINE> class Router(OpenStackResourceList): <NEW_LINE> <INDENT> def create(self, body): <NEW_LINE> <INDENT> return super(NeutronClient.Router, self).create(body['name'], body) <NEW_LINE> <DEDEN... | Dummy OpenStack networking service | 62598faedd821e528d6d8f33 |
class Sector(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = 'admin' <NEW_LINE> index_together = [["name"]] <NEW_LINE> <DEDENT> name = models.CharField( max_length=9, default=None, unique=True, db_index=True, ) <NEW_LINE> create_date = models.DateTimeField(auto_now_add=True) <NEW_LINE> wr... | Sector/Industry model | 62598faebd1bec0571e150c2 |
class LoanBooksByUserListView(LoginRequiredMixin,generic.ListView): <NEW_LINE> <INDENT> model = BookInstance <NEW_LINE> template_name = 'catalog/bookinstance_list_borrowed_user.html' <NEW_LINE> paginate_by = 10 <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return BookInstance.objects.filter(borrower=self.reque... | Generic class-based view listing books on loan to current user. | 62598faee1aae11d1e7ce822 |
class Menu(Item): <NEW_LINE> <INDENT> @types(title=Unicode, items=ListOf(Item), meta=Meta) <NEW_LINE> def __init__(self, title, items, meta=Meta()): <NEW_LINE> <INDENT> Item.__init__(self, ('title', title), ('items', items), ('meta', meta)) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> @types(Item, data=dict, meta=Meta)... | Menu is built from an one-element dict having title string as key and item list element as value | 62598faea05bb46b3848a869 |
class Admin: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.voice_states = {} <NEW_LINE> <DEDENT> @commands.command(hidden=True) <NEW_LINE> async def quitbot(self, Password : str): <NEW_LINE> <INDENT> Configured = False <NEW_LINE> try: <NEW_LINE> <INDENT> File = open("Pa... | Bot adminstration commands.
Works in multiple servers at once. | 62598fae57b8e32f5250811a |
class ElementHasAttribute(object): <NEW_LINE> <INDENT> def __init__(self, locator, attribute_name, attribute_value): <NEW_LINE> <INDENT> self.locator = locator <NEW_LINE> self.attribute_name = attribute_name <NEW_LINE> self.attribute_value = attribute_value <NEW_LINE> <DEDENT> def __call__(self, driver): <NEW_LINE> <IN... | An expectation for checking that an element has a particular attribute.
returns the WebElement once it has the particular attribute | 62598fae85dfad0860cbfa72 |
class FakeHash(object): <NEW_LINE> <INDENT> def __init__(self, h): <NEW_LINE> <INDENT> self.h = h <NEW_LINE> <DEDENT> def digest(self): <NEW_LINE> <INDENT> return struct.pack('<Q', self.h) | Implmenets the hexdigest required by HyperLogLog. | 62598faed7e4931a7ef3c093 |
class LedControl(LedControlBase): <NEW_LINE> <INDENT> def _port_name_to_index(self, port_name): <NEW_LINE> <INDENT> if not port_name.startswith(self.SONIC_PORT_NAME_PREFIX): <NEW_LINE> <INDENT> return -1 <NEW_LINE> <DEDENT> port_idx = int(port_name[len(self.SONIC_PORT_NAME_PREFIX):]) <NEW_LINE> return port_idx <NEW_LIN... | Platform specific LED control class | 62598fae4527f215b58e9ed4 |
class PageOfVulnerabilityCheck(object): <NEW_LINE> <INDENT> swagger_types = { 'links': 'list[Link]', 'page': 'PageInfo', 'resources': 'list[VulnerabilityCheck]' } <NEW_LINE> attribute_map = { 'links': 'links', 'page': 'page', 'resources': 'resources' } <NEW_LINE> def __init__(self, links=None, page=None, resources=None... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fae8e7ae83300ee909f |
class Platform: <NEW_LINE> <INDENT> LINUX = 'linux' <NEW_LINE> WINDOWS = 'windows' <NEW_LINE> DARWIN = 'darwin' <NEW_LINE> ANDROID = 'android' <NEW_LINE> IOS = 'ios' | Enumeration of supported platforms | 62598fae7b180e01f3e4904f |
class FunctionExecutionError(DockerBuildException): <NEW_LINE> <INDENT> def __init__(self, message, function_name, cause): <NEW_LINE> <INDENT> super(FunctionExecutionError, self).__init__(message) <NEW_LINE> self._function_name = function_name <NEW_LINE> self._cause = cause <NEW_LINE> <DEDENT> @property <NEW_LINE> def ... | Raised if an error is encountered when a build in function is executed | 62598fae23849d37ff8510b1 |
class User(db.Model): <NEW_LINE> <INDENT> __bind_key__ = 'libraries' <NEW_LINE> __tablename__ = 'user' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> absolute_uid = db.Column(db.Integer, unique=True) <NEW_LINE> permissions = db.relationship('Permissions', backref='user') <NEW_LINE> def __repr__(self... | User table
Foreign-key absolute_uid is the primary key of the user in the user
database microservice. | 62598fae7047854f4633f3d8 |
class Category(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Catégorie' <NEW_LINE> verbose_name_plural = 'Catégories' <NEW_LINE> ordering = ['position', 'title'] <NEW_LINE> <DEDENT> title = models.CharField('Titre', max_length=80) <NEW_LINE> position = models.IntegerField('Position'... | A Category is a simple container for Forums.
There is no kind of logic in a Category. It simply here for Forum presentation in a predefined order. | 62598faecb5e8a47e493c178 |
class bcolors: <NEW_LINE> <INDENT> HEADER = '\033[95m' <NEW_LINE> OKBLUE = '\033[94m' <NEW_LINE> OKGREEN = '\033[92m' <NEW_LINE> WARNING = '\033[93m' <NEW_LINE> FAIL = '\033[91m' <NEW_LINE> ENDC = '\033[0m' <NEW_LINE> BOLD = '\033[1m' <NEW_LINE> UNDERLINE = '\033[4m' | ANSI color codes | 62598fae4f6381625f1994be |
class History(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(History, self).__init__() <NEW_LINE> <DEDENT> def writeMessageToRoom(self, message_id, message, room, name, email, picture, timestamp, **kwargs): <NEW_LINE> <INDENT> msg = { 'message_id': message_id, 'message': message, 'room': roo... | docstring for History. | 62598fae26068e7796d4c954 |
class HostName(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'site_names': {'key': 'siteNames', 'type': '[str]'}, 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, 'azure_resource_type': {'key': 'azureResourceType', 'type': 'str'}, 'custom_... | Details of a hostname derived from a domain.
:ivar name: Name of the hostname.
:vartype name: str
:ivar site_names: List of apps the hostname is assigned to. This list will have more than one
app only if the hostname is pointing to a Traffic Manager.
:vartype site_names: list[str]
:ivar azure_resource_name: Name of t... | 62598faea17c0f6771d5c234 |
class RespVoiceprintRegisterResponse(object): <NEW_LINE> <INDENT> openapi_types = { 'has_error': 'bool', 'error_id': 'str', 'error_desc': 'str', 'data': 'object' } <NEW_LINE> attribute_map = { 'has_error': 'hasError', 'error_id': 'errorId', 'error_desc': 'errorDesc', 'data': 'data' } <NEW_LINE> def __init__(self, has_e... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598fae9c8ee82313040171 |
class DjangoEXPAException(Exception): <NEW_LINE> <INDENT> def __init__(self, error_message): <NEW_LINE> <INDENT> self.error_message = error_message | This error is raised whenever the EXPA API is not working as expected. | 62598fae44b2445a339b6970 |
@skipIf(NO_MOCK, NO_MOCK_REASON) <NEW_LINE> class RpmTestCase(TestCase, LoaderModuleMockMixin): <NEW_LINE> <INDENT> def setup_loader_modules(self): <NEW_LINE> <INDENT> return {rpm: {'rpm': MagicMock(return_value=MagicMock)}} <NEW_LINE> <DEDENT> def test_list_pkgs(self): <NEW_LINE> <INDENT> mock = MagicMock(return_value... | Test cases for salt.modules.rpm | 62598fae56ac1b37e63021eb |
class ThreadedCommentAdmin(CommentsAdmin): <NEW_LINE> <INDENT> list_display = ("avatar_link", "intro", "submit_date", "is_public", "is_removed", "admin_link") <NEW_LINE> list_display_links = ("intro", "submit_date") <NEW_LINE> fieldsets = ( (_("User"), {"fields": ("user_name", "user_email", "user_url")}), (None, {"fiel... | Admin class for comments. | 62598fae7cff6e4e811b5a2c |
class SamplerDynestyParameterForm(DynamicForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs['name'] = 'data-parameter' <NEW_LINE> kwargs['fields_properties'] = DYNESTY_FIELDS_PROPERTIES <NEW_LINE> self.job = kwargs.pop('job', None) <NEW_LINE> super(SamplerDynestyParameterForm, se... | Sampler Dynesty Parameter Form extending Dynamic Form | 62598fae30dc7b766599f84d |
class RingSBendWaveguideCoupler(RingSymmWaveguideCoupler): <NEW_LINE> <INDENT> sbend_straight = NonNegativeNumberProperty(default = TECH.WG.SHORT_STRAIGHT) <NEW_LINE> def define_shape(self): <NEW_LINE> <INDENT> bs1a, bs2a = self.get_bend_size(self.coupler_angles[0]) <NEW_LINE> bs1b, bs2b = self.get_bend_size(self.coupl... | coupler that couples with an SBend along or away from the ring | 62598fae2ae34c7f260ab0e1 |
class LatLong: <NEW_LINE> <INDENT> def generate(self, json_result) -> None: <NEW_LINE> <INDENT> lat_longs = mapquest_interaction.lat_long(json_result) <NEW_LINE> latitude = '' <NEW_LINE> longitude = '' <NEW_LINE> for dictionary in lat_longs: <NEW_LINE> <INDENT> if dictionary['lat'] >= 0: <NEW_LINE> <INDENT> latitude = ... | Class that prints the latitude and longitude of each location | 62598faeaad79263cf42e7d3 |
class ValueIterationAgent(ValueEstimationAgent): <NEW_LINE> <INDENT> def __init__(self, mdp, discount = 0.9, iterations = 100): <NEW_LINE> <INDENT> self.mdp = mdp <NEW_LINE> self.discount = discount <NEW_LINE> self.iterations = iterations <NEW_LINE> self.values = util.Counter() <NEW_LINE> self.qValues = util.Counter() ... | * Please read learningAgents.py before reading this.*
A ValueIterationAgent takes a Markov decision process
(see mdp.py) on initialization and runs value iteration
for a given number of iterations using the supplied
discount factor. | 62598fae8da39b475be031e4 |
class ExpectimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> def expValue(gameState, i ,depth): <NEW_LINE> <INDENT> if gameState.isLose() or gameState.isWin(): <NEW_LINE> <INDENT> return self.evaluationFunction(gameState) <NEW_LINE> <DEDENT> actions = gameState.g... | Your expectimax agent (question 4) | 62598fae66656f66f7d5a3ef |
class SourceFree1DMaxwellOperator(MaxwellOperator): <NEW_LINE> <INDENT> _default_dimensions = 1 <NEW_LINE> def get_eh_subset(self): <NEW_LINE> <INDENT> return ( (False,True,False) + (False,False,True) ) | A 1D TE Maxwell operator.
Field order is [Ey Hz]. | 62598fae66673b3332c303cc |
class IJsonMime(IMime): <NEW_LINE> <INDENT> pass | Interface for JSON mime type. | 62598fae009cb60464d01520 |
class Summary: <NEW_LINE> <INDENT> def __init__(self, proc_results): <NEW_LINE> <INDENT> self.proc_results = proc_results <NEW_LINE> <DEDENT> def _gen_files(self): <NEW_LINE> <INDENT> files = [] <NEW_LINE> for entry in self.proc_results: <NEW_LINE> <INDENT> for call in entry["calls"]: <NEW_LINE> <INDENT> if call["categ... | Generates summary information. | 62598fae67a9b606de545fcd |
class TweetAnalyzer(): <NEW_LINE> <INDENT> def clean_tweet(self, tweet): <NEW_LINE> <INDENT> return ' '.join(re.sub("(@[A-Za-z0-9]+)|([^0-9A-Za-z \t])|(\w+:\/\/\S+)", " ", tweet).split()) <NEW_LINE> <DEDENT> def analyze_sentiment(self, tweet): <NEW_LINE> <INDENT> analysis = TextBlob(self.clean_tweet(tweet)) <NEW_LINE> ... | Functionality for analyzing and categorizing content from tweets. | 62598faefff4ab517ebcd7e5 |
class IncompatiblePeer(SSHException): <NEW_LINE> <INDENT> pass | A disagreement arose regarding an algorithm required for key exchange.
.. versionadded:: 2.9 | 62598faea219f33f346c6816 |
class FontSizeSpec(DataSpec): <NEW_LINE> <INDENT> def __init__(self, default, help=None): <NEW_LINE> <INDENT> super(FontSizeSpec, self).__init__(List(String), default=default, help=help) <NEW_LINE> <DEDENT> def prepare_value(self, cls, name, value): <NEW_LINE> <INDENT> if isinstance(value, string_types): <NEW_LINE> <IN... | A DataSpec property that can be set to a font size fixed value,
or a data source column name referring to column of font size data. | 62598faee5267d203ee6b90a |
@attr.s <NEW_LINE> class Session: <NEW_LINE> <INDENT> configuration: Configuration = attr.ib() <NEW_LINE> def __attrs_post_init__(self) -> None: <NEW_LINE> <INDENT> self.interval_wave_object = simpleaudio.WaveObject.from_wave_file( self.configuration.interval_sound_path.as_posix(), ) <NEW_LINE> self.start_stop_wave_obj... | Meditation session. | 62598fae60cbc95b0636434f |
class FilteringOption(Option): <NEW_LINE> <INDENT> def take_action(self, action, dest, opt, value, values, parser): <NEW_LINE> <INDENT> if action in FilteringOption.ACTIONS: <NEW_LINE> <INDENT> Option.take_action(self, action, dest, opt, value, values, parser) <NEW_LINE> <DEDENT> if value is None: <NEW_LINE> <INDENT> v... | Subclass that supports Option filtering for FilteringOptionParser | 62598faecb5e8a47e493c179 |
class NativeProcess(_NativeProcess): <NEW_LINE> <INDENT> pass | This class represents a process in the native environment on which it is
imported. It aims to allow applications to access a :py:class:`.Process`
object suitable for its environment with out checking the operating system. | 62598fae4f6381625f1994bf |
class AttributeOption(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'attributeoption' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> option = db.Column(db.String(64)) <NEW_LINE> group_id = db.Column(db.Integer, db.ForeignKey('attributeoptiongroup.id'), nullable=False) <NEW_LINE> item_attropt_values... | Значения выбора:
Например "Страна" - Россия, США...
Например "Размер" Small/Medium/Large
| 62598faecc0a2c111447b012 |
class User_revision( object ): <NEW_LINE> <INDENT> def __init__( self, revision, user_id = None, username = None ): <NEW_LINE> <INDENT> self.__revision = revision <NEW_LINE> self.__user_id = user_id <NEW_LINE> self.__username = username <NEW_LINE> <DEDENT> def to_dict( self ): <NEW_LINE> <INDENT> return dict( revision ... | A revision timestamp along with information on the user that made that revision. | 62598fae01c39578d7f12d7f |
@base.calculators.add('scenario_risk') <NEW_LINE> class ScenarioRiskCalculator(base.RiskCalculator): <NEW_LINE> <INDENT> core_func = scenario_risk <NEW_LINE> losses_by_key = datastore.persistent_attribute('losses_by_key') <NEW_LINE> gmf_by_trt_gsim = datastore.persistent_attribute('gmf_by_trt_gsim') <NEW_LINE> pre_calc... | Run a scenario risk calculation | 62598faea17c0f6771d5c236 |
class SpiderError(IOError): <NEW_LINE> <INDENT> def __init__(self, reason): <NEW_LINE> <INDENT> self.args = reason <NEW_LINE> self.reason = reason <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '#SpiderError%s#' % self.reason | 错误信息 | 62598fae76e4537e8c3ef5ae |
class UserInput(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.body = None <NEW_LINE> self.clickPosition = None <NEW_LINE> self.gameRef = None <NEW_LINE> self.leftMouse = False <NEW_LINE> self.middleMouse = False <NEW_LINE> self.rightMouse = False <NEW_LINE> <DEDENT> def cre... | A class to handle mouse input that creates dynamic bodies | 62598fae460517430c43205e |
class Element(object): <NEW_LINE> <INDENT> self_closing_tags = ('meta', 'img', 'link', 'script', 'br', 'hr') <NEW_LINE> ELEMENT = '%' <NEW_LINE> ID = '#' <NEW_LINE> CLASS = '.' <NEW_LINE> def __init__(self, haml): <NEW_LINE> <INDENT> self.haml = haml <NEW_LINE> self.tag = None <NEW_LINE> self.id = None <NEW_LINE> self.... | contains the pieces of an element and can populate itself from haml element text | 62598fae56b00c62f0fb28b7 |
class Meta: <NEW_LINE> <INDENT> model = SelectTemplateHit <NEW_LINE> fields = ('uuid', 'task_uuid', 'date_created', 'query_range', 'query_range_sequence', 'ff_id', 'ff_name', 'is_resolved_hit', 'ff_cath_domain_count', 'ff_uniq_ec_count', 'ff_uniq_go_count', 'ff_seq_count', 'ff_dops_score', 'evalue', 'bitscore', ) <NEW_... | Meta class to map serializer's fields with the model fields. | 62598faef548e778e596b5a6 |
class SelectFrame(BaseSelectFrame): <NEW_LINE> <INDENT> menu_start_line = 2 <NEW_LINE> def initialize(self, options, text, spos , height=None, background=''): <NEW_LINE> <INDENT> self._options = options <NEW_LINE> self._text = text <NEW_LINE> self._sx, self._sy = spos <NEW_LINE> self._height = height <NEW_LINE> self._b... | options = ( value1, value2, ...)
text = (text1, text2, ...)
spos = (startx, starty) | 62598faeeab8aa0e5d30bd8f |
class TestUnknownResourceHookUpdate(TestFunctional): <NEW_LINE> <INDENT> def test_epilogue_update(self): <NEW_LINE> <INDENT> self.server.manager(MGR_CMD_SET, SERVER, {'job_history_enable': 'True'}) <NEW_LINE> hook_body = "import pbs\n" <NEW_LINE> hook_body += "e = pbs.event()\n" <NEW_LINE> hook_body += "hstr=\'" + "unk... | Test that a resource that is not known to the server and is
updated in an execjob_epilogue hook doesn't crash the server. | 62598fae009cb60464d01522 |
class DnsSrvRecord(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required = [ "srv_name","port"] <NEW_LINE> self.b_key = "dns-srv-record" <NEW_LINE> self.a10_url="/axapi/v3/gslb/zone/{name}/service/{service_port}+{service_name}/dns-srv-record/{s... | Class Description::
Specify DNS SRV Record.
Class dns-srv-record supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param srv_name: {"description": "Specify Domain Name", "format": "string", "minLength": 1, "optional": false, "maxLength": 127, "type... | 62598fae7d847024c075c3c5 |
@base.ReleaseTracks(base.ReleaseTrack.BETA, base.ReleaseTrack.ALPHA) <NEW_LINE> class SetDefaultBeta(base.DescribeCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> _AddSetDefaultArgs(parser) <NEW_LINE> <DEDENT> def Run(self, args): <NEW_LINE> <INDENT> return versions_util.SetD... | Sets an existing Cloud ML Engine version as the default for its model. | 62598fae796e427e5384e796 |
class ReleaseViewSet(AppResourceViewSet): <NEW_LINE> <INDENT> model = models.Release <NEW_LINE> serializer_class = serializers.ReleaseSerializer <NEW_LINE> def get_object(self, **kwargs): <NEW_LINE> <INDENT> return self.get_queryset(**kwargs).get(version=self.kwargs['version']) <NEW_LINE> <DEDENT> def rollback(self, re... | A viewset for interacting with Release objects. | 62598faeb7558d589546362c |
class MetaSerializer(type): <NEW_LINE> <INDENT> _fields_storage_key = '_fields' <NEW_LINE> @classmethod <NEW_LINE> def __prepare__(mcs, name, bases, **kwargs): <NEW_LINE> <INDENT> return OrderedDict() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _get_fields(mcs, bases, namespace): <NEW_LINE> <INDENT> fields = [ (nam... | Metaclass for handling serialization with field objects. | 62598fae8a43f66fc4bf217c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.