code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class CroppedImage(AxesWidget, Actionable): <NEW_LINE> <INDENT> ACTIONS = [ ('on_changed', 'changed', 'disconect'), ] <NEW_LINE> def __init__(self, ax, pixels): <NEW_LINE> <INDENT> AxesWidget.__init__(self, ax) <NEW_LINE> Actionable.__init__(self) <NEW_LINE> self.pixels = pixels <NEW_LINE> self.image = self.ax.imshow(s... | Widget that recolors a multichannel image using a given a scale sequence
and associated colors.
Parameters
----------
ax : axes
Axes to draw the widget
pixels : 3d array
Source pixels to recolor
Attributes
----------
ax : axes
Axes to draw the widget
pixels : 3d array
Source pixels to recolor
image : ... | 62598fa2009cb60464d0138b |
class CacheInvalidationRule(_messages.Message): <NEW_LINE> <INDENT> host = _messages.StringField(1) <NEW_LINE> path = _messages.StringField(2) | A CacheInvalidationRule object.
Fields:
host: If set, this invalidation rule will only apply to requests with a
Host header matching host.
path: A string attribute. | 62598fa2d6c5a102081e1fad |
class EvaluatorMeta(type): <NEW_LINE> <INDENT> def __init__(cls, name, bases, namespace): <NEW_LINE> <INDENT> super().__init__(name, bases, namespace) <NEW_LINE> if 'evaluate' in namespace and not isinstance(namespace['evaluate'], staticmethod): <NEW_LINE> <INDENT> raise EvaluatorError(cls.__name__ + ".evaluate() shoul... | A metaclass for creating Evaluator classes.
The metaclass ensures that Evaluator instances cannot be created and
it checks that the 'evaluate' method of a (derived) Evaluator class
is static.
If these conditions are not met, an EvaluatorError exception is raised. | 62598fa2435de62698e9bc5a |
class ContractCredentialsTest(BaseContractTerminatedMilestonesWebTest): <NEW_LINE> <INDENT> initial_auth = ('Basic', ('broker', '')) <NEW_LINE> initial_data = test_contract_data <NEW_LINE> test_get_credentials = snitch(get_credentials) <NEW_LINE> test_generate_credentials = snitch(generate_credentials) | esco contract credentials tests | 62598fa201c39578d7f12be5 |
class RefStateProvinceRUDView(RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> lookup_field = 'id' <NEW_LINE> serializer_class = RefStateProvinceSerializer <NEW_LINE> permission_classes = (PermissionSettings.IS_ADMIN_OR_READ_ONLY, CustomDjangoModelPermissions) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> re... | This module creates the RETRIEVE, UPDATE, DESTROY method for Country Model | 62598fa2adb09d7d5dc0a3f0 |
class _StatusConditionImpl(NamedTuple): <NEW_LINE> <INDENT> and_clauses: Tuple[BoolFun, ...] <NEW_LINE> def __call__(self, target: Stateful) -> bool: <NEW_LINE> <INDENT> return all(clause(target) for clause in self.and_clauses) <NEW_LINE> <DEDENT> def __and__(self, other: Any) -> 'StatusCondition': <NEW_LINE> <INDENT> ... | Internal implementation of StatusCondition.
See the factory function status_condition for a summary. | 62598fa245492302aabfc337 |
class classical_thermo: <NEW_LINE> <INDENT> _ptr=0 <NEW_LINE> _link=0 <NEW_LINE> _owner=True <NEW_LINE> def __init__(self,link,pointer=0): <NEW_LINE> <INDENT> if pointer==0: <NEW_LINE> <INDENT> f=link.o2scl.o2scl_create_classical_thermo <NEW_LINE> f.restype=ctypes.c_void_p <NEW_LINE> f.argtypes=[] <NEW_LINE> self._ptr=... | Python interface for class :ref:`classical_thermo <o2sclp:classical_thermo_tl>`. | 62598fa26aa9bd52df0d4d31 |
class Creator(_AtomFromString): <NEW_LINE> <INDENT> _tag = 'creator' <NEW_LINE> _namespace = DC_NAMESPACE | The <dc:creator> element identifies an author-or more generally, an entity
responsible for creating the volume in question. Examples of a creator
include a person, an organization, or a service. In the case of
anthologies, proceedings, or other edited works, this field may be used to
indicate editors or other entities ... | 62598fa2d53ae8145f9182f2 |
class WtfError(Exception): <NEW_LINE> <INDENT> pass | (For debugging) Should never occur | 62598fa2a17c0f6771d5c0a1 |
class CriticNetwork(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_dim, action_dim, hidden_size, output_size=1): <NEW_LINE> <INDENT> super(CriticNetwork, self).__init__() <NEW_LINE> self.fc1 = nn.Linear(state_dim, hidden_size) <NEW_LINE> self.fc2 = nn.Linear(hidden_size + action_dim, hidden_size) <NEW_LINE> s... | A network for critic | 62598fa20a50d4780f705241 |
class OverlayText(TextState): <NEW_LINE> <INDENT> def __init__(self, engine, target, parent, text, center=False): <NEW_LINE> <INDENT> super().__init__(engine, target, text, center) <NEW_LINE> self.parent = parent <NEW_LINE> <DEDENT> def render(self, console): <NEW_LINE> <INDENT> self.parent.render(console) <NEW_LINE> y... | Displays text over another state's rendering. | 62598fa2e5267d203ee6b773 |
class Xrdb(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "http://cgit.freedesktop.org/xorg/app/xrdb" <NEW_LINE> url = "https://www.x.org/archive/individual/app/xrdb-1.1.0.tar.gz" <NEW_LINE> version('1.1.0', 'd48983e561ef8b4b2e245feb584c11ce') <NEW_LINE> depends_on('libxmu') <NEW_LINE> depends_on('libx11') <NEW... | xrdb - X server resource database utility. | 62598fa256b00c62f0fb2717 |
class Crossintray(_ObjectiveFunction): <NEW_LINE> <INDENT> def __init__(self, ndim): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._objective_function = crossintray <NEW_LINE> self.ndim = ndim <NEW_LINE> if self.ndim != 2: <NEW_LINE> <INDENT> raise ValueError("The crossintray function is defined for solution s... | TODO | 62598fa2cc0a2c111447ae74 |
class Circle(object): <NEW_LINE> <INDENT> def __init__(self, radius): <NEW_LINE> <INDENT> self.radius = radius <NEW_LINE> <DEDENT> @property <NEW_LINE> def area(self): <NEW_LINE> <INDENT> return math.pi*self.radius**2 <NEW_LINE> <DEDENT> @property <NEW_LINE> def perimeter(self): <NEW_LINE> <INDENT> return math.pi*self.... | classdocs | 62598fa255399d3f05626389 |
class HamrMessenger(object): <NEW_LINE> <INDENT> def __init__(self, server_ip='192.168.1.1', server_port=2390): <NEW_LINE> <INDENT> self.address=(server_ip, server_port) <NEW_LINE> self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) <NEW_LINE> self.message_types = { 'holo_drive': (103, 'fff'), 'dif_drive': (10... | An interface that allows for motor commands to be sent to the HAMR.
If the source code on the HAMR was not changed, custom params for initialization should not be
necessary.
Attributes:
server_ip: A string that represents the IP of the access point of the HAMR.
server_port: An integer that represents the port... | 62598fa22ae34c7f260aaf47 |
class Environment(BASE, ModificationsTrackedObject): <NEW_LINE> <INDENT> __tablename__ = 'environment' <NEW_LINE> id = sa.Column(sa.String(255), primary_key=True, default=uuidutils.generate_uuid) <NEW_LINE> name = sa.Column(sa.String(255), nullable=False) <NEW_LINE> tenant_id = sa.Column(sa.String(36), nullable=False) ... | Represents a Environment in the metadata-store | 62598fa285dfad0860cbf9a8 |
class TwoLayerNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=3*32*32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.params['W1'] = np.random.normal(0,weight_scale,(input_dim,hidden_dim)) <NEW_LINE> self.params['... | A two-layer fully-connected neural network with ReLU nonlinearity and
softmax loss that uses a modular layer design. We assume an input dimension
of D, a hidden dimension of H, and perform classification over C classes.
The architecure should be affine - relu - affine - softmax.
Note that this class does not implemen... | 62598fa201c39578d7f12be6 |
class EmptySeqError(Error): <NEW_LINE> <INDENT> pass | Raised when sequence is empty or whitespace only | 62598fa22c8b7c6e89bd362e |
class EditArticleHandler(FrontPageHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.preprocess(Article, handleSinglePage = True) <NEW_LINE> if self.user and self.admin: <NEW_LINE> <INDENT> article = ndb.Key(urlsafe=self.request.get('aid')).get() <NEW_LINE> template_values = { 'article':article, 'art... | Handles from show to modify to submit an article in textarea. | 62598fa2379a373c97d98e7f |
class ApexAgent(DQNAgent): <NEW_LINE> <INDENT> _agent_name = "APEX" <NEW_LINE> _default_config = APEX_DEFAULT_CONFIG <NEW_LINE> @override(DQNAgent) <NEW_LINE> def update_target_if_needed(self): <NEW_LINE> <INDENT> if self.optimizer.num_steps_trained - self.last_target_update_ts > self.config["target_netw... | DQN variant that uses the Ape-X distributed policy optimizer.
By default, this is configured for a large single node (32 cores). For
running in a large cluster, increase the `num_workers` config var. | 62598fa23cc13d1c6d4655d4 |
class ProgramsApiConfigMixin(object): <NEW_LINE> <INDENT> DEFAULTS = { 'enabled': True, 'api_version_number': 1, 'internal_service_url': 'http://internal.programs.org/', 'public_service_url': 'http://public.programs.org/', 'authoring_app_js_path': '/path/to/js', 'authoring_app_css_path': '/path/to/css', 'cache_ttl': 0,... | Utilities for working with Programs configuration during testing. | 62598fa2d58c6744b42dc207 |
class DjangoSQLPanel(DebugPanel): <NEW_LINE> <INDENT> name = 'Django SQL' <NEW_LINE> has_content = True <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(DjangoSQLPanel, self).__init__(*args, **kwargs) <NEW_LINE> self.jinja_env.loader = jinja2.ChoiceLoader( [ self.jinja_env.loader, jinja2.Prefix... | Panel that shows information about Django SQL operations.
| 62598fa27b25080760ed7312 |
class UserProfile(AbstractUser): <NEW_LINE> <INDENT> email = models.EmailField(verbose_name="pochtovyy yashchik") <NEW_LINE> point = models.PositiveIntegerField(default=0, verbose_name="integratsiya") <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = "Profil' pol'zovatelya" <NEW_LINE> verbose_name_plural = verb... | 用户资料 | 62598fa2adb09d7d5dc0a3f2 |
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 for the users object
| 62598fa2097d151d1a2c0e93 |
class TransitionDurationLessThanEqualTransitionDurationMixed(Atom): <NEW_LINE> <INDENT> def __init__(self, lhs_transition, rhs_transition): <NEW_LINE> <INDENT> self._lhs = lhs_transition <NEW_LINE> self._rhs = rhs_transition <NEW_LINE> self.verdict = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> retu... | This class models the atom (duration(t1) < duration(t2))
for v the duration of another transition. | 62598fa292d797404e388a9a |
class Bars(Selection1DExpr, Chart): <NEW_LINE> <INDENT> group = param.String(default='Bars', constant=True) <NEW_LINE> kdims = param.List(default=[Dimension('x')], bounds=(1,3)) <NEW_LINE> _max_kdim_count = 3 | Bars is a Chart element representing categorical observations
using the height of rectangular bars. The key dimensions represent
the categorical groupings of the data, but may also be used to
stack the bars, while the first value dimension represents the
height of each bar. | 62598fa20a50d4780f705243 |
@API.resource('/api/v1/users') <NEW_LINE> class UsersAPI(Resource): <NEW_LINE> <INDENT> @admin_required <NEW_LINE> def get(self): <NEW_LINE> <INDENT> args = rqParse(rqArg('cursor', type=vdr.toCursor)) <NEW_LINE> usersQuery = User.query() .order(-User.created_r) .fetch_page_async(page_size=10, star... | Get list of users with ndb Cursor for pagination. Obtaining users is executed
in parallel with obtaining total count via *_async functions | 62598fa20c0af96317c561ea |
class DatasetsPatch(base.Command): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument('--description', help='Description of the dataset.') <NEW_LINE> parser.add_argument('dataset_name', help='The name of the dataset.') <NEW_LINE> <DEDENT> def Run(self, args): <NEW_LIN... | Updates the description of a dataset.
| 62598fa267a9b606de545e33 |
class Message(object): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> DESCRIPTOR = None <NEW_LINE> def __deepcopy__(self, memo=None): <NEW_LINE> <INDENT> clone = type(self)() <NEW_LINE> clone.MergeFrom(self) <NEW_LINE> return clone <NEW_LINE> <DEDENT> def __eq__(self, other_msg): <NEW_LINE> <INDENT> raise NotImplemented... | Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol
compiler. These generated types subclass Message and implement the methods
shown below.
TODO(robinson): Link to an HTML document here.
TODO(robinson): Document that instances of this class will also
have ... | 62598fa2eab8aa0e5d30bbf0 |
class LimitAggregatorQuotaField(AggregatorQuotaField): <NEW_LINE> <INDENT> aggregation_field = 'limit' | Aggregates sum children quotas limits. | 62598fa255399d3f0562638b |
class ShowSpanningTreeMstDetailSchema(MetaParser): <NEW_LINE> <INDENT> schema = { 'mst_instances': { Any(): { 'mst_id': int, Optional('vlan'): str, 'bridge_address': str, 'bridge_priority': int, 'sysid': int, Optional('root'): str, Optional('root_address'): str, Optional('root_priority'): int, Optional('operational'): ... | Schema for show spanning-tree mst detail | 62598fa2dd821e528d6d8d9e |
class ClanWarLeagueClan(BaseClan): <NEW_LINE> <INDENT> __slots__ = BaseClan.__slots__ + ("_cs_members", "_iter_members") <NEW_LINE> def __init__(self, *, data, client): <NEW_LINE> <INDENT> super().__init__(data=data, client=client) <NEW_LINE> self._iter_members = ( ClanWarLeagueClanMember(data=mdata, client=self._clien... | Represents a Clan War League Clan.
Attributes
----------
tag: :class:`str`
The clan's tag
name: :class:`str`
The clan's name
badge: :class:`Badge`
The clan's badge
level: :class:`int`
The clan's level. | 62598fa24f6381625f1993f1 |
class DistrictButon(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.enabled = True <NEW_LINE> self.checked = False <NEW_LINE> <DEDENT> def onClick(self): <NEW_LINE> <INDENT> infc = (GetSelectedLayers())[0] <NEW_LINE> if ensure_dist_id(infc): <NEW_LINE> <INDENT> add_id = Add_Integer_Field_Tool(... | Implementation for DSaddin_district.button (Button) | 62598fa2090684286d59360f |
class CleanupNonlocalControl(NonlocalControl): <NEW_LINE> <INDENT> def __init__(self, outer: NonlocalControl) -> None: <NEW_LINE> <INDENT> self.outer = outer <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def gen_cleanup(self, builder: 'IRBuilder', line: int) -> None: ... <NEW_LINE> def gen_break(self, builder: 'IRBuil... | Abstract nonlocal control that runs some cleanup code. | 62598fa23d592f4c4edbad36 |
class OneShotClientTransaction(ClientTransaction): <NEW_LINE> <INDENT> FSMDefinitions = { InitialState: { Transaction.Inputs.request: { tsk.NewState: Transaction.States.terminated, tsk.Action: 'transmit', }, }, Transaction.States.terminated: {}, } | Transaction that constitutes a single unreliable request send. | 62598fa201c39578d7f12be8 |
class WriteLogEntriesResponse(_messages.Message): <NEW_LINE> <INDENT> pass | Result returned from WriteLogEntries.
empty | 62598fa297e22403b383ad74 |
class ZincblendeStructureGenerator(BulkGeneratorBase, ZincblendeStructure): <NEW_LINE> <INDENT> def save(self, fname='zincblende', **kwargs): <NEW_LINE> <INDENT> super().save(fname=fname, scaling_matrix=self.scaling_matrix, **kwargs) | :class:`ZincblendeStructure` generator class. | 62598fa21f5feb6acb162a8c |
class QueuedMogileFSStorage(QueuedFileSystemStorage): <NEW_LINE> <INDENT> def __init__(self, remote='storages.backends.mogile.MogileFSStorage', *args, **kwargs): <NEW_LINE> <INDENT> super(QueuedMogileFSStorage, self).__init__(remote=remote, *args, **kwargs) | A custom :class:`~queued_storage.backends.QueuedFileSystemStorage`
subclass which uses the ``MogileFSStorage`` storage of the
`django-storages <https://django-storages.readthedocs.io/>`_ app as
the remote storage. | 62598fa27d847024c075c22f |
class UnexpectedRSPValue(Exception): <NEW_LINE> <INDENT> pass | 가위 바위 보 가운데 하나가 아닌 값인 경우에 발생하는 에러 | 62598fa2cb5e8a47e493c0ab |
class api: <NEW_LINE> <INDENT> def __init__(self, info): <NEW_LINE> <INDENT> requires = ('description', 'score', 'choices') <NEW_LINE> options = ('difficulty', 'analysis', 'remark') <NEW_LINE> for require in requires: <NEW_LINE> <INDENT> setattr(self, '_'+require, info.get(require)) <NEW_LINE> <DEDENT> for option in op... | 不定项选择 API
Argument
--------
description: DataRequired
score: DataRequired
choices: DataRequired: Dict[str, int]
difficulty: Optional, NumberRange(0, 1): float
analysis: Optional
remark: Optional
Example
-------
{
"type": "不定项选择",
"description": "本题为不定项选择.",
"score": "5",
"difficulty": "0.1",
"anal... | 62598fa2379a373c97d98e81 |
class Object(object): <NEW_LINE> <INDENT> def __init__(self, name, size, hash, extra, meta_data, container, driver): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.size = size <NEW_LINE> self.hash = hash <NEW_LINE> self.container = container <NEW_LINE> self.extra = extra or {} <NEW_LINE> self.meta_data = meta_dat... | Represents an object (BLOB). | 62598fa28c0ade5d55dc35c4 |
class U(R): <NEW_LINE> <INDENT> def b(self): <NEW_LINE> <INDENT> pass | clashes with class A. | 62598fa27cff6e4e811b5890 |
class DeleteDeployGroupsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.DeployGroupIds = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.DeployGroupIds = params.get("DeployGroupIds") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for nam... | DeleteDeployGroups请求参数结构体
| 62598fa2adb09d7d5dc0a3f4 |
class UrlBase(object): <NEW_LINE> <INDENT> def __init__(self, source=None): <NEW_LINE> <INDENT> self.urls = list(map(Url, source.urls)) if source else [] <NEW_LINE> <DEDENT> def serialize(self): <NEW_LINE> <INDENT> return [url.serialize() for url in self.urls] <NEW_LINE> <DEDENT> def to_struct(self): <NEW_LINE> <INDENT... | Base class for url-aware objects. | 62598fa201c39578d7f12be9 |
class ConfigurationSpec(_messages.Message): <NEW_LINE> <INDENT> generation = _messages.IntegerField(1, variant=_messages.Variant.INT32) <NEW_LINE> revisionTemplate = _messages.MessageField('RevisionTemplate', 2) | ConfigurationSpec holds the desired state of the Configuration (from the
client).
Fields:
generation: Deprecated and not currently populated by Cloud Run. See
metadata.generation instead, which is the sequence number containing the
latest generation of the desired state. Read-only.
revisionTemplate: Revis... | 62598fa257b8e32f52508051 |
class PluginClasses(Collection): <NEW_LINE> <INDENT> def __init__(self, world, collection, owning=False): <NEW_LINE> <INDENT> assert type(collection) == POINTER(PluginClasses) <NEW_LINE> assert collection <NEW_LINE> self.owning = owning <NEW_LINE> super(PluginClasses, self).__init__( world, collection, c.plugin_classes... | Collection of plugin classes. | 62598fa26fb2d068a7693d6a |
class ExpectHelloRequest(ExpectHandshake): <NEW_LINE> <INDENT> def __init__(self, description=None): <NEW_LINE> <INDENT> super(ExpectHelloRequest, self).__init__( ContentType.handshake, HandshakeType.hello_request) <NEW_LINE> self.description = description <NEW_LINE> <DEDENT> def process(self, state, msg): <NEW_LINE> <... | Processing of TLS handshake protocol hello request message. | 62598fa2e76e3b2f99fd88a2 |
class tf_reader(object): <NEW_LINE> <INDENT> def __init__(self, tf_record_path, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> print(config) <NEW_LINE> dataset = tf.data.TFRecordDataset([tf_record_path], buffer_size=config.BUFFER_SIZE) <NEW_LINE> dataset = dataset.repeat(cfg.TRAIN.EPOCH) <NEW_LINE> if sel... | dataset reader | 62598fa2a17c0f6771d5c0a4 |
class Login(APIView): <NEW_LINE> <INDENT> permission_classes = (AllowAny, ) <NEW_LINE> def post(self, request, format=None): <NEW_LINE> <INDENT> adapter = self.adapter_class(request) <NEW_LINE> provider = adapter.get_provider() <NEW_LINE> app = provider.get_app(request) <NEW_LINE> view = OAuth2LoginView() <NEW_LINE> vi... | View for returning Ibis-specific url to submit Oauth2 request
The user submits a blank post request to this view and receives,
view a serialized JSON object, a url that embedds an oauth
'client_id' to identify the app with, a 'redirect_uri' to
redirect the user after login, and a 'state' to secure against
tampering th... | 62598fa266656f66f7d5a25c |
class DeleteComment(bloghandler.Handler): <NEW_LINE> <INDENT> @decorator.user_logged_in <NEW_LINE> @decorator.post_exists <NEW_LINE> @decorator.comment_exists <NEW_LINE> @decorator.user_owns_comment <NEW_LINE> def get(self, blog_id): <NEW_LINE> <INDENT> blog_post = BlogPost.get_by_id(int(blog_id)) <NEW_LINE> cid = self... | DeleteComment handler processes a User request to remove a
comment that they made from the blog and delete it from the
comment database. | 62598fa2dd821e528d6d8d9f |
class Signal(QObject): <NEW_LINE> <INDENT> changed = pyqtSignal() | Signal creates a pyqtSignal to be emitted in other classes. | 62598fa23539df3088ecc11f |
@pytest.mark.usefixtures("localtyperegistry") <NEW_LINE> class BaseSpokeTest(object): <NEW_LINE> <INDENT> type = None <NEW_LINE> def create_instance(self): <NEW_LINE> <INDENT> return self.type.model() <NEW_LINE> <DEDENT> @classproperty <NEW_LINE> def typename(cls): <NEW_LINE> <INDENT> return cls.type.model.get_name() <... | Basic spoke testing | 62598fa291af0d3eaad39c77 |
class PrivateEndpointConnection(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'private_en... | Properties of the PrivateEndpointConnection.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{re... | 62598fa276e4537e8c3ef417 |
class CmdSnmpMemDataSourceInfo(RRDDataSourceInfo): <NEW_LINE> <INDENT> implements(ICmdSnmpMemDataSourceInfo) <NEW_LINE> adapts(CmdSnmpMemDataSource) <NEW_LINE> hostname = ProxyProperty('hostname') <NEW_LINE> ipAddress = ProxyProperty('ipAddress') <NEW_LINE> snmpVer = ProxyProperty('snmpVer') <NEW_LINE> snmpCommunity = ... | Adapter between ICmdSnmpMemDataSourceInfo and CmdSnmpMemDataSource. | 62598fa21f037a2d8b9e3f54 |
class Iface: <NEW_LINE> <INDENT> def checkKeyword(self, params): <NEW_LINE> <INDENT> pass | 关键词服务
@since 1.0.0
@author bjf
@date 2015年9月1日 下午5:34:32 | 62598fa2e1aae11d1e7ce759 |
class TradeMonitor(BasicMonitor): <NEW_LINE> <INDENT> def __init__(self, mainEngine, eventEngine, parent=None): <NEW_LINE> <INDENT> super(TradeMonitor, self).__init__(mainEngine, eventEngine, parent) <NEW_LINE> d = OrderedDict() <NEW_LINE> d['tradeID'] = {'chinese': u'成交编号', 'cellType': BasicCell} <NEW_LINE> d['orderID... | 成交监控 | 62598fa2925a0f43d25e7ea8 |
class BadRequestImageBuilderActionError(ImageBuilderActionError, BadRequest): <NEW_LINE> <INDENT> def __init__(self, message: str, validation_failures: list = None): <NEW_LINE> <INDENT> super().__init__(message, validation_failures) | Represent an error during the execution of an action due to a problem with the request. | 62598fa24527f215b58e9d4d |
class Credits(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.finished = False <NEW_LINE> <DEDENT> def progress(self, window): <NEW_LINE> <INDENT> self.finished = True | Plays the credits sequence at the end of the game. | 62598fa2460517430c431f90 |
class MigrationStatusPrinter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.printed_yet = False <NEW_LINE> <DEDENT> def info(self, msg, *args, **kwargs): <NEW_LINE> <INDENT> if not self.printed_yet: <NEW_LINE> <INDENT> print('\n ', end='') <NEW_LINE> self.printed_yet = True <NEW_LINE> <DEDE... | Print migration status in an attractive way during a Django migration run.
In particular, you get output that looks like this
Running migrations:
Applying users.0005_set_initial_contrib_email_flag...
set first_l10n_email_sent on 2793 profiles.
set first_answer_email_sent on 46863 profiles.
... | 62598fa26e29344779b004c7 |
class TestCertificateFields(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testCertificateFields(self): <NEW_LINE> <INDENT> model = artikcloud.models.certificate_fields.CertificateFields() | CertificateFields unit test stubs | 62598fa2e5267d203ee6b778 |
class TestLibVirtControllerSessionDirectTLS( TestLibVirtControllerSession, TestLibVirtControllerDirectTLS, unittest.TestCase ): <NEW_LINE> <INDENT> pass | Test LibVirtController with spice_remote_viewer viewer at session mode. | 62598fa2498bea3a75a5798c |
class KeyboardHook(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.user32 = windll.user32 <NEW_LINE> self.kbHook = None <NEW_LINE> <DEDENT> def installHook(self, pointer): <NEW_LINE> <INDENT> self.kbHook = self.user32.SetWindowsHookExA( win32con.WH_KEYBOARD_LL, pointer, win32api.GetMod... | Written by: TwhK / Kheldar
What do? Installs a global keyboard hook
To install the hook, call the (gasp!) installHook() function.
installHook() takes a pointer to the function that will be called
after a keyboard event. installHook() returns True if everything
was successful, and False if it failed
Note: I've also p... | 62598fa297e22403b383ad76 |
class DummyABBController: <NEW_LINE> <INDENT> def __init__(self, ip='192.168.125.1', port=5000): <NEW_LINE> <INDENT> logger.debug("DummyABBController.__init__(ip={}, port={})".format( ip, port)) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.__class__.__name__ <NEW_LINE> <DEDENT> def __str__(se... | Dummy ABB controller class.
| 62598fa22ae34c7f260aaf4c |
class TokenGenerator(PasswordResetTokenGenerator): <NEW_LINE> <INDENT> def _make_hash_value(self, user, timestamp): <NEW_LINE> <INDENT> return ( six.text_type(user.pk) + six.text_type(timestamp) + six.text_type(user.is_active) ) | Generate token to create link during reseting user's password | 62598fa267a9b606de545e36 |
class TwoLayerNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=3*32*32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.params['W1'] = weight_scale * np.random.randn(input_dim, hidden_dim) <NEW_LINE> self.params['b1... | A two-layer fully-connected neural network with ReLU nonlinearity and
softmax loss that uses a modular layer design. We assume an input dimension
of D, a hidden dimension of H, and perform classification over C classes.
The architecture should be affine - relu - affine - softmax.
Note that this class does not impleme... | 62598fa2379a373c97d98e82 |
@Body.register <NEW_LINE> class Keyword(model.Keyword): <NEW_LINE> <INDENT> __slots__ = ['lineno'] <NEW_LINE> def __init__(self, name='', doc='', args=(), assign=(), tags=(), timeout=None, type=BodyItem.KEYWORD, parent=None, lineno=None): <NEW_LINE> <INDENT> model.Keyword.__init__(self, name, doc, args, assign, tags, t... | Represents a single executable keyword.
These keywords never have child keywords or messages. The actual keyword
that is executed depends on the context where this model is executed.
See the base class for documentation of attributes not documented here. | 62598fa256ac1b37e6302057 |
class LieAlgebraRegularVectorFields(InfinitelyGeneratedLieAlgebra, IndexedGenerators): <NEW_LINE> <INDENT> def __init__(self, R): <NEW_LINE> <INDENT> cat = LieAlgebras(R).WithBasis() <NEW_LINE> InfinitelyGeneratedLieAlgebra.__init__(self, R, index_set=ZZ, category=cat) <NEW_LINE> IndexedGenerators.__init__(self, ZZ, pr... | The Lie algebra of regular vector fields on `\CC^{\times}`.
This is the Lie algebra with basis `\{d_i\}_{i \in \ZZ}` and subject
to the relations
.. MATH::
[d_i, d_j] = (i - j) d_{i+j}.
This is also known as the Witt (Lie) algebra.
.. NOTE::
This differs from some conventions (e.g., [Ka1990]_), where
... | 62598fa2b7558d589546349a |
class FolderPlayList(topic.TopicPlayList): <NEW_LINE> <INDENT> def brains(self): <NEW_LINE> <INDENT> return self.context.getFolderContents() | Playlist view for folder | 62598fa2a8ecb0332587107a |
class Abstract (WebDAVElement): <NEW_LINE> <INDENT> name = "abstract" | Identifies a privilege as abstract. (RFC 3744, section 5.3) | 62598fa299cbb53fe6830d3f |
class DeletePortPair(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(DeletePortPair, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'port_pair', metavar="PORT_PAIR", help=_("ID or name of the Port Pair to delete.") ) <NEW_LINE> return parser <NEW_LI... | Delete a given Port Pair. | 62598fa2442bda511e95c2c7 |
class SystemAttackHandler(Handler): <NEW_LINE> <INDENT> def handle_request(self, request): <NEW_LINE> <INDENT> print("Request handled in system attack handler.....!\n") <NEW_LINE> self._successor.handle_request(request) <NEW_LINE> print("Passed the request to next handler....!") | Handle request and forward it to the successor. | 62598fa2435de62698e9bc60 |
class AliasedSubParsersAction(argparse._SubParsersAction): <NEW_LINE> <INDENT> class _AliasedPseudoAction(argparse.Action): <NEW_LINE> <INDENT> def __init__(self, name, aliases, help): <NEW_LINE> <INDENT> dest = name <NEW_LINE> if aliases: <NEW_LINE> <INDENT> dest += ' (%s)' % ','.join(aliases) <NEW_LINE> <DEDENT> supe... | Manually add aliases (which aren't supported in Python 2...
From https://gist.github.com/sampsyo/471779 | 62598fa28da39b475be0304c |
class LowercaseUnit(ProcessorUnit): <NEW_LINE> <INDENT> def transform(self, tokens: list) -> list: <NEW_LINE> <INDENT> return [token.lower() for token in tokens] | Process unit for text lower case. | 62598fa2d7e4931a7ef3bf06 |
class TestAuthRequest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testAuthRequest(self): <NEW_LINE> <INDENT> pass | AuthRequest unit test stubs | 62598fa2cc0a2c111447ae7a |
class BaoTing(BaseType): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(BaoTing, self).__init__() <NEW_LINE> <DEDENT> def is_this_type(self, hand_card, card_analyse): <NEW_LINE> <INDENT> used_card_type = [CardType.WAN] <NEW_LINE> return hand_card.is_ting | 8) 报听:在听牌阶段选择报听,并最终胡牌。 。 | 62598fa224f1403a926857e9 |
class Formatter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._filters = {} <NEW_LINE> for name, func in DEFAULT_FORMATTERS.items(): <NEW_LINE> <INDENT> self.register(name, func) <NEW_LINE> <DEDENT> <DEDENT> def __call__(self, value, func, *args): <NEW_LINE> <INDENT> if not callable(func): <... | A formatter is a function (or any callable, really)
that takes a value and returns a nicer-looking value,
most likely a sting.
Formatter stores and calls those functions, keeping
the namespace uncluttered.
Formatting functions should take a value as the first
argument--usually the value of the Datum on which the
func... | 62598fa2925a0f43d25e7eaa |
class WebcamCollector(memdam.recorder.collector.collector.Collector): <NEW_LINE> <INDENT> def _collect(self, limit): <NEW_LINE> <INDENT> handle, screenshot_file = tempfile.mkstemp('') <NEW_LINE> exe = './bin/wacaw' <NEW_LINE> if not os.path.exists(exe): <NEW_LINE> <INDENT> exe = './wacaw' <NEW_LINE> <DEDENT> command = ... | Collects snapshots from webcam by using external universal (osx) binary wacaw | 62598fa2090684286d593611 |
@add_start_docstrings( BERT_START_DOCSTRING, BERT_INPUTS_DOCSTRING, ) <NEW_LINE> class TFBertForSequenceClassification(TFBertPreTrainedModel): <NEW_LINE> <INDENT> def __init__(self, config, *inputs, **kwargs): <NEW_LINE> <INDENT> super(TFBertForSequenceClassification, self).__init__(config, *inputs, **kwargs) <NEW_LINE... | Outputs: `Tuple` comprising various elements depending on the configuration (config) and inputs:
**logits**: ``Numpy array`` or ``tf.Tensor`` of shape ``(batch_size, config.num_labels)``
Classification (or regression if config.num_labels==1) scores (before SoftMax).
**hidden_states**: (`optional`, retur... | 62598fa230dc7b766599f6ba |
class JSONSpecValidatorFactory: <NEW_LINE> <INDENT> schema_validator_class = Draft4Validator <NEW_LINE> spec_validator_factory = Draft4ExtendedValidatorFactory <NEW_LINE> def __init__(self, schema, schema_url='', resolver_handlers=None): <NEW_LINE> <INDENT> self.schema = schema <NEW_LINE> self.schema_url = schema_url <... | Json documents validator factory against a json schema.
:param schema: schema for validation.
:param schema_url: schema base uri. | 62598fa2e5267d203ee6b77a |
class Drillstring(pydantic.BaseModel): <NEW_LINE> <INDENT> id: str = pydantic.Field(..., alias="_id") <NEW_LINE> data: DrillstringData <NEW_LINE> @property <NEW_LINE> def mwd_with_gamma_sensor(self) -> Optional[DrillstringDataComponent]: <NEW_LINE> <INDENT> for component in self.data.components: <NEW_LINE> <INDENT> if ... | Needed subset of drillstring response fields | 62598fa27047854f4633f244 |
class MessengerLabelViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> queryset = models.MessengerLabel.objects.all() <NEW_LINE> serializer_class = serializers.MessengerLabelSerializer | API endpoint that allows to create a new Messenger Label. | 62598fa2d486a94d0ba2be44 |
class TestPO2IniCommand(test_convert.TestConvertCommand, TestPO2Ini): <NEW_LINE> <INDENT> convertmodule = po2ini <NEW_LINE> defaultoptions = {"progress": "none"} <NEW_LINE> def test_help(self): <NEW_LINE> <INDENT> options = test_convert.TestConvertCommand.test_help(self) <NEW_LINE> options = self.help_check(options, "-... | Tests running actual po2ini commands on files | 62598fa24428ac0f6e658398 |
class UserEvent(WebhookEvent, WithUser): <NEW_LINE> <INDENT> pass | A user event. | 62598fa263d6d428bbee261f |
class Article(ndb.Model): <NEW_LINE> <INDENT> title = ndb.StringProperty() <NEW_LINE> slug = ndb.StringProperty() <NEW_LINE> keywords = ndb.StringProperty(repeated=True) <NEW_LINE> text = ndb.TextProperty() <NEW_LINE> when = ndb.DateTimeProperty(auto_now_add=True) <NEW_LINE> def as_dict(self): <NEW_LINE> <INDENT> retur... | classdocs | 62598fa25166f23b2e243244 |
class MethodIdItem(Measurable): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> Measurable.__init__(self, parent) <NEW_LINE> self.classIdx = Bytes(self, 2) <NEW_LINE> self.protoIdx = Bytes(self, 2) <NEW_LINE> self.nameIdx = Bytes(self, 4) <NEW_LINE> self._data = [self.classIdx, self.protoIdx, self.n... | classdocs | 62598fa2dd821e528d6d8da2 |
class ValueType(object): <NEW_LINE> <INDENT> VALUE_TYPE_UNSPECIFIED = 0 <NEW_LINE> BOOL = 1 <NEW_LINE> INT64 = 2 <NEW_LINE> DOUBLE = 3 <NEW_LINE> STRING = 4 <NEW_LINE> DISTRIBUTION = 5 <NEW_LINE> MONEY = 6 | The value type of a metric.
Attributes:
VALUE_TYPE_UNSPECIFIED (int): Do not use this default value.
BOOL (int): The value is a boolean.
This value type can be used only if the metric kind is ``GAUGE``.
INT64 (int): The value is a signed 64-bit integer.
DOUBLE (int): The value is a double precision floatin... | 62598fa299fddb7c1ca62d1e |
class NodeMetadata: <NEW_LINE> <INDENT> def __init__(self, updated_at: int = 1000): <NEW_LINE> <INDENT> self.updated = updated_at <NEW_LINE> <DEDENT> def get_content_from_node(self): <NEW_LINE> <INDENT> return {'getNode': {'updated_at': self.updated}, 'random': {'random': 2}} | Classe utilizzata per simulare le chiamate richiedenti info sui metadati dei file | 62598fa23539df3088ecc121 |
class Example: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.klass = '' <NEW_LINE> self.words = [] | Represents a document with a label. klass is 'pos' or 'neg' by convention.
words is a list of strings. | 62598fa2009cb60464d01392 |
class ListViewTestSuite: <NEW_LINE> <INDENT> root_url = None <NEW_LINE> def test_list_view(self): <NEW_LINE> <INDENT> response = self.client.get(f"/{self.root_url}/") <NEW_LINE> self.assertEqual(200, response.status_code) | Tests for ListView. | 62598fa26fb2d068a7693d6b |
@unique <NEW_LINE> class ScriptType(Enum): <NEW_LINE> <INDENT> shell = 0 <NEW_LINE> python = 1 | Defines script types such as shell or python script | 62598fa291f36d47f2230dd8 |
class YouTube: <NEW_LINE> <INDENT> y_id: Optional[str] <NEW_LINE> format: Optional[str] <NEW_LINE> video: dict <NEW_LINE> def __init__(self, y_id, video_format=None): <NEW_LINE> <INDENT> self.y_id = y_id <NEW_LINE> self.format = video_format <NEW_LINE> self.video = models.DB().jget(self.y_id, 'info', {}) <NEW_LINE> <DE... | Дополнительные методы для работы с YouTube | 62598fa22ae34c7f260aaf4e |
class SpoolMotor(Motor): <NEW_LINE> <INDENT> def __init__(self, motor_hat, name="spool_motor", index=3): <NEW_LINE> <INDENT> super().__init__(motor_hat, name=name, style="spool", index=index) | Creates a SpoolMotor object for use with the MotorHAT | 62598fa221bff66bcd722ad2 |
class SandboxFolder(Folder): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> sandbox = get_repository_folder('sandbox') <NEW_LINE> if not os.path.exists(sandbox): <NEW_LINE> <INDENT> os.makedirs(sandbox) <NEW_LINE> <DEDENT> abspath = tempfile.mkdtemp(dir=sandbox) <NEW_LINE> super(SandboxFolder, self).__init... | A class to manage the creation and management of a sandbox folder.
Note: this class must be used within a context manager, i.e.:
with SandboxFolder as f:
## do something with f
In this way, the sandbox folder is removed from disk
(if it wasn't removed already) when exiting the 'with' block.
.. todo:: Implement ... | 62598fa244b2445a339b68a4 |
class CapacityFilter(filters.BaseHostFilter): <NEW_LINE> <INDENT> def host_passes(self, host_state, filter_properties): <NEW_LINE> <INDENT> if host_state.host == filter_properties.get('vol_exists_on'): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> volume_size = filter_properties.get('size') <NEW_LINE> if host_sta... | CapacityFilter filters based on volume host's capacity utilization. | 62598fa299cbb53fe6830d41 |
class KeyHandler(object): <NEW_LINE> <INDENT> def __init__(self, filename=None, resaveOnDeletion=True): <NEW_LINE> <INDENT> if not resaveOnDeletion: <NEW_LINE> <INDENT> warnings.warn("The resaveOnDeletion argument to KeyHandler will" " default to True in future versions.") <NEW_LINE> <DEDENT> self._keys = {} <NEW_LINE>... | KeyHandler handles the tedious task of managing nonces associated
with a BTC-e API key/secret pair.
The getNextNonce method is threadsafe, all others are not. | 62598fa23c8af77a43b67e77 |
class SvgTest(unittest.TestCase): <NEW_LINE> <INDENT> maxDiff = None <NEW_LINE> def result_file_name(self, slug, ext): <NEW_LINE> <INDENT> test_name = self._testMethodName <NEW_LINE> assert test_name.startswith("test_") <NEW_LINE> file_name = "{}_{}{}".format(test_name[5:], slug, ext) <NEW_LINE> return os.path.join(HER... | Base class for tests of SVG output. | 62598fa27cff6e4e811b5894 |
class NovacView(BrowserView): <NEW_LINE> <INDENT> implements(INovacView) <NEW_LINE> def __init__(self, context, request): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> self.request = request <NEW_LINE> self.logger = logging.getLogger('cirb.novac.browser.novacview') <NEW_LINE> novac_url = os.environ.get("novac_u... | Cas browser view | 62598fa2adb09d7d5dc0a3f8 |
class number_of_potential_SSS_job_movers(Variable): <NEW_LINE> <INDENT> _return_type="int32" <NEW_LINE> def __init__(self, type): <NEW_LINE> <INDENT> self.is_type = "is_building_type_%s" % type <NEW_LINE> Variable.__init__(self) <NEW_LINE> <DEDENT> def dependencies(self): <NEW_LINE> <INDENT> return [attribute_label('jo... | Number of jobs of given type that should potentially move. Expects attribute 'potential_movers'
of job set that has 1's for jobs that should move, otherwise 0's. | 62598fa2435de62698e9bc62 |
class UserDB(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> username = db.Column(db.String(15), primary_key=True, nullable=False) <NEW_LINE> contact_id = db.Column(db.Integer, db.ForeignKey('contacts.id'), nullable=False) <NEW_LINE> password_hash = db.Column(db.String(128), nullable=False) <NEW_LINE>... | User object stores all necessary information for a site user.
| 62598fa28da39b475be0304e |
class AddParameters(Brick): <NEW_LINE> <INDENT> @lazy <NEW_LINE> def __init__(self, transition, num_params, params_name, weights_init, biases_init, **kwargs): <NEW_LINE> <INDENT> super(AddParameters, self).__init__(**kwargs) <NEW_LINE> update_instance(self, locals()) <NEW_LINE> self.input_names = [name for name in tran... | Adds dependency on parameters to a transition function.
In fact an improved version of this brick should be moved
to the main body of the library, because it is clearly reusable
(e.g. it can be a part of Encoder-Decoder translation model. | 62598fa2d7e4931a7ef3bf08 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.