code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class CashInpostResponse(object): <NEW_LINE> <INDENT> def __init__(self, auth_id_response=None, response_code=None, receiver_transaction_id=None): <NEW_LINE> <INDENT> self.swagger_types = { 'auth_id_response': 'str', 'response_code': 'str', 'receiver_transaction_id': 'str' } <NEW_LINE> self.attribute_map = { 'auth_id_r... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fa70c0af96317c5628b |
class Tangente(PlanePage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> PlanePage.__init__(self, u'Gráfica de la tangente<br><br>α(x)=(x,tan x)') <NEW_LINE> npuntos = 100 <NEW_LINE> delta = .2 <NEW_LINE> def Tan(t): <NEW_LINE> <INDENT> return Vec3(t, tan(t), 0) <NEW_LINE> <DEDENT> def Derivada(t): ... | La función tangente establece un <b>difeomorfismo</b> entre un segmento
abierto y la totalidad de los números reales. La gráfica de un periodo
es una curva infinitamente diferenciable que admite dos asíntotas:
una a la izquierda y otra a la derecha. Una <b>asíntota</b> de una curva es
una recta a la cual la curva se ac... | 62598fa701c39578d7f12c88 |
class MatchList(Match): <NEW_LINE> <INDENT> def __init__(self, doc, pos=None): <NEW_LINE> <INDENT> self._orig = doc <NEW_LINE> self._doc = [] <NEW_LINE> for ele in doc: <NEW_LINE> <INDENT> if isinstance(ele, list): <NEW_LINE> <INDENT> self._doc.append(MatchList(ele)) <NEW_LINE> <DEDENT> elif isinstance(ele, dict): <NEW... | A List that is part of a document matching a query.
A ``MatchDoc`` might contain lists within itself,
all those lists will be wrapped in a ``MatchList``
so their content can be traversed, tested against the filter
and updated according to the query being executed. | 62598fa7cc0a2c111447af18 |
class CinderEncryptedVolumeType(resource.Resource): <NEW_LINE> <INDENT> support_status = support.SupportStatus(version='5.0.0') <NEW_LINE> default_client_name = 'cinder' <NEW_LINE> entity = 'volume_encryption_types' <NEW_LINE> required_service_extension = 'encryption' <NEW_LINE> PROPERTIES = ( PROVIDER, CONTROL_LOCATIO... | A resource for encrypting a cinder volume type.
A Volume Encryption Type is a collection of settings used to conduct
encryption for a specific volume type.
Note that default cinder security policy usage of this resource
is limited to being used by administrators only. | 62598fa721bff66bcd722b6f |
class ppTSLastChange( ppTicketSetExtension ): <NEW_LINE> <INDENT> def __init__(self,ticketset,ticketsetdata): <NEW_LINE> <INDENT> self.__ts = ticketsetdata <NEW_LINE> <DEDENT> def extend(self): <NEW_LINE> <INDENT> timemax = to_datetime( 0, utc ) <NEW_LINE> timenow = to_datetime( datetime.datetime.now(utc) ) <NEW_LINE> ... | Get the Last Ticket Changetime | 62598fa74428ac0f6e65842b |
class ParseProgress(OperationProgress): <NEW_LINE> <INDENT> def __init__(self, current, total): <NEW_LINE> <INDENT> OperationProgress.__init__(self, current, total, "Recipe parsing") | Recipe parsing progress | 62598fa756ac1b37e63020f5 |
class QSqlIndex(QSqlRecord): <NEW_LINE> <INDENT> def append(self, QSqlField, bool=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def cursorName(self): <NEW_LINE> <INDENT> return "" <NEW_LINE> <DEDENT> def isDescending(self, p_int): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def name(self): <NEW_LINE> <IN... | QSqlIndex(cursorName: str = '', name: str = '')
QSqlIndex(QSqlIndex) | 62598fa71b99ca400228f4b4 |
class UserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.order_by('date_joined') <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> http_method_names = ['get', 'post', 'put', 'delete'] <NEW_LINE> def get_serializer_class(self): <NEW_LINE> <INDENT> serializer_class = self.serializer_cla... | This viewset automatically provides `list` and `detail` actions. | 62598fa70c0af96317c5628c |
class VehicleTurningLeft(BaseVehicleTurning): <NEW_LINE> <INDENT> def __init__(self, world, ego_vehicles, config, randomize=False, debug_mode=False, criteria_enable=True, timeout=60): <NEW_LINE> <INDENT> self._subtype = 'left' <NEW_LINE> super(VehicleTurningLeft, self).__init__( world, ego_vehicles, config, randomize, ... | Version of the VehicleTurning scenario where
the adversary is placed at the left side after the junction | 62598fa70a50d4780f7052e6 |
class ZmqSender(ZmqClient): <NEW_LINE> <INDENT> def __init__(self, *, host=None, port=None, address=None, bind=False, timeout=-1, serializer=None, callback=None, **kwargs): <NEW_LINE> <INDENT> super().__init__( address=address, host=host, port=port, bind=bind, serializer=serializer, timeout=timeout, callback=callback, ... | Uses REQ / REP to send and receive data,
i.e. a client that only expects b'ack'
by default connects | 62598fa799fddb7c1ca62d6d |
class TransactionsID(models.Model): <NEW_LINE> <INDENT> coin_type = models.CharField(max_length=50,verbose_name="币种") <NEW_LINE> transaction_id = models.CharField(max_length=255, verbose_name="交易ID") <NEW_LINE> used = models.BooleanField(verbose_name="是否处理",default=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verb... | 交易ID记录表,用户保存交易ID:币种,ID | 62598fa757b8e32f525080a0 |
class SendPaymentForm(TLObject): <NEW_LINE> <INDENT> __slots__ = ["msg_id", "credentials", "requested_info_id", "shipping_option_id"] <NEW_LINE> ID = 0x2b8879b3 <NEW_LINE> QUALNAME = "functions.payments.SendPaymentForm" <NEW_LINE> def __init__(self, *, msg_id: int, credentials, requested_info_id: str = None, shipping_o... | Attributes:
LAYER: ``112``
Attributes:
ID: ``0x2b8879b3``
Parameters:
msg_id: ``int`` ``32-bit``
credentials: Either :obj:`InputPaymentCredentialsSaved <pyrogram.api.types.InputPaymentCredentialsSaved>`, :obj:`InputPaymentCredentials <pyrogram.api.types.InputPaymentCredentials>`, :obj:`InputPaymentCre... | 62598fa785dfad0860cbf9f9 |
class GreaterOperator(BinaryOperator): <NEW_LINE> <INDENT> def __init__(self, field, value): <NEW_LINE> <INDENT> super(GreaterOperator, self).__init__(">", field, value) | Builds a greater-than filter based on the supplied field-value pair as
described
https://docs.puppet.com/puppetdb/4.1/api/query/v4/ast.html#greater-than.
In order to create the following query:
[">", "catalog_timestamp", "2016-06-01 00:00:00"]
The following code can be used.
GreaterOperator('catalog_timestamp', dat... | 62598fa7e1aae11d1e7ce7a8 |
class JsButton(NavButton): <NEW_LINE> <INDENT> def __init__(self, title, style = 'js', tab_name = None, **kw): <NEW_LINE> <INDENT> NavButton.__init__(self, title, '#', style = style, tab_name = tab_name, **kw) <NEW_LINE> <DEDENT> def build(self, *a, **kw): <NEW_LINE> <INDENT> if self.tab_name: <NEW_LINE> <INDENT> self.... | A button which fires a JS event and thus has no path and cannot
be in the 'selected' state | 62598fa7a8ecb03325871119 |
class AaaLdap(ManagedObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ManagedObject.__init__(self, "AaaLdap") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def class_id(): <NEW_LINE> <INDENT> return "aaaLdap" <NEW_LINE> <DEDENT> ADMIN_STATE = "AdminState" <NEW_LINE> ATTRIBUTE = "Attribute" <NEW_LINE>... | This class contains the relevant properties and constant supported by this MO. | 62598fa7bd1bec0571e15048 |
class Solution: <NEW_LINE> <INDENT> def subdomainVisits(self, cpdomains): <NEW_LINE> <INDENT> d = {} <NEW_LINE> ret = [] <NEW_LINE> for ele in cpdomains: <NEW_LINE> <INDENT> e = ele.split() <NEW_LINE> visits = int(e[0]) <NEW_LINE> url = e[1] <NEW_LINE> url_list = url.split('.') <NEW_LINE> tmp = "" <NEW_LINE> for i in r... | @param cpdomains: a list cpdomains of count-paired domains
@return: a list of count-paired domains | 62598fa7442bda511e95c35f |
class NewItemForm(formencode.Schema): <NEW_LINE> <INDENT> allow_extra_fields = True <NEW_LINE> filter_extra_fields = True <NEW_LINE> brand = formencode.validators.String(not_empty=True) <NEW_LINE> model = formencode.validators.String(not_empty=True) <NEW_LINE> description = formencode.validators.String(not_empty=True) ... | Проверка данных формы создания нового объекта | 62598fa716aa5153ce40040c |
class UTF8Recoder: <NEW_LINE> <INDENT> def __init__(self, f, encoding): <NEW_LINE> <INDENT> self.reader = codecs.getreader(encoding)(f) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> return self.reader.next().encode("utf-8") | Iterator that reads an encoded stream and reencodes the input to UTF-8
http://docs.python.org/library/csv.html | 62598fa78da39b475be030ec |
class Trefethen(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=2): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self.bounds = zip([-10.0] * self.dimensions, [10.0] * self.dimensions) <NEW_LINE> self.custom_bounds = [(-5, 5), (-5, 5)] <NEW_LINE> self.global_optimum = [-0.02440307923... | Trefethen test objective function.
This class defines the Trefethen global optimization problem. This
is a multimodal minimization problem defined as follows:
.. math::
f_{\text{Trefethen}}(\mathbf{x}) = 0.25 x_{1}^{2} + 0.25 x_{2}^{2} + e^{\sin\left(50 x_{1}\right)} - \sin\left(10 x_{1} + 10 x_{2}\right) + \sin... | 62598fa72c8b7c6e89bd36d0 |
class SeleniumStaleElementError(SeleniumError): <NEW_LINE> <INDENT> pass | Requested element no longer exists
| 62598fa776e4537e8c3ef4b7 |
class Piece(object): <NEW_LINE> <INDENT> KING = 0 <NEW_LINE> QUEEN = 1 <NEW_LINE> BISHOP = 2 <NEW_LINE> KNIGHT = 3 <NEW_LINE> ROOK = 4 <NEW_LINE> PAWN = 5 <NEW_LINE> def __init__(self, owner, type): <NEW_LINE> <INDENT> self._owner = owner <NEW_LINE> self._set_type(type) <NEW_LINE> <DEDENT> def get_player(self): <NEW_LI... | This class models one single chess piece. | 62598fa760cbc95b06364256 |
class GenerateCEOReportStart(ModelView): <NEW_LINE> <INDENT> __name__ = 'ceo.report.generate.start' <NEW_LINE> start_date = fields.DateTime('Start Date', required=True) <NEW_LINE> end_date = fields.DateTime('End Date', required=True) <NEW_LINE> @staticmethod <NEW_LINE> def default_start_date(): <NEW_LINE> <INDENT> retu... | Generate CEO Report | 62598fa767a9b606de545ed6 |
class ServiceTagsOperations(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._config = config <NEW_LINE> <DE... | ServiceTagsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2020_11_01.models
:param cl... | 62598fa7a8370b77170f02e5 |
class ClusterLevel(object): <NEW_LINE> <INDENT> def __init__(self, level_name: int = None, no_elements: int = 1, intra_class_correlation = 1, **kwargs): <NEW_LINE> <INDENT> self.level_name = level_name <NEW_LINE> self.no_elements = no_elements <NEW_LINE> self.intra_class_correlation = intra_class_correlation <NEW_LINE>... | Class describing cluster levels | 62598fa71f5feb6acb162b2c |
class EnablingModesComponent(ModesComponent): <NEW_LINE> <INDENT> def __init__(self, component = None, enabled_color = 'DefaultButton.On', disabled_color = 'DefaultButton.Off', *a, **k): <NEW_LINE> <INDENT> super(EnablingModesComponent, self).__init__(*a, **k) <NEW_LINE> component.set_enabled(False) <NEW_LINE> self.add... | Adds the two modes 'enabled' and 'disabled'. The provided component will be
enabled while the 'enabled' mode is active. | 62598fa730bbd722464698fd |
class _Var(object): <NEW_LINE> <INDENT> def __init__(self, y): <NEW_LINE> <INDENT> self.y = y <NEW_LINE> self.nobs, self.nvars = y.shape <NEW_LINE> <DEDENT> def fit(self, nlags): <NEW_LINE> <INDENT> self.nlags = nlags <NEW_LINE> nvars = self.nvars <NEW_LINE> lmat = lagmat(self.y, nlags, trim='both', original='in') <NEW... | obsolete VAR class, use tsa.VAR instead, for internal use only
Examples
--------
>>> v = Var(ar2s)
>>> v.fit(1)
>>> v.arhat
array([[[ 1. , 0. ],
[ 0. , 1. ]],
[[-0.77784898, 0.01726193],
[ 0.10733009, -0.78665335]]]) | 62598fa73539df3088ecc1bf |
class LeftRightError(Exception): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Error occurred while communicating with rpkid: handle=%s code=%s text=%s' % ( self.args[0].self_handle, self.args[0].error_code, self.args[0].error_text) | Class for wrapping report_error_elt errors from Zookeeper.call_rpkid().
It expects a single argument, which is the associated report_error_elt instance. | 62598fa744b2445a339b68f4 |
class FlowInstance(InstanceResource): <NEW_LINE> <INDENT> class Status(object): <NEW_LINE> <INDENT> DRAFT = "draft" <NEW_LINE> PUBLISHED = "published" <NEW_LINE> <DEDENT> def __init__(self, version, payload, sid=None): <NEW_LINE> <INDENT> super(FlowInstance, self).__init__(version) <NEW_LINE> self._properties = { 'sid'... | PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. | 62598fa721bff66bcd722b71 |
class ApiException(Exception): <NEW_LINE> <INDENT> INVALID_REPLY = -1 <NEW_LINE> INVALID_VALUE = -2 <NEW_LINE> FAILED_AUTH = -32602 <NEW_LINE> def __init__(self, code, msg, data): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.msg = msg <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> def __str__(self):... | Raised when bad reply from server or error msg in the reply. | 62598fa78c0ade5d55dc3616 |
class EmailRequest(Message): <NEW_LINE> <INDENT> email = StringField(1, required=True) | ProtoRPC message definition to represent an email | 62598fa756ac1b37e63020f7 |
class PartyTable: <NEW_LINE> <INDENT> parties = {} <NEW_LINE> next_id = len(parties) + 1 <NEW_LINE> def get_single_party_by_name(self, name): <NEW_LINE> <INDENT> for party in self.parties.values(): <NEW_LINE> <INDENT> if party['name'] == name: <NEW_LINE> <INDENT> return party <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def a... | acts as a table for storing parties and their related information | 62598fa70c0af96317c5628e |
class ExtractAndCleanDownloads510k(luigi.Task): <NEW_LINE> <INDENT> def requires(self): <NEW_LINE> <INDENT> return Download_510K() <NEW_LINE> <DEDENT> def output(self): <NEW_LINE> <INDENT> return luigi.LocalTarget(join(BASE_DIR, '510k/extracted')) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> output_dir = self... | Unzip each of the download files and remove all the non-UTF8 characters.
Unzip -p streams the data directly to iconv which then writes to disk. | 62598fa70a50d4780f7052e8 |
class LessonFinder(object): <NEW_LINE> <INDENT> LESSON_FILE_EXTENSION = '.les' <NEW_LINE> def __init__(self, lessons_dir): <NEW_LINE> <INDENT> self.lessons_dir = lessons_dir <NEW_LINE> self.lesson_file_name_list = [] <NEW_LINE> <DEDENT> def find_lessons(self): <NEW_LINE> <INDENT> lesson_list = [] <NEW_LINE> file_names ... | Assists in finding lessons. | 62598fa73cc13d1c6d465677 |
class ProcessorMixin(object): <NEW_LINE> <INDENT> def process(self, iprot, oprot): <NEW_LINE> <INDENT> name, type, seqid = iprot.readMessageBegin() <NEW_LINE> try: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> fn = self._processMap[name] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise TApplicationExceptio... | Process application error if there is one. | 62598fa73539df3088ecc1c0 |
class SimpleRigidBody2d(BasePointMass2d): <NEW_LINE> <INDENT> BasePointMass2d._PHYSICS_DEFAULTS.update(**SIMPLERIGIDBODY2D_DEFAULTS) <NEW_LINE> def __init__(self, position, radius, velocity, beta, omega, spritedata=None): <NEW_LINE> <INDENT> BasePointMass2d.__init__(self, position, radius, velocity, spritedata) <NEW_LI... | Moving object with linear and angular motion, with optional sprite.
Notes
-----
Although this isn't really a point mass in the physical sense, we inherit
from BasePointMass2d in order to avoid duplicating or refactoring code. | 62598fa7e1aae11d1e7ce7a9 |
class FilteredProductSeriesVocabulary(SQLObjectVocabularyBase): <NEW_LINE> <INDENT> _table = ProductSeries <NEW_LINE> _orderBy = ['product', 'name'] <NEW_LINE> def toTerm(self, obj): <NEW_LINE> <INDENT> return SimpleTerm( obj, obj.id, '%s %s' % (obj.product.name, obj.name)) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_... | Describes ProductSeries of a particular product. | 62598fa756ac1b37e63020f8 |
class VideoPlayView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request, video_id): <NEW_LINE> <INDENT> video = Video.objects.get(id=int(video_id)) <NEW_LINE> course=video.lesson.course <NEW_LINE> course.students += 1 <NEW_LINE> course.save() <NEW_LINE> user_courses = UserCourse.objects.filter(user=req... | 课程章节视频播放页面 | 62598fa7656771135c48958d |
class Helper(Basic): <NEW_LINE> <INDENT> def __init__( self, name, registry): <NEW_LINE> <INDENT> super(Helper, self).__init__('does not matter', 'does not matter') <NEW_LINE> self._name = name <NEW_LINE> self._registry = registry.registry <NEW_LINE> <DEDENT> @property <NEW_LINE> def suffix(self): <NEW_LINE> <INDENT> p... | This provider wraps a particularly named credential helper. | 62598fa7b7558d589546353b |
class VerificationIPFlowParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'target_resource_id': {'required': True}, 'direction': {'required': True}, 'protocol': {'required': True}, 'local_port': {'required': True}, 'remote_port': {'required': True}, 'local_ip_address': {'required': True}, 'rem... | Parameters that define the IP flow to be verified.
All required parameters must be populated in order to send to Azure.
:param target_resource_id: Required. The ID of the target resource to perform next-hop on.
:type target_resource_id: str
:param direction: Required. The direction of the packet represented as a 5-tu... | 62598fa72c8b7c6e89bd36d1 |
class PageTitleMixin(object): <NEW_LINE> <INDENT> page_title = None <NEW_LINE> active_tab = None <NEW_LINE> def get_page_title(self): <NEW_LINE> <INDENT> return self.page_title <NEW_LINE> <DEDENT> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> ctx = super(PageTitleMixin, self).get_context_data(**kwargs) <NEW... | Passes page_title and active_tab into context, which makes it quite useful
for the accounts views.
Dynamic page titles are possible by overriding get_page_title. | 62598fa755399d3f05626430 |
class CyclesPlotter: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.labels = [] <NEW_LINE> self.cycles = [] <NEW_LINE> <DEDENT> def items(self): <NEW_LINE> <INDENT> return zip(self.labels, self.cycles) <NEW_LINE> <DEDENT> def add_label_cycle(self, label, cycle): <NEW_LINE> <INDENT> self.labels.append(... | Relies on the plot method of cycle objects to build multiple subfigures. | 62598fa72ae34c7f260aafed |
class TestConstraintPropagation(unittest.TestCase): <NEW_LINE> <INDENT> def test_3by3_matrix(self): <NEW_LINE> <INDENT> affinity = np.array([[1, 0.25, 0], [0.31, 1, 0], [0, 0, 1]]) <NEW_LINE> constraint_matrix = np.array([[1, 1, 0], [1, 1, 0], [0, 0, 0]]) <NEW_LINE> adjusted_affinity = constraint.ConstraintPropagation(... | Tests for the ConstraintPropagation class. | 62598fa776e4537e8c3ef4b8 |
class VersionNegotiationFailed(NoApplicableCode): <NEW_LINE> <INDENT> code = 400 | Version negotiation exception implementation
| 62598fa767a9b606de545ed8 |
class Trade(BaseModel): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._default_params = { 'book': kwargs.get('book'), 'tid': kwargs.get('tid'), 'amount': Decimal(kwargs.get('amount')), 'price': Decimal(kwargs.get('price')), 'maker_side': kwargs.get('maker_side'), 'created_at': dateutil.pars... | A class that represents a Bitso public trade. | 62598fa7d6c5a102081e2053 |
class TempFile: <NEW_LINE> <INDENT> def __init__(self, content: str) -> None: <NEW_LINE> <INDENT> with NamedTemporaryFile(delete=False, mode="w", encoding="utf-8") as f: <NEW_LINE> <INDENT> f.write(content) <NEW_LINE> f.flush() <NEW_LINE> f.close() <NEW_LINE> self.f = f.name <NEW_LINE> <DEDENT> <DEDENT> def __del__(sel... | Temporary file for convenience in tests that include opening and reading files. | 62598fa791f36d47f2230e2a |
class Summarizer(Summarizer): <NEW_LINE> <INDENT> def __init__(self, args, opts): <NEW_LINE> <INDENT> self.s_t = SentTokenizer(offsets=False) <NEW_LINE> self.w_t = WordTokenizer(stem=False) <NEW_LINE> <DEDENT> def summarize(self, extracted_refs, facet_results, max_length=250): <NEW_LINE> <INDENT> summaries = defaultdic... | classdocs | 62598fa7460517430c431fe2 |
class RevisionValidationForm(RevisionForm): <NEW_LINE> <INDENT> def clean_slug(self): <NEW_LINE> <INDENT> is_valid = True <NEW_LINE> original = self.cleaned_data['slug'] <NEW_LINE> if '/' in original or '?' in original or ' ' in original: <NEW_LINE> <INDENT> is_valid = False <NEW_LINE> raise forms.ValidationError(SLUG_... | Created primarily to disallow slashes in slugs during validation | 62598fa710dbd63aa1c70abf |
class RectPack: <NEW_LINE> <INDENT> def __init__(self, l, u, division_num, dim, scaler, aq_func): <NEW_LINE> <INDENT> self.l = l <NEW_LINE> self.u = u <NEW_LINE> self.center = (l + u) / 2 <NEW_LINE> j = np.mod(division_num, dim) <NEW_LINE> k = (division_num - j) / dim <NEW_LINE> self.d = np.sqrt(j * np.power(3, float(-... | class for the rectangular
including border, center and acquisition function value | 62598fa74f88993c371f0490 |
class RosdepWrapper(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> installer_context = create_default_installer_context(verbose=False) <NEW_LINE> self.installer, self.installer_keys, self.default_key, self.os_name, self.os_version = get_default_installer( installer_context=installer_context, ... | Wrapper around rosdep.
Hides all the configuration of rosdep from the caller. | 62598fa7627d3e7fe0e06db8 |
class Pep8CheckCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> if self.view.file_name().endswith('.py'): <NEW_LINE> <INDENT> folder_name, file_name = os.path.split(self.view.file_name()) <NEW_LINE> self.view.window().run_command('exec', {'cmd': ['pep8', '... | This will invoke PEP8 checking on the given file.
pep8.py must be in your system's path for this to work.
http://pypi.python.org/pypi/pep8
Options:
--version show program's version number and exit
--help show this help message and exit
--verbose print status messages, or debug with... | 62598fa7fff4ab517ebcd6f2 |
class TestTtest(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT> data = longley.load(as_pandas=False) <NEW_LINE> data.exog = add_constant(data.exog, prepend=False) <NEW_LINE> cls.res1 = OLS(data.endog, data.exog).fit() <NEW_LINE> R = np.identity(7) <NEW_LINE> cls.Ttest = cl... | Test individual t-tests. Ie., are the coefficients significantly
different than zero.
| 62598fa78c0ade5d55dc3617 |
class itkAccumulateImageFilterIUL2IUL2(itkImageToImageFilterAPython.itkImageToImageFilterIUL2IUL2): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <... | Proxy of C++ itkAccumulateImageFilterIUL2IUL2 class | 62598fa71b99ca400228f4b6 |
class Bond(_msys.Bond): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "<Bond %d>" % self.id <NEW_LINE> <DEDENT> @property <NEW_LINE> def system(self): <NEW_LINE> <INDENT> return System(self._ptr) <NEW_LINE> <DEDENT> @property <NEW_LINE> def first(self): <NEW_LINE> <INDENT>... | Represents a bond in a System | 62598fa7a8ecb0332587111d |
class EMC1072(): <NEW_LINE> <INDENT> def __init__(self, bus: int, chip_address: int=0x4c): <NEW_LINE> <INDENT> self._bus = SMBus(bus) <NEW_LINE> self._chip_address = chip_address <NEW_LINE> self.status = Status(self._bus, self._chip_address) <NEW_LINE> self.configuration = Configuration(self._bus, self._chip_address) <... | Interface to the EMC1072 temperature sensor. | 62598fa724f1403a9268583a |
class Devotional(ObjectType): <NEW_LINE> <INDENT> id = ID() <NEW_LINE> title = String() <NEW_LINE> passage = String() <NEW_LINE> body = String() <NEW_LINE> creation_date = DateTime() <NEW_LINE> publish_date = Date() <NEW_LINE> author = Field(lambda: User) <NEW_LINE> comments = List(lambda: Comment) <NEW_LINE> def __ini... | Devotional graphql type definition. | 62598fa7eab8aa0e5d30bc98 |
class SystemUserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = SystemUser <NEW_LINE> fields = ('email', 'password', 'username', 'is_active', 'is_superuser') <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE> <INDENT> retur... | A form for updating users. Includes all the fields on
the user, but replaces the password field with admin's
password hash display field. | 62598fa7656771135c48958f |
class AllViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = Product.objects.all() <NEW_LINE> serializer_class = ProductSerializer | A viewset for viewing all products | 62598fa78a43f66fc4bf208a |
class ComputationLayer: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.input = None <NEW_LINE> self.output = None <NEW_LINE> <DEDENT> def _ops(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def _compile(self): <NEW_LINE> <INDENT> raise NotImp... | Base class for computation graph layers.
Inherited by NeuronLayer and ConnectionLayer.
Basically, creates a computation graph kernel (or subset thereof).
Defines:
- computation graph nodes the subclasses must have (and possibly create): input and output
- abstract methods the subclasses must implement in order to com... | 62598fa7dd821e528d6d8e43 |
class AbsComplexPlane(ABC): <NEW_LINE> <INDENT> xmin = NotImplemented <NEW_LINE> xmax = NotImplemented <NEW_LINE> xlen = NotImplemented <NEW_LINE> ymin = NotImplemented <NEW_LINE> ymax = NotImplemented <NEW_LINE> ylen = NotImplemented <NEW_LINE> plane = NotImplemented <NEW_LINE> f = NotImplemented <NEW_LINE> ... | Abstract base class for complex plane.
A complex plane is a 2x2 grid of complex numbers, having
the form (x + y*1j), where 1j is the unit imaginary number in
Python, and one can think of x and y as the coordinates for
the horizontal axis and the vertical axis of the plane,
respectively. Recall that (1j)*(1j) == -1. A... | 62598fa7851cf427c66b81d6 |
class ActionGroup(object): <NEW_LINE> <INDENT> STANDARD = 0 <NEW_LINE> TOGGLE = 1 <NEW_LINE> def __init__(self, shell, group_name): <NEW_LINE> <INDENT> self.group_name = group_name <NEW_LINE> self.shell = shell <NEW_LINE> self._actions = {} <NEW_LINE> if is_rb3(self.shell): <NEW_LINE> <INDENT> self.actiongroup = Gio.Si... | container for all Actions used to associate with menu items | 62598fa72c8b7c6e89bd36d3 |
class AppkeyGetAllRsp(ResponsePacket): <NEW_LINE> <INDENT> def __init__(self, raw_data): <NEW_LINE> <INDENT> __data = {} <NEW_LINE> __data["subnet_handle"], = struct.unpack("<H", raw_data[0:2]) <NEW_LINE> __data["appkey_key_index"] = raw_data[2:94] <NEW_LINE> super(AppkeyGetAllRsp, self).__init__("AppkeyGetAll", 0x9A, ... | Response to a(n) AppkeyGetAll command. | 62598fa78e7ae83300ee8fb0 |
class TestController(object): <NEW_LINE> <INDENT> application_under_test = application_name <NEW_LINE> fixtures = [BaseFixture, ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.app = load_app(self.application_under_test) <NEW_LINE> try: <NEW_LINE> <INDENT> teardown_db() <NEW_LINE> <DEDENT> except Exception as e: ... | Base functional test case for the controllers.
The tracim application instance (``self.app``) set up in this test
case (and descendants) has authentication disabled, so that developers can
test the protected areas independently of the :mod:`repoze.who` plugins
used initially. This way, authentication can be tested onc... | 62598fa74e4d562566372333 |
class TestPositionalsNargsOptional(ParserTestCase): <NEW_LINE> <INDENT> argument_signatures = [Sig('foo', nargs='?')] <NEW_LINE> failures = ['-x', 'a b'] <NEW_LINE> successes = [ ('', NS(foo=None)), ('a', NS(foo='a')), ] | Tests an Optional Positional | 62598fa75fdd1c0f98e5dea6 |
class SimpleProcess(LocalProcess): <NEW_LINE> <INDENT> def read(self, filename=None): <NEW_LINE> <INDENT> if filename is None: <NEW_LINE> <INDENT> filename = self.main_src.output <NEW_LINE> <DEDENT> if os.path.isdir(filename): <NEW_LINE> <INDENT> filelist = [os.path.join(filename, f) for f in os.listdir(filename) if no... | A process that provides simple utilities for reading inputs and
writing outputs. It is running locally. | 62598fa792d797404e388aec |
class SSDEfficientNetB2BiFPNKerasFeatureExtractor( SSDEfficientNetBiFPNKerasFeatureExtractor): <NEW_LINE> <INDENT> def __init__(self, is_training, depth_multiplier, min_depth, pad_to_multiple, conv_hyperparams, freeze_batchnorm, inplace_batchnorm_update, bifpn_min_level=3, bifpn_max_level=7, bifpn_num_iterations=5, bif... | SSD Keras EfficientNet-b2 BiFPN (EfficientDet-d2) Feature Extractor. | 62598fa7f7d966606f747ef2 |
class DeserializeInstance(object): <NEW_LINE> <INDENT> def __init__(self, obj_dict): <NEW_LINE> <INDENT> self.user = None <NEW_LINE> for key, value in obj_dict.items(): <NEW_LINE> <INDENT> if isinstance(value, dict): <NEW_LINE> <INDENT> setattr(self, key, DeserializeInstance(value) if isinstance(value, dict) else value... | 字典对象反序列化
:param:
* obj_dict: (dict) 对象序列化字典
:return:
* obj: (object) 对象
举例如下::
print('--- DeserializeInstance demo ---')
temp_dict = {'user': {'name': {'last_name': 'zhang', 'first_name': 'san'}, 'address': 'Beijing'}}
new_obj = DeserializeInstance(temp_dict)
print('last_name is: ', new_obj.... | 62598fa760cbc95b0636425a |
class IVistor(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def visit_for_concrete_component_a(self, component: ConcreteComponentA): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def visit_for_concrete_component_b(self, component: ConcreteComponentB): <NEW_LINE> <INDENT> pass | Интерфейс посетителя (Visitor).
Объявляет набор методов, соответстующих классам компонентов.
Сигнатура метода посещения позволяет посетителю
понять конкретный класс компонента, с которым он имеет дело. | 62598fa75166f23b2e2432e5 |
class List(ConfigType): <NEW_LINE> <INDENT> def __init__(self, item_type=None, bounds=False, type_name='list value'): <NEW_LINE> <INDENT> super(List, self).__init__(type_name=type_name) <NEW_LINE> if item_type is None: <NEW_LINE> <INDENT> item_type = String() <NEW_LINE> <DEDENT> if not callable(item_type): <NEW_LINE> <... | List type.
Represent values of other (item) type, separated by commas.
The resulting value is a list containing those values.
List doesn't know if item type can also contain commas. To workaround this
it tries the following: if the next part fails item validation, it appends
comma and next item until validation succe... | 62598fa7e76e3b2f99fd8944 |
class HuobifGateway(BaseGateway): <NEW_LINE> <INDENT> default_setting = { "access_key": "", "secret_key": "", "session_number": 3, "proxy_host": "", "proxy_port": "", } <NEW_LINE> exchanges = [Exchange.HUOBI] <NEW_LINE> def __init__(self, event_engine): <NEW_LINE> <INDENT> super().__init__(event_engine, "HUOBIF") <NEW_... | VN Trader Gateway for Huobif connection. | 62598fa7d7e4931a7ef3bfaa |
class OfficialMovable(BaseModel): <NEW_LINE> <INDENT> pass | Public official movable property | 62598fa74527f215b58e9df1 |
class IllegalOpcode(Exception): <NEW_LINE> <INDENT> def __init__(self, opcode=None): <NEW_LINE> <INDENT> self.msg = "Illegal Opcode" <NEW_LINE> if opcode: <NEW_LINE> <INDENT> self.msg += ": " + str(opcode) <NEW_LINE> <DEDENT> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.msg) | Catch illegal opcodes | 62598fa7baa26c4b54d4f1bf |
class TagSitemap(Sitemap): <NEW_LINE> <INDENT> def changefreq(self, obj): <NEW_LINE> <INDENT> if obj.touched > timezone.now()-timedelta(hours=1): <NEW_LINE> <INDENT> return "hourly" <NEW_LINE> <DEDENT> if obj.touched > timezone.now()-timedelta(days=1): <NEW_LINE> <INDENT> return "daily" <NEW_LINE> <DEDENT> if obj.touch... | SiteMap for Tags | 62598fa71f5feb6acb162b30 |
class ExternalMediaOutlet(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('Name'), max_length=255) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return u'%s' % self.name <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _('External media outlet') <NEW_LINE> verbose_name_plural = _('Ext... | An instance of this class is an external media outlet.
'__str__' Returns the name.
'class Meta' Sets the description model (singular and plural) and defines ordering of data by name. | 62598fa7a8370b77170f02ea |
class Config(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> config_file = kwargs.get('config_file', '/etc/tribe.json') <NEW_LINE> self._config = self._get_config(config_file) <NEW_LINE> <DEDENT> def _get_config(self, config_file): <NEW_LINE> <INDENT> return json.load(open(config_file)) <... | A class which handles the configuration of tribe. | 62598fa7b7558d589546353e |
class BasePlugin(object): <NEW_LINE> <INDENT> help_text = "Somebody didn't give their plugin any help text. For shame." | The root Plugin object.
Provides all plugins with a default help text. | 62598fa7627d3e7fe0e06dba |
class InvalidFilterValue(JSONAPIParameterException): <NEW_LINE> <INDENT> status_code = http.BAD_REQUEST <NEW_LINE> def __init__(self, detail=None, value=None, field_type=None): <NEW_LINE> <INDENT> if not detail: <NEW_LINE> <INDENT> detail = "Value '{0}' is not valid".format(value) <NEW_LINE> if field_type: <NEW_LINE> <... | Raised when client passes an invalid value to a query param filter. | 62598fa77d847024c075c2d3 |
class GenerateFilesAction(SystemBuildahAction): <NEW_LINE> <INDENT> def _create_manifest(self, namespace, parser): <NEW_LINE> <INDENT> manifest = { "version": "1.0", "defaultValues": {}, } <NEW_LINE> for item in namespace.default: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> k, v = item.split('=') <NEW_LINE> manifest['... | Creates new system image files. | 62598fa721bff66bcd722b75 |
class Scroll(Transition): <NEW_LINE> <INDENT> UP, DOWN, LEFT, RIGHT = range(4) <NEW_LINE> def __init__(self, fromRenderer, toRenderer, dir=UP, duration=8): <NEW_LINE> <INDENT> self.dir = dir <NEW_LINE> Transition.__init__(self, fromRenderer, toRenderer, duration) <NEW_LINE> <DEDENT> def tween(self, rwdc, fromFrame, toF... | Vertical/horizontal scrolling transition | 62598fa78c0ade5d55dc3618 |
class OleRecordBase(object): <NEW_LINE> <INDENT> TYPE = None <NEW_LINE> MAX_SIZE = None <NEW_LINE> SIZE = None <NEW_LINE> def __init__(self, type, size, more_data, pos, data): <NEW_LINE> <INDENT> if self.TYPE is not None and type != self.TYPE: <NEW_LINE> <INDENT> raise ValueError('Wrong subclass {0} for type {1}' .form... | a record found in an OleRecordStream
always has a type and a size, also pos and data | 62598fa701c39578d7f12c8f |
class AllowAny(BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> return True | Allows everybody to access the view. | 62598fa7090684286d593663 |
class ArLLACoords(Ar3DPoint): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> this = _AriaPy.new_ArLLACoords(*args) <NEW_LINE> try: self.this.append(this... | Proxy of C++ ArLLACoords class | 62598fa7498bea3a75a57a2c |
class Mcl(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "https://www.micans.org/mcl/index.html" <NEW_LINE> url = "https://www.micans.org/mcl/src/mcl-14-137.tar.gz" <NEW_LINE> version('14-137', 'bc8740456cf51019d0a9ac5eba665bb5') | The MCL algorithm is short for the Markov Cluster Algorithm, a fast
and scalable unsupervised cluster algorithm for graphs (also known
as networks) based on simulation of (stochastic) flow in graphs. | 62598fa7eab8aa0e5d30bc9a |
class Loader(object): <NEW_LINE> <INDENT> def __init__(self, config_path=None): <NEW_LINE> <INDENT> config_path = config_path or CONF.api_paste_config <NEW_LINE> self.config_path = CONF.find_file(config_path) <NEW_LINE> if not self.config_path: <NEW_LINE> <INDENT> raise exception.ConfigNotFound(path=config_path) <NEW_L... | Used to load WSGI applications from paste configurations. | 62598fa724f1403a9268583b |
class SQLQueryBuilder(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create_operation(model, fieldname, operator, argument, relation=None): <NEW_LINE> <INDENT> opfunc = OPERATORS[operator] <NEW_LINE> field = getattr(model, relation or fieldname) <NEW_LINE> return opfunc(field, argument) <NEW_LINE> <DEDENT> @... | Provides static functions for building SQLAlchemy query object based on a
:class:`QueryParameters` instance. | 62598fa7e1aae11d1e7ce7ab |
class MillConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> async def async_step_user(self, user_input=None): <NEW_LINE> <INDENT> data_schema = vol.Schema( { vol.Required(CONNECTION_TYPE, default=CLOUD): vol.In( ( CLOUD, LOCAL, ) ) } ) <NEW_LINE> if user_input is None: <NE... | Handle a config flow for Mill integration. | 62598fa7656771135c489591 |
class Overlay(FSLCommand): <NEW_LINE> <INDENT> _cmd = 'overlay' <NEW_LINE> input_spec = OverlayInputSpec <NEW_LINE> output_spec = OverlayOutputSpec <NEW_LINE> def _format_arg(self, name, spec, value): <NEW_LINE> <INDENT> if name == 'transparency': <NEW_LINE> <INDENT> if value: <NEW_LINE> <INDENT> return '1' <NEW_LINE> ... | Use FSL's overlay command to combine background and statistical images
into one volume
Examples
--------
>>> from nipype.interfaces import fsl
>>> combine = fsl.Overlay()
>>> combine.inputs.background_image = 'mean_func.nii.gz'
>>> combine.inputs.auto_thresh_bg = True
>>> combine.inputs.stat_image = 'zstat1.nii.... | 62598fa7b7558d589546353f |
class RequestError(httplib.HTTPException): <NEW_LINE> <INDENT> pass | An HTTPException thrown when the server reports an error in the
client's request.
This exception corresponds to the HTTP status code 400. | 62598fa7f548e778e596b4b4 |
class EveryTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.crontab = CronTab(tabfile=os.path.join(TEST_DIR, 'data', 'test.tab')) <NEW_LINE> <DEDENT> def test_00_minutes(self): <NEW_LINE> <INDENT> for job in self.crontab: <NEW_LINE> <INDENT> job.every(3).minutes() <NEW_LINE> se... | Test basic functionality of crontab. | 62598fa7379a373c97d98f21 |
class Solution: <NEW_LINE> <INDENT> def minimumSize(self, nums, s): <NEW_LINE> <INDENT> if not nums: <NEW_LINE> <INDENT> return -1 <NEW_LINE> <DEDENT> prefix_sum = self.get_prefix_sum(nums) <NEW_LINE> min_size = float('inf') <NEW_LINE> for start in range(len(nums)): <NEW_LINE> <INDENT> for end in range(start, len(nums)... | @param nums: an array of integers
@param s: An integer
@return: an integer representing the minimum size of subarray
前缀和:Time O(n^2) Space O(n) 超时 | 62598fa763b5f9789fe85075 |
class SquareError(ErrorMetric): <NEW_LINE> <INDENT> def distance(self, a, b): <NEW_LINE> <INDENT> return (a - b) ** 2 | Squared error of two tensors. | 62598fa77047854f4633f2e9 |
class IsAdmin(BaseRule): <NEW_LINE> <INDENT> def __init__(self, is_admin: bool): <NEW_LINE> <INDENT> self.is_admin: bool = is_admin <NEW_LINE> <DEDENT> async def check(self, message: types.Message): <NEW_LINE> <INDENT> status = USERS[message.from_id] <NEW_LINE> if not self.is_admin and status != "admin": <NEW_LINE> <IN... | Check admin rights of user. | 62598fa73539df3088ecc1c4 |
class scannerClose_result(object): <NEW_LINE> <INDENT> def __init__(self, io=None, ia=None,): <NEW_LINE> <INDENT> self.io = io <NEW_LINE> self.ia = ia <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thri... | Attributes:
- io
- ia | 62598fa7dd821e528d6d8e45 |
class Session(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Unicode(255), primary_key=True) <NEW_LINE> election_id = db.Column(db.Integer, db.ForeignKey('election.id')) <NEW_LINE> question_number = db.Column(db.Integer) <NEW_LINE> election = db.relationship('Election', backref=db.backref('sessions', lazy='dynamic', ... | Refers vfork session, with its own public key and protinfo | 62598fa738b623060ffa8fa7 |
class InflectionTable(OrderedDotDict): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return self.format_values() | A table of inflected forms of a word.
| 62598fa745492302aabfc3e0 |
class LabelInfoFormatError(Error): <NEW_LINE> <INDENT> pass | An error encountered if the label format is not correct. | 62598fa7925a0f43d25e7f4e |
class Trial: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._elements = {} <NEW_LINE> del self._elements['_elements'] <NEW_LINE> <DEDENT> def __setattr__(self, name: str, value): <NEW_LINE> <INDENT> super.__setattr__(self, name, value) <NEW_LINE> self._elements[name] = value <NEW_LINE> <DEDENT> def __... | this class is only accessed by TrialGenerator.
| 62598fa76e29344779b0056c |
class TestV1EndpointAddress(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 testV1EndpointAddress(self): <NEW_LINE> <INDENT> pass | V1EndpointAddress unit test stubs | 62598fa74e4d562566372335 |
class ObjDict(Dictomatic): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def wrap(cls, data, decode=True, start=True): <NEW_LINE> <INDENT> return wrap_obj(data, cls, decode, start) <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[name] <NEW_LINE> <DEDENT> except Ke... | Simple dictionary that behaves like an object dict that doesn't hide
errors, or do any dehumping stuff. | 62598fa7435de62698e9bd05 |
class Corrector(Plugin): <NEW_LINE> <INDENT> REGEX = re.compile(r"(.*)") <NEW_LINE> REGEX_RGX = re.compile(r"s/([^/]+)\/([^/]+)/?.*") <NEW_LINE> def __init__(self, bot): <NEW_LINE> <INDENT> super().__init__(bot) <NEW_LINE> self.last_words = {} <NEW_LINE> <DEDENT> def do_command(self, bot, message, matched_groups=No... | Simple Plugin application.
Repeat last sentence of user that correct it by using a regex.
example:
lucas| hellp
lucas| s/p/o
bot | lucas would say: hello | 62598fa7435de62698e9bd06 |
class TestDecimalToBinaryIP(unittest.TestCase): <NEW_LINE> <INDENT> def test_decimal_to_binary_ip(self): <NEW_LINE> <INDENT> self.assertEqual("00000000.00000000.00000000.00000000", decimal_to_binary_ip("0.0.0.0")) <NEW_LINE> self.assertEqual("11111111.11111111.11111111.11111111", decimal_to_binary_ip("255.255.255.255")... | Test for the file decimal_to_binary_ip.py
Arguments:
unittest {[type]} -- [description] | 62598fa7f9cc0f698b1c5251 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.