code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Monedero(models.Model): <NEW_LINE> <INDENT> nombre = models.CharField(max_length=50) <NEW_LINE> usuario = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> moneda = models.ForeignKey(Moneda, on_delete=models.CASCADE) <NEW_LINE> monto = models.DecimalField(max_digits=11, decimal_places=2, default=0) <NE...
Model definition for Monedero.
6259905532920d7e50bc758b
class observe(object): <NEW_LINE> <INDENT> def __init__(self, *evtnames, **kwargs): <NEW_LINE> <INDENT> self.evtnames = evtnames <NEW_LINE> if "extname" in kwargs: <NEW_LINE> <INDENT> self.extname = kwargs["extname"] <NEW_LINE> <DEDENT> <DEDENT> def __guess_extension_name(self, modname): <NEW_LINE> <INDENT> if modname....
Event observing decorator Automatically register the decorated function to observe the given event. If the decorated function is located into an extension, we check before each call if the extension is enabled or not. If that's not the case, the callback is not called. .. note:: That's not a really optimized beh...
62599055b57a9660fecd2fb6
class CreateCampaignRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.License = None <NEW_LINE> self.SendTime = None <NEW_LINE> self.Name = None <NEW_LINE> self.Strategies = None <NEW_LINE> self.TemplateId = None <NEW_LINE> self.CrowdID = None <NEW_LINE> self.SmsType = None <NEW_L...
CreateCampaign请求参数结构体
625990557cff6e4e811b6f7c
class Bot(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> async def on_turn(self, context: TurnContext): <NEW_LINE> <INDENT> raise NotImplementedError()
Represents a bot that can operate on incoming activities.
62599055b830903b9686ef1b
class SMPEntry: <NEW_LINE> <INDENT> def __init__(self, documentidentifier, peppolmember_id): <NEW_LINE> <INDENT> self.id = None <NEW_LINE> self.documentidentifier = documentidentifier <NEW_LINE> self.certificate_not_before = None <NEW_LINE> self.certificate_not_after = None <NEW_LINE> self.endpointurl = None <NEW_LINE>...
Object representing SMP entry
62599055379a373c97d9a55f
class StaffRuleCreateView( LoginRequiredMixin, PermissionRequiredMixin, CreateView ): <NEW_LINE> <INDENT> model = StaffRule <NEW_LINE> form_class = StaffRuleCreateForm <NEW_LINE> template_name = "staffrule_create.html" <NEW_LINE> login_url = "login" <NEW_LINE> permission_required = "rosters.change_roster"
Staff Rule Create View.
625990554a966d76dd5f042c
class ArrayManyToManyRel(ForeignObjectRel): <NEW_LINE> <INDENT> def __init__(self, field, to, field_name, related_name=None, related_query_name=None, limit_choices_to=None, symmetrical=True): <NEW_LINE> <INDENT> super(ArrayManyToManyRel, self).__init__( field, to, related_name=related_name, related_query_name=related_q...
Used by ManyToManyFields to store information about the relation. ``_meta.get_fields()`` returns this class to provide access to the field flags for the reverse relation.
62599055dc8b845886d54b00
class Command(BaseCommand): <NEW_LINE> <INDENT> aliases = ['exit'] <NEW_LINE> interactive_only = True <NEW_LINE> def handle(self, options): <NEW_LINE> <INDENT> component.get('ConsoleUI').quit()
Exit the client
62599055baa26c4b54d507df
class DependencyExtractorStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.Match = channel.unary_unary( '/cloud.deps.api.v1alpha.extractor.DependencyExtractor/Match', request_serializer=depscloud__api_dot_v1alpha_dot_extractor_dot_extractor__pb2.MatchRequest.SerializeToString, resp...
Missing associated documentation comment in .proto file.
625990553eb6a72ae038bb9c
class Plugin(BasePlugin): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> del self.ctx.tod_vx <NEW_LINE> del self.ctx.tod_vy <NEW_LINE> del self.ctx.frequencies <NEW_LINE> del self.ctx.strategy_coords <NEW_LINE> del self.ctx.beams <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Clean up"
Cleans up the context to avoid a memory leak
6259905599cbb53fe683241d
class Client(object, metaclass=ClientRegistry): <NEW_LINE> <INDENT> access_token_key = 'access_token' <NEW_LINE> shared_key = 'oauth_verifier' <NEW_LINE> access_token_url = None <NEW_LINE> authorize_url = None <NEW_LINE> base_url = None <NEW_LINE> name = None <NEW_LINE> user_info_url = None <NEW_LINE> def __init__(self...
Base abstract OAuth Client class.
625990558a43f66fc4bf36c9
class BulletClient(object): <NEW_LINE> <INDENT> def __init__(self, connection_mode=None): <NEW_LINE> <INDENT> self._shapes = {} <NEW_LINE> if connection_mode is None: <NEW_LINE> <INDENT> self._client = pybullet.connect(pybullet.SHARED_MEMORY) <NEW_LINE> if self._client >= 0: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDEN...
A wrapper for pybullet to manage different clients.
62599055d53ae8145f91999e
class Factory: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def to_quote_view(quotes: list([Quote])): <NEW_LINE> <INDENT> return list(map(lambda quote: QuoteView.from_quote(quote), quotes))
This Object will give us the list of quotes from the Object QuoteView
6259905594891a1f408ba194
class AnacondaSetPythonBuilder(object): <NEW_LINE> <INDENT> def update_interpreter_build_system(self, cmd): <NEW_LINE> <INDENT> if get_settings( active_view(), 'auto_python_builder_enabled', True) is False: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> project = self._get_project() <NEW_LINE> if project.get('build_sys...
Sets or modifies the builder of the current project
6259905521a7993f00c674aa
class GearmanTaskBackend(TaskBackend): <NEW_LINE> <INDENT> TASK_BATCH_SIZE = settings.BATCH_SIZE <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.client = MCPGearmanClient([settings.GEARMAN_SERVER]) <NEW_LINE> self.current_task_batches = {} <NEW_LINE> self.pending_gearman_jobs = {} <NEW_LINE> <DEDENT> def submit...
Submits tasks to MCPClient via Gearman. Tasks are batched into BATCH_SIZE groups (default 128), pickled and sent to MCPClient. This adds some complexity but saves a lot of overhead.
62599055f7d966606f749356
class OIDCAuthenticationRequestView(View): <NEW_LINE> <INDENT> http_method_names = ['get'] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(OIDCAuthenticationRequestView, self).__init__(*args, **kwargs) <NEW_LINE> self.OIDC_OP_AUTH_ENDPOINT = import_from_settings('OIDC_OP_AUTHORIZATION_ENDPOINT...
OIDC client authentication HTTP endpoint
625990552ae34c7f260ac623
class Room(CommandHandler): <NEW_LINE> <INDENT> def __init__(self, server): <NEW_LINE> <INDENT> self.server = server <NEW_LINE> self.sessions = [] <NEW_LINE> <DEDENT> def add(self, session): <NEW_LINE> <INDENT> self.sessions.append(session) <NEW_LINE> <DEDENT> def remove(self, session): <NEW_LINE> <INDENT> self.session...
A generic environment that contain one or more users (sessions). It takes care of the basic command handling and broadcasting.
62599055435de62698e9d33f
class DeconzDevice(DeconzBase, Entity): <NEW_LINE> <INDENT> def __init__(self, device, gateway): <NEW_LINE> <INDENT> super().__init__(device, gateway) <NEW_LINE> self.unsub_dispatcher = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def entity_registry_enabled_default(self): <NEW_LINE> <INDENT> if not self.gateway.optio...
Representation of a deCONZ device.
6259905516aa5153ce401a21
class _multimap: <NEW_LINE> <INDENT> def __init__(self, primary, secondary): <NEW_LINE> <INDENT> self._primary = primary <NEW_LINE> self._secondary = secondary <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self._primary[key] <NEW_LINE> <DEDENT> except KeyError: <NEW...
Helper class for combining multiple mappings. Used by .{safe_,}substitute() to combine the mapping and keyword arguments.
62599055097d151d1a2c25a8
class FolderWizardExtension(WizardExtension): <NEW_LINE> <INDENT> id = "puddle.resource.folder_wizard" <NEW_LINE> name = "Folder" <NEW_LINE> image = ImageResource("new") <NEW_LINE> wizard_class = "puddle.resource.wizard.folder_wizard:" "FolderWizard" <NEW_LINE> description = "Create a new folder resource"
Contributes a new folder wizard.
62599055cad5886f8bdc5b1f
class Formatter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.formatters = {} <NEW_LINE> <DEDENT> def add(self, formatter): <NEW_LINE> <INDENT> self.formatters[formatter.get_name()] = formatter <NEW_LINE> <DEDENT> def format(self, name, content): <NEW_LINE> <INDENT> return self.formatters[na...
Formatter class
6259905524f1403a9268636d
class Modeler: <NEW_LINE> <INDENT> def __init__(self, P, num_outcomes, dnn_layers, dnn_poly_degree, drop_prob, optimizer): <NEW_LINE> <INDENT> with tf.name_scope("Modeler"): <NEW_LINE> <INDENT> self._output, self._weights, self._biases = dnn_regressor( P, num_outcomes, dnn_poly_degree, dnn_layers, drop_prob) <NEW_LINE>...
Stores the tf expressions related to the modeler
6259905532920d7e50bc758d
class FileType(object): <NEW_LINE> <INDENT> def __init__(self, mode='r', bufsize=-1, encoding=None, errors=None): <NEW_LINE> <INDENT> self._mode = mode <NEW_LINE> self._bufsize = bufsize <NEW_LINE> self._encoding = encoding <NEW_LINE> self._errors = errors <NEW_LINE> <DEDENT> def __call__(self, string): <NEW_LINE> <IND...
Factory for creating file object types Instances of FileType are typically passed as type= arguments to the ArgumentParser add_argument() method. Keyword Arguments: - mode -- A string indicating how the file is to be opened. Accepts the same values as the builtin open() function. - bufsize -- The file's ...
62599055baa26c4b54d507e0
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'
Colors for stdout coloring
625990557cff6e4e811b6f7e
class TestLP1074374(unittest.TestCase): <NEW_LINE> <INDENT> layer = RESTLayer <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.user_manager = getUtility(IUserManager) <NEW_LINE> with transaction(): <NEW_LINE> <INDENT> self.mlist = create_list('test@example.com') <NEW_LINE> self.anne = self.user_manager.create_user(...
LP: #1074374 - deleting a user left their address records active.
625990550a50d4780f70685d
class ShipTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.image = pygame.image.load('img/ship.bmp') <NEW_LINE> self.ship = Ship(0, 0, self.image) <NEW_LINE> <DEDENT> def test_initialization(self): <NEW_LINE> <INDENT> self.assertEqual(self.ship.rect.centerx, 0) <NEW_LINE> self....
Tests the Ship class of Alien Invaders game
62599055b5575c28eb71376a
class Permissions(object): <NEW_LINE> <INDENT> def __init__(self, create, read, update, delete): <NEW_LINE> <INDENT> self.create = create <NEW_LINE> self.read = read <NEW_LINE> self.update = update <NEW_LINE> self.delete = delete <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_user_permissions_for_category(categor...
Determines and represents the permissions available on a given resource in a given context
625990556e29344779b01b87
class MASK_OT_set_marker_drawtype(Operator): <NEW_LINE> <INDENT> bl_idname = "mask.set_marker_drawtype" <NEW_LINE> bl_label = "Set Marker Drawtype" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> sc = context.space_data <NEW_LINE> sc.show_marker_pattern = False <NEW_LINE> sc.show_marker_search= False <NEW_LI...
Don't draw markers
62599055a17c0f6771d5d640
class PrivateingredientsApiTests(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_ingredie...
Tests the private user ingredients API
625990558e7ae83300eea5ce
class Hitmarker(GridComponent): <NEW_LINE> <INDENT> def __init__(self, square_size, grid_rect, square_group): <NEW_LINE> <INDENT> image_name = 'hit.png' <NEW_LINE> GridComponent.__init__(self, square_size, grid_rect, square_group, image_name)
A subclass of GridComponent for displaying successful strikes on the enemy grid. :parent: gridcomponent.GridComponent
625990553cc13d1c6d466c7b
class SparseSquaredHingeProblem(SparseLinearProblem): <NEW_LINE> <INDENT> @property <NEW_LINE> def _solution_class(self): <NEW_LINE> <INDENT> return SparseSquaredHingeSolution <NEW_LINE> <DEDENT> @property <NEW_LINE> def _loss_index(self): <NEW_LINE> <INDENT> return 3. <NEW_LINE> <DEDENT> def _check_data_inputs(self, A...
Class for training sparse linear models with squared hinge loss. The optimization objective is .. math:: \sum_i \onehalf (1 - b_i a_i^T w)_+^2 + \lambda ||w||_1 , where the "+" subscript denotes the rectifier function. Each label should have value 1 or -1.
62599055e5267d203ee6ce2c
class InvalidThermostatState(Exception): <NEW_LINE> <INDENT> pass
Vital information is missing from the response
62599055379a373c97d9a562
class PressRelease(Highlight, BaseContent): <NEW_LINE> <INDENT> security = ClassSecurityInfo() <NEW_LINE> archetype_name = 'Press Release' <NEW_LINE> meta_type = 'PressRelease' <NEW_LINE> portal_type = 'PressRelease' <NEW_LINE> allowed_content_types = [] + list(getattr(Highlight, 'allowed_content_types', [])) <NEW_LINE...
Press release
625990558da39b475be04729
class CreateGroupRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ApplicationId = None <NEW_LINE> self.NamespaceId = None <NEW_LINE> self.GroupName = None <NEW_LINE> self.ClusterId = None <NEW_LINE> self.GroupDesc = None <NEW_LINE> self.GroupResourceType = None <NEW_LINE> <DEDENT...
CreateGroup请求参数结构体
62599055baa26c4b54d507e1
class Tool(benchexec.tools.template.BaseTool2): <NEW_LINE> <INDENT> REQUIRED_PATHS = ["predator", "predator-bfs", "predator-dfs", "predatorHP.py"] <NEW_LINE> def executable(self, tool_locator): <NEW_LINE> <INDENT> return tool_locator.find_executable("predatorHP.py") <NEW_LINE> <DEDENT> def name(self): <NEW_LINE> <INDEN...
Wrapper for a Predator - Hunting Party http://www.fit.vutbr.cz/research/groups/verifit/tools/predator-hp/
6259905573bcbd0ca4bcb7cf
class Sliding_Window_Dataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, data, gpudevice, sliding_window_size, sliding_window_step): <NEW_LINE> <INDENT> super(Sliding_Window_Dataset, self).__init__() <NEW_LINE> self.gpudevice = gpudevice <NEW_LINE> self.data, self.labels = data <NEW_LINE> t,d = self.data.shape <NE...
Characterizes a dataset for PyTorch
62599055d99f1b3c44d06bde
class User(UserMixin, db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> username = db.Column(db.String(64), index=True, unique=True) <NEW_LINE> email = db.Column(db.String(120), index=True, unique=True) <NEW_LINE> password_hash = db.Column(db.String(128)) <NEW_LINE> about_me = db.Co...
Represetns a system User
625990553539df3088ecd7e4
class Operations(object): <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <NEW_LINE> <DEDENT> def l...
Operations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models :par...
62599055e64d504609df9e6f
class PingTask(Task): <NEW_LINE> <INDENT> executor_script = "/framework/calico_executor.py ping_task" <NEW_LINE> def __init__(self, can_ping_targets=[], cant_ping_targets=[], *args, **kwargs): <NEW_LINE> <INDENT> super(PingTask, self).__init__(*args, **kwargs) <NEW_LINE> assert can_ping_targets or cant_ping_targets, "M...
Subclass of Task which attempts to ping a target. Pass in a collection of can_ping_targets or cant_ping_targets, and this PingTask will fail accordingly. Since it can target multiple tasks, results reported by the Executor are stored in ping_status_data, so individual pings can be checked.
62599055cb5e8a47e493cc26
class CmdTime(MuxCommand): <NEW_LINE> <INDENT> key = "@time" <NEW_LINE> aliases = "@uptime" <NEW_LINE> locks = "cmd:perm(time) or perm(Players)" <NEW_LINE> help_category = "System" <NEW_LINE> def func(self): <NEW_LINE> <INDENT> table = prettytable.PrettyTable(["{wserver time statistic","{wtime"]) <NEW_LINE> table.align...
show server time statistics Usage: @time List Server time statistics such as uptime and the current time stamp.
62599055baa26c4b54d507e2
class TestModel(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> unittest.TestCase.setUp(self) <NEW_LINE> config_parser = SafeConfigParser() <NEW_LINE> config_parser.read_string(TEST_CONFIG) <NEW_LINE> self.site_config = config_parser[SEC_SITE] <NEW_LINE> <DEDENT> def test_weather_model(self...
Test Weather Model class
62599055435de62698e9d342
class Easy21Action(Action): <NEW_LINE> <INDENT> def __init__(self, hit: bool): <NEW_LINE> <INDENT> self.hit = hit <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'hit' if self.hit else 'stick' <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(self)
Easy21 Action that can be performed on the environment state
6259905521bff66bcd7241a4
class RadioThermostat(ThermostatDevice): <NEW_LINE> <INDENT> def __init__(self, device, hold_temp): <NEW_LINE> <INDENT> self.device = device <NEW_LINE> self.set_time() <NEW_LINE> self._target_temperature = None <NEW_LINE> self._current_temperature = None <NEW_LINE> self._operation = STATE_IDLE <NEW_LINE> self._name = N...
Representation of a Radio Thermostat.
62599055be383301e0254d2c
class InvertedResidualRelu(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_chs, out_chs, stride=1, exp_ratio=6.0, slice=1, real_in_chs = None): <NEW_LINE> <INDENT> super(InvertedResidualRelu, self).__init__() <NEW_LINE> mid_chs = make_divisible(in_chs * exp_ratio) <NEW_LINE> if real_in_chs: <NEW_LINE> <INDENT> in...
Inverted residual block w/ optional SE and CondConv routing
625990553617ad0b5ee07687
class NStepGRU(NStepGRUBase): <NEW_LINE> <INDENT> use_bi_direction = False <NEW_LINE> def rnn(self, *args): <NEW_LINE> <INDENT> return rnn.n_step_gru(*args) <NEW_LINE> <DEDENT> @property <NEW_LINE> def n_cells(self): <NEW_LINE> <INDENT> return 1
__init__(self, n_layers, in_size, out_size, dropout) Stacked Uni-directional GRU for sequences. This link is stacked version of Uni-directional GRU for sequences. It calculates hidden and cell states of all layer at end-of-string, and all hidden states of the last layer for each time. Unlike :func:`chainer.functions...
6259905576d4e153a661dd1b
class Meta: <NEW_LINE> <INDENT> name = 'denmark_provider'
The name of the provider.
62599055ac7a0e7691f73a20
class SessionCart: <NEW_LINE> <INDENT> def __init__(self, request): <NEW_LINE> <INDENT> cart_id = request.session.get(CART_ID) <NEW_LINE> if cart_id: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> cart = models.Cart.objects.get(id=cart_id, checked_out=False) <NEW_LINE> <DEDENT> except models.Cart.DoesNotExist: <NEW_LINE>...
@change: Rename Cart to SessionCart to avoid clashes
625990558a43f66fc4bf36cc
class MTable(object): <NEW_LINE> <INDENT> def __init__(self, name, families): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.families = families <NEW_LINE> self._rows = {} <NEW_LINE> <DEDENT> def row(self, key): <NEW_LINE> <INDENT> return self._rows.get(key, {}) <NEW_LINE> <DEDENT> def rows(self, keys): <NEW_LINE...
HappyBase.Table mock
62599055cc0a2c111447c52c
class ISchoolFolder(Interface): <NEW_LINE> <INDENT> contains('Products.Tutorweb.interfaces.ISchool') <NEW_LINE> title = schema.TextLine(title=_(u"Object title"), required=True) <NEW_LINE> description = schema.TextLine(title=_(u"Description"), description=_(u"A short summary of this folder"))
An folder object containing schools.
62599055d53ae8145f9199a2
class Launcher(_LauncherBase): <NEW_LINE> <INDENT> def __init__(self, protocol, port, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> if not issubclass(protocol, Protocol): <NEW_LINE> <INDENT> raise TypeError(r'Dot Implemented Protocol Interface') <NEW_LINE> <DEDENT> self._settings = { r'ssl_option...
TornadoTCP的启动器 用于简化和统一程序的启动操作
625990558da39b475be0472c
class TrustedFilter(filters.BaseHostFilter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.compute_attestation = ComputeAttestation() <NEW_LINE> <DEDENT> run_filter_once_per_request = True <NEW_LINE> def host_passes(self, host_state, filter_properties): <NEW_LINE> <INDENT> instance_type = filter_prop...
Trusted filter to support Trusted Compute Pools.
62599055462c4b4f79dbcf45
class MaintenanceRecordFilterBackend(filters.BaseFilterBackend): <NEW_LINE> <INDENT> def filter_queryset(self, request, queryset, view): <NEW_LINE> <INDENT> request_params = request.query_params <NEW_LINE> active = request_params.get('active') <NEW_LINE> if isinstance(active, basestring) and active.lower() == 'true' ...
Filter MaintenanceRecords using the request_user and 'query_params'
625990557b25080760ed877f
class FileScheme(object): <NEW_LINE> <INDENT> host = '<file>' <NEW_LINE> port = '<file>' <NEW_LINE> reason = '<none>' <NEW_LINE> def __init__(self, location): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def request(self, method, fullpath, body='', headers=None): <NEW_LINE> <INDENT> self.status = 200 <NEW_LINE> self.ms...
Retarded scheme to local file wrapper.
6259905591af0d3eaad3b368
class AutoRestUrlTestServiceConfiguration(Configuration): <NEW_LINE> <INDENT> def __init__( self, global_string_path, global_string_query=None, base_url=None, filepath=None): <NEW_LINE> <INDENT> if global_string_path is None: <NEW_LINE> <INDENT> raise ValueError('global_string_path must not be None.') <NEW_LINE> <DEDEN...
Configuration for AutoRestUrlTestService Note that all parameters used to create this instance are saved as instance attributes. :param global_string_path: A string value 'globalItemStringPath' that appears in the path :type global_string_path: str :param global_string_query: should contain value null :type global_st...
625990558e71fb1e983bd00a
class Acidentes(object): <NEW_LINE> <INDENT> causa = '' <NEW_LINE> tipo = '' <NEW_LINE> quantidade_ocorrencias = 0
Causes of accidents
6259905532920d7e50bc7591
class NoAuthenticationError(Exception): <NEW_LINE> <INDENT> pass
Raised when trying to use an invalid or missing authentication token.
62599055cad5886f8bdc5b21
class SiteSettingsForm(KeyValueForm): <NEW_LINE> <INDENT> def __init__(self, siteconfig, *args, **kwargs): <NEW_LINE> <INDENT> self.request = kwargs.pop('request', None) <NEW_LINE> self.siteconfig = siteconfig <NEW_LINE> super(SiteSettingsForm, self).__init__(instance=siteconfig, *args, **kwargs) <NEW_LINE> <DEDENT> de...
A base form for loading/saving settings for a SiteConfiguration. This is meant to be subclassed for different settings pages. Any fields defined by the form will be loaded/saved automatically. Attributes: request (django.http.HttpRequest): The HTTP request used for this form. siteconfig (djblets.site...
625990557cff6e4e811b6f82
class NullSearchProvider(provider.SolrSearchProvider): <NEW_LINE> <INDENT> async def search_album_name(self, *args, **kwargs): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> async def search_artist_name(self, *args, **kwargs): <NEW_LINE> <INDENT> return []
This is a pretty sketchy way to test these charts, but some of them have a habit of changing. This will at least allow us to ensure that they work without the complexity of end to end testing.
625990556e29344779b01b8b
class Permutation: <NEW_LINE> <INDENT> def __init__(self, image=list(range(4))): <NEW_LINE> <INDENT> if not type(image) is list: raise(TypeError) <NEW_LINE> try: <NEW_LINE> <INDENT> [image.index(v) for v in range(max(image)+1)] <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> print("ArgumentError: ", image) <NEW_LINE> <...
Permutation class
6259905501c39578d7f141d8
class PoolScanTcpListener(common.PoolScanner): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(PoolScanTcpListener, self).__init__(**kwargs) <NEW_LINE> min_size = self.profile.get_obj_size("_TCP_LISTENER") <NEW_LINE> if not min_size: <NEW_LINE> <INDENT> raise RuntimeError(repr(min_size)) <NE...
PoolScanner for Tcp Listeners
62599055435de62698e9d344
class tektronixMDO3052(tektronixMDO3000): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__dict__.setdefault('_instrument_id', 'MDO3052') <NEW_LINE> super(tektronixMDO3052, self).__init__(*args, **kwargs) <NEW_LINE> self._analog_channel_count = 2 <NEW_LINE> self._digital_channel_count...
Tektronix MDO3052 IVI oscilloscope driver
625990558e7ae83300eea5d0
class StringTable: <NEW_LINE> <INDENT> def __init__(self, name=None, kids=None): <NEW_LINE> <INDENT> self.name = name or u'' <NEW_LINE> self.kids = kids or [] <NEW_LINE> <DEDENT> def fromRaw(self, data, i, limit): <NEW_LINE> <INDENT> i, (cpsublen, cpwValueLength, cpwType, self.name) = parseCodePage(data, i, limit) <NEW...
WORD wLength; WORD wValueLength; WORD wType; WCHAR szKey[]; String Children[]; // list of zero or more String structures.
6259905582261d6c5273096a
class D3Q15Lattice(Lattice): <NEW_LINE> <INDENT> def __init__(self,Nx,Ny,Nz): <NEW_LINE> <INDENT> super(D3Q15Lattice,self).__init__(Nx,Ny,Nz) <NEW_LINE> self.ex = [0,1,-1,0,0,0,0,1,-1,1,-1,1,-1,1,-1]; self.ex = np.array(self.ex,dtype=np.float32); <NEW_LINE> self.ey = [0,0,0,1,-1,0,0,1,1,-1,-1,1,1,-1,-1]; self.ey = np....
D3Q15 Lattice
62599055e5267d203ee6ce30
class Hashtag(object): <NEW_LINE> <INDENT> def __init__(self, text=None): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def NewFromJsonDict(data): <NEW_LINE> <INDENT> return Hashtag(text=data.get('text', None))
A class representing a twitter hashtag
62599055596a897236129050
class ExceptionLoggerHook(object): <NEW_LINE> <INDENT> DEFAULT_LEVEL = logging.CRITICAL <NEW_LINE> def __init__(self, level=DEFAULT_LEVEL): <NEW_LINE> <INDENT> self.level = level <NEW_LINE> <DEDENT> def __call__(self, *args): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> logger.log(self.level, "Uncaught exception", exc_...
Replacement function for sys.__excepthook__. This excepthook implementation can replace the default one to capture unhandled exceptions with a logger.
6259905510dbd63aa1c72119
class UserItemsBids(APIView): <NEW_LINE> <INDENT> def get(self, request, pk, format=None): <NEW_LINE> <INDENT> user = get_user(pk) <NEW_LINE> items_id_dict = Bid.objects.filter(user=user.id).values('item_id') <NEW_LINE> item_ids = [val['item_id'] for val in items_id_dict] <NEW_LINE> item_objects = Item.objects.filter(p...
Retrieve all the items on which a user has bid; GET user/<user_id>/bids/items
62599055d7e4931a7ef3d5c0
@dataclass <NEW_LINE> class GitExecutor(MultiExecutor): <NEW_LINE> <INDENT> repository: str = '' <NEW_LINE> version: str = '' <NEW_LINE> force: bool = False <NEW_LINE> def execute(self, **kwargs) -> Result: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.execute_executor(GitCloneExecutor( repository=self.repository, ...
Executor that clones, checks out and pulls a repository Args: repository (str): The repository that will be cloned. :obj:`required` version (str): Version of the repository. Defaults to :obj:`'master'` force (bool): Force changes made in the repository to be discarded. Defaults to :obj:`False`
62599055379a373c97d9a566
class PrimoControlPanelForm(ControlPanelForm): <NEW_LINE> <INDENT> implements(IPrimoControlPanelForm) <NEW_LINE> primolayout = FormFieldsets(IPrimoLayout) <NEW_LINE> primolayout.id = 'primolayout' <NEW_LINE> primolayout.label = _(u'Connexion') <NEW_LINE> form_fields = FormFieldsets(primolayout) <NEW_LINE> label = _(u"P...
Primo Control Panel Form
625990558a43f66fc4bf36ce
class PathStatus(Enum): <NEW_LINE> <INDENT> MOVING_TOWARDS_TARGET = 0 <NEW_LINE> INTERMEDIATE_NODE_REACHED = 1 <NEW_LINE> CHECKPOINT_REACHED = 2
Enum of pathfinding status
62599055cc0a2c111447c52e
class overridable_property: <NEW_LINE> <INDENT> def __init__(self, fget=None, fset=None, fdel=None, doc=None): <NEW_LINE> <INDENT> self.fget = fget <NEW_LINE> self.fset = fset <NEW_LINE> self.fdel = fdel <NEW_LINE> self.__doc__ = doc <NEW_LINE> <DEDENT> def __get__(self, obj, objtype=None): <NEW_LINE> <INDENT> if obj i...
The same as Python's "property" attribute, but allows the accessor methods to be overridden in subclasses.
62599055d99f1b3c44d06be2
class InsteonDimmerDevice(InsteonEntity, LightEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def brightness(self): <NEW_LINE> <INDENT> onlevel = self._insteon_device_state.value <NEW_LINE> return int(onlevel) <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_on(self): <NEW_LINE> <INDENT> return bool(self.brightness) <...
A Class for an Insteon device.
6259905538b623060ffaa2f0
class AzulejoTestBase(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.screen = None <NEW_LINE> cls.keybinding_obj = None
Base setup of tests
62599055be8e80087fbc05c3
class StartBackend(RunConfig): <NEW_LINE> <INDENT> command_name = "start-backend" <NEW_LINE> @staticmethod <NEW_LINE> def start_backend(*args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> wd = os.path.abspath( os.path.join(os.path.dirname(__file__), "..", "..") ) <NEW_LINE> print("Deleting existing windmill ...
Starts the backend flask server with CORS enabled
6259905521a7993f00c674b0
class FileRefDto: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'id', None, None, ), (2, TType.STRING, 'format', None, None, ), ) <NEW_LINE> def __init__(self, id=None, format=None,): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.format = format <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <IN...
Attributes: - id - format
625990550fa83653e46f6426
class Preprocessor: <NEW_LINE> <INDENT> from ..schemata import identity <NEW_LINE> noop = identity().coerce <NEW_LINE> preprocessor = noop <NEW_LINE> def setValue(self, value, **kwds): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> value = self.preprocessor(value=value, node=self, **kwds) <NEW_LINE> <DEDENT> except Attri...
A mix-in class that performs arbitrary transformations on the value of a node
6259905507f4c71912bb097d
class BaseConfigManager(ManagerInterface): <NEW_LINE> <INDENT> def __init__(self, path=None, *args, **kwargs): <NEW_LINE> <INDENT> self.load(path) <NEW_LINE> super(BaseConfigManager, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def list(self): <NEW_LINE> <INDENT> return self._get("") <NEW_LINE> <DEDENT> def get(...
base config manager common operations for config files :param:config_path or as own property
62599055097d151d1a2c25ae
@Singleton <NEW_LINE> class TranscriptContainer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._transcript_container = {} <NEW_LINE> <DEDENT> def add(self, transcript_id, transcript): <NEW_LINE> <INDENT> if type(transcript) is not Transcript: <NEW_LINE> <INDENT> raise TypeError('Transcript, T...
classdocs
62599055baa26c4b54d507e6
class TestSuiteAutoload(TestAppendingMain): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.test_runner = ipyenv.TestRunner( test_paths=(helper.get_abspath_from('nose-like-tests'),), sitelib_paths=(helper.get_abspath_from('sitelib'),), suite_autoload=True )
Tests for test suite auto-loading.
6259905545492302aabfda1a
class Author(models.Model): <NEW_LINE> <INDENT> first_name = models.CharField(max_length=100) <NEW_LINE> last_name = models.CharField(max_length=100) <NEW_LINE> date_of_birth = models.DateField(null=True, blank=True) <NEW_LINE> date_of_death = models.DateField('Died', null=True, blank=True) <NEW_LINE> def __str__(self)...
Model representing an author.
62599055b7558d58954649cc
class OutstandingRequest(object): <NEW_LINE> <INDENT> def __init__(self, request_id, controller): <NEW_LINE> <INDENT> self.controller = controller <NEW_LINE> self.id = request_id
These represent requests on the server side that haven't completed yet.
62599055596a897236129051
class AddWithLimits(ExprWithLimits): <NEW_LINE> <INDENT> def __new__(cls, function, *symbols, **assumptions): <NEW_LINE> <INDENT> function = sympify(function) <NEW_LINE> if hasattr(function, 'func') and function.func is C.Equality: <NEW_LINE> <INDENT> lhs = function.lhs <NEW_LINE> rhs = function.rhs <NEW_LINE> return C...
Represents unevaluated oriented additions. Parent class for Integral and Sum.
6259905510dbd63aa1c7211a
class ConceptVariantEntry(VariantEntry): <NEW_LINE> <INDENT> def __init__(self, concept_entry_content, variant_attributes=None, type_=None, time_or_duration_ref=None, substitute_attribute=None, scheme_attribute=None, entry_group_att...
conceptVariant |= element xobis:concept { variantAttributes?, genericType?, (timeRef | durationRef)?, element xobis:entry { substituteAttribute?, schemeAttribute?, entryGroupAttributes?, conceptEntryContent }, noteList? }
625990558da39b475be0472f
class ClassFactory(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.classes = {} <NEW_LINE> <DEDENT> def _BuildClass(self, key): <NEW_LINE> <INDENT> raise cx_Exceptions.NotImplemented() <NEW_LINE> <DEDENT> def _GenerateClass(self, className, baseClass, classDict, initArgNames): <NEW_LINE> <INDE...
Implements a class factory which builds classes as needed and caches them.
62599055097d151d1a2c25af
class ContextFilter(logging.Filter): <NEW_LINE> <INDENT> def __init__(self, field, value): <NEW_LINE> <INDENT> self.field = field <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def filter(self, record): <NEW_LINE> <INDENT> setattr(record, self.field, self.value) <NEW_LINE> return True
Log filter that adds a static field to a record.
6259905599cbb53fe6832423
class OutlierFilter(): <NEW_LINE> <INDENT> def __init__(self, cloud, k = 50, factor = 1): <NEW_LINE> <INDENT> self._k = k <NEW_LINE> self._factor = factor <NEW_LINE> self._filter = cloud.make_statistical_outlier_filter() <NEW_LINE> self._filter.set_mean_k(self._k) <NEW_LINE> self._filter.set_std_dev_mul_thresh(self._fa...
Remove outliers in PCL
625990554e696a045264e8c4
class RedisCache(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._redis = redis.Redis() <NEW_LINE> self._prefix = REDIS_PREFIX <NEW_LINE> <DEDENT> def __contains__(self, key): <NEW_LINE> <INDENT> return self._redis.exists(self._prefix + key) <NEW_LINE> <DEDENT> def __setitem__(self, key, value...
Redis cache.
62599055d53ae8145f9199a6
class Meta: <NEW_LINE> <INDENT> model = Post <NEW_LINE> fields = ['authors', 'summary', 'title', 'created', 'get_absolute_url']
The Meta Attributes: model: Post fields: authors, summary, title, created, get_absolute_url,
625990558da39b475be04730
class Die: <NEW_LINE> <INDENT> def __init__(self, sides): <NEW_LINE> <INDENT> self.sides = sides if sides else 6 <NEW_LINE> <DEDENT> def describe(self): <NEW_LINE> <INDENT> return 'This die has {sides} sides'.format(sides = self.sides) <NEW_LINE> <DEDENT> def roll(self): <NEW_LINE> <INDENT> return random.randint(1, sel...
A Multi-sided die Instance variables: sides -> the number of sides on die
62599055009cb60464d02a79
class TestArrayField(TransactionTestCase): <NEW_LINE> <INDENT> def test_tic_tac_toe(self): <NEW_LINE> <INDENT> boards = [ ["x", "o", "x", "o", "o", "x", "x", "x", "o"], [" ", " ", " ", " ", "x", " ", " ", " ", " "], [" ", " ", " ", "o", "o", " ", " ", " ", "o"], [" ", " ", " ", " ", " ", " ", " ", " ", " "], ] <NEW_LIN...
Tests that queries involving array fields can be performed.
625990550fa83653e46f6428
class ContactSerializer(Schema): <NEW_LINE> <INDENT> first_name = fields.String(required=True) <NEW_LINE> last_name = fields.String(required=True) <NEW_LINE> email = fields.Email(required=True) <NEW_LINE> phone_number = fields.Integer() <NEW_LINE> company = fields.String() <NEW_LINE> address = fields.String() <NEW_LINE...
Class for serialize and deserialize contact data
62599055f7d966606f74935a
class BotProcessorConsumer(SyncConsumer): <NEW_LINE> <INDENT> def respond_query(self,event): <NEW_LINE> <INDENT> controllers.silly_print("message received by Bot Processor",event) <NEW_LINE> query_set = event['query_set'] <NEW_LINE> player_num = event['player_num'] <NEW_LINE> match_id = event['match_id'] <NEW_LINE> pri...
This consumer handles decision request from player prime. This object is stateless, all game state data comes from db lookup methods callable by channels: - respond_query
62599055e64d504609df9e72
class Meta: <NEW_LINE> <INDENT> ordering = ('related_user', '-active', 'occupied')
ServiceAgent
62599055e76e3b2f99fd9f43
class WhatResponder(Responder): <NEW_LINE> <INDENT> def response(self, input, mood): <NEW_LINE> <INDENT> return '{}ってなに?'.format(input)
オウム返しのための行うサブクラス
62599055dd821e528d6da422
class VABSystemSecondOrderReaction(object): <NEW_LINE> <INDENT> def __init__(self, init_x, k, init_t=0): <NEW_LINE> <INDENT> if init_x > 0: <NEW_LINE> <INDENT> self._x = float(init_x) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError('Invalid initial concentration assignment. Must be greater than 0') <NEW_...
This class defines a simulated second-order chemical reaction: aA -> products. Throughout, x is used for concentration, and k for the reaction constant (that includes the stoichiometric coefficient, a).
625990556e29344779b01b8f
class VppTestRunner(unittest.TextTestRunner): <NEW_LINE> <INDENT> @property <NEW_LINE> def resultclass(self): <NEW_LINE> <INDENT> return VppTestResult <NEW_LINE> <DEDENT> def __init__(self, keep_alive_pipe=None, descriptions=True, verbosity=1, result_pipe=None, failfast=False, buffer=False, resultclass=None, print_summ...
A basic test runner implementation which prints results to standard error.
625990557047854f46340904
class VendorEdit(CuvenEdit): <NEW_LINE> <INDENT> def __init__(self, parent= None, name= None, modal= 0, fl= 0): <NEW_LINE> <INDENT> CuvenEdit.__init__(self,parent) <NEW_LINE> self.wNumber.setText(self._cuvenL.getNextNumber('V')) <NEW_LINE> self._type= 'V' <NEW_LINE> self.setCaption(self.tr('Edit vendor')) <NEW_LINE> se...
Dialogue for editing vendor properies. Inherits CuvenEdit.
625990558e7ae83300eea5d3
class CommandLine(object) : <NEW_LINE> <INDENT> def __init__(self, inOpts=None) : <NEW_LINE> <INDENT> import argparse <NEW_LINE> self.parser = argparse.ArgumentParser(description = 'geneExpressionZ_groups.py - a tool to convert gene expression matrix to z-score values.', epilog = 'Please feel free to forward any questi...
Handle the command line, usage and help requests. CommandLine uses argparse, now standard in 2.7 and beyond. it implements a standard command line argument parser with various argument options, and a standard usage and help, attributes: myCommandLine.args is a dictionary which includes each of the available command ...
6259905529b78933be26ab67
class KonnectedSwitch(ToggleEntity): <NEW_LINE> <INDENT> def __init__(self, device_id, zone_num, data): <NEW_LINE> <INDENT> self._data = data <NEW_LINE> self._device_id = device_id <NEW_LINE> self._zone_num = zone_num <NEW_LINE> self._activation = self._data.get(CONF_ACTIVATION, STATE_HIGH) <NEW_LINE> self._momentary =...
Representation of a Konnected switch.
62599055379a373c97d9a56a
class SingleTimeFreqExecutable(PlotExecutable): <NEW_LINE> <INDENT> time_dependent_options = ['--channel-name', '--frame-type']
Class to be used for to create workflow.Executable instances for the pycbc_plot_singles_timefreq executable. Basically inherits directly from PlotExecutable.
6259905545492302aabfda1d
class hadamard(_PYQUEST): <NEW_LINE> <INDENT> def call_interactive(self, qureg: tqureg, qubit: int) -> None: <NEW_LINE> <INDENT> quest.hadamard(qureg, qubit) <NEW_LINE> <DEDENT> def matrix(self, **kwargs) -> np.ndarray: <NEW_LINE> <INDENT> matrix = 1 / np.sqrt(2) * np.array([[1, 1], [1, -1]], dtype=complex) <NEW_LINE> ...
Implements Hadamard gate .. math:: U = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1\\ 1 & -1 \end{pmatrix} Args: qureg: quantum register qubit: qubit the unitary gate is applied to
6259905571ff763f4b5e8cf5