code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <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... | rectangle with private instance attributes width and height | 62598f6b63f4b57ef008592d |
class LTREE(sqltypes.Concatenable, sqltypes.TypeEngine): <NEW_LINE> <INDENT> class Comparator(sqltypes.Concatenable.Comparator): <NEW_LINE> <INDENT> def ancestor_of(self, other): <NEW_LINE> <INDENT> if isinstance(other, list): <NEW_LINE> <INDENT> return self.op('@>')(expression.cast(other, ARRAY(LTREE))) <NEW_LINE> <DE... | Postgresql LTREE type.
The LTREE datatype can be used for representing labels of data stored in
hierarchial tree-like structure. For more detailed information please refer
to http://www.postgresql.org/docs/9.1/static/ltree.html.
.. note::
Using :class:`LTREE`, :class:`LQUERY` and :class:`LTXTQUERY` types may
... | 62598f6b5e10d32532ce34a8 |
class VeloSensor(Entity): <NEW_LINE> <INDENT> def __init__(self, name, station_id, show_on_map): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._station_id = station_id <NEW_LINE> self._show_on_map = show_on_map <NEW_LINE> self._attrs = {} <NEW_LINE> self._station_data = {} <NEW_LINE> self._state = None <NEW_LIN... | Get the available amount of bikes and set the station attributes. | 62598f6b925a0f43d25e77b5 |
class IAgentType(enum.Enum): <NEW_LINE> <INDENT> REDIS = 1 <NEW_LINE> MEMCACHED = 2 <NEW_LINE> NOSQL = 3 <NEW_LINE> CONFIGURATION = 4 <NEW_LINE> LOG = 5 <NEW_LINE> OTHERS = -1 | Defines all config agent supported by DI
| 62598f6bc432627299fa2750 |
class CachingNamespaceAPI(object): <NEW_LINE> <INDENT> def __init__(self, user): <NEW_LINE> <INDENT> self._api = NamespaceAPI(user, factory=CachingAPIFactory()) <NEW_LINE> <DEDENT> def create(self, values): <NEW_LINE> <INDENT> return self._api.create(values) <NEW_LINE> <DEDENT> def delete(self, paths): <NEW_LINE> <INDE... | The public API to cached namespace-related logic in the model.
@param user: The L{User} to perform operations on behalf of. | 62598f6b30c21e258be97f7c |
class meshdata(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> with adios2.open("xgc.mesh.bp","r") as fm: <NEW_LINE> <INDENT> rz=fm.read('rz') <NEW_LINE> self.cnct=fm.read('/cell_set[0]/node_connect_list') <NEW_LINE> self.r=rz[:,0] <NEW_LINE> self.z=rz[:,1] <NEW_LINE> self.triobj = Triangulation(se... | mesh data class for 2D contour plot | 62598f6bff9c53063f519dd3 |
class UpdateAlarmInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(UpdateAlarmInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_AccessTokenSecret(self, value): <NEW_LINE> <INDENT> super(UpdateAlarmInputSet, self)._set_input('AccessTokenSecret'... | An InputSet with methods appropriate for specifying the inputs to the UpdateAlarm
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f6bd4950a0f3b1109f6 |
class ExactGP(gpytorch.models.ExactGP): <NEW_LINE> <INDENT> def __init__(self, train_x, train_y, likelihood, mean=None, kernel=None): <NEW_LINE> <INDENT> super().__init__(train_x, train_y, likelihood) <NEW_LINE> if mean is None: <NEW_LINE> <INDENT> mean = gpytorch.means.ZeroMean() <NEW_LINE> <DEDENT> self.mean_module =... | Exact GP Model.
A GP Model outputs at location `x' a Multivariate Normal given by:
..math:: A = [K(x_t, x_t) + \sigma^2 I]^-1
..math:: \mu(x) = m(x) + K(x, x_t)^\top A (y_t - m(x_t))
..math:: \Sigma(x) = K(x, x) - K(x, x_t)^\top A K(x_t, x)
Parameters
----------
train_x: Tensor
Tensor of dimension N x dim_x.
tra... | 62598f6b796e427e5384df12 |
class Arena(StructuredNode): <NEW_LINE> <INDENT> name = StringProperty(required=True, unique_index=True) <NEW_LINE> venue_id = IntegerProperty(required=True, unique_index=True) <NEW_LINE> capacity = IntegerProperty(required=True) <NEW_LINE> latitude = FloatProperty(required=True) <NEW_LINE> longitude = FloatProperty(re... | Boilerplate for an arena node
name (str): name of the arena
capacity (int): capacity of the arena
latitude (float): latitude of arena
longitude (float): longitude of arena | 62598f6b5e10d32532ce34a9 |
class envelope_armature_settings_op(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "armature.envelope_armature_settings" <NEW_LINE> bl_label = "Envelope Armature Settings" <NEW_LINE> bl_space_type = "VIEW_3D" <NEW_LINE> bl_region_type = "TOOLS" <NEW_LINE> bl_category ="Tools" <NEW_LINE> bl_options = {'UNDO','REGI... | Set the envelopes and radii of an armature's bones for use in curve/mesh sync. | 62598f6b167d2b6e312b66fa |
class SystemEnvironment(AbstractEnvironment, Env): <NEW_LINE> <INDENT> def __init__(self, system, initial_state=None, reward=None, termination_model=None): <NEW_LINE> <INDENT> super().__init__( dim_state=system.dim_state, dim_action=system.dim_action, dim_observation=system.dim_observation, action_space=system.action_s... | Wrapper for System Environments.
Parameters
----------
system: AbstractSystem
underlying system
initial_state: callable, optional
callable that returns an initial state
reward: callable, optional
callable that, given state and action returns a rewards
termination_model: callable, optional
callable that... | 62598f6b91af0d3eaad39588 |
class AnalysisInfo(Processing): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> self.key = "info" <NEW_LINE> db = Database() <NEW_LINE> dbtask = db.view_task(self.task["id"], details=True) <NEW_LINE> if dbtask: <NEW_LINE> <INDENT> task = dbtask.to_dict() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if os.path.i... | General information about analysis session. | 62598f6b50485f2cf55da6ec |
@dataclasses.dataclass <NEW_LINE> class BreakpointResolved: <NEW_LINE> <INDENT> breakpointId: BreakpointId <NEW_LINE> location: Location <NEW_LINE> @classmethod <NEW_LINE> def from_json(cls, json: dict) -> BreakpointResolved: <NEW_LINE> <INDENT> return cls( BreakpointId(json["breakpointId"]), Location.from_json(json["l... | Fired when breakpoint is resolved to an actual script and location.
Attributes
----------
breakpointId: BreakpointId
Breakpoint unique identifier.
location: Location
Actual breakpoint location. | 62598f6bd10714528d69d649 |
class Config(object): <NEW_LINE> <INDENT> STATIC_PATH = "app/static" <NEW_LINE> SQLALCHEMY_TRACK_MODIFICATIONS = False <NEW_LINE> LOG_LEVEL = "INFO" | Common configurations | 62598f6b7c178a314d78cc20 |
class WordWriter: <NEW_LINE> <INDENT> def __init__(self, ofs: typing.TextIO, width: int = 80): <NEW_LINE> <INDENT> self.line = [] <NEW_LINE> self.line_len = 0 <NEW_LINE> self.width = width <NEW_LINE> self.ofs = ofs <NEW_LINE> <DEDENT> def _flush(self): <NEW_LINE> <INDENT> self.ofs.write(' '.join(self.line) + '\n') <NEW... | A simple interface to output space-separated words in lines of fixed
maximum width. | 62598f6b925a0f43d25e77b8 |
class ColumnWiseBlock(BaseBlock): <NEW_LINE> <INDENT> engine = None <NEW_LINE> def __init__(self, name, column: Union[str, List] = '__all__', excludes: Union[None, List] = None, **kwargs): <NEW_LINE> <INDENT> super(ColumnWiseBlock, self).__init__(name=name, **kwargs) <NEW_LINE> self.column = column <NEW_LINE> self.excl... | apply feature engineering for each columns. | 62598f6b4d74a7450cd58a97 |
class CustomIndexDashboard(Dashboard): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> Dashboard.__init__(self, **kwargs) <NEW_LINE> self.children.append(modules.LinkList( title=_('Quick links'), layout='inline', draggable=False, deletable=False, collapsible=False, children=[ { 'title': _('Return ... | Custom index dashboard for twtv3. | 62598f6b76d4e153a661c396 |
class MajorityElement: <NEW_LINE> <INDENT> def find_majority_element(self, nums: List[int]) -> int: <NEW_LINE> <INDENT> count_ht = {} <NEW_LINE> max_count = len(nums) // 2 <NEW_LINE> if max_count == 0: <NEW_LINE> <INDENT> return nums[0] <NEW_LINE> <DEDENT> for n in nums: <NEW_LINE> <INDENT> count = count_ht.get(n) <NEW... | Source : https://leetcode.com/problems/majority-element/
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
You may assume that the array is non-empty and the majority element always exist in the array.
Example 1:
Input: [3,2,3]
Out... | 62598f6bfb3f5b602db47d70 |
class Player(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, start_x, start_y, width, height): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.images = [] <NEW_LINE> self.images.append(pygame.transform.scale( pygame.image.load(player_image), (width, height))) <NEW_LINE> self.images... | The class that holds the main player, and controls how they jump. nb. The player doens't move left or right, the world moves around them | 62598f6b1f037a2d8b9e386d |
@skipIf(NO_MOCK, NO_MOCK_REASON) <NEW_LINE> class LocaleTestCase(TestCase): <NEW_LINE> <INDENT> def test_system(self): <NEW_LINE> <INDENT> ret = [{'changes': {}, 'comment': 'System locale salt already set', 'name': 'salt', 'result': True}, {'changes': {}, 'comment': 'System locale saltstack needs to be set', 'name': 's... | Validate the locale state | 62598f6bec188e330fdf8020 |
class TestHostSensorSerser(JNTTServer, JNTTServerCommon): <NEW_LINE> <INDENT> loglevel = logging.DEBUG <NEW_LINE> path = '/tmp/janitoo_test' <NEW_LINE> broker_user = 'toto' <NEW_LINE> broker_password = 'toto' <NEW_LINE> server_class = HostSensorServer <NEW_LINE> server_conf = "tests/data/janitoo_hostsensor.conf" <NEW_L... | Test the hostsensor server
| 62598f6b8e05c05ec3f6ea05 |
class Currency(Enum): <NEW_LINE> <INDENT> USD = "USD" <NEW_LINE> INR = "INR" <NEW_LINE> CAD = "CAD" | Set of choices for the status | 62598f6b3eb6a72ae0389dc1 |
class ToManyRequests(HTTPException): <NEW_LINE> <INDENT> pass | Exception that's thrown when status code 429 occurs. | 62598f6b0383005118f6ce8c |
class AgentSSH(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._conn = None <NEW_LINE> self._keys = () <NEW_LINE> <DEDENT> def get_keys(self): <NEW_LINE> <INDENT> return self._keys <NEW_LINE> <DEDENT> def _connect(self, conn): <NEW_LINE> <INDENT> self._conn = conn <NEW_LINE> ptype, result = se... | Client interface for using private keys from an SSH agent running on the
local machine. If an SSH agent is running, this class can be used to
connect to it and retreive L{PKey} objects which can be used when
attempting to authenticate to remote SSH servers.
Because the SSH agent protocol uses environment variables an... | 62598f6bfb3f5b602db47d71 |
class ApiError(_BaseError): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> type = 'ApiError' <NEW_LINE> message = 'Something went wrong while processing that request' <NEW_LINE> status = 500 <NEW_LINE> code = 100 <NEW_LINE> super(ApiError, self).__init__(type, message, status, code, None) | An error indicating that something went wrong, but the exact
reason cannot be described. Typically, this appears when an
error goes unhandled | 62598f6bd18da76e235b6cf6 |
class Recall: <NEW_LINE> <INDENT> def __init__(self, is_multilabel=True): <NEW_LINE> <INDENT> self.is_multilabel = is_multilabel <NEW_LINE> self.__metric = ig_metrics.Recall( average=True, is_multilabel=self.is_multilabel) <NEW_LINE> <DEDENT> def update(self, y_pred, y): <NEW_LINE> <INDENT> self.__metric.update((y_pred... | Wrapper metric around `pytorch-ignite`. | 62598f6bbf627c535bcb0c01 |
class MobileSignupAPIView(CreateAPIView): <NEW_LINE> <INDENT> queryset = get_user_model() <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> permission_classes = (AllowAny, ) <NEW_LINE> authentication_classes = () <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> username = request.POST.get(... | Mobile 일반 회원가입 | 62598f6b9b70327d1c57e52b |
class MavenBuild(Maven): <NEW_LINE> <INDENT> def __init__(self, build_dir, definition=None): <NEW_LINE> <INDENT> assert MavenBuild.is_build_dir(build_dir) <NEW_LINE> super().__init__() <NEW_LINE> self.build_dir = os.path.abspath(build_dir) <NEW_LINE> self.definition = definition <NEW_LINE> <DEDENT> @property <NEW_LINE>... | MavenBuild represents a build directory initialized by maven.
The build instance can be used to build/test/install. It alleviates the
user to know which generator is used. | 62598f6b30c21e258be97f81 |
class Geocode(db.Model): <NEW_LINE> <INDENT> __tablename__ = "geocodes" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> zipcode = db.Column(db.String(5), nullable=False) <NEW_LINE> country = db.Column(db.String(2), nullable=False) <NEW_LINE> latitude = db.Column(db.Float) <NEW_LINE> longitude = db.Co... | Location data with latitudes and longitudes.
- location identifier
- zipcode
- country
- latitude
- longitude
- stack identifier | 62598f6b8e05c05ec3f6ea06 |
@dataclass <NEW_LINE> class PathInfo: <NEW_LINE> <INDENT> path_pair: Tuple[str, str] <NEW_LINE> files_to_copy: List[str] <NEW_LINE> dirs_to_copy: List[str] | Class for holding a path pair from installed to repo path and also holds
information about which files and directories belong to the path | 62598f6b167d2b6e312b66fe |
class MotionSensor(SmoothedInputDevice): <NEW_LINE> <INDENT> def __init__( self, pin=None, queue_len=1, sample_rate=10, threshold=0.5, partial=False, pull_up=False, pin_factory=None): <NEW_LINE> <INDENT> super(MotionSensor, self).__init__( pin, pull_up=pull_up, threshold=threshold, queue_len=queue_len, sample_wait=1 / ... | Extends :class:`SmoothedInputDevice` and represents a passive infra-red
(PIR) motion sensor like the sort found in the `CamJam #2 EduKit`_.
.. _CamJam #2 EduKit: http://camjam.me/?page_id=623
A typical PIR device has a small circuit board with three pins: VCC, OUT,
and GND. VCC should be connected to a 5V pin, GND to... | 62598f6b50485f2cf55da6f0 |
class Dtlink5(Package): <NEW_LINE> <INDENT> homepage = "http://www.example.com" <NEW_LINE> url = "http://www.example.com/dtlink5-1.0.tar.gz" <NEW_LINE> version('1.0', '0123456789abcdef0123456789abcdef') | Simple package which acts as a link dependency | 62598f6bd99f1b3c44d04e35 |
class ReplayBuffer: <NEW_LINE> <INDENT> def __init__(self, action_size, buffer_size, batch_size, seed): <NEW_LINE> <INDENT> self.action_size = action_size <NEW_LINE> self.memory = deque(maxlen=buffer_size) <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.experience = namedtuple("Experience", field_names=["state"... | Fixed-size buffer to store experience tuples. | 62598f6bec188e330fdf8024 |
class Article: <NEW_LINE> <INDENT> def __init__(self, info, headline, link_to_site, image, date_written, daysSince): <NEW_LINE> <INDENT> self.info = info <NEW_LINE> self.headline = headline <NEW_LINE> self.link_to_site = link_to_site <NEW_LINE> self.image = image <NEW_LINE> self.date_written = date_written <NEW_LINE> s... | This class defines the Article objects | 62598f6b21bff66bcd7223e0 |
class ITaxonomySelect2Widget(Interface): <NEW_LINE> <INDENT> pass | Marker interface for the taxonomy select widget | 62598f6b6e29344779affddf |
class ProcUptime(KernelProcFileTestBase.KernelProcFileTestBase): <NEW_LINE> <INDENT> def parse_contents(self, contents): <NEW_LINE> <INDENT> return self.parse_line("{:f} {:f}\n", contents)[0] <NEW_LINE> <DEDENT> def get_path(self): <NEW_LINE> <INDENT> return "/proc/uptime" | /proc/uptime tells how long the system has been running. | 62598f6b50485f2cf55da6f1 |
class semicolon(parser.semicolon): <NEW_LINE> <INDENT> def __init__(self, sString=';'): <NEW_LINE> <INDENT> parser.semicolon.__init__(self) | unique_id = report_statement : semicolon | 62598f6b56b00c62f0fb2039 |
class Caja(Actor): <NEW_LINE> <INDENT> def iniciar(self, x, y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.imagen = self.pilas.imagenes.cargar('caja.png') <NEW_LINE> self.radio_de_colision = 25 <NEW_LINE> self.aprender(self.pilas.habilidades.RebotarComoCaja) | Representa una caja que posee fisica.
.. image:: images/actores/caja.png | 62598f6b1f5feb6acb1623bb |
class Bala(actores.Actor): <NEW_LINE> <INDENT> def __init__(self, pilas, x=0, y=0, rotacion=0, velocidad_maxima=9, angulo_de_movimiento=90): <NEW_LINE> <INDENT> super(Bala, self).__init__(pilas=pilas, x=x, y=y) <NEW_LINE> self.imagen = pilas.imagenes.cargar('disparos/bola_amarilla.png') <NEW_LINE> self.rotacion = rotac... | Representa una bala que va en línea recta. | 62598f6bc432627299fa2759 |
class RecipeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.RecipeSerializer <NEW_LINE> queryset = Recipe.objects.all() <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> ... | Manage recipes in the database | 62598f6bd164cc61758206f9 |
class RouteFilterListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[RouteFilter]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(RouteFilterListResult, self).__init__(**kwargs) <NEW... | Response for the ListRouteFilters API service call.
:param value: Gets a list of route filters in a resource group.
:type value: list[~azure.mgmt.network.v2018_01_01.models.RouteFilter]
:param next_link: The URL to get the next set of results.
:type next_link: str | 62598f6bd18da76e235b6cf8 |
class DeleteLaunchConfigurationRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.LaunchConfigurationId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.LaunchConfigurationId = params.get("LaunchConfigurationId") | DeleteLaunchConfiguration request structure.
| 62598f6bfb3f5b602db47d73 |
class InvenioGitHubAPIException(Exception): <NEW_LINE> <INDENT> pass | General GitHub API Exception. | 62598f6b30c21e258be97f84 |
class TimeoutMessage(RoutedMessageBase): <NEW_LINE> <INDENT> ident = 'TIM' <NEW_LINE> def __init__(self, nodes='', srcid=0): <NEW_LINE> <INDENT> RoutedMessageBase.__init__(self, srcid) <NEW_LINE> self.attr.update({'nodes': str}) <NEW_LINE> self.nodes = nodes | container message for timeout notification | 62598f6ba4f1c619b294dd7a |
class Account(object): <NEW_LINE> <INDENT> interest = 0.02 <NEW_LINE> def __init__(self, account_holder): <NEW_LINE> <INDENT> self.balance = 0 <NEW_LINE> self.holder = account_holder <NEW_LINE> self.transactions = [] <NEW_LINE> <DEDENT> def deposit(self, amount): <NEW_LINE> <INDENT> self.balance = self.balance + amount... | A bank account that allows deposits and withdrawals.
>>> eric_account = Account('Eric')
>>> eric_account.deposit(1000000) # depositing my paycheck for the week
1000000
>>> eric_account.transactions
[('deposit', 1000000)]
>>> eric_account.withdraw(100) # buying dinner
999900
>>> eric_account.transactions
[('depo... | 62598f6b796e427e5384df1a |
class MeissenNoReadAccessException(MeissenFileSystemException): <NEW_LINE> <INDENT> pass | Raised if something can not be read | 62598f6b7b25080760ed6c1f |
class _ShellChannel(SSHSession): <NEW_LINE> <INDENT> name = b'session' <NEW_LINE> connected = False <NEW_LINE> def __init__(self, creator, protocolFactory, shellConnected): <NEW_LINE> <INDENT> SSHChannel.__init__(self) <NEW_LINE> self._creator = creator <NEW_LINE> self._protocolFactory = protocolFactory <NEW_LINE> self... | A L{_ShellChannel} opens a shell channel and connects
its input and output to an L{IProtocol} provider.
@ivar _creator: See L{__init__}
@ivar _protocolFactory: See L{__init__}
@ivar _shellConnected: See L{__init__}
@ivar _protocol: An L{IProtocol} provider created using C{_protocolFactory}
which is hooked up to ... | 62598f6b8e05c05ec3f6ea08 |
class InputXGradient(GradientAttribution): <NEW_LINE> <INDENT> def __init__(self, forward_func: Callable) -> None: <NEW_LINE> <INDENT> GradientAttribution.__init__(self, forward_func) <NEW_LINE> <DEDENT> def attribute( self, inputs: TensorOrTupleOfTensorsGeneric, target: TargetType = None, additional_forward_args: Any ... | A baseline approach for computing the attribution. It multiplies input with
the gradient with respect to input.
https://arxiv.org/abs/1611.07270 | 62598f6b6fece00bbaccb110 |
class Close(Tag): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> <DEDENT> def getname(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> def render(self, context): <NEW_LINE> <INDENT> return '' | Class representing section closing tag.
| 62598f6b3eb6a72ae0389dc7 |
class PythonLogger: <NEW_LINE> <INDENT> def __init__(self, component): <NEW_LINE> <INDENT> self.logger = logging.getLogger(component) <NEW_LINE> self.initialLevel = self.logger.level | Keeps track of log level of a component and number of handlers
attached to it at the time this object was initialized. | 62598f6b925a0f43d25e77c0 |
class UserAdder(SimpleItem): <NEW_LINE> <INDENT> implements(IUserAdder) <NEW_LINE> default_member_type = DEFAULT_MEMBER_TYPE <NEW_LINE> def addUser(self, login, password): <NEW_LINE> <INDENT> mdtool = getToolByName(self, 'portal_memberdata') <NEW_LINE> mtype = self.default_member_type <NEW_LINE> mdtool.invokeFactory(mt... | UserAdder that adds the current default remember-based member types. | 62598f6bbf627c535bcb0c07 |
class InvalidTitle(Error): <NEW_LINE> <INDENT> pass | Invalid page title | 62598f6bd4950a0f3b1109fb |
class MyHtmlParser(HTMLParser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> HTMLParser.__init__(self) <NEW_LINE> self.href = [] <NEW_LINE> self.title = [] <NEW_LINE> self.summary = [] <NEW_LINE> self.author = [] <NEW_LINE> self.ul = None <NEW_LINE> self.ul_li = None <NEW_LINE> self.ul_li_h3 = None <NEW_... | 根据html内容解析出相应的标签,获取标签的属性或相应的数据并输出 | 62598f6b796e427e5384df1c |
class PlanetSchematicsTypeMap(caching.base.CachingMixin, models.Model): <NEW_LINE> <INDENT> schematic = models.ForeignKey(PlanetSchematic) <NEW_LINE> type = models.ForeignKey('InvType') <NEW_LINE> quantity = models.IntegerField(null=True, blank=True) <NEW_LINE> is_input = models.BooleanField(blank=True) <NEW_LINE> obje... | This table defines the input/output requirements for Planetary Interaction
Schematics
CCP Table: planetSchematicsTypeMap | 62598f6b66656f66f7d59b76 |
class PluginError (DoctorError): <NEW_LINE> <INDENT> def __init__(self, plugin_data={}, **kargs): <NEW_LINE> <INDENT> self.plugin_data = plugin_data <NEW_LINE> super(PluginError, self).__init__(**kargs) | PluginError class.
Define an error exception for the Plugin class. | 62598f6ba8ecb0332587098d |
class Message(Document): <NEW_LINE> <INDENT> text = StringField(max_length=1024, required=True) <NEW_LINE> created_at = DateTimeField(default=datetime.utcnow) <NEW_LINE> user = ReferenceField(document_type=User) <NEW_LINE> @classmethod <NEW_LINE> def get_history_query(cls, first_message_id=None): <NEW_LINE> <INDENT> if... | Chat message model
| 62598f6b5e10d32532ce34ae |
class PreRegistrationForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Registration <NEW_LINE> fields = ( 'banco', 'cod_transaction', ) <NEW_LINE> widgets = { 'cod_transaction': forms.TextInput( attrs={ 'placeholder': 'Numero de Transaccion', 'class':'payment-content__form__input', } ),... | formulario para registro de numero de deposito | 62598f6bd53ae8145f917c1e |
class IncrProc(Command): <NEW_LINE> <INDENT> name = "incr" <NEW_LINE> properties = ['name'] <NEW_LINE> options = Command.waiting_options <NEW_LINE> def message(self, *args, **opts): <NEW_LINE> <INDENT> if len(args) < 1: <NEW_LINE> <INDENT> raise ArgumentError("Invalid number of arguments") <NEW_LINE> <DEDENT> options =... | Increment the number of processes in a watcher
==============================================
This command increments the number of processes in a watcher by +1.
ZMQ Message
-----------
::
{
"command": "incr",
"properties": {
"name": "<watchername>",
"nb": <nbprocess>,
... | 62598f6bd6c5a102081e18cb |
class ErrorAlpha(Formatoption): <NEW_LINE> <INDENT> priority = BEFOREPLOTTING <NEW_LINE> name = 'Alpha value of the error range' <NEW_LINE> group = 'colors' <NEW_LINE> connections = ['error'] <NEW_LINE> def update(self, value): <NEW_LINE> <INDENT> self.error._kwargs['alpha'] = value | Set the alpha value for the error range
This formatoption can be used to set the alpha value (opacity) for the
:attr:`error` formatoption
Possible types
--------------
float
A float between 0 and 1
See Also
--------
error | 62598f6b1d351010ab8f32ca |
class MP_NodeManager(PolymorphicManager): <NEW_LINE> <INDENT> def get_query_set(self): <NEW_LINE> <INDENT> qset = super(MP_NodeManager, self).get_query_set() <NEW_LINE> return qset.order_by('path') | Custom manager for nodes. | 62598f6ba8ecb0332587098f |
class AnalogOutput: <NEW_LINE> <INDENT> RANGE = (-3.3, 3.3) <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.frequency = 0 <NEW_LINE> self.wavetype = "sine" <NEW_LINE> self._waveform_table = self.RANGE[1] * np.sin( np.arange( self.RANGE[0], self.RANGE[1], (self.RANGE[1] - self.R... | Model of the PSLab's analog outputs.
Parameters
----------
name : str
Name of the analog output pin represented by this instance.
Attributes
----------
frequency : float
Frequency of the waveform on this pin in Hz.
wavetype : {'sine', 'tria', 'custom'}
Type of waveform on this pin. 'sine' is a sine wave w... | 62598f6b63f4b57ef0085934 |
class LSPAEstimator(Estimator): <NEW_LINE> <INDENT> def __init__(self, train_args={}, predict_args={}): <NEW_LINE> <INDENT> Estimator.__init__( self, train=partial(lspa_train, **train_args), predict=partial(max_affine_predict, **predict_args), ) | The LSPA estimator.
>>> from common.util import set_random_seed
>>> set_random_seed(19)
>>> def regression_func(X):
... return 1.0 - 2.0*X[:, 0] + X[:, 1]**2
>>> X = np.random.randn(200, 2)
>>> y = regression_func(X) + 0.1 * np.random.randn(X.shape[0])
>>> X_test = np.random.randn(500, 2)
>>> y_test = regressio... | 62598f6b23e79379d538bc8b |
class SinglePropertyComplexType: <NEW_LINE> <INDENT> my_list: List[int] <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return str([str(item) for item in self.my_list]) | Test class with a single property of a complex type. | 62598f6bc432627299fa275f |
class Style(CMSPlugin): <NEW_LINE> <INDENT> label = models.CharField( verbose_name='Label', blank=True, max_length=255, help_text='Overrides the display name in the structure mode.', ) <NEW_LINE> tag_type = models.CharField( verbose_name='Tag type', choices=TAG_CHOICES, default=TAG_CHOICES[0][0], max_length=255, ) <NEW... | Renders a given ``TAG_CHOICES`` element with additional attributes | 62598f6bbf627c535bcb0c0b |
class Tooltip(object): <NEW_LINE> <INDENT> def __init__(self, widget, text='widget info'): <NEW_LINE> <INDENT> self.waittime = 500 <NEW_LINE> self.wraplength = 180 <NEW_LINE> self.widget = widget <NEW_LINE> self.text = text <NEW_LINE> self.widget.bind("<Enter>", self.enter) <NEW_LINE> self.widget.bind("<Leave>", self.l... | Create a tooltip for a given widget. | 62598f6b15fb5d323ce7e4af |
class ParamUserIdError(OAuthException): <NEW_LINE> <INDENT> error_code = 110 <NEW_LINE> error_id = "PARAM_USER_ID" <NEW_LINE> error_description = 'Invalid user id' | Autogenerated exception class for API error code 110 | 62598f6b8c3a8732951f5cda |
class ResumenCompetenciaEvaluacion(models.Model): <NEW_LINE> <INDENT> estudiante = models.ForeignKey("rubricas.Estudiante", null=True, on_delete=models.SET_NULL) <NEW_LINE> item = models.ForeignKey("rubricas.ItemCalificacionSeccion", null=True, on_delete=models.SET_NULL) <NEW_LINE> competencia = models.ForeignKey("rubr... | Esta clase sirve para representar el resultado acumulado
de un estudiante para una competencia en una evaluación particular (ItemCalificacionSeccion) | 62598f6b8a349b6b436859cb |
class TestRouteResultDetails(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'compilation_errors': {'key': 'compilationErrors', 'type': '[RouteCompilationError]'}, } <NEW_LINE> def __init__( self, *, compilation_errors: Optional[List["RouteCompilationError"]] = None, **kwargs ): <NEW_LINE> <INDENT> ... | Detailed result of testing a route.
:ivar compilation_errors: JSON-serialized list of route compilation errors.
:vartype compilation_errors: list[~azure.mgmt.iothub.v2021_07_02.models.RouteCompilationError] | 62598f6b26238365f5fac300 |
class IntroButton (gtk.Button): <NEW_LINE> <INDENT> def __init__ (self, text, icon_name): <NEW_LINE> <INDENT> gtk.Button.__init__ (self) <NEW_LINE> self.set_name ("intro-button") <NEW_LINE> self.set_focus_on_click (False) <NEW_LINE> self.set_relief (gtk.RELIEF_NONE) <NEW_LINE> self.set_property ('can-focus', False) <NE... | Particular button to be displayed in the introduction | 62598f6b21bff66bcd7223e8 |
class CompilePandoc(PageCompiler): <NEW_LINE> <INDENT> name = "pandoc" <NEW_LINE> def compile_html(self, source, dest, is_two_file=True): <NEW_LINE> <INDENT> makedirs(os.path.dirname(dest)) <NEW_LINE> try: <NEW_LINE> <INDENT> subprocess.check_call(('pandoc', '-o', dest, source)) <NEW_LINE> <DEDENT> except OSError as e:... | Compile markups into HTML using pandoc. | 62598f6b66656f66f7d59b7a |
class OnionParser(ArgumentParser): <NEW_LINE> <INDENT> def parse_args(self, args, namespace=None): <NEW_LINE> <INDENT> self._args = ' '.join(args) <NEW_LINE> try: <NEW_LINE> <INDENT> ns, extras = super().parse_known_args(args=args, namespace=namespace) <NEW_LINE> <DEDENT> except (ArgumentError, ArgumentTypeError) as e:... | `argparse.ArgumentParser` subclass for parsing Onion comments.
This class is essentially used to reimplement the installer
programs' existing command line parsers with some slight tweaks
specific to parsing Onion comments during the notebook's pre-cell
execution phase. Since the arguments are eventually passed to the
... | 62598f6b5e10d32532ce34b0 |
class NewSectionForm(forms.Form): <NEW_LINE> <INDENT> name = forms.CharField(widget=forms.TextInput, label="Section Name") | For instructors registering a new class section | 62598f6ba8ecb03325870991 |
class ExtractFanSpeedSensor(SmartySensor): <NEW_LINE> <INDENT> def __init__(self, name, smarty): <NEW_LINE> <INDENT> super().__init__(name='{} Extract Fan Speed'.format(name), device_class=None, unit_of_measurement=None, smarty=smarty) <NEW_LINE> <DEDENT> def update(self) -> None: <NEW_LINE> <INDENT> _LOGGER.debug('Upd... | Extract Fan Speed RPM. | 62598f6b0a366e3fb87dc14f |
class AutoEPDDisplay(AutoDisplay): <NEW_LINE> <INDENT> def __init__(self, epd=None, vcom=-2.06, bus=0, device=0, spi_hz=24000000, **kwargs): <NEW_LINE> <INDENT> if epd is None: <NEW_LINE> <INDENT> if EPD is None: <NEW_LINE> <INDENT> raise RuntimeError('Problem importing EPD interface. Did you build the ' 'backend with ... | This class initializes the EPD, and uses it to display the updates | 62598f6b3eb6a72ae0389dcd |
class TestStudentList(unittest.TestCase): <NEW_LINE> <INDENT> def test_student_list(self): <NEW_LINE> <INDENT> stl = StudentList() <NEW_LINE> stl.add_student(11510493, 'Edward FANG') <NEW_LINE> stl.add_student(11610001, 'Alice') <NEW_LINE> stl.add_student(11510001, 'Nancy') <NEW_LINE> stl.add_student(11510001, 'Nancy')... | Test all | 62598f6b6aa9bd52df0d465d |
class TestTCP(VppTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(TestTCP, cls).setUpClass() <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestTCP, self).setUp() <NEW_LINE> self.vapi.session_enable_disable(is_enabled=1) <NEW_LINE> self.create_loopbac... | TCP Test Case | 62598f6b50485f2cf55da6fa |
class SkipList(set): <NEW_LINE> <INDENT> skip_list = [1, 3] <NEW_LINE> def __contains__(self, item): <NEW_LINE> <INDENT> if item in self.skip_list: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return super().__contains__(item) | Container that ignores items. | 62598f6bbe8e80087fbbe7e8 |
@dataclass(order=True) <NEW_LINE> class Programme: <NEW_LINE> <INDENT> programmeuuid: str = field( init=True, repr=True, compare=False, ) <NEW_LINE> starttime: datetime = field( init=True, repr=True, compare=True, ) <NEW_LINE> endtime: datetime = field( init=True, repr=True, compare=False, ) <NEW_LINE> title: str = fie... | SkyQ Programme Class. | 62598f6b4d74a7450cd58a9e |
class RawPdfPath: <NEW_LINE> <INDENT> def __init__(self, *path: Union[str, int]): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.path) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return iter(self.path) <NEW_LINE> <DEDENT> def _tag(self): <... | Class to model raw paths in a file. | 62598f6b711fe17d825dfe76 |
class UserAPI(MethodView): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> auth_header = request.headers.get('Authorization') <NEW_LINE> if auth_header: <NEW_LINE> <INDENT> token = auth_header.split(" ")[1] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> token = '' <NEW_LINE> <DEDENT> if token: <NEW_LINE> <INDENT>... | User Resource | 62598f6bff9c53063f519de3 |
class TemplateStyler(Styler): <NEW_LINE> <INDENT> def __init__(self, selector): <NEW_LINE> <INDENT> self._formation = copy.deepcopy(self._selectFormationFromDocumentStyleSheet(selector)) <NEW_LINE> <DEDENT> def _selectFormationFromDocumentStyleSheet(self, selector): <NEW_LINE> <INDENT> formation = QCoreApplication.inst... | Template kind of Formation:
when created it snapshots the state of the DocumentStyleSheet.
Subsequent user editing of DocumentStyleSheet does NOT change (cascade) to existing DocumentElements | 62598f6b287bf620b627134b |
class IUnfollowedEvent(IObjectEvent): <NEW_LINE> <INDENT> pass | pass | 62598f6b8a349b6b436859cd |
class DrivenByDemand(ControlStrategy): <NEW_LINE> <INDENT> outPort = EReference(ordered=True, unique=True, containment=False) <NEW_LINE> def __init__(self, *, outPort=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> if outPort is not None: <NEW_LINE> <INDENT> self.outPort = outPort | Control strategy specifying that an asset is driven by the demand of one of the output ports | 62598f6b23e79379d538bc8e |
class StreamSimpleWriter(SimpleWriter, StreamMixin): <NEW_LINE> <INDENT> pass | Stream SimpleWriter. | 62598f6b8e05c05ec3f6ea0c |
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = "users" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> username = db.Column(db.String(256), nullable=False, unique=True) <NEW_LINE> email = db.Column(db.String(256), nullable=False, unique=True) <NEW_LINE> password = db.Column(db.String(256),... | The model for a User | 62598f6b3eb6a72ae0389dcf |
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.set_filename('selection01.xlsx') <NEW_LINE> <DEDENT> def test_create_file(self): <NEW_LINE> <INDENT> workbook = Workbook(self.got_filename) <NEW_LINE> worksheet = workbook.add_worksheet() <NEW_LINE> worksheet.... | Test file created by XlsxWriter against a file created by Excel. | 62598f6bbe8e80087fbbe7ea |
class DatasetDeflateCompression(DatasetCompression): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, } <NEW_LINE> _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'}, 'level': {'key': 'level', 'type': 'str'}, } <NEW_LINE> def __init__( self... | The Deflate compression method used on a dataset.
All required parameters must be populated in order to send to Azure.
:param additional_properties: Unmatched properties from the message are deserialized to this
collection.
:type additional_properties: dict[str, object]
:param type: Required. Type of dataset compres... | 62598f6b8c3a8732951f5cdd |
class HyperVSecurityGroupsDriver(sg_driver.HyperVSecurityGroupsDriverMixin, firewall.FirewallDriver): <NEW_LINE> <INDENT> pass | Security Groups Driver.
Security Groups implementation for Hyper-V VMs. | 62598f6ba4f1c619b294dd84 |
class AlexNet(object): <NEW_LINE> <INDENT> def __init__(self, x, keep_prob, num_classes, skip_layer, weights_path='DEFAULT'): <NEW_LINE> <INDENT> self.X = x <NEW_LINE> self.NUM_CLASSES = num_classes <NEW_LINE> self.KEEP_PROB = keep_prob <NEW_LINE> self.SKIP_LAYER = skip_layer <NEW_LINE> if weights_path == 'DEFAULT': <N... | Implementation of the AlexNet. | 62598f6b50485f2cf55da6fd |
class InvoiceArchivingSchemaGroup(colander.Schema): <NEW_LINE> <INDENT> archive_invoices = InvoiceArchivingSchema( title=_('Archive invoices') ).bind(years=select_years) | Invoice archiving schema group
Provide a box and a title to the schema | 62598f6b0a366e3fb87dc153 |
class _bl_icr_sect_t(LittleEndianStructure): <NEW_LINE> <INDENT> _pack_ = 1 <NEW_LINE> _fields_ = [('pl_size', c_uint32), ('pl_crc', c_uint32)] | One section of integrity check record. | 62598f6b167d2b6e312b670c |
class Notification: <NEW_LINE> <INDENT> def __init__(self, Nid, subscription): <NEW_LINE> <INDENT> self.Nid = Nid <NEW_LINE> self.subscription = subscription <NEW_LINE> <DEDENT> def getNid(self): <NEW_LINE> <INDENT> return self.Nid <NEW_LINE> <DEDENT> def getSubcription(self): <NEW_LINE> <INDENT> return self.subscripti... | this is Notification class for Course
it contains elements of a Notification
Contain parameter:
Nid -- int -- id to identify the Notification (must be unique) -- static
subscription-- int -- Sid(from class Subscription) -- static -- subscription id
Contain function:
Notification(Nid, user)
--- c... | 62598f6bbe8e80087fbbe7ec |
class PandasTableModelEdit(QtCore.QAbstractTableModel): <NEW_LINE> <INDENT> log_change = QtCore.pyqtSignal(object) <NEW_LINE> def __init__(self, data, parent=None): <NEW_LINE> <INDENT> QtCore.QAbstractTableModel.__init__(self, parent) <NEW_LINE> if data is not None: <NEW_LINE> <INDENT> self.__data = np.array(data.value... | This class is an abstract table class from Qt to visualize
data in a table format and using the pandas dataframe
as object that supply the data to be visualized.
To Do: Nothing
Last edit: Removed the ability to edit the table | 62598f6b4d74a7450cd58aa0 |
class tree: <NEW_LINE> <INDENT> def __init__(self, filename=None, t=None): <NEW_LINE> <INDENT> if t: <NEW_LINE> <INDENT> self.t=t <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if filename: <NEW_LINE> <INDENT> self.filename=filename <NEW_LINE> self.readT() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError('... | This class is intended to read tree graphs generated by the method in:
------------------
"VascuSynth: simulating vascular trees for generating volumetric image
data with ground-truth segmentation and tree analysis"
------------------
The class is used to read these trees and transform them into a Net... | 62598f6bec188e330fdf8030 |
class DataStore(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DataStore, self).__init__() <NEW_LINE> self.data = {} <NEW_LINE> self.metadata = [] <NEW_LINE> check_local_repo() <NEW_LINE> self.load_files() <NEW_LINE> <DEDENT> def load_files(self): <NEW_LINE> <INDENT> print("loading files ...... | Class to access data | 62598f6b1d351010ab8f32d1 |
class TestS3(CFNToolkitTestBase): <NEW_LINE> <INDENT> def test_function_regex(self): <NEW_LINE> <INDENT> cfntoolkit.s3.validate_function_arn( "arn:aws:lambda:us-west-2:021973571807:function:CopyLambdaRuntime") <NEW_LINE> try: <NEW_LINE> <INDENT> cfntoolkit.s3.validate_function_arn("") <NEW_LINE> self.fail("Expected Val... | Test Custom::S3BucketNotification resource. | 62598f6b73bcbd0ca4bc99e5 |
class DefaultShellCommandExecutor(ShellCommandExecutor): <NEW_LINE> <INDENT> def run(self, command: List[str]) -> None: <NEW_LINE> <INDENT> subprocess.run(command, check=True) | The default shell command executor. It uses python's `subprocess` module to run the commands. | 62598f6b711fe17d825dfe7a |
class GetContactsWithQueryInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(GetContactsWithQueryInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_ClientID(self, value): <NEW_LINE> <INDENT> super(GetContactsWithQueryInputSet, self)._set_input('... | An InputSet with methods appropriate for specifying the inputs to the GetContactsWithQuery
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f6b91af0d3eaad3959a |
class FeedBack(models.Model): <NEW_LINE> <INDENT> comment = models.CharField(max_length=255) <NEW_LINE> datetime = models.DateTimeField(auto_now_add=True) <NEW_LINE> person = models.ForeignKey('Person') | stores the users's feedback | 62598f6bd10714528d69d65d |
class SolarizedDarkStyle(Style): <NEW_LINE> <INDENT> background_color = BASE03 <NEW_LINE> default_style = "" <NEW_LINE> styles = { Text: BASE0, Whitespace: BASE03, Error: RED, Other: BASE0, Comment: italic(BASE01), Comment.Multiline: italic(BASE01), Comment.Preproc: italic(BASE01), Comment.Single: italic(BASE01), Comme... | Solarized Dark Style | 62598f6b925a0f43d25e77cb |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.