code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class plLearnNdNormal(plMLLearnObject): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> for _s in [plMLLearnObject]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, plLearnNdNormal, name, value) <NEW_LINE> __swig_getmethods_...
Proxy of C++ plLearnNdNormal class
62598f6fa4f1c619b294ddf6
class Address: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create(**kwargs): <NEW_LINE> <INDENT> return Address(**kwargs) <NEW_LINE> <DEDENT> def __init__(self, json=None, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> if json is None and not kwargs: <NEW_LINE> <INDENT> raise j.exceptions.Value("No data or kwargs ...
auto-generated. don't touch.
62598f6f07d97122c42164a2
class BaseCustomAuthUserForm(forms.ModelForm): <NEW_LINE> <INDENT> error_messages = { 'duplicate username': _('Duplicate username: %(username)s'), 'duplicate email': _('Duplicate email: %(email)s'), 'invalid passwords': _( 'Invalid passwords: %(password1)s, %(password2)s'), 'invalid authentication': _( 'Invalid authent...
Base form of the CustomAuthUser.
62598f6fa8ecb03325870a08
class AttributeDictionary(dict): <NEW_LINE> <INDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> return self.get(key, None) <NEW_LINE> <DEDENT> __setattr__ = dict.__setitem__ <NEW_LINE> __delattr__ = dict.__delitem__
A dictionnary with object-like accessors
62598f6f7b25080760ed6c9e
class CallableFromPathError(EventMQError): <NEW_LINE> <INDENT> pass
Raised when construction of a callable from a path and callable_name fails.
62598f6ffb3f5b602db47db1
class OnDemandImporter(object): <NEW_LINE> <INDENT> def find_module(self, fullname, path=None): <NEW_LINE> <INDENT> origName = fullname <NEW_LINE> if not path: <NEW_LINE> <INDENT> mod = sys.modules.get(fullname, False) <NEW_LINE> if mod is None or mod and isinstance(mod, types.ModuleType): <NEW_LINE> <INDENT> return mo...
The on-demand importer imports a module proxy that inserts the desired module into the calling scope only when an attribute from the module is actually used.
62598f6f63f4b57ef0085970
class Page(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('Name'), max_length=100) <NEW_LINE> url = models.CharField( _('URL'), max_length=200, help_text=_("Define the URL for this page, for example 'about/'. NOTE: You should not include the initial slash."), db_index=True, ) <NEW_LINE> template = models....
Model to represent an automatic 'flatpage'
62598f6f1f037a2d8b9e38f1
class BCryptSHA256PasswordHasher(BasePasswordHasher): <NEW_LINE> <INDENT> algorithm = "bcrypt_sha256" <NEW_LINE> digest = hashlib.sha256 <NEW_LINE> library = ("bcrypt", "bcrypt") <NEW_LINE> rounds = 12 <NEW_LINE> def salt(self): <NEW_LINE> <INDENT> bcrypt = self._load_library() <NEW_LINE> return bcrypt.gensalt(self.rou...
Secure password hashing using the bcrypt algorithm (recommended) This is considered by many to be the most secure algorithm but you must first install the bcrypt library. Please be warned that this library depends on native C code and might cause portability issues.
62598f6fbe8e80087fbbe860
class SolverInfo(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.prefix = "" <NEW_LINE> self.stack = [] <NEW_LINE> <DEDENT> def clear(self): <NEW_LINE> <INDENT> self.prefix = "" <NEW_LINE> self.stack = [] <NEW_LINE> <DEDENT> def pop(self): <NEW_LINE> <INDENT> last_string = self.stack.pop() <NE...
Communal object for storing some formatting for solver iprint. Attributes ---------- prefix : str Prefix to prepend during this iprint. stack : list List of strings; strings are popped and appended as needed.
62598f6fec188e330fdf80a4
class DatabaseAppsRouter(object): <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label in DATABASE_MAPPING: <NEW_LINE> <INDENT> return DATABASE_MAPPING[model._meta.app_label] <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> def db_for_write(self, model, **hints): <N...
A router to control all database operations on models for different databases. In case an app is not set in settings.DATABASE_APPS_MAPPING, the router will fallback to the `default` database. Settings example: DATABASE_APPS_MAPPING = {'app1': 'db1', 'app2': 'db2'}
62598f6f26238365f5fac379
class PyramidIntegration(PyramidIntegrationMixin, FrameworkIntegration): <NEW_LINE> <INDENT> oauth1_client_cls = OAuth1Session <NEW_LINE> oauth2_client_cls = OAuth2Session <NEW_LINE> expires_in = 3600 <NEW_LINE> def generate_access_token_params(self, request_token_url, request): <NEW_LINE> <INDENT> if request_token_url...
Pyramid framework integration.
62598f6f6fece00bbaccb18e
class ExtensionsV1beta1RunAsUserStrategyOptions(object): <NEW_LINE> <INDENT> swagger_types = { 'ranges': 'list[ExtensionsV1beta1IDRange]', 'rule': 'str' } <NEW_LINE> attribute_map = { 'ranges': 'ranges', 'rule': 'rule' } <NEW_LINE> def __init__(self, ranges=None, rule=None): <NEW_LINE> <INDENT> self._ranges = None <NEW...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f6f1f5feb6acb16243c
class DefenseSubmission(ExecutableSubmission): <NEW_LINE> <INDENT> def __init__(self, submission_id, submissions, storage_bucket): <NEW_LINE> <INDENT> super(DefenseSubmission, self).__init__(submission_id, submissions, storage_bucket) <NEW_LINE> if self.type != TYPE_DEFENSE: <NEW_LINE> <INDENT> raise WorkerError('Incor...
Helper class to run one defense submission.
62598f6fcad5886f8bdc4b24
class SelectionItem(MenuItem): <NEW_LINE> <INDENT> def __init__(self, text, index, menu=None): <NEW_LINE> <INDENT> super(SelectionItem, self).__init__(text=text, menu=menu, should_exit=True) <NEW_LINE> self.index = index <NEW_LINE> <DEDENT> def get_return(self): <NEW_LINE> <INDENT> return self.index
The item type used in :class:`consolemenu.SelectionMenu`
62598f6f287bf620b62713bc
class MultiDict(object): <NEW_LINE> <INDENT> def __init__(self, *dd): <NEW_LINE> <INDENT> self.dicts = dd <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> val = None <NEW_LINE> for d in self.dicts: <NEW_LINE> <INDENT> if d.get(key) != None: <NEW_LINE> <INDENT> val = d[key] <NEW_LINE> <DEDENT> <DEDENT...
a virtual dict-like class which functions as the union of underlying dicts
62598f6fc432627299fa27d9
class NumberCardView(IconCardView): <NEW_LINE> <INDENT> def get_file_name(self, card): <NEW_LINE> <INDENT> return f"images/numbers/{card.get_number()}"
Card view for rendering the number cards by looking for the number in the images/numbers folder.
62598f6f1f037a2d8b9e38f3
class ISourcePlugin(IPlugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.options_dict = {} <NEW_LINE> <DEDENT> def authenticate(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def help(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def retrieve_topics(self, p...
Represents the interface for the source plugins.
62598f6f796e427e5384df99
class TestAdminOrdering(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.request_factory = RequestFactory() <NEW_LINE> b1 = Band(name='Aerosmith', bio='', rank=3) <NEW_LINE> b1.save() <NEW_LINE> b2 = Band(name='Radiohead', bio='', rank=1) <NEW_LINE> b2.save() <NEW_LINE> b3 = Band(name='Van Halen...
Let's make sure that ModelAdmin.queryset uses the ordering we define in ModelAdmin rather that ordering defined in the model's inner Meta class.
62598f6f63f4b57ef0085971
class Uri(str): <NEW_LINE> <INDENT> def __init__(self, uri): <NEW_LINE> <INDENT> self._uri = uri <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self._uri)
A unique resource identifier.
62598f6f0383005118f6cf06
class LsbootLocalDiskImagePath(ManagedObject): <NEW_LINE> <INDENT> consts = LsbootLocalDiskImagePathConsts() <NEW_LINE> naming_props = set([u'type']) <NEW_LINE> mo_meta = MoMeta("LsbootLocalDiskImagePath", "lsbootLocalDiskImagePath", "diskimgpath-[type]", VersionMeta.Version131a, "InputOutput", 0x3f, [], ["admin", "ls-...
This is LsbootLocalDiskImagePath class.
62598f6f66656f66f7d59bf4
class WebsiteConfigSettings(TransientModel): <NEW_LINE> <INDENT> _inherit = 'website.config.settings' <NEW_LINE> social_xing = fields.Char('Xing Account', related='website_id.social_xing')
Adds the fields for Social Media Icons.
62598f6f07d97122c42164a4
class CapitalQueryAllListView(SingleTableMixin, generic.TemplateView): <NEW_LINE> <INDENT> template_name = 'dashboard/dataquery/capital_query_list.html' <NEW_LINE> form_class = CapitalSearchForm <NEW_LINE> table_class = CapitalQueryTable <NEW_LINE> context_table_name = 'capital_list' <NEW_LINE> def get_queryset(self): ...
# 历史资金查询
62598f6fa4f1c619b294ddf8
class HTMLSanitization(HTMLTransform): <NEW_LINE> <INDENT> def __init__(self, sanitizer, out): <NEW_LINE> <INDENT> HTMLTransform.__init__(self, out) <NEW_LINE> self.sanitizer = sanitizer <NEW_LINE> self.waiting_for = None <NEW_LINE> <DEDENT> def _handle_start(self, tag, attrs, startend): <NEW_LINE> <INDENT> if self.wai...
Sanitize parsed HTML using TracHTMLSanitizer.
62598f6f9b70327d1c57e5b1
class RidgeRegression(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, n_features): <NEW_LINE> <INDENT> super(RidgeRegression, self).__init__() <NEW_LINE> self.linear = torch.nn.Linear(n_features, 1, bias=False) <NEW_LINE> <DEDENT> def forward(self, x): <NEW_LINE> <INDENT> return self.linear(x)
Assume the data matrix is dense
62598f6f8c3a8732951f5d54
class Users(Base, UserMixin): <NEW_LINE> <INDENT> __tablename__ = 'Users' <NEW_LINE> user_id = Column(Integer, primary_key=True, autoincrement=True, unique=True) <NEW_LINE> user_name = Column(VARCHAR(128), nullable=False, unique=True) <NEW_LINE> password = Column(VARCHAR(256), nullable=False) <NEW_LINE> email = Column(...
Table constructed for users.
62598f6fd10714528d69d6d3
class LxmlHtmlParser(LxmlParser): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.module = html <NEW_LINE> <DEDENT> def get_parser(self, encoding=None): <NEW_LINE> <INDENT> return html.HTMLParser(encoding=encoding)
Parser using lxml. Note that it is not available on every systems.
62598f6fdc8b845886d52db8
class TmuxNewWindow(Terminal): <NEW_LINE> <INDENT> name = 'tmux-new-window' <NEW_LINE> command = 'tmux new-window -c "{cwd}" -n "{title}" "{command}"' <NEW_LINE> priority = 2.70 <NEW_LINE> def __init__(self, sh_cmd, title=None, env=None, d=None): <NEW_LINE> <INDENT> if not bb.utils.which(os.getenv('PATH'), 'tmux'): <NE...
Open a new window in the current running tmux session
62598f6f21bff66bcd722465
class ItemInfo(object): <NEW_LINE> <INDENT> def __init__(self, name, source, details): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.source = source <NEW_LINE> if details is not None: <NEW_LINE> <INDENT> self.details = details <NEW_LINE> <DEDENT> self._priority = PRIORITIES.get(self.__class__, PRIORITIES[ItemInf...
Represents an object that can be displayed by content assistant.
62598f6f1d351010ab8f3346
class SpeechTypeUnique(object): <NEW_LINE> <INDENT> def __init__(self, message=None): <NEW_LINE> <INDENT> if not message: <NEW_LINE> <INDENT> message = _( u'The selected type of speech is already associated with this word.' ) <NEW_LINE> <DEDENT> self.message = message <NEW_LINE> <DEDENT> def __call__(self, form, field)...
This class checks if the word has been not been assigned to selected type of speech.
62598f6f4d74a7450cd58adc
class PyHouseMqttFactory(ReconnectingClientFactory): <NEW_LINE> <INDENT> m_broker = {} <NEW_LINE> def __init__(self, p_pyhouse_obj, p_broker): <NEW_LINE> <INDENT> self.m_pyhouse_obj = p_pyhouse_obj <NEW_LINE> self.m_broker = p_broker <NEW_LINE> l_addr = p_broker.Host.Name <NEW_LINE> LOG.info('PyHouseMqttFactory Mqtt In...
This factory holds the state for this broker (there may be more than one).
62598f6f0383005118f6cf09
class CategoryQuerySet(TranslatableQuerySet, TreeQuerySet): <NEW_LINE> <INDENT> def as_manager(cls): <NEW_LINE> <INDENT> manager = CategoryManager.from_queryset(cls)() <NEW_LINE> manager._built_with_as_manager = True <NEW_LINE> return manager <NEW_LINE> <DEDENT> as_manager.queryset_only = True <NEW_LINE> as_manager = c...
The Queryset methods for the Category model.
62598f6f0a366e3fb87dc1cc
@register_command <NEW_LINE> class Calls(IntervalCommand): <NEW_LINE> <INDENT> name = 'calls' <NEW_LINE> description = "Prints calls" <NEW_LINE> @classmethod <NEW_LINE> def add_parser(cls, subparser): <NEW_LINE> <INDENT> parser = super(Calls, cls).add_parser(subparser) <NEW_LINE> cls.add_list_option(parser) <NEW_LINE> ...
Print calls.
62598f6f15fb5d323ce7e52d
class CSVFileReader(CSVSheetReader): <NEW_LINE> <INDENT> def get_file_handle(self): <NEW_LINE> <INDENT> unicode_reader = open( self._native_sheet.payload, "r", encoding=self._encoding ) <NEW_LINE> return unicode_reader
read csv from phyical file
62598f6fd6c5a102081e194c
class Product_Specifications_Screen(models.Model): <NEW_LINE> <INDENT> screen = models.CharField("диагональ экрана", max_length=100) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.screen <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = "экран" <NEW_LINE> verbose_name_plural = "экраны"
Характеристики экрана
62598f6f9b70327d1c57e5b3
class Pet(Model): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, } <NEW_LINE> def __init__(self, id=None, name=None, **kwargs): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.name = name
Pet :param id: :type id: int :param name: :type name: str
62598f6fac7a0e7691f71d1d
class IntPull(PrimitivePull): <NEW_LINE> <INDENT> _updateTracker = set() <NEW_LINE> repository = dict() <NEW_LINE> _watchers = dict() <NEW_LINE> _arrayFinder = re.compile(r"(.*) ((?:\[\d*\])+)") <NEW_LINE> _pointerFinder = re.compile(r"(\(.* \*\)) ") <NEW_LINE> _spaceFixer = re.compile(r" ") <NEW_LINE> _typeHandlerCode...
*Concrete* class to represent integral types.
62598f6f56b00c62f0fb20be
class client: <NEW_LINE> <INDENT> def __init__(self, mac): <NEW_LINE> <INDENT> self._mac = mac <NEW_LINE> self.signal = None
Клиент, находщийс в зоне действи сигнала адаптера. Атрибуты: - mac - signal
62598f6f50485f2cf55da777
class SublimeHaskellOutputText(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit, text = None): <NEW_LINE> <INDENT> if not text: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.view.insert(edit, self.view.size(), text)
Helper command to output text to any view TODO: Is there any default command for this purpose?
62598f6f7b25080760ed6ca4
class NotFoundError(ServiceError): <NEW_LINE> <INDENT> pass
Error when the service returns a 404 Not found
62598f6f925a0f43d25e7844
class AverageMeter: <NEW_LINE> <INDENT> def __init__(self, keep_verbose_stats=False): <NEW_LINE> <INDENT> self.val = 0 <NEW_LINE> self.avg = 0 <NEW_LINE> self.sum = 0 <NEW_LINE> self.count = 0 <NEW_LINE> self.data = [] if keep_verbose_stats else None <NEW_LINE> <DEDENT> def update(self, val, n=1): <NEW_LINE> <INDENT> s...
Computes and stores the average and current value
62598f6f21bff66bcd722467
class XML(BaseModel): <NEW_LINE> <INDENT> name: Optional[str] = None <NEW_LINE> namespace: Optional[str] = None <NEW_LINE> prefix: Optional[str] = None <NEW_LINE> attribute: bool = False <NEW_LINE> wrapped: bool = False <NEW_LINE> class Config: <NEW_LINE> <INDENT> extra = Extra.allow <NEW_LINE> schema_extra = { "exampl...
A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. References: - https://swagger.io/docs/specification/data-...
62598f6f66656f66f7d59bf8
class InferenceBatchSoftmax(Module): <NEW_LINE> <INDENT> def forward(self, input_, dim=-1): <NEW_LINE> <INDENT> if not self.training: <NEW_LINE> <INDENT> return F.softmax(input_, dim=dim) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return input_ <NEW_LINE> <DEDENT> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> ret...
Implementation of the Softmax activation, that is only run during inference. During training, the input is returned unchanged.
62598f6f63f4b57ef0085973
class _allow_interrupt(object): <NEW_LINE> <INDENT> def __init__(self, action=None): <NEW_LINE> <INDENT> self._init_action(action) <NEW_LINE> <DEDENT> def _init_action(self, action): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __exit__(self, ...
Utility for fixing CTRL-C events on Windows. On Windows, the Python interpreter intercepts CTRL-C events in order to translate them into ``KeyboardInterrupt`` exceptions. It (presumably) does this by setting a flag in its "control control handler" and checking it later at a convenient location in the interpreter. Ho...
62598f6f3eb6a72ae0389e49
class PullSmsSendStatusByPhoneNumberResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.PullSmsSendStatusSet = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("PullSmsSendStatusSet") is not None: <NEW_LINE>...
PullSmsSendStatusByPhoneNumber response structure.
62598f6fd4950a0f3b110a3b
class SeriesCategory(EventCategory): <NEW_LINE> <INDENT> slug = models.SlugField(_('Slug'),max_length=50,help_text=_('This slug is used primarily for custom templates in registration, if the category is shown separately on the registration page. You can override the default.')) <NEW_LINE> separateOnRegistrationPage = ...
Categorization for class series events, inherits from EventCategory.
62598f6f1f037a2d8b9e38f6
class MapperProperty(object): <NEW_LINE> <INDENT> cascade = () <NEW_LINE> def setup(self, context, entity, path, reduced_path, adapter, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def create_row_processor(self, context, path, reduced_path, mapper, row, adapter): <NEW_LINE> <INDENT> return None, None, None <...
Manage the relationship of a ``Mapper`` to a single class attribute, as well as that attribute as it appears on individual instances of the class, including attribute instrumentation, attribute access, loading behavior, and dependency calculations.
62598f6fd10714528d69d6d6
class MediaSubstitutionMetaclass(MediaDefiningClass): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> Media = attrs.get('Media', None) <NEW_LINE> if Media: <NEW_LINE> <INDENT> Media.js = map(subst, Media.js) <NEW_LINE> <DEDENT> new_class = super(MediaSubstitutionMetaclass, cls).__new__(cls...
Metaclass for classes that can have media definitions
62598f6f4d74a7450cd58add
class ClusterDialog(QDialog): <NEW_LINE> <INDENT> def __init__(self, model, parent=None): <NEW_LINE> <INDENT> super(ClusterDialog, self).__init__(parent) <NEW_LINE> self._model = model <NEW_LINE> self._init_gui() <NEW_LINE> self._create_actions() <NEW_LINE> <DEDENT> def _init_gui(self): <NEW_LINE> <INDENT> self.setWind...
A dialog for cluster processing.
62598f6f0383005118f6cf0b
class _LoggerHook(tf.train.SessionRunHook): <NEW_LINE> <INDENT> def begin(self): <NEW_LINE> <INDENT> self._step = -1 <NEW_LINE> self._start_time = time.time() <NEW_LINE> <DEDENT> def before_run(self, run_context): <NEW_LINE> <INDENT> self._step += 1 <NEW_LINE> return tf.train.SessionRunArgs(loss) <NEW_LINE> <DEDENT> de...
Logs loss and runtime.
62598f6f26238365f5fac37f
class LocalData(local): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.contexts = {}
Thread-local data for contexts.
62598f6fec188e330fdf80aa
class NetworkProxySettings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> AutomaticProxySettings = 0 <NEW_LINE> NoProxyProxySettings = 1 <NEW_LINE> WindowsDefaultProxySettings = 2 <NEW_LINE> OverrideProxySettings = 3
A list of the valid network proxy settings.
62598f6f6aa9bd52df0d46dd
class Erebus2EWSUpdate(CNodeVisitor): <NEW_LINE> <INDENT> trans = { 'Subject': 'item:Subject', 'Start': 'calendar:Start', 'End': 'calendar:End', 'IsAllDayEvent': 'calendar:IsAllDayEvent', 'Location': 'calendar:Location', 'MeetingTimeZone': 'calendar:MeetingTimeZone', 'Sensitivity': 'item:Sensitivity', 'DateTimeCreated'...
Make an Update item, to update an item in the Exchange calendar. This is an internal class used by ExchangeBackend
62598f6f8c3a8732951f5d58
@api.bind(resource=ArticleTagResource) <NEW_LINE> class ArticleTagEndpointSet(api.DjangoModelEndpointSetMixin, api.ResourceEndpointSet): <NEW_LINE> <INDENT> url = api.url( base_name="articletag", base_regex=r"articletags", lookup={ "field": "tag", "regex": r"\w+" } ) <NEW_LINE> middleware = { "authentication": [ api.au...
Handle ArticleTag retrieval.
62598f6f6fece00bbaccb195
class Solution: <NEW_LINE> <INDENT> def numDistinct(self, s: str, t: str) -> int: <NEW_LINE> <INDENT> if t == '': <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> if s == '': <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> distinct_nums = list() <NEW_LINE> for _ in range(len(t)): <NEW_LINE> <INDENT> distinct_nums.appe...
115. Distinct Subsequences dynamic programming
62598f6fac7a0e7691f71d1f
class ElboRatioTest(test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._rng = np.random.RandomState(0) <NEW_LINE> <DEDENT> def test_convergence_to_kl_using_sample_form_on_3dim_normal(self): <NEW_LINE> <INDENT> vector_shape = (2, 3) <NEW_LINE> n_samples = 5000 <NEW_LINE> with self.test_session...
Show sampling converges to true KL values.
62598f6f50485f2cf55da778
class RsubTestCase(unittest.TestCase): <NEW_LINE> <INDENT> @given(SIZE_STRATEGY, SIZE_STRATEGY) <NEW_LINE> @settings(max_examples=10) <NEW_LINE> def test_rsub(self, size_1, size_2): <NEW_LINE> <INDENT> self.assertEqual( size_1.__rsub__(size_2), Range(size_2.magnitude - size_1.magnitude) )
Test rsub.
62598f6f287bf620b62713c0
class Stack(object): <NEW_LINE> <INDENT> def __init__(self, iterable=None): <NEW_LINE> <INDENT> self.list = LinkedList() <NEW_LINE> self.list.head = None <NEW_LINE> self._counter = 0 <NEW_LINE> if isinstance(iterable, (tuple, list)): <NEW_LINE> <INDENT> for item in iterable: <NEW_LINE> <INDENT> self.push(item) <NEW_LIN...
A stack data structure.
62598f6f6e29344779affe67
class HeatingType(enum.Enum): <NEW_LINE> <INDENT> auto = "auto" <NEW_LINE> gas = "gas" <NEW_LINE> oil = "oil" <NEW_LINE> pellets = "pellets" <NEW_LINE> heatpump = "heatpump" <NEW_LINE> fuelcell = "fuelcell" <NEW_LINE> hybrid = "hybrid"
Possible options for heating type.
62598f6f76d4e153a661c41b
class HostedNumberOrderContext(InstanceContext): <NEW_LINE> <INDENT> def __init__(self, version, sid): <NEW_LINE> <INDENT> super(HostedNumberOrderContext, self).__init__(version) <NEW_LINE> self._solution = {'sid': sid, } <NEW_LINE> self._uri = '/HostedNumberOrders/{sid}'.format(**self._solution) <NEW_LINE> <DEDENT> de...
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
62598f6f0383005118f6cf0d
class BasicPostTestsMixin(BasicTestsMixin): <NEW_LINE> <INDENT> basic_post_fixtures = [] <NEW_LINE> basic_post_use_admin = False <NEW_LINE> def setup_basic_post_test(self, user, with_local_site, local_site_name, post_valid_data): <NEW_LINE> <INDENT> raise NotImplementedError("%s doesn't implement setup_basic_post_test"...
Mixin to add basic HTTP POST unit tests. The subclass must implement ``setup_basic_post_test`` and ``check_post_result``. It may also set ``basic_post_fixtures`` to a list of additional fixture names to import, and ``basic_post_use_admin`` to ``True`` if it wants to run the test as an administrator user.
62598f6f66673b3332c2fbca
class Scatter(Line): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Scatter, self).__init__(*args, **kwargs) <NEW_LINE> self.marks[0].marks[0].type = 'symbol' <NEW_LINE> del self.marks[0].marks[0].properties.enter.stroke <NEW_LINE> del self.marks[0].marks[0].properties.enter.stroke_w...
Vega Scatter chart
62598f6fec188e330fdf80ac
class GeneNotFoundException(AlignmentException): <NEW_LINE> <INDENT> pass
Raised when gene was not found in any of the alignments
62598f6f26238365f5fac381
class ApiSamplesTrap(ApiSampleTestBase): <NEW_LINE> <INDENT> all_extensions = True <NEW_LINE> def _get_extensions_tested(self): <NEW_LINE> <INDENT> tests = [] <NEW_LINE> for attr in globals().values(): <NEW_LINE> <INDENT> if not inspect.isclass(attr): <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> if not issubclass(a...
Make sure extensions don't get added without tests
62598f6f7c178a314d78ccaf
class ServerException(Exception): <NEW_LINE> <INDENT> pass
For internal error reporting
62598f6f5e10d32532ce34f1
class FreqStack: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.freq = Counter() <NEW_LINE> self.group = defaultdict(list) <NEW_LINE> self.mxfreq = 0 <NEW_LINE> <DEDENT> def push(self, val: int) -> None: <NEW_LINE> <INDENT> f = self.freq[val] + 1 <NEW_LINE> self.freq[val] = f <NEW_LINE> if f > self.mx...
Runtime: 335 ms, faster than 76.57% of Python3 online submissions for Maximum Frequency Stack. OS/Neet: no need to del empty gruops
62598f6f9b70327d1c57e5b8
class DummyBackend(object): <NEW_LINE> <INDENT> def _show_message(self, title, text): <NEW_LINE> <INDENT> dia = Gtk.MessageDialog(buttons=Gtk.ButtonsType.CLOSE, message_format=title) <NEW_LINE> dia.format_secondary_text(text) <NEW_LINE> dia.run() <NEW_LINE> dia.hide() <NEW_LINE> <DEDENT> def remove_packages(self, xid, ...
Provide some dummy dialogs which simulate package operations.
62598f6f796e427e5384dfa1
class IdpProfile(models.Model): <NEW_LINE> <INDENT> PROVIDER_UNKNOWN = 0 <NEW_LINE> PROVIDER_PASSWORDLESS = 10 <NEW_LINE> PROVIDER_GOOGLE = 20 <NEW_LINE> PROVIDER_GITHUB = 30 <NEW_LINE> PROVIDER_FIREFOX_ACCOUNTS = 31 <NEW_LINE> PROVIDER_LDAP = 40 <NEW_LINE> PROVIDER_TYPES = ( (PROVIDER_UNKNOWN, 'Unknown Provider',), (P...
Basic Identity Provider information for Profiles.
62598f6fc432627299fa27e2
class DeviceManager(object): <NEW_LINE> <INDENT> USB_VID_ELGATO = 0x0fd9 <NEW_LINE> USB_PID_STREAMDECK = 0x0060 <NEW_LINE> def _get_transport(self, transport): <NEW_LINE> <INDENT> if transport == "hidapi": <NEW_LINE> <INDENT> from .Transport.HIDAPI import HIDAPI <NEW_LINE> return HIDAPI() <NEW_LINE> <DEDENT> else: <NEW...
Central device manager, to enumerate any attached StremDeck devices. An instance of this class must be created in order to detect and use any StreamDeck devices.
62598f6fd6c5a102081e1951
class User(object): <NEW_LINE> <INDENT> def __init__(self, name='anonymous', token='anonymous'): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.token = token <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.nam...
A user is defined by a name and a persistent ID (TOKEN) or token The TOKEN remains constant for a given user using a given client. Ideally it is a more general TOKEN set during the authentication (e.g with eduGain/Shibboleth). The user name/token can be sent via Basic access authentication
62598f6f07d97122c42164ad
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'user' <NEW_LINE> username = db.Column(db.String, primary_key=True) <NEW_LINE> password = db.Column(db.String) <NEW_LINE> authenticated = db.Column(db.Boolean, default=False) <NEW_LINE> def __init__(self, username, password): <NEW_LINE> <INDENT> self.username = ...
An admin user capable of viewing reports. :param str username: username address of user :param str password: encrypted password for the user
62598f6f07d97122c42164ae
class SerializeHistorySpecialTests(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.page = QWebPage() <NEW_LINE> self.history = self.page.history() <NEW_LINE> self.assertEqual(self.history.count(), 0) <NEW_LINE> <DEDENT> def test_no_active_item(self): <NEW_LINE> <INDENT> items = [Item(Q...
Tests for serialize() without items set up in setUp.
62598f6f5166f23b2e242be9
class ApiError(Exception): <NEW_LINE> <INDENT> pass
Raised when something goes wrong when connecting to the api.
62598f6f76d4e153a661c41e
class SubsetSampler(Sampler): <NEW_LINE> <INDENT> def __init__(self, indices): <NEW_LINE> <INDENT> self.indices = indices <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return (i for i in self.indices) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.indices)
Samples elements from a given list of indices, without replacement. Arguments: indices (sequence): a sequence of indices
62598f6fb57a9660fecd129b
class FirmwareVnicCdnConstraint(ManagedObject): <NEW_LINE> <INDENT> consts = FirmwareVnicCdnConstraintConsts() <NEW_LINE> naming_props = set(['type']) <NEW_LINE> mo_meta = MoMeta("FirmwareVnicCdnConstraint", "firmwareVnicCdnConstraint", "constraint-vnic-cdn-[type]", VersionMeta.Version224b, "InputOutput", 0x3f, [], [""...
This is FirmwareVnicCdnConstraint class.
62598f6f76d4e153a661c41f
class FeatureTest(object): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> raise NotImplementedError('This method must be implemented.')
This is base test. A method run() implementation is required.
62598f6f8a349b6b43685a4f
class AppViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Group.objects.all() <NEW_LINE> serializer_class = AppSerializer
API endpoint that allows groups to be viewed or edited.
62598f6f1d351010ab8f334e
class DistccTestBase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.env = self.root_env.Clone() <NEW_LINE> self.old_detect = self.env.Detect <NEW_LINE> self.env.Detect = self.MockDetect <NEW_LINE> self.mock_detect_return = 1 <NEW_LINE> self.old_whereis = self.env.WhereIs <NEW_LINE> se...
Base class for distcc tests.
62598f6f6aa9bd52df0d46e3
class TestVip(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 testVip(self): <NEW_LINE> <INDENT> pass
Vip unit test stubs
62598f6f26238365f5fac384
class BillingUpdateForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('plan', ) <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BillingUpdateForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['plan'].queryset = Plan.o...
Form for updating billing information.
62598f6f287bf620b62713c5
class StructuredLogger_usingMozLog(StructuredLogger): <NEW_LINE> <INDENT> @override <NEW_LINE> def __init__(self, stream, app_name): <NEW_LINE> <INDENT> self.stream = stream <NEW_LINE> self.app_name = app_name <NEW_LINE> if not app_name: <NEW_LINE> <INDENT> Log.error("mozlog expects an `app_name` in the config") <NEW_L...
WRITE TO MozLog STANDARD FORMAT https://wiki.mozilla.org/Firefox/Services/Logging
62598f6fd6c5a102081e1953
class XmlAttributeRef(XmlAttribute): <NEW_LINE> <INDENT> def __init__(self, ref, use=None): <NEW_LINE> <INDENT> self._ref = ref <NEW_LINE> self._use = use <NEW_LINE> <DEDENT> def describe(self, name, element, app): <NEW_LINE> <INDENT> element.set('ref', self._ref) <NEW_LINE> if self._use: <NEW_LINE> <INDENT> element.se...
Reference to stock XML attribute.
62598f6f30c21e258be98011
class FrontPage(RESTFrontPage): <NEW_LINE> <INDENT> def __init__(self, app, config, mount): <NEW_LINE> <INDENT> mainroot = 'wmarchive' <NEW_LINE> wpath = os.getenv('WMA_STATIC_ROOT', '') <NEW_LINE> print(wpath) <NEW_LINE> if not wpath: <NEW_LINE> <INDENT> content = os.path.abspath(__file__).rsplit('/', 5)[0] <NEW_LINE...
WMArchive front page. WMArchive provides only one web page, the front page. The page just loads the javascript user interface, complete with CSS and all JS code embedded into it. The JavaScript code performs all the app functionality via the REST interface defined by the :class:`~.WMAData` class.
62598f6f56b00c62f0fb20c5
class RunnersHostsCommand(SubCommand): <NEW_LINE> <INDENT> name = "runners:hosts" <NEW_LINE> def add_arguments(self, parser: ArgumentParser) -> None: <NEW_LINE> <INDENT> parser.add_argument("-i", "--indent", type=int, default=None) <NEW_LINE> <DEDENT> def __call__(self, args: Namespace) -> int: <NEW_LINE> <INDENT> prin...
[Runners -> Hosts] get the hosts from the runners
62598f6f711fe17d825dfef4
class KnownSystem(System): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> super(KnownSystem, self).__init__(float(obj['x']), float(obj['y']), float(obj['z']), obj['name'], obj['id64'], 0.0) <NEW_LINE> self._id = obj['id'] if 'id' in obj else None <NEW_LINE> self._needs_permit = obj['needs_permit'] if ...
A known system with recorded coordinates and additional data.
62598f6f8e05c05ec3f6ea4d
@skipIf(NO_MOCK, NO_MOCK_REASON) <NEW_LINE> class GPGTestCase(TestCase, LoaderModuleMockMixin): <NEW_LINE> <INDENT> def setup_loader_modules(self): <NEW_LINE> <INDENT> return {gpg: {}} <NEW_LINE> <DEDENT> def test__get_gpg_exec(self): <NEW_LINE> <INDENT> gpg_exec = '/bin/gpg' <NEW_LINE> with patch('salt.utils.which', M...
unit test GPG renderer
62598f6f21bff66bcd72246f
class Top(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, master=None, height=None, bg=None): <NEW_LINE> <INDENT> tk.Frame.__init__(self, master, bg=bg, height=height) <NEW_LINE> self.bg = bg <NEW_LINE> self.ft = font.Font(family='微软雅黑', size=23) <NEW_LINE> self.drawLabe() <NEW_LINE> <DEDENT> def drawLabe(self): <NEW...
顶部栏
62598f6f07d97122c42164af
class StoryRelationsItems(object): <NEW_LINE> <INDENT> swagger_types = { 'href': 'str', 'model': 'str', 'operation': 'str', 'params': 'StoryRelationsTagsParams' } <NEW_LINE> attribute_map = { 'href': 'href', 'model': 'model', 'operation': 'operation', 'params': 'params' } <NEW_LINE> def __init__(self, href=None, model=...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f6ffb3f5b602db47db8
class AttentionAggregator(object): <NEW_LINE> <INDENT> def __init__(self, name, input_dim, output_dim, ffd_drop=0., attn_drop=0., usebias=False, act=tf.nn.elu): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.ffd_drop = ffd_drop <NEW_LINE> self.attn_drop = attn_drop <NEW_LINE> self.usebias = usebias <NEW_LINE> sel...
one head attention aggregator for GAT
62598f6f07d97122c42164b0
class TaggedValues(object): <NEW_LINE> <INDENT> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> def direct(self, tag, stereotype=None, default=UNSET): <NEW_LINE> <INDENT> if stereotype is None: <NEW_LINE> <INDENT> stereotype, tag = tag.split(':') <NEW_LINE> <DEDENT> stereotyp...
Adapter to get information about an UMLElements TaggedValues.
62598f6f66656f66f7d59c00
class ShortenerISGD(Shortener): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = "http://is.gd" <NEW_LINE> self.api = "http://is.gd/create.php?format=simple&url="
A shortener for is.gd
62598f6f3eb6a72ae0389e51
class IofloMaster(object): <NEW_LINE> <INDENT> def __init__(self, opts): <NEW_LINE> <INDENT> self.opts = opts <NEW_LINE> self.preloads = explode_opts(self.opts) <NEW_LINE> self.access_keys = salt.daemons.masterapi.access_keys(self.opts) <NEW_LINE> self.preloads.append( ('.salt.access_keys', dict(value=self.access_keys)...
IofloMaster Class
62598f6f1d351010ab8f3350
class csvSimpleExport(base.baseplugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> return ("csv_simple", __doc__) <NEW_LINE> <DEDENT> def write(self, data_to_save, outfile="out.csv"): <NEW_LINE> <INDENT> with open(outfile, 'wb') as f: <NEW_LIN...
Simple CSV write - without header
62598f6f1f5feb6acb162449
class profile(object): <NEW_LINE> <INDENT> __INSTANCE = None <NEW_LINE> PROFILE_ENABLED = 'PROFILE' in os.environ and os.environ['PROFILE'] <NEW_LINE> def __new__(cls, print_seconds=None): <NEW_LINE> <INDENT> if profile.__INSTANCE is None: <NEW_LINE> <INDENT> profile.__INSTANCE = object.__new__(cls) <NEW_LINE> profile....
Utility decorator that implements a simple profiler.
62598f6fec188e330fdf80b2
class Goku: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pygame.init() <NEW_LINE> self.screen = pygame.display.set_mode((1000, 666)) <NEW_LINE> self.screen_rect = self.screen.get_rect() <NEW_LINE> pygame.display.set_caption("Son Goku") <NEW_LINE> <DEDENT> def _update_screen(self): <NEW_LINE> <INDENT> sel...
Una classe que crea i impimeix una imatge en una finestra
62598f6f50485f2cf55da780
class sfp_blockchain(SpiderFootPlugin): <NEW_LINE> <INDENT> opts = {} <NEW_LINE> results = dict() <NEW_LINE> def setup(self, sfc, userOpts=dict()): <NEW_LINE> <INDENT> self.sf = sfc <NEW_LINE> self.results = dict() <NEW_LINE> for opt in userOpts.keys(): <NEW_LINE> <INDENT> self.opts[opt] = userOpts[opt] <NEW_LINE> <DED...
Blockchain:Footprint,Investigate,Passive:Public Registries::Queries blockchain.info to find the balance of identified bitcoin wallet addresses.
62598f6f66673b3332c2fbd0
class Edge(Enum): <NEW_LINE> <INDENT> Rising = 'RIS' <NEW_LINE> Falling = 'FALL'
Available Options for trigger slope
62598f6fa8ecb03325870a18
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, left, lower, right, upper): <NEW_LINE> <INDENT> if right < left or upper < lower: <NEW_LINE> <INDENT> raise ArithmeticError('Rectangle must have positive area.') <NEW_LINE> <DEDENT> self.left = float(left) <NEW_LINE> self.lower = float(lower) <NEW_LINE> self.right...
Geometric representation of rectangle objects. Attributes ---------- left : float Minimum x-value of the rectangle lower : float Minimum y-value of the rectangle right : float Maximum x-value of the rectangle upper : float Maximum y-value of the rectangle
62598f6f796e427e5384dfa7
class Member: <NEW_LINE> <INDENT> def __init__(self, full_name: str='', intro: str='', msg : str='', is_instructor=False, skills=None): <NEW_LINE> <INDENT> self.full_name = full_name <NEW_LINE> self.intro = intro <NEW_LINE> if is_instructor: <NEW_LINE> <INDENT> self.member_type = "instructor" <NEW_LINE> self.bio = msg ...
Member(Person) Details.
62598f6f73bcbd0ca4bc9a5f
class Grace(TethysAppBase): <NEW_LINE> <INDENT> name = 'GRACE' <NEW_LINE> index = 'grace:home' <NEW_LINE> icon = 'grace/images/logo.jpg' <NEW_LINE> package = 'grace' <NEW_LINE> root_url = 'grace' <NEW_LINE> color = '#e74c3c' <NEW_LINE> description = 'View GRACE mission data' <NEW_LINE> tags = 'Hydrology' <NEW_LINE> ena...
Tethys app class for GRACE.
62598f6f1d351010ab8f3352
class Channel(Connection): <NEW_LINE> <INDENT> def __init__(self, process): <NEW_LINE> <INDENT> super(Channel, self).__init__(process, process) <NEW_LINE> self.text_label = None <NEW_LINE> self.process = process <NEW_LINE> <DEDENT> @property <NEW_LINE> def start_point(self): <NEW_LINE> <INDENT> parent_rect = self.proce...
Subclass of Connection used to draw channels between processes
62598f6fa4f1c619b294de00