code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ApplicationIdentifiersCollectorTest(shared_test_lib.BaseTestCase): <NEW_LINE> <INDENT> def _CreateTestRegistry(self): <NEW_LINE> <INDENT> key_path_prefix = 'HKEY_LOCAL_MACHINE\\Software' <NEW_LINE> registry_file = dfwinreg_fake.FakeWinRegistryFile( key_path_prefix=key_path_prefix) <NEW_LINE> registry_key = dfwinr... | Tests for the Windows application identifiers (AppID) collector. | 625990777047854f46340d3f |
class Statistics(models.Model): <NEW_LINE> <INDENT> total_clients = models.BigIntegerField(default=0, help_text='total of clients ' 'served until today') <NEW_LINE> max_concurrent_clients = models.IntegerField(default=0, help_text='max concurrent ' 'clients ever') <NEW_LINE> max_concurrent_domains = models.IntegerField... | Holds simple stats about the application, such as, total clients served
maximum concurrent clients ever served. | 62599077009cb60464d02ec2 |
class CommandRollershutter(RollershutterDevice): <NEW_LINE> <INDENT> def __init__(self, hass, name, command_up, command_down, command_stop, command_state, value_template): <NEW_LINE> <INDENT> self._hass = hass <NEW_LINE> self._name = name <NEW_LINE> self._state = None <NEW_LINE> self._command_up = command_up <NEW_LINE>... | Represents a rollershutter - can be controlled using shell cmd. | 625990777047854f46340d40 |
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) <NEW_LINE> class GroupAdminTest(TestCase): <NEW_LINE> <INDENT> urls = "admin_views.urls" <NEW_LINE> fixtures = ['admin-views-users.xml'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.client.login(username='super', password='... | Tests group CRUD functionality. | 625990777cff6e4e811b73c6 |
class MissingPlaceholder(BlueprintWithNameException): <NEW_LINE> <INDENT> def __init__( self, domain: str, blueprint_name: str, placeholder_names: Iterable[str] ) -> None: <NEW_LINE> <INDENT> super().__init__( domain, blueprint_name, f"Missing placeholder {', '.join(sorted(placeholder_names))}", ) | When we miss a placeholder. | 625990775fc7496912d48f2d |
class CustomSettingsTestCase(TestCase): <NEW_LINE> <INDENT> new_settings = {} <NEW_LINE> _override = None <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls._override = override_settings(**cls.new_settings) <NEW_LINE> cls._override.enable() <NEW_LINE> if 'INSTALLED_APPS' in cls.new_settings... | A TestCase which makes extra models available in the Django project, just for testing.
Based on http://djangosnippets.org/snippets/1011/ in Django 1.4 style. | 625990777b180e01f3e49d28 |
class linux_pslist(linux_common.AbstractLinuxCommand): <NEW_LINE> <INDENT> def __init__(self, config, *args, **kwargs): <NEW_LINE> <INDENT> linux_common.AbstractLinuxCommand.__init__(self, config, *args, **kwargs) <NEW_LINE> config.add_option('PID', short_option = 'p', default = None, help = 'Operate on these Process I... | Gather active tasks by walking the task_struct->task list | 62599077fff4ab517ebcf19e |
class Trampa(Objeto): <NEW_LINE> <INDENT> def __init__(self, nombre, texto, ejecucion, desarme, suicidio): <NEW_LINE> <INDENT> super(Trampa, self).__init__(nombre, True) <NEW_LINE> self.texto = texto <NEW_LINE> self.ejecucion = ejecucion <NEW_LINE> self.desarme = desarme <NEW_LINE> self.suicidio = suicidio <NEW_LINE> <... | Clase que representa a los objetos trampa.
Son objetos utilizables por los tributos, siempre son consumibles, y
poseen tres posibles resultados.
Parametros:
@texto: str. Texto desplegado al usar la trampa
@ejecucion: str. Texto usado cuando el arma tiene exito.
@desarme: str. Texto usado cuando el objetivo... | 6259907763b5f9789fe86aec |
class LasagneMnistConvExample(ConvNet): <NEW_LINE> <INDENT> def _build_middle(self, l_in, **_): <NEW_LINE> <INDENT> return super(LasagneMnistConvExample, self)._build_middle( l_in, num_conv_layers=2, num_dense_layers=1, lc0_num_filters=32, lc0_filter_size=(5, 5), lc1_num_filters=32, lc1_filter_size=(5, 5), ld0_num_unit... | Builder of Lasagne's MNIST basic CNN example (examples/mnist_conv.py).
The network's architecture is: in -> conv(5, 5) x 32 -> max-pool(2, 2) -> conv(5, 5) x 32 -> max-pool(2, 2) ->
dense (256) -> dropout -> out. | 625990774527f215b58eb664 |
class Hero: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.positive_effects = [] <NEW_LINE> self.negative_effects = [] <NEW_LINE> self.stats = { "HP": 128, "MP": 42, "SP": 100, "Strength": 15, "Perception": 4, "Endurance": 8, "Charisma": 2, "Intelligence": 3, "Agility": 8, "Luck": 1 } <NEW_LINE> <DEDE... | Given class. | 6259907797e22403b383c88a |
class FlakyRetryPolicy(RetryPolicy): <NEW_LINE> <INDENT> def __init__(self, max_retries=5): <NEW_LINE> <INDENT> self.max_retries = max_retries <NEW_LINE> <DEDENT> def on_read_timeout(self, *args, **kwargs): <NEW_LINE> <INDENT> if kwargs['retry_num'] < self.max_retries: <NEW_LINE> <INDENT> logger.debug("Retrying read af... | A retry policy that retries 5 times by default, but can be configured to
retry more times. | 62599077ec188e330fdfa22e |
class AuthException(AiopogoError): <NEW_LINE> <INDENT> pass | Raised when logging in fails | 625990774a966d76dd5f0872 |
@benchmark.Disabled('reference') <NEW_LINE> class V8InfiniteScrollIgnition(V8InfiniteScroll): <NEW_LINE> <INDENT> def SetExtraBrowserOptions(self, options): <NEW_LINE> <INDENT> super(V8InfiniteScrollIgnition, self).SetExtraBrowserOptions(options) <NEW_LINE> v8_helper.EnableIgnition(options) <NEW_LINE> <DEDENT> @classme... | Measures V8 GC metrics using Ignition. | 6259907766673b3332c31d87 |
class Piecewise1D(object): <NEW_LINE> <INDENT> def __init__(self, x_grid, x_interp): <NEW_LINE> <INDENT> if not np.all(x_grid[1:] > x_grid[:-1]): <NEW_LINE> <INDENT> raise ValueError("x_grid must be sorted in ascending order") <NEW_LINE> <DEDENT> self.x_grid = x_grid <NEW_LINE> self.x_interp = x_interp <NEW_LINE> self.... | Fast piecewise linear interpolation in one dimension.
Optimized for the special case that the interpolation is done many
times on the same positions, on datapoints with a constant x grid,
but varying y values.
Parameters
----------
x_grid : ndarray
Horizontal (x) grid on which the datapoints will be given
x_inter... | 625990779c8ee82313040e4b |
class Endpoints(ApiObject): <NEW_LINE> <INDENT> obj_type = client.V1Endpoints <NEW_LINE> api_clients = { "preferred": client.CoreV1Api, "v1": client.CoreV1Api, } <NEW_LINE> def create(self, namespace: str = None) -> None: <NEW_LINE> <INDENT> if namespace is None: <NEW_LINE> <INDENT> namespace = self.namespace <NEW_LINE... | Kubetest wrapper around a Kubernetes `Endpoints`_ API Object.
The actual ``kubernetes.client.V1Endpoints`` instance that this
wraps can be accessed via the ``obj`` instance member.
This wrapper provides some convenient functionality around the
API Object and provides some state management for the `Endpoints`_.
.. _E... | 62599077283ffb24f3cf5233 |
class Pendulum(ODEsim): <NEW_LINE> <INDENT> def __init__(self, ax, g, l, phi, omega, x0, y0): <NEW_LINE> <INDENT> self.ax = ax <NEW_LINE> self.g = g <NEW_LINE> self.l = l <NEW_LINE> self.state = np.array([phi, omega]) <NEW_LINE> self.x0 = x0 <NEW_LINE> self.y0 = y0 <NEW_LINE> self.line, = ax.plot([], [], 'o-', lw=2) <N... | Simulation of a pendulum | 62599077097d151d1a2c29fe |
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('email', 'password', 'name') <NEW_LINE> extra_kwargs = {'password': {'write_only': True, 'min_length': 5}} <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE>... | Serializer para objecto user | 62599077d268445f2663a822 |
class CourseUpdatesView(CourseTabView): <NEW_LINE> <INDENT> @method_decorator(login_required) <NEW_LINE> @method_decorator(cache_control(no_cache=True, no_store=True, must_revalidate=True)) <NEW_LINE> def get(self, request, course_id, **kwargs): <NEW_LINE> <INDENT> return super(CourseUpdatesView, self).get(request, cou... | The course updates page. | 6259907716aa5153ce401e63 |
class ClearPresetStatus(OptionalParameterTestFixture): <NEW_LINE> <INDENT> CATEGORY = TestCategory.CONTROL <NEW_LINE> PID = 'PRESET_STATUS' <NEW_LINE> REQUIRES = ['scene_writable_states', 'preset_info'] <NEW_LINE> def Test(self): <NEW_LINE> <INDENT> self.scene = None <NEW_LINE> scene_writable_states = self.Property('sc... | Set the PRESET_STATUS with clear preset = 1 | 6259907799fddb7c1ca63a9a |
class KsotpGateway(VtGateway): <NEW_LINE> <INDENT> def __init__(self, eventEngine, gatewayName='KSOTP'): <NEW_LINE> <INDENT> super(KsotpGateway, self).__init__(eventEngine, gatewayName) <NEW_LINE> self.mdApi = KsotpMdApi(self) <NEW_LINE> self.tdApi = KsotpTdApi(self) <NEW_LINE> self.mdConnected = False <NEW_LINE> self.... | 金仕达期权接口 | 6259907701c39578d7f143f9 |
class ADDON(object): <NEW_LINE> <INDENT> NAME = "Visual Feedback for Reviews" <NEW_LINE> MODULE = "review_feedback" <NEW_LINE> ID = "1749604199" <NEW_LINE> VERSION = __version__ <NEW_LINE> LICENSE = "GNU AGPLv3" <NEW_LINE> AUTHORS = ( { "name": "Aristotelis P. (Glutanimate)", "years": "2017-2020", "contact": "Glutanima... | Class storing general add-on properties
Property names need to be all-uppercase with no leading underscores | 62599077442bda511e95da1c |
class Envelope(xsd.ComplexType): <NEW_LINE> <INDENT> Header = xsd.Element(Header, nillable=True) <NEW_LINE> Body = xsd.Element(Body) <NEW_LINE> @classmethod <NEW_LINE> def response(cls, tagname, return_object, header=None): <NEW_LINE> <INDENT> envelope = cls() <NEW_LINE> if header is not None: <NEW_LINE> <INDENT> envel... | SOAP Envelope. | 625990773317a56b869bf20a |
class InputMoveRequest(): <NEW_LINE> <INDENT> def __init__(self, direction, strafing=False, rotating=False): <NEW_LINE> <INDENT> self.direction = direction <NEW_LINE> self.strafing = strafing <NEW_LINE> self.rotating = rotating | sent from input controller to model | 6259907755399d3f05627e9d |
class View(Action): <NEW_LINE> <INDENT> pass | Definition associated with a model that represents
the information to be used for the display of associated
set of elements/items of a model. | 6259907721bff66bcd7245f2 |
class station_info: <NEW_LINE> <INDENT> def GET(self): <NEW_LINE> <INDENT> web.header('Access-Control-Allow-Origin', '*') <NEW_LINE> web.header('Content-Type', 'application/json') <NEW_LINE> names = data('snames') <NEW_LINE> nlst = re.findall('[\'|"](.*?)[\'|"]', names) <NEW_LINE> jpinfo = {"snames":nlst,"ignore_rain":... | Returns station information as json. | 625990774a966d76dd5f0874 |
class Configuration: <NEW_LINE> <INDENT> URL = os.environ["PROMETHEUS_HOST_URL"] <NEW_LINE> PROMETHEUS_SERVICE_ACCOUNT_TOKEN = os.environ["PROMETHEUS_SERVICE_ACCOUNT_TOKEN"] <NEW_LINE> HEADERS = {"Authorization": f"bearer {PROMETHEUS_SERVICE_ACCOUNT_TOKEN}"} <NEW_LINE> PROM = PrometheusConnect(url=URL, disable_ssl=True... | Configuration of metrics-exporter. | 625990774a966d76dd5f0875 |
class Meta: <NEW_LINE> <INDENT> model = BountyFulfillment <NEW_LINE> fields = ('fulfiller_address', 'fulfiller_email', 'fulfiller_github_username', 'fulfiller_name', 'fulfillment_id', 'accepted', 'profile', 'created_on', 'accepted_on', 'fulfiller_github_url') | Define the bounty fulfillment serializer metadata. | 62599077ad47b63b2c5a91d8 |
class ProgressBar(WidgetInterface): <NEW_LINE> <INDENT> orientations = { 'left_to_right': gtk.PROGRESS_LEFT_TO_RIGHT, 'right_to_left': gtk.PROGRESS_RIGHT_TO_LEFT, 'bottom_to_top': gtk.PROGRESS_BOTTOM_TO_TOP, 'top_to_bottom': gtk.PROGRESS_TOP_TO_BOTTOM, } <NEW_LINE> def __init__(self, field_name, model_name, attrs=None)... | Progress Bar | 62599077283ffb24f3cf5235 |
@implementer(IFile) <NEW_LINE> class File(Item): <NEW_LINE> <INDENT> def PUT(self, REQUEST=None, RESPONSE=None): <NEW_LINE> <INDENT> request = REQUEST if REQUEST is not None else self.REQUEST <NEW_LINE> response = RESPONSE if RESPONSE is not None else request.response <NEW_LINE> self.dav__init(request, response) <NEW_L... | Convenience subclass for ``File`` portal type
| 625990774e4d562566373d8c |
class CreateVisitTimeIntervalViewTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = User() <NEW_LINE> self.factory = RequestFactory() <NEW_LINE> <DEDENT> def test_get(self): <NEW_LINE> <INDENT> request = self.factory.get(reverse('register')) <NEW_LINE> request.user = self.user <NEW_LIN... | Test the snippet create view | 625990778a43f66fc4bf3b20 |
class FSTStateRemaining: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._state_renaming = dict() <NEW_LINE> self._seen_states = set() <NEW_LINE> <DEDENT> def add_state(self, state, idx): <NEW_LINE> <INDENT> if state in self._seen_states: <NEW_LINE> <INDENT> counter = 0 <NEW_LINE> new_state = state + s... | Class for remaining the states in FST | 6259907767a9b606de54776a |
class ActivityFinalNode(models.Model): <NEW_LINE> <INDENT> __package__ = 'UML.Activities' <NEW_LINE> final_node = models.OneToOneField('FinalNode', on_delete=models.CASCADE, primary_key=True) | An ActivityFinalNode is a FinalNode that terminates the execution of its owning Activity or
StructuredActivityNode. | 625990774f88993c371f11e6 |
class MS_LDA(FSCommand): <NEW_LINE> <INDENT> _cmd = 'mri_ms_LDA' <NEW_LINE> input_spec = MS_LDAInputSpec <NEW_LINE> output_spec = MS_LDAOutputSpec <NEW_LINE> def _list_outputs(self): <NEW_LINE> <INDENT> outputs = self._outputs().get() <NEW_LINE> outputs['vol_synth_file'] = os.path.abspath(self.inputs.output_synth) <NEW... | Perform LDA reduction on the intensity space of an arbitrary # of FLASH images
Examples
--------
>>> grey_label = 2
>>> white_label = 3
>>> zero_value = 1
>>> optimalWeights = MS_LDA(lda_labels=[grey_label, white_label], label_file='label.mgz', weight_file='weights.txt',
shift=zero_value, s... | 625990777cff6e4e811b73ca |
@pytest.mark.skipif(not IS_LINUX, reason="Irrelevant on non-linux") <NEW_LINE> class TestRepr: <NEW_LINE> <INDENT> def test_repr(self) -> None: <NEW_LINE> <INDENT> repr_str = repr(distro._distro) <NEW_LINE> assert "LinuxDistribution" in repr_str <NEW_LINE> for attr in MODULE_DISTRO.__dict__.keys(): <NEW_LINE> <INDENT> ... | Test the __repr__() method. | 6259907701c39578d7f143fa |
class ReLU(Module, Activation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if config.show_calls: <NEW_LINE> <INDENT> print('--- initializing ReLU ---') <NEW_LINE> <DEDENT> self.prev_s = torch.Tensor() <NEW_LINE> <DEDENT> def forward(self, input): <NEW_LINE> <INDENT> if config.show_calls: <NEW_LINE> <IN... | Doc block! | 62599077442bda511e95da1d |
class ObjectExistsRequest(CadRequest): <NEW_LINE> <INDENT> def __init__(self, path, storage_name=None, version_id=None): <NEW_LINE> <INDENT> CadRequest.__init__(self) <NEW_LINE> self.path = path <NEW_LINE> self.storage_name = storage_name <NEW_LINE> self.version_id = version_id <NEW_LINE> <DEDENT> def to_http_info(self... | Request model for object_exists operation.
Initializes a new instance.
:param path File or folder path e.g. '/file.ext' or '/folder'
:param storage_name Storage name
:param version_id File version ID | 625990771b99ca40022901fb |
class LimitCpuResou(LimitBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LimitCpuResou, self).__init__() <NEW_LINE> <DEDENT> def mk_cgroup(self): <NEW_LINE> <INDENT> if self.typelist: <NEW_LINE> <INDENT> for typename in self.typelist: <NEW_LINE> <INDENT> if self.conf[typename]["USE"]=="1": <NEW... | 限制CPU | 6259907763b5f9789fe86af0 |
class CoordinateTransformation(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> this = _osr.new_CoordinateTransformation(*args) <NEW_LINE> try: s... | Proxy of C++ OSRCoordinateTransformationShadow class | 6259907732920d7e50bc79d3 |
class InputModule(AbstractInput): <NEW_LINE> <INDENT> def __init__(self, input_dev, testing=False): <NEW_LINE> <INDENT> super(InputModule, self).__init__(input_dev, testing=testing, name=__name__) <NEW_LINE> self.api_url = None <NEW_LINE> self.api_key = None <NEW_LINE> self.city = None <NEW_LINE> if not testing: <NEW_L... | A sensor support class that gets weather for a city | 62599077fff4ab517ebcf1a2 |
class RestorableSqlDatabasesListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[RestorableSqlDatabaseGetResult]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(RestorableSql... | The List operation response, that contains the SQL database events and their properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of SQL database events and their properties.
:vartype value: list[~azure.mgmt.cosmosdb.models.RestorableSqlDatabaseGetResul... | 62599077ec188e330fdfa232 |
class rocp(_rocbase): <NEW_LINE> <INDENT> alias = 'ROCP', 'RateOfChangePercentage' <NEW_LINE> outputs = 'rocp' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.o.rocp = self.o.rocp - 1.0 | The ROC calculation compares the current price with the price n periods
ago, to determine momentum the as the percent change in price.
Formula:
- rocp = data / data(-period) - 1.0
See:
- https://school.stockcharts.com/doku.php?id=technical_indicators:rate_of_change_roc_and_momentum | 62599077aad79263cf430144 |
class RedisStore(Store): <NEW_LINE> <INDENT> def __init__(self, ip="127.0.0.1", port=6379, db=0): <NEW_LINE> <INDENT> self.db = redis.StrictRedis(host=ip, port=port, db=db) <NEW_LINE> self.timeout = web.webapi.config.session_parameters.timeout <NEW_LINE> <DEDENT> def __contains__(self, key): <NEW_LINE> <INDENT> try: <N... | Store for saving a session in redis | 62599077627d3e7fe0e08814 |
class ErrorContainer(Exception): <NEW_LINE> <INDENT> def append(self, error): <NEW_LINE> <INDENT> self.args += (error, ) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.args) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return iter(self.args) <NEW_LINE> <DEDENT> def __getitem__... | A base error class for collecting multiple errors. | 62599077379a373c97d9a9af |
class NuFluxes(object): <NEW_LINE> <INDENT> Honda2006 = staticmethod(AtmosphericNuFlux("honda2006")) <NEW_LINE> Honda2006H3a = staticmethod(AtmosphericNuFlux("honda2006",knee="gaisserH3a_elbert")) <NEW_LINE> Honda2006H4a = staticmethod(AtmosphericNuFlux("honda2006",knee="gaisserH4a_elbert")) <NEW_LINE> ERS ... | Namespace for neutrino fluxes | 6259907723849d37ff852a43 |
class Purge(BaseView): <NEW_LINE> <INDENT> def update(self): <NEW_LINE> <INDENT> self.purgeLog = [] <NEW_LINE> if super(Purge, self).update(): <NEW_LINE> <INDENT> if 'form.button.Purge' in self.request.form: <NEW_LINE> <INDENT> self.processPurge() <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def processPurge(self): <NEW_LINE>... | The purge control panel
| 6259907766673b3332c31d8b |
class ReactComponent(Enum): <NEW_LINE> <INDENT> TEXT_FIELD = 'TextField' <NEW_LINE> JSON_FIELD = 'JsonField' <NEW_LINE> DATE_FIELD = 'DateField' <NEW_LINE> NUMBER_FIELD = 'NumberField' <NEW_LINE> BOOLEAN_FIELD = 'BooleanField' <NEW_LINE> FUNCTION_FIELD = 'FunctionField' <NEW_LINE> REFERENCE_MANY_FIELD = 'ReferenceManyF... | Represented React components of `admin-on-rest`. | 62599077adb09d7d5dc0bef6 |
class PlaylistLinkFeed(gdata.data.BatchFeed): <NEW_LINE> <INDENT> entry = [PlaylistLinkEntry] | Describes list of playlists | 6259907767a9b606de54776b |
class ExtensionAddon(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.AddonName = None <NEW_LINE> self.AddonParam = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.AddonName = params.get("AddonName") <NEW_LINE> self.AddonParam = params.get("AddonParam") | Information of the add-on selected for installation during cluster creation
| 625990772c8b7c6e89bd5176 |
class NotSentinelInstance(Exception): <NEW_LINE> <INDENT> pass | Raised when Redis instance is not configured as a sentinel | 6259907701c39578d7f143fb |
class Taboo(BaseContract): <NEW_LINE> <INDENT> def __init__(self, contract_name, parent=None): <NEW_LINE> <INDENT> super(Taboo, self).__init__(contract_name, self._get_contract_code(), parent) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _get_contract_code(): <NEW_LINE> <INDENT> return 'vzTaboo' <NEW_LINE> <DEDENT>... | Taboo : Class for Taboos | 625990771b99ca40022901fc |
class SignatureRequest(Resource): <NEW_LINE> <INDENT> pass | Contains information regarding documents that need to be signed
Comprises the following attributes:
test_mode (bool): Whether this is a test signature request. Test
requests have no legal value. Defaults to 0.
signature_request_id (str): The id of the SignatureRequest
requester_email_address (str)... | 6259907756b00c62f0fb425f |
class AssetEnvBaseInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Name = None <NEW_LINE> self.Type = None <NEW_LINE> self.User = None <NEW_LINE> self.Value = None <NEW_LINE> self.MachineIp = None <NEW_LINE> self.MachineName = None <NEW_LINE> self.OsInfo = None <NEW_LINE> self.Quuid... | 资产管理环境变量列表
| 6259907763b5f9789fe86af2 |
class MonitorlogApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> config = Configuration() <NEW_LINE> if api_client: <NEW_LINE> <INDENT> self.api_client = api_client <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if not config.api_client: <NEW_LINE> <INDENT> config.api_client = Ap... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen | 625990774f6381625f19a172 |
class ThreeLayerConvNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=(3, 32, 32), num_filters=32, filter_size=7, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0, dtype=np.float32): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.dtype = dtype <NEW_LINE> b1=np.zeros... | A three-layer convolutional network with the following architecture:
conv - relu - 2x2 max pool - affine - relu - affine - softmax
The network operates on minibatches of data that have shape (N, C, H, W)
consisting of N images, each with height H and width W and with C input
channels. | 62599077be8e80087fbc0a21 |
class ValueFlow: <NEW_LINE> <INDENT> Id = None <NEW_LINE> values = None <NEW_LINE> class Value: <NEW_LINE> <INDENT> intvalue = None <NEW_LINE> tokvalue = None <NEW_LINE> condition = None <NEW_LINE> def __init__(self, element): <NEW_LINE> <INDENT> self.intvalue = element.get('intvalue') <NEW_LINE> if self.intvalue: <NEW... | ValueFlow::Value class
Each possible value has a ValueFlow::Value item.
Each ValueFlow::Value either has a intvalue or tokvalue
C++ class:
http://cppcheck.net/devinfo/doxyoutput/classValueFlow_1_1Value.html
Attributes:
values Possible values | 625990772ae34c7f260aca74 |
class SenderInitializationError(Exception): <NEW_LINE> <INDENT> pass | Error during sender initialization | 62599077a05bb46b3848bdf1 |
class TankAnt(BodyguardAnt): <NEW_LINE> <INDENT> name = 'Tank' <NEW_LINE> damage = 1 <NEW_LINE> food_cost = 6 <NEW_LINE> armor = 2 <NEW_LINE> container = True <NEW_LINE> implemented = True <NEW_LINE> def action(self, colony): <NEW_LINE> <INDENT> bees = list(self.place.bees) <NEW_LINE> for bee in bees: <NEW_LINE> <INDEN... | TankAnt provides both offensive and defensive capabilities. | 625990771f5feb6acb164583 |
class User(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create(data): <NEW_LINE> <INDENT> hashed=generate_password_hash(data['password']) <NEW_LINE> query = "INSERT INTO users (name,username,email,password,role)" "VALUES('%s','%s', '%s', '%s', '%s')" % ( data['name'],data['username'],data['e... | create user | 625990775fdd1c0f98e5f90c |
class FilterExists(object): <NEW_LINE> <INDENT> def validator(self): <NEW_LINE> <INDENT> from flexget import validator <NEW_LINE> root = validator.factory() <NEW_LINE> root.accept('path') <NEW_LINE> bundle = root.accept('list') <NEW_LINE> bundle.accept('path') <NEW_LINE> return root <NEW_LINE> <DEDENT> def get_config(s... | Reject entries that already exist in given path.
Example::
exists: /storage/movies/ | 62599077dc8b845886d54f48 |
class StartPage(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, parent, controller): <NEW_LINE> <INDENT> root = tk.Frame.__init__(self,parent) <NEW_LINE> label = tk.Label(self, text="Welcome to NYC!", font=("Verdana", 20)) <NEW_LINE> label.pack(pady=100,padx=100) <NEW_LINE> button1 = tk.Button(self, text="Search", he... | This class bulid the Home page of the GUI | 6259907755399d3f05627ea1 |
class BaseScenario(Scenario): <NEW_LINE> <INDENT> objects = GeoInheritanceManager() <NEW_LINE> class Meta(object): <NEW_LINE> <INDENT> abstract = False <NEW_LINE> app_label = 'footprint' | BaseScenarios represent an editing of primary or BaseFeature data. | 6259907732920d7e50bc79d6 |
class Sequential(Module): <NEW_LINE> <INDENT> def __init__(self, *modules: Module): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.modules = modules <NEW_LINE> self.input = None <NEW_LINE> <DEDENT> def forward(self, input): <NEW_LINE> <INDENT> self.input = input <NEW_LINE> output = input <NEW_LINE> for module i... | A sequential model.
:param *modules: modules in sequential order | 62599077097d151d1a2c2a04 |
class MM_STATUS(Layer3): <NEW_LINE> <INDENT> constructorList = [ie for ie in Header(5, 49)] <NEW_LINE> def __init__(self, with_options=True, **kwargs): <NEW_LINE> <INDENT> Layer3.__init__(self) <NEW_LINE> self.extend([ Int('Cause', Pt=2, Type='uint8', Dict=Reject_dict)]) <NEW_LINE> self._post_init(with_optio... | Net <-> ME
Local
# content #
Cause is 1 byte | 6259907760cbc95b06365a34 |
class T_RotMxInfo(ct.Structure): <NEW_LINE> <INDENT> _fields_ = [("EigenVector", ct.c_int * 3), ("Order", ct.c_int), ("Inverse", ct.c_int), ("RefAxis", ct.c_char), ("DirCode", ct.c_char)] | EigenVector: the rotation axis of the affiliated rotation Matrix
Order: one of {1, 2, 3, 4, 6, -1, -2, -3, -4, -6}
Inverse: 0 - rotation matrix has a positive turn angle
-1 - rotation matrix has a negative turn angle
RefAxis: one of {o, x, y, z}
Dircode: one of {. = " ' | \ *} | 6259907766673b3332c31d8d |
class KeyMotorActor(pykka.ThreadingActor): <NEW_LINE> <INDENT> use_daemon_thread = True <NEW_LINE> def __init__(self, hub_actor): <NEW_LINE> <INDENT> super(KeyMotorActor, self).__init__() <NEW_LINE> self.hub_actor = hub_actor <NEW_LINE> <DEDENT> def open(self, callback): <NEW_LINE> <INDENT> self.hub_actor.key_motor_to_... | 鍵のモーターを扱うアクター | 62599077796e427e53850108 |
class Mpg123(Plugin): <NEW_LINE> <INDENT> height = 1 <NEW_LINE> width = 1 <NEW_LINE> playing = False <NEW_LINE> def pad_down_callback(self, pad): <NEW_LINE> <INDENT> if not self.playing: <NEW_LINE> <INDENT> self.start() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.stop() <NEW_LINE> <DEDENT> self.playing = not sel... | Plays mp3's in a subprocess using mpg123. Press button once to
start off the mp3, press button again to kill all mpg123's
running.
Example config:
[rickroll]
mp3 = /path/to/rick.mp3
plugin = mpg123
position = 0 | 62599077f9cc0f698b1c5f93 |
class ContestWebServer(WebService): <NEW_LINE> <INDENT> def __init__(self, shard, contest): <NEW_LINE> <INDENT> logger.initialize(ServiceCoord("ContestWebServer", shard)) <NEW_LINE> self.contest = contest <NEW_LINE> self.notifications = {} <NEW_LINE> parameters = { "login_url": "/", "template_path": pkg_resources.resou... | Service that runs the web server serving the contestants.
| 6259907767a9b606de54776c |
class DownloadFactory(CommandFactory): <NEW_LINE> <INDENT> def __init__(self, n_threads=1, memory=4): <NEW_LINE> <INDENT> CommandFactory.__init__(self, args.basedir, n_threads, memory, "dl") <NEW_LINE> <DEDENT> def make_cmd(self, s): <NEW_LINE> <INDENT> cmd = "/usr/bin/Rscript %ssrc/downloadSRA.R %s %s '%s' " % ... | Generate command line calls to download SRA fastq files
| 625990772c8b7c6e89bd5178 |
class DocumentReader(Reader): <NEW_LINE> <INDENT> @defer.inlineCallbacks <NEW_LINE> def open(self, url): <NEW_LINE> <INDENT> cache = self.cache() <NEW_LINE> id = self.mangle(url, 'document') <NEW_LINE> d = cache.get(id) <NEW_LINE> if d is None: <NEW_LINE> <INDENT> d = yield self.download(url) <NEW_LINE> cache.put(id, d... | The XML document reader provides an integration
between the SAX L{Parser} and the document cache. | 6259907716aa5153ce401e69 |
class gbdWebsuiteDockWidgetTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dockwidget = gbdWebsuiteDockWidget(None) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.dockwidget = None <NEW_LINE> <DEDENT> def test_dockwidget_ok(self): <NEW_LINE> <INDENT> pass | Test dockwidget works. | 6259907799cbb53fe6832874 |
class Error(Model): <NEW_LINE> <INDENT> def __init__(self, error_message: str=None, error_code: str=None, error_link: str=None, user_message: str=None): <NEW_LINE> <INDENT> self.swagger_types = { 'error_message': str, 'error_code': str, 'error_link': str, 'user_message': str } <NEW_LINE> self.attribute_map = { 'error_m... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62599077baa26c4b54d50c40 |
class Celula: <NEW_LINE> <INDENT> def __init__(self, v=0, p=1): <NEW_LINE> <INDENT> self.vertice = int(v) <NEW_LINE> self.peso = int(p) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.vertice == other.vertice | Classe que implementa uma celula de aresta | 625990774f6381625f19a173 |
class TEST23(PMEM2_SOURCE_DEVDAX): <NEW_LINE> <INDENT> test_case = "test_pmem2_src_mcsafe_read_write_invalid_ftype" | test mcsafe read and write operations on source with invalid type on devdax | 62599077e1aae11d1e7cf4d7 |
class CabButton: <NEW_LINE> <INDENT> def __init__(self, pin_no, name): <NEW_LINE> <INDENT> self.pin = Pin(pin_no, Pin.IN, Pin.PULL_UP) <NEW_LINE> self.name = name <NEW_LINE> self.out_button = None <NEW_LINE> self.auto_rate = "N/A" <NEW_LINE> self.active = 1 <NEW_LINE> self.inactive = 0 <NEW_LINE> self.ticks = 0 <NEW_LI... | Represents a physical button of a cabinet. Connects to cab panel. | 625990772c8b7c6e89bd5179 |
class TestUtil(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls._work_dir = "test_fluiddyn_util_util" <NEW_LINE> if not os.path.exists(cls._work_dir): <NEW_LINE> <INDENT> os.mkdir(cls._work_dir) <NEW_LINE> <DEDENT> os.chdir(cls._work_dir) <NEW_LINE> <DEDENT> @... | Test fluiddyn.util.util module. | 625990773539df3088ecdc27 |
class SerializeReceiver(Receiver): <NEW_LINE> <INDENT> def __init__(self, format): <NEW_LINE> <INDENT> self.format = format <NEW_LINE> <DEDENT> def get_data(self, request, method): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> deserialized_objects = list(serializers.deserialize(self.format, request.raw_post_data)) <NEW_... | Base class for all data formats possible
within Django's serializer framework. | 625990775fdd1c0f98e5f90e |
class AzLexer(RegexLexer): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> commands = GatherCommands() <NEW_LINE> tokens = { 'root': [ (words( tuple(kid.data for kid in commands.command_tree.children), prefix=r'\b', suffix=r'\b'), Keyword), (words( tuple(commands.get_all_subcommands()), prefix=r'\b', suffix=r'\b'), Keywor... | A custom lexer for Azure CLI | 62599077627d3e7fe0e08818 |
class ButtonMixin(object): <NEW_LINE> <INDENT> class Media: <NEW_LINE> <INDENT> js = ('js/admin-button.js',) | Prevent double-clicking button double save | 62599077009cb60464d02ecc |
class Terminated(BaseModel): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> db_table = 'terminated' <NEW_LINE> <DEDENT> code = CharField(8) <NEW_LINE> name = CharField(32) <NEW_LINE> o_date = CharField() <NEW_LINE> t_date = CharField() <NEW_LINE> insert_date = CharField() | 沪深300成分及权重 | 62599077f9cc0f698b1c5f94 |
class VolumeTypeExtraSpecs(BASE, ManilaBase): <NEW_LINE> <INDENT> __tablename__ = 'volume_type_extra_specs' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> key = Column(String(255)) <NEW_LINE> value = Column(String(255)) <NEW_LINE> volume_type_id = Column(String(36), ForeignKey('volume_types.id'), nullable... | Represents additional specs as key/value pairs for a volume_type. | 6259907771ff763f4b5e913c |
class NewTypeExpr(Expression): <NEW_LINE> <INDENT> name = None <NEW_LINE> old_type = None <NEW_LINE> info = None <NEW_LINE> def __init__(self, name: str, old_type: 'mypy.types.Type', line: int) -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.old_type = old_type <NEW_LINE> <DEDENT> def accept(self, visitor... | NewType expression NewType(...). | 625990774f88993c371f11e9 |
class IncomeApiTestCase(NamedModelApiTestCase): <NEW_LINE> <INDENT> factory_class = factories.IncomeModelFactory <NEW_LINE> model_class = models.Income <NEW_LINE> serializer_class = serializers.IncomeSerializer <NEW_LINE> url_detail = "income-detail" <NEW_LINE> url_list = "income-list" <NEW_LINE> name = factories.Incom... | Income API unit test class. | 6259907744b2445a339b7626 |
class ExifItem(BaseModel): <NEW_LINE> <INDENT> image = models.ForeignKey(Image, on_delete=models.CASCADE) <NEW_LINE> key = models.CharField(max_length=255) <NEW_LINE> value_str = models.CharField(max_length=65536, null=True) <NEW_LINE> value_int = models.IntegerField(null=True) <NEW_LINE> value_float = models.FloatFiel... | Piece of exif info of a certain Image | 6259907799cbb53fe6832876 |
class DiredOpenExternalCommand(TextCommand, DiredBaseCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> path = self.path <NEW_LINE> files = self.get_selected(parent=False) <NEW_LINE> fname = join(path, files[0] if files else '') <NEW_LINE> p, f = os.path.split(fname.rstrip(os.sep)) <NEW_LINE> if no... | open dir/file in external file explorer | 62599077be8e80087fbc0a25 |
class UserProfileFeedViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.ProfileFeedItemSerializer <NEW_LINE> queryset = models.ProfileFeedItem.objects.all() <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (permissions.UpdateOwnStatus, IsAuthenti... | Handles creating, reading and updating profile feed items | 62599077283ffb24f3cf523c |
class StdInSocketChannel(ZMQSocketChannel): <NEW_LINE> <INDENT> msg_queue = None <NEW_LINE> def __init__(self, context, session, address): <NEW_LINE> <INDENT> super(StdInSocketChannel, self).__init__(context, session, address) <NEW_LINE> self.ioloop = ioloop.IOLoop() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDEN... | A reply channel to handle raw_input requests that the kernel makes. | 625990773539df3088ecdc29 |
class TestVARMA(CheckFREDManufacturing): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT> true = results_varmax.fred_varma11.copy() <NEW_LINE> true['predict'] = varmax_results.iloc[1:][['predict_varma11_1', 'predict_varma11_2']] <NEW_LINE> true['dynamic_predict'] = varmax_results.il... | Test against the sspace VARMA example with some params set to zeros. | 625990775fdd1c0f98e5f90f |
class WorkerTests(ChannelTestCase): <NEW_LINE> <INDENT> def test_channel_filters(self): <NEW_LINE> <INDENT> worker = Worker(None, only_channels=["yes.*", "maybe.*"]) <NEW_LINE> self.assertEqual( worker.apply_channel_filters(["yes.1", "no.1"]), ["yes.1"], ) <NEW_LINE> self.assertEqual( worker.apply_channel_filters(["yes... | Tests that the router's routing code works correctly. | 6259907723849d37ff852a49 |
class Solution: <NEW_LINE> <INDENT> def lowestCommonAncestor(self, root: TreeNode, p: TreeNode, q: TreeNode) -> TreeNode: <NEW_LINE> <INDENT> if root.val == p.val and self.find(root, q): <NEW_LINE> <INDENT> return root <NEW_LINE> <DEDENT> if root.val == q.val and self.find(root, p): <NEW_LINE> <INDENT> return root <NEW... | 当两个节点互为父子节点时,最近的公共节点就是父节点本身;
否则,必为一个节点在左子树,一个节点在右子树;
超时 | 62599077cc0a2c111447c79a |
class TotalClashScoreReader(object): <NEW_LINE> <INDENT> def __init__(self, line=False, *args, **kwds): <NEW_LINE> <INDENT> self.readline(line) <NEW_LINE> <DEDENT> def readline(self, line=False): <NEW_LINE> <INDENT> if line: <NEW_LINE> <INDENT> self.clashscore = float(line) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>... | Reads the single value line produced by "phenix.clashscore verbose=False" | 625990773346ee7daa338329 |
class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('username', 'last_login', 'first_name', 'last_name', 'email') | User name fields required. | 62599077091ae356687065cd |
class BinaryOperation(Operation): <NEW_LINE> <INDENT> def __init__(self, left: Operation, right: Operation): <NEW_LINE> <INDENT> self._left = left <NEW_LINE> self._right = right <NEW_LINE> <DEDENT> @property <NEW_LINE> def info(self): <NEW_LINE> <INDENT> return '{} {} {}'.format( get_contract_info(self._left), self._op... | Operation combining two operations | 625990777b180e01f3e49d2e |
class LowerCaseProperty(_DerivedProperty): <NEW_LINE> <INDENT> def __init__(self, property, *args, **kwargs): <NEW_LINE> <INDENT> super(LowerCaseProperty, self).__init__( lambda self: property.__get__(self, type(self)).lower(), *args, **kwargs) | A convenience class for generating lower-cased fields for filtering.
Example usage:
>>> class Pet(db.Model):
... name = db.StringProperty(required=True)
... name_lower = LowerCaseProperty(name)
>>> pet = Pet(name='Fido')
>>> pet.name_lower
'fido' | 625990775fcc89381b266e23 |
class WeatherAlert: <NEW_LINE> <INDENT> def __init__(self, alert): <NEW_LINE> <INDENT> self.title = alert.title <NEW_LINE> self.time = pytz.utc.localize(datetime.utcfromtimestamp(alert.time)) <NEW_LINE> try: <NEW_LINE> <INDENT> self.expires = pytz.utc.localize(datetime.utcfromtimestamp(alert.expires)) <NEW_LINE> <DEDEN... | This is for storing weather alerts. The fields are very similar to a ForecastAlert. | 6259907756b00c62f0fb4265 |
class BNMF(NMF): <NEW_LINE> <INDENT> _LAMB_INCREASE_W = 1.1 <NEW_LINE> _LAMB_INCREASE_H = 1.1 <NEW_LINE> def update_h(self): <NEW_LINE> <INDENT> H1 = np.dot(self.W.T, self.data[:,:]) + 3.0*self._lamb_H*(self.H**2) <NEW_LINE> H2 = np.dot(np.dot(self.W.T,self.W), self.H) + 2*self._lamb_H*(self.H**3) + self._lamb_H*self.H... | BNMF(data, data, num_bases=4)
Binary Matrix Factorization. Factorize a data matrix into two matrices s.t.
F = | data - W*H | is minimal. H and W are restricted to binary values.
Parameters
----------
data : array_like, shape (_data_dimension, _num_samples)
the input data
num_bases: int, optional
Number... | 62599077167d2b6e312b825b |
class UsageError(RuntimeError): <NEW_LINE> <INDENT> pass | Should be raised in case an error happens in the setup rather than the test. | 62599077ec188e330fdfa23a |
class NACCESSTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_NACCESS_rsa_file(self): <NEW_LINE> <INDENT> with open("PDB/1A8O.rsa") as rsa: <NEW_LINE> <INDENT> naccess = process_rsa_data(rsa) <NEW_LINE> <DEDENT> self.assertEqual(len(naccess), 66) <NEW_LINE> <DEDENT> def test_NACCESS_asa_file(self): <NEW_LINE> <IN... | Tests for NACCESS parsing etc which don't need the binary tool.
See also test_NACCESS_tool.py for run time testing with the tool. | 625990777047854f46340d4d |
class Menu(MenuComponent, metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, name: str, description: str): <NEW_LINE> <INDENT> self.menu_components = [] <NEW_LINE> self.name = name <NEW_LINE> self.description = description <NEW_LINE> <DEDENT> def add(self, menu_component: MenuComponent): <NEW_LINE> <INDENT> sel... | Menu class | 62599077a8370b77170f1d61 |
class ApresentadoresViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Apresentadores.objects.all() <NEW_LINE> serializer_class = ApresentadoresSerializer | API endpoint that allows groups to be viewed or edited. | 6259907792d797404e389825 |
class ArticlePost(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> avatar = models.ImageField(upload_to='article/%Y%m%d/', blank=True) <NEW_LINE> column = models.ForeignKey( ArticleColumn, null=True, blank=True, on_delete=models.CASCADE, related_name='article' ) <... | 文章的 Model | 625990779c8ee82313040e51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.