code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class permutation (object): <NEW_LINE> <INDENT> def __init__ (self, *cycles): <NEW_LINE> <INDENT> size = max(max(cycle) for cycle in cycles) <NEW_LINE> self._lookup = [0] * size <NEW_LINE> for i in xrange(1, size + 1): <NEW_LINE> <INDENT> result = i <NEW_LINE> for cycle in reversed(cycles): <NEW_LINE> <INDENT> try: <NE... | A class to convert cycles into permutation functions.
The perm object is to be called as a function, and implements the
symmetric group of n elements. | 62598ee66fb2d068a769316f |
class Twitter(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.logger = LoggerManager().getLogger(__name__) <NEW_LINE> <DEDENT> def set_key(self, APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET): <NEW_LINE> <INDENT> self.twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, ... | Has functions to tweet from Python (using Twython library)
| 62598ee6d268445f26638eda |
class FirebirdDB(DB): <NEW_LINE> <INDENT> def __init__(self, **keywords): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> import kinterbasdb as db <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> db = None <NEW_LINE> pass <NEW_LINE> <DEDENT> if 'pw' in keywords: <NEW_LINE> <INDENT> keywords['password'] = keywords... | Firebird Database.
| 62598ee68da39b475be01842 |
class QuestionSet(models.Model): <NEW_LINE> <INDENT> __metaclass__ = TransMeta <NEW_LINE> questionnaire = models.ForeignKey(Questionnaire) <NEW_LINE> sortid = models.IntegerField() <NEW_LINE> heading = models.CharField( max_length=64 ) <NEW_LINE> checks = models.CharField( max_length=128, blank=True, help_text=( u'Curr... | Which questions to display on a question page | 62598ee6a8ecb0332586f880 |
class SubstitutionScore(object): <NEW_LINE> <INDENT> clustal_symbols = {1 : '*', 0 : ':', -1 : '.', -2 : ' '} <NEW_LINE> def __init__(self, clustal, from_residue, to_residue): <NEW_LINE> <INDENT> assert(-2 <= clustal <= 1) <NEW_LINE> self.clustal = clustal <NEW_LINE> self.blosum62 = blosum62[(from_residue, to_residue)]... | Container class to score substitution matrix scores for a residue match.
The clustal score is based on the Clustal Omega alignment output (clustal format). A score of 1 (asterix) means
identical residue types, 0 (colon) indicates "conservation between groups of strongly similar properties -
scoring > 0.5 in the Gonnet ... | 62598ee6097d151d1a2bf6b8 |
class Discord(BotPlugin): <NEW_LINE> <INDENT> def get_configuration_template(self): <NEW_LINE> <INDENT> return CONFIG_TEMPLATE <NEW_LINE> <DEDENT> def configure(self, configuration): <NEW_LINE> <INDENT> if configuration is not None and configuration != {}: <NEW_LINE> <INDENT> config = dict(chain(CONFIG_TEMPLATE.items()... | Discord utilities for Errbot | 62598ee610dbd63aa1c6f20b |
class MnistMLPParallel(chainer.Chain): <NEW_LINE> <INDENT> def __init__(self, n_in, n_units, n_out): <NEW_LINE> <INDENT> super(MnistMLPParallel, self).__init__( first0=MnistMLP(n_in, n_units // 2, n_units).to_gpu(0), first1=MnistMLP(n_in, n_units // 2, n_units).to_gpu(1), second0=MnistMLP(n_units, n_units // 2, n_out).... | An example of model-parallel MLP.
This chain combines four small MLPs on two different devices. | 62598ee6a8370b77170eea7b |
class FabberRun(object): <NEW_LINE> <INDENT> def __init__(self, data, log): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.log = log <NEW_LINE> self.timestamp, self.timestamp_str = self._get_log_timestamp(self.log) <NEW_LINE> self.nii_header = None <NEW_LINE> <DEDENT> def write_to_dir(self, dirname, ref_nii=None,... | The result of a Fabber run
:ivar data: A mapping from output name (e.g. ``mean_ftiss`` to data object)
:ivar log: Log output from fabber as a string
:ivar timestamp: Timestamp of the run as a Python datetime object
:ivar timestamp_str: String version of the timestamp | 62598ee68c0ade5d55dc29cf |
class LastSiteUrl(object): <NEW_LINE> <INDENT> def is_admin_url(self, url): <NEW_LINE> <INDENT> if re.search('^(http:\/\/.*){0,1}\/admin\/', url) is None: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> <DEDENT> def process_request(self, request): <NEW_LINE> <INDENT> if self.is_admin_url(request.path) and ... | Records th last url the user visited.
Can be used to return user back to the last app page they were at,
from the admin page, no matter how deep into admin they were. | 62598ee6d58c6744b42db602 |
class TimeSampler: <NEW_LINE> <INDENT> def __init__(self, start_time=0, stop_time=10): <NEW_LINE> <INDENT> self.start_time = start_time <NEW_LINE> self.stop_time = stop_time <NEW_LINE> <DEDENT> def sample_regular_time(self, num_points=None, resolution=None): <NEW_LINE> <INDENT> if num_points is None and resolution is N... | TimeSampler determines how and when samples will be taken from signal and noise.
Samples timestamps for regular and irregular time signals
Parameters
----------
start_time: float/int (default 0)
Time sampling of time series starts
stop_time: float/int (default 10)
Time sampling of time series s... | 62598ee6eab8aa0e5d30a410 |
class Message(BaseEvent): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def to_string(client, data): <NEW_LINE> <INDENT> return data["log"]["message"] <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_hash(data): <NEW_LINE> <INDENT> msg = data["param_message"] <NEW_LINE> return [msg["message"]] <NEW_LINE> <DEDENT> @s... | Messages store the following metadata:
- message: 'My message from %s about %s'
- params: ('foo', 'bar') | 62598ee630bbd722464682d1 |
class RegisterRequest(Message): <NEW_LINE> <INDENT> messageType = 'REGISTER_REQUEST' | Prompt all node clients to send a RegisterNodeMessage | 62598ee632920d7e50bc46c5 |
class UploadDictionaryForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> model = AdjlistConversion <NEW_LINE> fields = '__all__' | A Django form for uploading a RMG dictionary file. | 62598ee660cbc95b063629d5 |
class AckOrResolveRequest(object): <NEW_LINE> <INDENT> def __init__(self, user_name=None, incident_names=None, message=None): <NEW_LINE> <INDENT> self.swagger_types = { 'user_name': 'str', 'incident_names': 'list[str]', 'message': 'str' } <NEW_LINE> self.attribute_map = { 'user_name': 'userName', 'incident_names': 'inc... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ee607f4c71912badaec |
@pulumi.output_type <NEW_LINE> class GetDataGroupResult: <NEW_LINE> <INDENT> def __init__(__self__, id=None, name=None, partition=None, records=None, type=None): <NEW_LINE> <INDENT> if id and not isinstance(id, str): <NEW_LINE> <INDENT> raise TypeError("Expected argument 'id' to be a str") <NEW_LINE> <DEDENT> pulumi.se... | A collection of values returned by getDataGroup. | 62598ee697e22403b3839588 |
class StudentRegistrationForm(ModelForm): <NEW_LINE> <INDENT> email = forms.EmailField() <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(StudentRegistrationForm, self).__init__(*args, **kwargs) <NEW_LINE> if kwargs['instance']: <NEW_LINE> <INDENT> student = kwargs['instance'] <NEW_LINE> self.f... | Form for handling student registration | 62598ee6dd821e528d6d75dd |
class MultiDBModelAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> allow_delete = False <NEW_LINE> allow_change = False <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.collection = collections.current() <NEW_LINE> self.using = self.collection.db_name <NEW_LINE> return super().__init__(*args, **kwar... | Base class for an Admin that connects to a database different from "default".
The database is fetched from the thread-local memory using `snoop.data.collections.current()`. See that
module for details on implementation and limitations. | 62598ee691f36d47f22301ef |
class RequestLogger(hypertoy.HyperToyHandler): <NEW_LINE> <INDENT> def on_request(self): <NEW_LINE> <INDENT> db_session = DBSession() <NEW_LINE> version = self.request_version[:50] <NEW_LINE> path = self.path[:3000] <NEW_LINE> method = self.command[:50] <NEW_LINE> port = self.options["port"] <NEW_LINE> request = HTTPR... | Record HTTP request information in a database. Not for production use. | 62598ee62ae34c7f260a9780 |
class DimensionReduction(object): <NEW_LINE> <INDENT> def __init__(self, algorithm='truncatedsvd', **kwargs): <NEW_LINE> <INDENT> loglevel = logging.ERROR if 'loglevel' not in kwargs else kwargs['loglevel'] <NEW_LINE> logging.basicConfig(format='[%(levelname)s][%(name)s] %(message)s', level=loglevel) <NEW_LINE> self.lo... | See batchTsvd.py for example usage | 62598ee67b25080760ed5b32 |
class Scanner: <NEW_LINE> <INDENT> __slots__ = ('linker', 'hashable_tracker', 'unhashable_tracker') <NEW_LINE> @component.inject_method(linker.Linker) <NEW_LINE> def __init__(self, linker): <NEW_LINE> <INDENT> self.linker = linker <NEW_LINE> self.hashable_tracker = set() <NEW_LINE> self.unhashable_tracker = list() <NEW... | Scanner object to find important functions in hooks | 62598ee6009cb60464cffbe8 |
class SimpleRBFNetwork(RBFNetwork): <NEW_LINE> <INDENT> __slots__ = ('_rho', '_init_centers') <NEW_LINE> def __init__(self, kernel=GaussianBasis(1.0), bias=True, rho=1.0, init_centers='data'): <NEW_LINE> <INDENT> RBFNetwork.__init__(self, kernel, bias) <NEW_LINE> self._rho = rho <NEW_LINE> self._init_centers = init_cen... | @todo:
- validate init_centers
- parametrize init_centers | 62598ee626068e7796d4aff4 |
class Image(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey( settings.AUTH_USER_MODEL, verbose_name='Пользователь', related_name='images_created', on_delete=models.CASCADE) <NEW_LINE> users_like = models.ManyToManyField( settings.AUTH_USER_MODEL, verbose_name='Пользователь поставивший лайк', related_name='i... | Сохранение изображений добавленных в закладки | 62598ee644b2445a339b5cb4 |
class TimeStampField(BaseField, timedelta): <NEW_LINE> <INDENT> def __init__(self, value: timedelta): <NEW_LINE> <INDENT> super().__init__() | timedelta/timestamp field for filter | 62598ee61f037a2d8b9e27a0 |
class RandomPermutation(object): <NEW_LINE> <INDENT> def __init__(self, permutation_percentage=0.2): <NEW_LINE> <INDENT> self.permutation_percentage = permutation_percentage <NEW_LINE> <DEDENT> def corrupt(self, data): <NEW_LINE> <INDENT> result = numx.copy(data) <NEW_LINE> num_switches = numx.int32(data.shape[1] * sel... | RandomPermutation corruption, a fix number of units change their activation values.
| 62598ee6ac7a0e7691f70baf |
class Page(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=31, unique=True) <NEW_LINE> content = models.TextField() <NEW_LINE> author = models.ForeignKey(User) <NEW_LINE> tags = TaggableManager() <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.title | a wiki page/article | 62598ee6435de62698e9a46f |
class StochasticSelection(Selection): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(StochasticSelection, self).__init__() <NEW_LINE> self.random = random <NEW_LINE> <DEDENT> def select(self, population): <NEW_LINE> <INDENT> size = self.compute_selection_size(population) <NEW_LINE> assert all([p.fitn... | A representation of the Stochastic Selection phase of a Genetic Algorithm. | 62598ee66fb2d068a7693170 |
class projection: <NEW_LINE> <INDENT> def __init__(self, width, depth=None, hf=None): <NEW_LINE> <INDENT> if hf is None: <NEW_LINE> <INDENT> assert depth is not None <NEW_LINE> self.depth = depth <NEW_LINE> self.hf = hash_family.get_cached(depth) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.hf = hf <NEW_LINE> sel... | A projection combines a hash family of given depth, and a width.
Together, a hash family and a width determine the dimensionality
reduction performed by a sketch. Compatible sketches must have
equal projections. | 62598ee64428ac0f6e656bec |
class Tag(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('name'), max_length=64) <NEW_LINE> slug = models.SlugField(_('slug'), unique=True, max_length=64, null=True, blank=True) <NEW_LINE> ordering = models.IntegerField(_('ordering')) <NEW_LINE> _object_cache = {} <NEW_LINE> class Meta: <NEW_LINE> <INDENT... | A tag (e.g. document stage) which can be applied to a Change. | 62598ee6be383301e0251e72 |
class MainStatusBar(QStatusBar): <NEW_LINE> <INDENT> def __init__(self, parent = None): <NEW_LINE> <INDENT> super(MainStatusBar, self).__init__(parent) <NEW_LINE> self.setFont(QFont("Helvetica [Cronyx]", 12)) <NEW_LINE> <DEDENT> def showMessage(self, message, msecs = 0, log_into = False): <NEW_LINE> <INDENT> if log_int... | Status Bar for main window | 62598ee6a8ecb0332586f881 |
class ImpulseResponse: <NEW_LINE> <INDENT> def __init__(self, impulseResponseVector=None): <NEW_LINE> <INDENT> self.data = [] <NEW_LINE> self.impulseResponse = impulseResponseVector <NEW_LINE> if impulseResponseVector is not None: <NEW_LINE> <INDENT> self.lengthSamples = len(impulseResponseVector) <NEW_LINE> <DEDENT> <... | Impulse response definition class. Used to share impulse responses with associated metadata.
Joe. | 62598ee63d592f4c4edb958f |
class Sensor(object): <NEW_LINE> <INDENT> def __init__(self, sensor): <NEW_LINE> <INDENT> pass | class description | 62598ee62c8b7c6e89bd1e5a |
class VirtualNetworkUsage(Model): <NEW_LINE> <INDENT> _validation = { 'current_value': {'readonly': True}, 'id': {'readonly': True}, 'limit': {'readonly': True}, 'name': {'readonly': True}, 'unit': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'current_value': {'key': 'currentValue', 'type': 'float'}, 'id': {'key... | Usage details for subnet.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar current_value: Indicates number of IPs used from the Subnet.
:vartype current_value: float
:ivar id: Subnet identifier.
:vartype id: str
:ivar limit: Indicates the size of the subnet.
:vartype limit... | 62598ee6097d151d1a2bf6ba |
class Parakeet(Pieces): <NEW_LINE> <INDENT> def is_promote(self): <NEW_LINE> <INDENT> if self.player == WHITE_PLAYER: <NEW_LINE> <INDENT> if self.posY == BOARD_LENGTH-1: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> <DEDENT> elif self.player == BLACK_PLAYER: <NEW_LINE> <INDENT> if self.posY == 0: <NEW_LINE> <INDE... | A Parakeet may move one square forward,
if no other piece is on that square.
Or, a Parakeet may
move one square forward diagonally | 62598ee610dbd63aa1c6f20d |
class SessionWishlistItem(ndb.Model): <NEW_LINE> <INDENT> session_websafe_key = ndb.StringProperty() <NEW_LINE> parent_wsck = ndb.StringProperty() | This represents a wishlist item. Ancestor: Profile entity | 62598ee6379a373c97d9768e |
class View(BrowserView): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> manager = IMarshalStorageManager(self.context) <NEW_LINE> storage = manager.get_storage() <NEW_LINE> lines = ["Download token storage", ] <NEW_LINE> for token, data in storage.iteritems(): <NEW_LINE> <INDENT> lines.append("%s: %s" % (t... | a view for checking the content of the storage
| 62598ee61f5feb6acb1612eb |
class get_TD (object): <NEW_LINE> <INDENT> def __init__(self,filename): <NEW_LINE> <INDENT> while(True): <NEW_LINE> <INDENT> if filename[len(filename) - 1] == 'v': <NEW_LINE> <INDENT> while (True): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> df= pd.read_csv(filename, skiprows=SKIP_ROWS, sep = ';', header= None, names ... | Create a touchdown object for plotting and anaylsis: td_obj = getTD('S1_000-Capacitance.csv') | 62598ee64527f215b58e85a0 |
class DescribeExportJobResultRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.JobId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.JobId = params.get("JobId") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in vars(self)... | DescribeExportJobResult请求参数结构体
| 62598ee663b5f9789fe837f7 |
class CO2(Gas): <NEW_LINE> <INDENT> def __defaults__(self): <NEW_LINE> <INDENT> self.molecular_mass = 44.01 <NEW_LINE> self.gas_specific_constant = 188.9 <NEW_LINE> self.composition.CO2 = 1.0 | Holds constants for CO2.
Assumptions:
None
Source:
None | 62598ee655399d3f05624bcc |
class EmailAuthBackend(ModelBackend): <NEW_LINE> <INDENT> def authenticate(self, email=None, password=None, **kwargs): <NEW_LINE> <INDENT> if email is None: <NEW_LINE> <INDENT> email = kwargs.get('username') <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> user = User.objects.get(username=email) <NEW_LINE> if user.check_pa... | Allow users to log in with their email address | 62598ee62ae34c7f260a9781 |
@marshal_with(ERPAddressSchema) <NEW_LINE> class CustomerPostalAddress(MethodResource): <NEW_LINE> <INDENT> def _get_customer_postal_address(self, customer_name): <NEW_LINE> <INDENT> link = erp_client.query(ERPDynamicLink).first( filters=[ ["Dynamic Link", "parenttype", "=", "Address"], ["Dynamic Link", "link_name", "=... | Customer Address management | 62598ee699fddb7c1ca62152 |
class DataFrameReader(object): <NEW_LINE> <INDENT> def __init__(self, sqlContext): <NEW_LINE> <INDENT> self._jreader = sqlContext._ssql_ctx.read() <NEW_LINE> self._sqlContext = sqlContext <NEW_LINE> <DEDENT> def _df(self, jdf): <NEW_LINE> <INDENT> from pyspark.sql.dataframe import DataFrame <NEW_LINE> return DataFrame(... | Interface used to load a :class:`DataFrame` from external storage systems
(e.g. file systems, key-value stores, etc). Use :func:`SQLContext.read`
to access this.
::Note: Experimental
.. versionadded:: 1.4 | 62598ee6e5267d203ee69fa0 |
class ZoneExport(_base.Resource): <NEW_LINE> <INDENT> resource_key = '' <NEW_LINE> resources_key = 'exports' <NEW_LINE> base_path = '/zones/tasks/export' <NEW_LINE> allow_create = True <NEW_LINE> allow_fetch = True <NEW_LINE> allow_delete = True <NEW_LINE> allow_list = True <NEW_LINE> _query_mapping = resource.QueryPar... | DNS Zone Exports Resource | 62598ee6adb09d7d5dc08c61 |
class TaskDetailView(ProfileRequiredMixin, DetailView): <NEW_LINE> <INDENT> model = Task <NEW_LINE> template_name = "tasks/detail_task.html" <NEW_LINE> queryset = Task.objects.filter(is_removed=False) <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> task = get_object_or_404(Task, is_removed=False, pk=self.kwargs['p... | CBV to see the details of an existing task -- task has to be visible to
the current user. | 62598ee6090684286d592a2d |
@API.public <NEW_LINE> class ABCService(Service, metaclass=ABCServiceMeta, abstract=True): <NEW_LINE> <INDENT> __slots__ = () | This class only purpose is to facilitate the use of a abstract parent class, relying
on :py:class:`abc.ABC`, with :py:class:`.Service`.
.. doctest:: abc_service_class
>>> from abc import ABC, abstractmethod
>>> from antidote import ABCService, world
>>> class AbstractClass(ABC):
... @abstractmetho... | 62598ee699cbb53fe682f54c |
class Py3status: <NEW_LINE> <INDENT> def avg_tmp(self, json=None, i3status_config=None): <NEW_LINE> <INDENT> output = subprocess.check_output(["acpi", "-t"]).strip() <NEW_LINE> lines = output.splitlines() <NEW_LINE> cumulatedTmp = 0 <NEW_LINE> color = i3status_config['color_good'] <NEW_LINE> numTmps = 0 <NEW_LINE> for ... | show averagy tmp | 62598ee6d7e4931a7ef3a73a |
class DataTreeSwapNearNodesMutator(Mutator): <NEW_LINE> <INDENT> def __init__(self, peach, node): <NEW_LINE> <INDENT> Mutator.__init__(self) <NEW_LINE> self.isFinite = True <NEW_LINE> self.name = "DataTreeSwapNearNodesMutator" <NEW_LINE> self._peach = peach <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> raise ... | Swap two nodes in the data model that are near each other.
TODO: Actually move the nodes instead of just the data. | 62598ee6be8e80087fbbd6e8 |
class User(models.Model): <NEW_LINE> <INDENT> scr_name = models.CharField(max_length=20) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.scr_name | a twitter user handle | 62598ee626068e7796d4aff6 |
class FileSystemUsersPerformanceGetResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'items': 'list[FileSystemUserPerformance]', 'total': 'list[FileSystemUserPerformance]' } <NEW_LINE> attribute_map = { 'items': 'items', 'total': 'total' } <NEW_LINE> required_args = { } <NEW_LINE> def __init__( self, items=None, ... | Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition. | 62598ee6a79ad161977686b4 |
class Scroller(object): <NEW_LINE> <INDENT> def __init__(self, width, height, base, color, speed): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.base = base <NEW_LINE> self.color = color <NEW_LINE> self.speed = speed <NEW_LINE> self.buildings=[] <NEW_LINE> self.add_building(0) <... | Scroller object will create the group of buildings to fill the screen and scroll
It takes:
width - an integer that represents in pixels the width of the scroller
This should only be a positive integer because a negative integer will draw buildings outside of the screen
height - an integer that represen... | 62598ee656ac1b37e6300887 |
class ListVersionsResponse(_messages.Message): <NEW_LINE> <INDENT> nextPageToken = _messages.StringField(1) <NEW_LINE> versions = _messages.MessageField('Version', 2, repeated=True) | A ListVersionsResponse object.
Fields:
nextPageToken: A string attribute.
versions: A Version attribute. | 62598ee6435de62698e9a471 |
class CapsuleSettings(FeatureSettings): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(CapsuleSettings, self).__init__(*args, **kwargs) <NEW_LINE> self.domain = None <NEW_LINE> self.instance_name = None <NEW_LINE> self.hash = None <NEW_LINE> self.ddns_package_url = None <NEW_LINE> <D... | Clients settings definitions. | 62598ee64e4d562566370ab4 |
class RequiresPythonRequirement(Requirement): <NEW_LINE> <INDENT> def __init__(self, specifier, match): <NEW_LINE> <INDENT> self.specifier = specifier <NEW_LINE> self._candidate = match <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "{class_name}({specifier!r})".format( class_name=self.__class__.__n... | A requirement representing Requires-Python metadata.
| 62598ee67d847024c075aa6a |
class CallbackRegistrationError(OpenFFToolkitException, TypeError): <NEW_LINE> <INDENT> pass | Error raised when callback registration fails. | 62598ee68c0ade5d55dc29d1 |
class Operations(object): <NEW_LINE> <INDENT> models = models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self.api_version = "2018-08-01" <NEW_LINE> self.... | Operations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Client API version. Constant value: "2018-08-01". | 62598ee6a8370b77170eea80 |
class Competition(FootballDataObject): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.id = '' <NEW_LINE> self.caption = '' <NEW_LINE> self.current_match_day = '' <NEW_LINE> self.last_updated = '' <NEW_LINE> self.league = '' <NEW_LINE> self.number_of_games = '' <NEW_LINE> self.number_of_teams... | Class to represent a competition | 62598ee64e4d562566370ab5 |
class MutateAttr(TreeAction): <NEW_LINE> <INDENT> def __init__(self, node, attr, newval_fn): <NEW_LINE> <INDENT> self.node = node <NEW_LINE> self.attr = attr <NEW_LINE> self.newval_fn = newval_fn <NEW_LINE> <DEDENT> def apply(self, state): <NEW_LINE> <INDENT> node = self.get_backref(state, self.node) <NEW_LINE> if node... | Modify 'attr' | 62598ee655399d3f05624bce |
class _Randomize(preprocess.preprocess.Preprocess): <NEW_LINE> <INDENT> def __init__(self, rand_type=Random.RandomizeClasses): <NEW_LINE> <INDENT> self.rand_type = rand_type <NEW_LINE> <DEDENT> def __call__(self, data): <NEW_LINE> <INDENT> randomizer = Random(rand_type=self.rand_type) <NEW_LINE> return randomizer(data) | Randomize data preprocessor. | 62598ee67047854f4633da71 |
class MyDelegate(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.running = True <NEW_LINE> self.data = [] <NEW_LINE> self.settings = [] <NEW_LINE> self.guess = [] <NEW_LINE> self.has_settings = False <NEW_LINE> self.win = False <NEW_LINE> self.waiting_on_news = False <NEW_LINE> self.robot = ro... | handles function calls from the pc | 62598ee663b5f9789fe837f9 |
class LayerCharCNN(LayerBase): <NEW_LINE> <INDENT> def __init__(self, gpu, char_embeddings_dim, filter_num, char_window_size, word_len): <NEW_LINE> <INDENT> super(LayerCharCNN, self).__init__(gpu) <NEW_LINE> self.char_embeddings_dim = char_embeddings_dim <NEW_LINE> self.char_cnn_filter_num = filter_num <NEW_LINE> self.... | LayerCharCNN implements character-level convolutional 1D layer. | 62598ee6a219f33f346c4ed5 |
class CarTaxiAdvance_form(ModelForm): <NEW_LINE> <INDENT> required_css_class = "required" <NEW_LINE> error_css_class = "error" <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = CarTaxiAdvance <NEW_LINE> exclude = ("balance",) <NEW_LINE> widgets = { "session": forms.HiddenInput(), "voucher_no": forms.HiddenInput(), } <... | Form for clearance of order. | 62598ee64f88993c371ef834 |
class JoinPoint: <NEW_LINE> <INDENT> _method = None <NEW_LINE> _advices_cache = None <NEW_LINE> _advices_hashsum = None <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._context = Context(**kwargs) <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self._method, name) <... | Wrapper around function or class method.
| 62598ee6090684286d592a2e |
class TestJapaneseApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = openapi_client.api.japanese_api.JapaneseApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_gender_japanese_name_full(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <... | JapaneseApi unit test stubs | 62598ee62ae34c7f260a9784 |
class TreeSearchPrescreen(TreeSearch): <NEW_LINE> <INDENT> def __init__(self, tree, search, prescreen, poolsize): <NEW_LINE> <INDENT> TreeSearch.__init__(self, tree) <NEW_LINE> self.search = TreeSearchUnique(tree, search, auto_add=False) <NEW_LINE> self.prescreen = prescreen <NEW_LINE> self.poolsize = poolsize <NEW_LIN... | Propose trees with prescreening | 62598ee6d7e4931a7ef3a73b |
class StopAnalyzer(LexicalAnalyzer): <NEW_LINE> <INDENT> _validation = { 'odata_type': {'required': True}, 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'stopwords': {'key': 'stopwords', 'type': '[str]'}, } <NEW... | Divides text at non-letters; Applies the lowercase and stopword token filters. This analyzer is implemented using Apache Lucene.
All required parameters must be populated in order to send to Azure.
:ivar odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by
server.
:vartype odata_type... | 62598ee644b2445a339b5cb6 |
class PasswordResetView(GenericAPIView): <NEW_LINE> <INDENT> serializer_class = PasswordResetSerializer <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> logger.debug('Password reset post called') <NEW_LINE> logger.debug(request.data) <NEW_LINE> serializer = self.get_serializer(data=request.data) <NEW_LINE> if se... | Calls Django Auth PasswordResetForm save method.
Accepts the following POST parameters: email
Returns the success/fail message. | 62598ee676e4537e8c3edc55 |
class Generator: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def valid(index: str, password: str) -> bool: <NEW_LINE> <INDENT> index = encrypt.base64encode(index.encode()).decode() <NEW_LINE> auth: Authentication = Authentication.objects(index=index) <NEW_LINE> if not auth or Generator.calc( password, auth[0].salt) !=... | 口令验证器 - 使用加密策略计算口令
加密策略:
密码 + 盐值作为初始密码
迭代SHA256算法对初始密码进行哈希指定次数 | 62598ee63539df3088eca94e |
class IsAdjacent(Node): <NEW_LINE> <INDENT> def tick(self, owner, game_map): <NEW_LINE> <INDENT> target = self.namespace.get("target") <NEW_LINE> distance = l2_distance((owner.x, owner.y), (target.x, target.y)) <NEW_LINE> if distance < 2: <NEW_LINE> <INDENT> return TreeStates.SUCCESS, [] <NEW_LINE> <DEDENT> else: <NEW_... | Return sucess is owner is adjacent to target. | 62598ee6a79ad161977686b6 |
class VacuumStatus: <NEW_LINE> <INDENT> def __init__(self, data: Dict[str, Any]) -> None: <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> @property <NEW_LINE> def state_code(self) -> int: <NEW_LINE> <INDENT> return int(self.data["state"]) <NEW_LINE> <DEDENT> @property <NEW_LINE> def state(self) -> str: <NEW_LI... | Container for status reports from the vacuum. | 62598ee63cc13d1c6d463e0b |
class __SRD: <NEW_LINE> <INDENT> def __init__(self, data_path: Path): <NEW_LINE> <INDENT> self.raw = {} <NEW_LINE> for file in data_path.iterdir(): <NEW_LINE> <INDENT> if file.name.endswith('.json'): <NEW_LINE> <INDENT> resource = file.stem.replace('5e-SRD-', '').lower() <NEW_LINE> log.debug(f'Loading SRD: {resource} f... | Contains the imported SRD data and methods to search it. | 62598ee6627d3e7fe0e05525 |
class Department(object): <NEW_LINE> <INDENT> def __init__(self, name, courses): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.courses = courses <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name | A department with a name and a list of courses. | 62598ee6f7d966606f74668d |
class SearchResultController(AbstractController): <NEW_LINE> <INDENT> def __init__(self, tableView, mainWindow, parentController, itemActionController): <NEW_LINE> <INDENT> AbstractController.__init__(self, tableView, mainWindow, None, True, parentController) <NEW_LINE> self.horizontalHeader().setSortIndicator(0, QtCor... | Controls view displaying search results. | 62598ee645492302aabfab4a |
class Coin(IntervalModule): <NEW_LINE> <INDENT> settings = ( ("format", "format string used for output."), ("color"), ("coin", "cryptocurrency to fetch"), ("decimal", "round coin price down to this decimal place"), ("currency", "fiat currency to show fiscal data"), ("symbol", "coin symbol"), ("interval", "update interv... | Fetches live data of all cryptocurrencies availible at coinmarketcap <https://coinmarketcap.com/>.
Coin setting should be equal to the 'id' field of your coin in <https://api.coinmarketcap.com/v1/ticker/>.
Example coin settings: bitcoin, bitcoin-cash, ethereum, litecoin, dash, lisk.
Example currency settings: usd, eur... | 62598ee6e64d504609df870d |
class Character(): <NEW_LINE> <INDENT> def __init__(self, max_health): <NEW_LINE> <INDENT> self._maxhealth = max_health <NEW_LINE> self._currenthealth = self._maxhealth <NEW_LINE> <DEDENT> def get_max_health(self): <NEW_LINE> <INDENT> return self._maxhealth <NEW_LINE> <DEDENT> def get_health(self): <NEW_LINE> <INDENT> ... | The Character class implements the basic functionality of a
player/enemy within the game, and is the superclass of Player & Enemy. | 62598ee6460517430c430b25 |
class Results(Page): <NEW_LINE> <INDENT> def vars_for_template(self): <NEW_LINE> <INDENT> return { 'total_earnings': self.group.total_contribution * Constants.multiplier, } | Players payoff: How much each has earned | 62598ee6e76e3b2f99fd70d5 |
class Buildings(pygame.sprite.LayeredDirty): <NEW_LINE> <INDENT> def __init__(self, renderer): <NEW_LINE> <INDENT> super(Buildings, self).__init__() <NEW_LINE> self.set_clip() | The sprite group for the buildings | 62598ee6be383301e0251e76 |
class Ai(object): <NEW_LINE> <INDENT> def __init__(self, racket, ball): <NEW_LINE> <INDENT> self.ball = ball <NEW_LINE> self.racket = racket <NEW_LINE> <DEDENT> def move(self): <NEW_LINE> <INDENT> y = self.ball.rect.centery - self.racket.height/2 <NEW_LINE> self.racket.move_with_mouse(y) | AI always chasing the ball with its center point | 62598ee6d268445f26638edd |
class Port(NetworkNotificationBase): <NEW_LINE> <INDENT> resource_name = 'port' | Listen for Neutron notifications.
Listen in order to mediate with the metering framework. | 62598ee6a8ecb0332586f885 |
class ExtensionsList(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'readonly': True}, 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[Extension]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs... | Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of Extensions within a Kubernetes cluster.
:vartype value: list[~azure.mgmt.kubern... | 62598ee6d58c6744b42db605 |
class Picture(db.Model): <NEW_LINE> <INDENT> author = db.UserProperty() <NEW_LINE> content = db.BlobProperty() <NEW_LINE> date = db.DateTimeProperty(auto_now_add=True) | Models a Gallery with an author, content ( the picture ), and date. | 62598ee667a9b606de54466c |
class ReadMeterCommand(Command): <NEW_LINE> <INDENT> args = [ arg('--serial-port', default=DEFAULT_SERIAL, metavar=DEFAULT_SERIAL, help='serial port to read packets from (defaults to %s)' % DEFAULT_SERIAL), arg('--baudrate', default=9600, help='baudrate for the serial connection'), arg('--tsv', action='store_true', hel... | Read a single P1 packet
Read a single packet from the smart meter.
Packets can either be printed to stdout or stored
in a sqlite database. | 62598ee630bbd722464682d7 |
class JobStatistics4(_messages.Message): <NEW_LINE> <INDENT> destinationUriFileCounts = _messages.IntegerField(1, repeated=True) | A JobStatistics4 object.
Fields:
destinationUriFileCounts: [Experimental] Number of files per destination
URI or URI pattern specified in the extract configuration. These values
will be in the same order as the URIs specified in the 'destinationUris'
field. | 62598ee666656f66f7d58a7e |
class Comment(models.Model): <NEW_LINE> <INDENT> section = models.SmallIntegerField(choices=UserActivity.SECTION_TYPE, blank=False) <NEW_LINE> item = models.IntegerField(blank=False) <NEW_LINE> commentator = models.ForeignKey(CommonInfo, blank=False) <NEW_LINE> is_anonymous = models.BooleanField() <NEW_LINE> datetime =... | 定义整个系统的评论 | 62598ee61f5feb6acb1612ef |
class MembershipSet(set): <NEW_LINE> <INDENT> def __init__(self, iterable=None): <NEW_LINE> <INDENT> if not iterable: <NEW_LINE> <INDENT> iterable = [] <NEW_LINE> <DEDENT> super(MembershipSet, self).__init__(iterable) <NEW_LINE> <DEDENT> def add(self, elem): <NEW_LINE> <INDENT> super(MembershipSet, self).add(perm) <NEW... | A set with all the and, or, and union operations disabled, it's really only
handy for testing membership
This is really more of a skeleton for the few times I've had to do this in a
project, usually we are implementing custom functionality that acts like a set
and so it will be nice to just be able to extend this and ... | 62598ee660cbc95b063629db |
class NegativeTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_not_a_list(self): <NEW_LINE> <INDENT> with self.assertRaises(TypeError) as error: <NEW_LINE> <INDENT> variance('a') <NEW_LINE> <DEDENT> self.assertEqual(error.exception.args[0], 'argument of the function must be a list of values of type int ' 'or floa... | This is negative test case for the function variance from the module stats. | 62598ee699cbb53fe682f54f |
@keras_export('keras.metrics.CategoricalAccuracy') <NEW_LINE> class CategoricalAccuracy(MeanMetricWrapper): <NEW_LINE> <INDENT> def __init__(self, name='categorical_accuracy', dtype=None): <NEW_LINE> <INDENT> super(CategoricalAccuracy, self).__init__( categorical_accuracy, name, dtype=dtype) | Calculates how often predictions matches one-hot labels.
You can provide logits of classes as `y_pred`, since argmax of
logits and probabilities are same.
This metric creates two local variables, `total` and `count` that are used to
compute the frequency with which `y_pred` matches `y_true`. This frequency is
ultimat... | 62598ee6925a0f43d25e66cb |
class MatFile(plot.BasePlot): <NEW_LINE> <INDENT> def __init__( self, name, ndigits=3, index=None ): <NEW_LINE> <INDENT> plot.BasePlot.__init__( self, name, ndigits=ndigits, index=index ) <NEW_LINE> self.names = [ self.name + '.mat' ] <NEW_LINE> self._data = {} <NEW_LINE> <DEDENT> def data( self, data ): <NEW_LINE> <IN... | MatFile( name, [ ndigits ], [ index ] )
name int Filename without extension
ndigits int Number of digits for the file index
index int Plot number
Note: Load in MATLAB using
>>> load 'filename.mat'
Example:
with MatFile('filename') as mat:
mat.data({'x':[0,1,2],'y':[3.1,4.5,1.2]}) | 62598ee6bd1bec0571e1441a |
class SnippetsByAuthorFeed(Feed): <NEW_LINE> <INDENT> feed_type = Atom1Feed <NEW_LINE> title_template = 'cab/feeds/title.html' <NEW_LINE> description_template = 'cab/feeds/description.html' <NEW_LINE> item_copyright = 'Freely redistributable' <NEW_LINE> def author_name(self, obj): <NEW_LINE> <INDENT> return obj.usernam... | Feed of the most recent Snippets by a given author. | 62598ee6adb09d7d5dc08c65 |
class Converter(Encoder): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TeX = TeXEncoder() <NEW_LINE> self.Codes = [] <NEW_LINE> <DEDENT> def toTeX(self, s): <NEW_LINE> <INDENT> for c in self.Codes: <NEW_LINE> <INDENT> s = s.replace(c, self.TeX.TeXCodes[c]) <NEW_LINE> <DEDENT> return s <NEW_LINE> <DE... | The abstract class representing entries.
Convert TeX special characters. | 62598ee64a966d76dd5ed582 |
class StatusField(models.CharField): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('max_length', 100) <NEW_LINE> self.check_for_status = not kwargs.pop('no_check_for_status', False) <NEW_LINE> super(StatusField, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def pre... | A CharField that looks for a ``STATUS`` class-attribute and
automatically uses that as ``choices``. The first option in
``STATUS`` is set as the default.
Also has a default max_length so you don't have to worry about
setting that.
Also features a ``no_check_for_status`` argument to make sure
South can handle this fie... | 62598ee61b99ca400228e85c |
class TestCompletions: <NEW_LINE> <INDENT> @pytest.fixture(autouse=True) <NEW_LINE> def cmdutils_stub(self, monkeypatch, stubs): <NEW_LINE> <INDENT> monkeypatch.setattr(objects, 'commands', { 'one': stubs.FakeCommand(name='one'), 'two': stubs.FakeCommand(name='two'), 'two-foo': stubs.FakeCommand(name='two-foo'), }) <NE... | Tests for completions.use_best_match. | 62598ee644b2445a339b5cb7 |
class AuthPhase: <NEW_LINE> <INDENT> def __init__(self, logger, hass, send_message, request): <NEW_LINE> <INDENT> self._hass = hass <NEW_LINE> self._send_message = send_message <NEW_LINE> self._logger = logger <NEW_LINE> self._request = request <NEW_LINE> self._authenticated = False <NEW_LINE> self._connection = None <... | Connection that requires client to authenticate first. | 62598ee657b8e32f52507454 |
class ProviderClient(object): <NEW_LINE> <INDENT> def __init__(self, client): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> <DEDENT> def all(self, per_page=None, next_id=None): <NEW_LINE> <INDENT> params = {} <NEW_LINE> if per_page is not None: <NEW_LINE> <INDENT> params['limit'] = per_page <NEW_LINE> <DEDENT> da... | Providers API. | 62598ee67cff6e4e811b408c |
class TelegramWorkflowManager(WorkflowManager): <NEW_LINE> <INDENT> LOG_TAG = "TelegramWorkflowManager" <NEW_LINE> def __init__(self, chat_id, bot:Bot) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.chat_id = chat_id <NEW_LINE> self.bot = bot <NEW_LINE> self.logger = utils.mylogger.getLoggerByChatId(ch... | This class manages the interaction with Telegram | 62598ee60c0af96317c54a3c |
class Post(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> content = models.TextField(blank=True) <NEW_LINE> like_users = models.ManyToManyField( User, through='PostLike', related_name='like_post_set', ) <NEW_LINE> created = models.DateTimeField(auto_now_add=True... | 인스타그램의 포스트 | 62598ee6f548e778e5969c2b |
class ConnectionMonitorEndpointFilterItem(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'address': {'key': 'address', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, type: Optional[Union[str, "ConnectionMonitorEndpointFilterItemType"]] = None, address: O... | Describes the connection monitor endpoint filter item.
:param type: The type of item included in the filter. Currently only 'AgentAddress' is
supported. Possible values include: "AgentAddress".
:type type: str or
~azure.mgmt.network.v2019_12_01.models.ConnectionMonitorEndpointFilterItemType
:param address: The addre... | 62598ee685dfad0860cbedb7 |
class Solution1: <NEW_LINE> <INDENT> def stoneGameV(self, stoneValue: List[int]) -> int: <NEW_LINE> <INDENT> def helper(i, j): <NEW_LINE> <INDENT> if dp[i][j] != -1: return dp[i][j] <NEW_LINE> result = 0 <NEW_LINE> for k in range(i, j): <NEW_LINE> <INDENT> tmp = 0 <NEW_LINE> leftSum = sumStone[k] - sumStone[i - 1] <NEW... | 根据题目得知石头的数量比较有限,只有500个,所以我们可以采用动态规划的思路才求解
dp(i, j) 表示第 i 个石头到第 j 个石头之间,这个子数组,根据题目的方式,能够获得的最大分数
若stoneValue[i:j+1]的最佳划分点为k, (i <= k < j),则有
dp(i, j) = max(dp(i, k) + sum(i, k), dp(k+1, j) + sum(k+1, j))
其中 sum(i,k) 表示第k个石头和第i个石头之间的数值之和(不包括石头i),可以标记为 sumStone(k) - sumStone(i - 1) 其中 sumStone(i) 表示stoneValue数组前i个石头数值之和
... | 62598ee6be383301e0251e78 |
class Arguments: <NEW_LINE> <INDENT> optional_args = graphene.String() | Mutation Arguments. | 62598ee6baa26c4b54d4d96e |
class APITest(TestCase): <NEW_LINE> <INDENT> urls = "contentious.tests.urls" <NEW_LINE> def test_save_and_get_data_with_multiple_languages(self): <NEW_LINE> <INDENT> api = BasicTranslationAPI() <NEW_LINE> request_en = HttpRequest() <NEW_LINE> request_en.path = '/test_view/' <NEW_LINE> request_en.language = "en-UK" <NEW... | Tests for the BasicTranslationAPI. | 62598ee65fcc89381b265475 |
class CommandError(Exception): <NEW_LINE> <INDENT> def __init__(self, *arg_names, **kwargs): <NEW_LINE> <INDENT> self.message = 'mandatory arguments: {}'.format(', '.join(arg_names)) <NEW_LINE> self.__dict__.update(kwargs) <NEW_LINE> super(CommandError, self).__init__(self.message) | raised if there is an error in invoking a :class:`<Command>` command | 62598ee6a8370b77170eea83 |
class WikiLink(WikiElement): <NEW_LINE> <INDENT> def __init__(self, tag, delimiter, base_url,space_char,class_func,path_func): <NEW_LINE> <INDENT> super(WikiLink,self).__init__(tag, '') <NEW_LINE> self.delimiter = delimiter <NEW_LINE> self.base_url = base_url <NEW_LINE> self.space_char = space_char <NEW_LINE> self.clas... | Used to match wiki links inside a link.
The search scope for these is only inside links.
>>> wiki_link = WikiLink('a','|',base_url='http://somewiki.org/',
... space_char='_',class_func=None, path_func=None)
>>> mo = wiki_link.regexp.search(" Home Page |Home")
>>> wiki_link.href(mo)
'http://somewi... | 62598ee60a50d4780f703a4a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.