code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Solution(object): <NEW_LINE> <INDENT> def lengthOfLIS(self, nums): <NEW_LINE> <INDENT> if not nums :return 0 <NEW_LINE> dp = [0] * len(nums) <NEW_LINE> dp[0] = 1 <NEW_LINE> for i in range(1 ,len(nums)): <NEW_LINE> <INDENT> tmax = 1 <NEW_LINE> for j in range(0 ,i): <NEW_LINE> <INDENT> if nums[i] > nums[j]: <NEW_LI...
题意是求数组的最大递增子序列,参考博文:https://blog.csdn.net/fuxuemingzhu/article/details/79820919 通过动态规划的思想来完成,假设要求F(n)的最大子序列,可以先求得F(n-1)的,以此类推,我们知道F(1)=1即第一个数的 最大子序列必定是1,那接下来就比较第2个数和第一个数,如果小于第1,则第2个数最大子序列也为1;如大于,则为2。同样的第三个数 就要比较第1和第2,如果大于,则对应的数上+1.若一直小于,则跳过! Runtime: 976 ms, faster than 40.42% of Python online submissions for Longest I...
62598f9a6fb2d068a7693cef
class NotSupprotedYetException(FBRankException): <NEW_LINE> <INDENT> pass
still not supprt
62598f9afbf16365ca793e2e
class EndTimeUrl(CommonUrlSearch): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> super().__init__(url) <NEW_LINE> self.lstSoupAllParagraphs = self._soup.find_all("p") <NEW_LINE> self.lstSoupAllLinks = self._soup.find_all("a") <NEW_LINE> <DEDENT> def getAllParagraphs(self, format = False): <NEW_LINE> ...
refer to wwwDsigns-of-end-timesDcomSaboutDhtml-WhatWeBelieve.txt
62598f9a009cb60464d0129b
class Connector(object): <NEW_LINE> <INDENT> def __init__(self, do_connect, do_close=None, retries=100, sleep=30): <NEW_LINE> <INDENT> self.do_connect = do_connect <NEW_LINE> self.do_close = do_close <NEW_LINE> self.retries = retries <NEW_LINE> self.sleep = sleep <NEW_LINE> self.conn = None <NEW_LINE> <DEDENT> def c(se...
Encapsulates connection attempt/re-attempt logic for a remote service
62598f9a1b99ca400228f3e8
class RURegionSelect(Select): <NEW_LINE> <INDENT> def __init__(self, attrs=None): <NEW_LINE> <INDENT> super().__init__(attrs, choices=RU_REGIONS_CHOICES)
A Select widget that uses a list of Russian Regions as its choices.
62598f9aadb09d7d5dc0a300
class AlternatingResolution(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def UpdateModel(unused_data, unused_model): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def IterateOnce(cls, data, model, golden_questions=None): <NEW_LINE> <INDENT> if golden_questions is Non...
Implements alternating-expectation algorithms for collective judgment.
62598f9a8da39b475be02f5b
class DisabledOptionalProductsOptions(models.Model): <NEW_LINE> <INDENT> MODEL_OPT_JBOSS_EAP = False <NEW_LINE> EXTRA_VAR_OPT_JBOSS_EAP = not MODEL_OPT_JBOSS_EAP <NEW_LINE> MODEL_OPT_JBOSS_FUSE = False <NEW_LINE> EXTRA_VAR_OPT_JBOSS_FUSE = not MODEL_OPT_JBOSS_FUSE <NEW_LINE> MODEL_OPT_JBOSS_BRMS = False <NEW_LINE> EXTR...
The disable optional products options of a scan.
62598f9a45492302aabfc24f
class BuiltUserCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = UserFactory.build() <NEW_LINE> <DEDENT> def test_user_not_saved(self): <NEW_LINE> <INDENT> self.assertIsNone(self.user.id) <NEW_LINE> <DEDENT> def test_init_imager_profile(self): <NEW_LINE> <INDENT> profile = ImagerProfi...
Single user not saved to database, testing conditions in handlers.py.
62598f9a1f037a2d8b9e3e5c
class Link(Link, Facade): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__( _facade_requires_=["from_bus", "to_bus"], *args, **kwargs ) <NEW_LINE> self.capacity = kwargs.get("capacity") <NEW_LINE> self.loss = kwargs.get("loss", 0) <NEW_LINE> self.capacity_cost = kwargs.get("...
Bi-direction link for two buses (e.g. to model transshipment) Parameters ---------- from_bus: oemof.solph.Bus An oemof bus instance where the link unit is connected to with its input. to_bus: oemof.solph.Bus An oemof bus instance where the link unit is connected to with its output. capacity: numeric ...
62598f9aac7a0e7691f72283
class UmbraCharacter(object): <NEW_LINE> <INDENT> def __init__(self, black_pattern, minus_pattern, plus_pattern): <NEW_LINE> <INDENT> self.black_pattern = black_pattern <NEW_LINE> self.minus_pattern = minus_pattern <NEW_LINE> self.plus_pattern = plus_pattern
This class defines a type of umbra characters.
62598f9a21a7993f00c65cf9
class Container(Base): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def has(cls, *kids): <NEW_LINE> <INDENT> r = cls() <NEW_LINE> r.containing(*kids) <NEW_LINE> return r <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> Base.__init__(self, *args, **kwargs) <NEW_LINE> self.children = [] <NEW_LI...
union()
62598f9a7047854f4633f159
class ThreeNeighbors: <NEW_LINE> <INDENT> def __init__(self, A, B, C): <NEW_LINE> <INDENT> if not all(isinstance(x, (PartPoint, FixedPoint)) for x in [A, B, C]): <NEW_LINE> <INDENT> raise TypeError( "Arguments to ThreeNeighbors must be FixedPoint or PartPoint.") <NEW_LINE> <DEDENT> self.A = A <NEW_LINE> self.B = B <NEW...
Represents three best spatially distributed neighbors of a point in a mesh.
62598f9a38b623060ffa8e06
class Hashtag(object): <NEW_LINE> <INDENT> def __init__(self,id): <NEW_LINE> <INDENT> self.id=id <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.id==other.id <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "#" + self.id
Aquesta classe s'encarrega de crear els hashtags ======================= ========= ========================================================================= Atribut Tipus Significat ======================= ========= ================================================================...
62598f9a435de62698e9bb6c
class Meta: <NEW_LINE> <INDENT> verbose_name = "Weight Band" <NEW_LINE> verbose_name_plural = "Weight Bands" <NEW_LINE> ordering = ("min_weight",)
Meta clss for shiping.WeightBand.
62598f9a01c39578d7f12af5
class SyncListItemList(ListResource): <NEW_LINE> <INDENT> def __init__(self, version, service_sid, list_sid): <NEW_LINE> <INDENT> super(SyncListItemList, self).__init__(version) <NEW_LINE> self._solution = {'service_sid': service_sid, 'list_sid': list_sid} <NEW_LINE> self._uri = '/Services/{service_sid}/Lists/{list_sid...
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
62598f9ab5575c28eb712b89
class PatchGANDiscriminator(nn.Module): <NEW_LINE> <INDENT> def __init__( self, in_channels: int, base_channels: int = 64, n_layers: int = 3, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.layers = nn.ModuleList() <NEW_LINE> self.layers.append( nn.Sequential( nn.utils.spectral_norm( nn.Conv2d(in_channels, ba...
Implements an N-layer PatchGAN discriminator
62598f9a07f4c71912baf1c2
class DevelopmentPageForm(forms.ModelForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(DevelopmentPageForm, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> title = forms.CharField( widget=forms.TextInput(attrs={'class': 'form-control'}), label=u'Title', ) <NEW_LINE> is_develo...
**Form for editing DevelopmentPage.**
62598f9a2c8b7c6e89bd3548
class Negation(OOA): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.OPERATION = "neg" <NEW_LINE> self.op = "-"
a parser that convert vm negation command to assembly
62598f9ad7e4931a7ef3be10
class UnknownRdataclass(exception.DNSException): <NEW_LINE> <INDENT> pass
A DNS class is unknown.
62598f9ad6c5a102081e1ebd
class CIDv1(BaseCID): <NEW_LINE> <INDENT> def __init__(self, codec, multihash): <NEW_LINE> <INDENT> super(CIDv1, self).__init__(1, codec, multihash) <NEW_LINE> <DEDENT> @property <NEW_LINE> def buffer(self): <NEW_LINE> <INDENT> return b''.join([bytes([self.version]), multicodec.add_prefix(self.codec, self.multihash)]) ...
CID version 1 object
62598f9a60cbc95b063640c3
class Compressor(object): <NEW_LINE> <INDENT> def open(self, output_file): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def add_stream(self, stream, size=0, name=None ): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> raise NotImplementedEr...
Interface to create a compressed file on disk, given streams
62598f9abe8e80087fbbedd8
class RoleBindingList(_kuber_definitions.Collection): <NEW_LINE> <INDENT> def __init__( self, items: typing.List["RoleBinding"] = None, metadata: "ListMeta" = None, ): <NEW_LINE> <INDENT> super(RoleBindingList, self).__init__( api_version="rbac.authorization.k8s.io/v1beta1", kind="RoleBindingList" ) <NEW_LINE> self._pr...
RoleBindingList is a collection of RoleBindings Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22.
62598f9a8a43f66fc4bf1ef4
class ServicePayment(models.Model): <NEW_LINE> <INDENT> service = models.ForeignKey(Services) <NEW_LINE> payment_type = models.CharField( max_length=36, blank=False, null=False, help_text="sale or authorize") <NEW_LINE> tax = models.DecimalField(max_digits=10, decimal_places=2) <NEW_LINE> handling_fee = models.DecimalF...
Keep payment metadata per service (no recurring payments)
62598f9a4428ac0f6e6582a4
class BadProxySpider(scrapy.Spider): <NEW_LINE> <INDENT> name = "bad_proxy" <NEW_LINE> def start_requests(self): <NEW_LINE> <INDENT> proxy_list = ProxyList() <NEW_LINE> proxy_list.refresh_proxy() <NEW_LINE> file_good_proxy = open(GOOD_PROXY, 'w') <NEW_LINE> file_good_proxy.close() <NEW_LINE> file_bad_proxy = open(ERROR...
first attemp to crawl
62598f9a3539df3088ecc02e
class Trolls: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = 'Trolls' <NEW_LINE> self.hp = 70 <NEW_LINE> self.attack = random.randint(15, 30)
Initialize Trolls class
62598f9a4e4d56256637219c
class TestBasics(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = getArg('service_url','honeyclient::manager::esx::test') <NEW_LINE> self.un = getArg('user_name','honeyclient::manager::esx::test') <NEW_LINE> self.pw = getArg('password','honeyclient::manager::esx::test') <NEW_LINE>...
Test basics methods. ALL PASSED
62598f9a7b25080760ed721d
class Resource(object): <NEW_LINE> <INDENT> def __init__(self, identity, revision, repo, isTree): <NEW_LINE> <INDENT> super(Resource, self).__init__() <NEW_LINE> self._id = identity <NEW_LINE> self._revision = revision <NEW_LINE> self._repo = repo <NEW_LINE> <DEDENT> def get_latest_revision(self): <NEW_LINE> <INDENT> r...
Abstract class representing a versioned object
62598f9a96565a6dacd2ce36
class CourseBetaTesterRole(CourseRole): <NEW_LINE> <INDENT> ROLE = 'beta_testers' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(CourseBetaTesterRole, self).__init__(self.ROLE, *args, **kwargs)
A course Beta Tester
62598f9a3539df3088ecc02f
class NumExprEngine(AbstractEngine): <NEW_LINE> <INDENT> has_neg_frac = True <NEW_LINE> def __init__(self, expr): <NEW_LINE> <INDENT> super().__init__(expr) <NEW_LINE> <DEDENT> def convert(self): <NEW_LINE> <INDENT> return str(super().convert()) <NEW_LINE> <DEDENT> def _evaluate(self): <NEW_LINE> <INDENT> import numexp...
NumExpr engine class
62598f9a4527f215b58e9c5d
class SubmitResult(object): <NEW_LINE> <INDENT> def __init__(self, type, url=None, form_data=None): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> if url and form_data: <NEW_LINE> <INDENT> raise GatewayError("Gateway returned url AND form data.") <NEW_LINE> <DEDENT> self.url = url <NEW_LINE> if type == "form": <NEW_LI...
The result of a submit operation. Currently supported result types are url, form, and None. url: The user should to be redirected to result.url. form: form_action is the target url; form_fields is a dict of form data. None: type is set to None if no further action is required.
62598f9acc0a2c111447ad86
class PaymentMethodViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = PaymentMethod.objects.all() <NEW_LINE> search_fields = ['name'] <NEW_LINE> filter_backends = (filters.SearchFilter,) <NEW_LINE> serializer_class = PaymentMethodSerializer <NEW_LINE> permission_classes = [IsAuthenticated]
Методы платежей
62598f9a23849d37ff850e40
class SplitAndLocMapperTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_split_inject_loc_mapper(self): <NEW_LINE> <INDENT> self.assertIsNone(_MIXED_MODULESTORE) <NEW_LINE> mapper = loc_mapper() <NEW_LINE> split_store = modulestore()._get_modulestore_by_type(SPLIT_MONGO_MODULESTORE_TYPE) <NEW_LINE> self.assertEqua...
Test injection of loc_mapper into Split
62598f9aa79ad16197769ddd
class GetSharedLinksArg(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_path_value', '_path_present', ] <NEW_LINE> _has_required_fields = False <NEW_LINE> def __init__(self, path=None): <NEW_LINE> <INDENT> self._path_value = None <NEW_LINE> self._path_present = False <NEW_LINE> if path is not None: <NEW_LINE> <INDENT> ...
:ivar sharing.GetSharedLinksArg.path: See :meth:`dropbox.dropbox.Dropbox.sharing_get_shared_links` description.
62598f9a55399d3f0562629a
class COUPling(SCPINode, SCPIQuery, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "COUPling" <NEW_LINE> args = ["AC", "DC"]
SOURce:FM:COUPling Arguments: AC, DC
62598f9ad486a94d0ba2bd4f
class ComputeRegionOperationsListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> maxResults = _messages.IntegerField(2, variant=_messages.Variant.UINT32, default=500) <NEW_LINE> orderBy = _messages.StringField(3) <NEW_LINE> pageToken = _messages.StringField(4) <NEW_LINE> pro...
A ComputeRegionOperationsListRequest object. Fields: filter: Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only a...
62598f9a29b78933be269f9a
class FcoinDataConverter: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def convert(data_type, original_data): <NEW_LINE> <INDENT> original_data = eval(original_data) <NEW_LINE> assert type(original_data) == dict <NEW_LINE> sym = Symbol.convert_to_standard_symbol(Platform.PLATFORM_FCOIN, original_data['symbol']) <NEW_LI...
Fcoin数据转换器
62598f9ab7558d58954633a9
class BHiPass(BEQSuite): <NEW_LINE> <INDENT> __documentation_section__ = 'Filter UGens' <NEW_LINE> __slots__ = () <NEW_LINE> _ordered_input_names = ( 'source', 'frequency', 'reciprocal_of_q', ) <NEW_LINE> _valid_calculation_rates = None <NEW_LINE> def __init__( self, calculation_rate=None, frequency=1200, reciprocal_of...
A high-pass filter. :: >>> source = ugentools.In.ar(0) >>> bhi_pass = ugentools.BHiPass.ar( ... frequency=1200, ... reciprocal_of_q=1, ... source=source, ... ) >>> bhi_pass BHiPass.ar()
62598f9a07f4c71912baf1c4
class VIEW3D_OT_display_measurements(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "view3d.display_measurements" <NEW_LINE> bl_label = "Display the measurements made in the" " 'Measure' panel in the 3D View." <NEW_LINE> bl_options = {'REGISTER'} <NEW_LINE> def modal(self, context, event): <NEW_LINE> <INDE...
Display the measurements made in the 'Measure' panel
62598f9a6aa9bd52df0d4c47
class Mean: <NEW_LINE> <INDENT> def __init__(self, in_headers, args): <NEW_LINE> <INDENT> self.input_headers = in_headers <NEW_LINE> self.output_headers = list(in_headers) <NEW_LINE> self.averagedColumn = args[0] <NEW_LINE> self.aggregate_headers = [self.averagedColumn + " Mean"] <NEW_LINE> self.sum = 0 <NEW_LINE> self...
An aggregation that computes the mean of all entries in a column. Round it to the nearest whole number.
62598f9acb5e8a47e493c031
class SetupEntityListen(Setup): <NEW_LINE> <INDENT> priority_assemble = 5 <NEW_LINE> def __init__(self, group, classes, listeners): <NEW_LINE> <INDENT> assert group is None or isinstance(group, str), 'Invalid group %s' % group <NEW_LINE> assert isinstance(classes, (list, tuple)), 'Invalid classes %s' % classes <NEW_LIN...
Provides the setup entity listen by type.
62598f9a1f5feb6acb16299c
class MergeDict(object): <NEW_LINE> <INDENT> def __init__(self, *dicts): <NEW_LINE> <INDENT> if not six.PY2: <NEW_LINE> <INDENT> warnings.warn( "scrapy.utils.datatypes.MergeDict is deprecated in favor " "of collections.ChainMap (introduced in Python 3.3)", category=ScrapyDeprecationWarning, stacklevel=2, ) <NEW_LINE> <...
A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. If a key appears in more than one of the given dictionaries, only the first occurrence will be used.
62598f9a379a373c97d98d8e
class UTCDateTime(types.TypeDecorator): <NEW_LINE> <INDENT> impl = types.DateTime <NEW_LINE> def process_bind_param(self, value, engine): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> if not hasattr(value, 'tzinfo'): <NEW_LINE> <INDENT> return UTC.localize(datetime.combine(value, time())) <NEW_LINE> <DE...
A datetime type that stores only UTC datetimes. PostgreSQL does this wonderful thing where it automatically converts all dateimes to the server-local timezone. Which, is ok, I suppose, but this is a web application and our database server isn't always in the same location as our users. So, we force Postgres to use UTC...
62598f9a56ac1b37e6301f64
class DependsOnlyOnWindow(TimestampCombinerImpl): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def combine(self, output_timestamp, other_output_timestamp): <NEW_LINE> <INDENT> return output_timestamp <NEW_LINE> <DEDENT> def merge(self, result_window, unused_merging_timestamps): <NEW_LINE> <INDENT> return self...
TimestampCombinerImpl that only depends on the window.
62598f9aa79ad16197769dde
class PslTypIGMPSnooping(PslTyp): <NEW_LINE> <INDENT> def unpack_py(self, value): <NEW_LINE> <INDENT> enabled = struct.unpack(">h", value[0:2])[0] <NEW_LINE> if (enabled == 0): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if (enabled == 0x0001): <NEW_LINE> <INDENT> return struct.unpack(">h", value[2:])[0] <NEW_L...
IGMP Snooping
62598f9a8e71fb1e983bb830
class RigidBody(object): <NEW_LINE> <INDENT> def __init__(self, name, masscenter, frame, mass, inertia): <NEW_LINE> <INDENT> if not isinstance(name, str): <NEW_LINE> <INDENT> raise TypeError('Supply a valid name.') <NEW_LINE> <DEDENT> self._name = name <NEW_LINE> self.set_masscenter(masscenter) <NEW_LINE> self.set_mass...
An idealized rigid body. This is essentially a container which holds the various components which describe a rigid body: a name, mass, center of mass, reference frame, and inertia. All of these need to be supplied on creation, but can be changed afterwards. Attributes ========== name : string The body's name. ma...
62598f9a99cbb53fe6830c4c
class User(UserMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = "user" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> username = db.Column(db.String(), unique=True, nullable=False) <NEW_LINE> email = db.Column(db.String(), unique=True, nullable=False) <NEW_LINE> password = db.Column(db.String()...
Classe para representação do usuário no banco de dados. Parâmetros: username: nome de usuário. email: email do usuário. password: senha so usuário. name (opcional): nome completo do usuário.
62598f9a442bda511e95c1e1
class CodeClass(CodeEntity): <NEW_LINE> <INDENT> def __init__(self, scope, parent, id_, name, definition=True): <NEW_LINE> <INDENT> CodeEntity.__init__(self, scope, parent) <NEW_LINE> self.id = id_ <NEW_LINE> self.name = name <NEW_LINE> self.members = [] <NEW_LINE> self.superclasses = [] <NEW_LINE> self.member_of = Non...
This class represents a program class for object-oriented languages. A class typically has a name, an unique `id`, a list of members (variables, functions), a list of superclasses, and a list of references. If a class is defined within another class (inner class), it should have its `member_of` set to the correspondi...
62598f9a236d856c2adc92f6
class RunningMeanFilterF(InPlaceFilterF): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> for _s in [InPlaceFilterF]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, RunningMeanFilterF, name, value) <NEW_LINE> __swig_getmeth...
Proxy of C++ Seiscomp::Math::Filtering::RunningMean<(float)> class
62598f9a498bea3a75a5789b
class Data(Header): <NEW_LINE> <INDENT> def __init__(self, aBuffer=None): <NEW_LINE> <INDENT> Header.__init__(self) <NEW_LINE> if aBuffer: <NEW_LINE> <INDENT> self.set_data(aBuffer) <NEW_LINE> <DEDENT> <DEDENT> def set_data(self, data): <NEW_LINE> <INDENT> self.set_bytes_from_string(data) <NEW_LINE> <DEDENT> def get_si...
This packet type can hold raw data. It's normally employed to hold a packet's innermost layer's contents in those cases for which the protocol details are unknown, and there's a copy of a valid packet available. For instance, if all that's known about a certain protocol is that a UDP packet with its contents set to "H...
62598f9afbf16365ca793e32
class evernote_emailer_missy(evernote_emailer): <NEW_LINE> <INDENT> def __init__(self, notebook_title): <NEW_LINE> <INDENT> missy_email <NEW_LINE> self.notebook_title = notebook_title <NEW_LINE> self.enote_email = missy_email
This class sends emails to evernote from my gmail account.
62598f9aa219f33f346c6595
class EffectsCollection(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(EffectsCollection, self).__init__() <NEW_LINE> self.handles = {} <NEW_LINE> self.effects = [] <NEW_LINE> <DEDENT> def add_effect_handle(self, handle): <NEW_LINE> <INDENT> assert handle != None <NEW_LINE> handles = self.ha...
Class for representing collection of effects .. versionadded:: 0.4
62598f9aadb09d7d5dc0a304
class TestAppendAndDelete(unittest.TestCase): <NEW_LINE> <INDENT> def test_hackerrank_sample1(self): <NEW_LINE> <INDENT> result = append_and_delete('hackerhappy', 'hackerrank', 9) <NEW_LINE> self.assertEquals(result, 'Yes') <NEW_LINE> <DEDENT> def test_hackerrank_sample2(self): <NEW_LINE> <INDENT> result = append_and_d...
Validate if sufficient number of opertions exist.
62598f9a8da39b475be02f5f
class Gpgsa: <NEW_LINE> <INDENT> sentence_id: str = 'GPGSA' <NEW_LINE> def __init__(self, gpgsv_group, select_mode='A', mode=3, pdop=1.56, hdop=0.92, vdop=1.25): <NEW_LINE> <INDENT> self.select_mode = select_mode <NEW_LINE> self.mode = mode <NEW_LINE> self.sats_ids = gpgsv_group.sats_ids <NEW_LINE> self.pdop = pdop <NE...
GPS DOP and active satellites Example: $GPGSA,A,3,19,28,14,18,27,22,31,39,,,,,1.7,1.0,1.3*35
62598f9a8e7ae83300ee8e19
class Worst(Model): <NEW_LINE> <INDENT> def predict(self, observations): <NEW_LINE> <INDENT> predictions = [] <NEW_LINE> for screen_video, page_video in observations: <NEW_LINE> <INDENT> pages = page_video.pages <NEW_LINE> for screen in screen_video.screens: <NEW_LINE> <INDENT> prediction = all(page not in screen.match...
This class represents a task 1, subtask B model that cheats to obtain the worst possible results.
62598f9a009cb60464d012a0
class Battle: <NEW_LINE> <INDENT> def __init__(self, entity1, entity2): <NEW_LINE> <INDENT> roll = self.roll_priority() <NEW_LINE> if(roll <= .5): <NEW_LINE> <INDENT> self.attacker1 = entity1 <NEW_LINE> self.attacker2 = entity2 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.attacker1 = entity2 <NEW_LINE> self.attac...
Class to run the battles between 2 entities, handles attacking and status checks for when someone dies.
62598f9a38b623060ffa8e0a
class TestException(Exception): <NEW_LINE> <INDENT> pass
An exception type to use to verify raises in tests
62598f9a23849d37ff850e42
class MemberSpecialTitleChangeEvent(Event): <NEW_LINE> <INDENT> def __init__( self, origin: str, new: str, current: str, member: Member ): <NEW_LINE> <INDENT> Event.__init__(self) <NEW_LINE> self.type = MEMBER_SPECIAL_TITLE_CHANGE_EVENT <NEW_LINE> self.origin = origin <NEW_LINE> self.new = new <NEW_LINE> self.current =...
群头衔改动(只有群主可以操作)
62598f9a10dbd63aa1c70931
class TextPolar(QQAITextUTF8Class): <NEW_LINE> <INDENT> api = 'https://api.ai.qq.com/fcgi-bin/nlp/nlp_textpolar'
情感分析识别
62598f9a01c39578d7f12af9
@export <NEW_LINE> class XceptionPreprocessingLayer(PreprocessingLayer): <NEW_LINE> <INDENT> def __init__(self, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__( preprocess_fn=tf.keras.applications.xception.preprocess_input, **kwargs )
Parameters ---------- preprocess_fn **kwargs
62598f9af8510a7c17d7e035
class PreprocessPlugin(object): <NEW_LINE> <INDENT> SUPPORTED_OS = [] <NEW_LINE> WEIGHT = 3 <NEW_LINE> ATTRIBUTE = '' <NEW_LINE> @property <NEW_LINE> def plugin_name(self): <NEW_LINE> <INDENT> return self.__class__.__name__ <NEW_LINE> <DEDENT> def _FindFileEntry(self, searcher, path): <NEW_LINE> <INDENT> find_spec = fi...
Class that defines the preprocess plugin object interface. Any preprocessing plugin that implements this interface should define which operating system this plugin supports. The OS variable supports the following values: + Windows + Linux + MacOSX Since some plugins may require knowledge gained from other chec...
62598f9a29b78933be269f9b
class Report(object): <NEW_LINE> <INDENT> def report_single_var_regression(self, y, x, y_variable_names, x_variable_names, statistic, pretty_index = None): <NEW_LINE> <INDENT> if not(isinstance(statistic, list)): <NEW_LINE> <INDENT> statistic = [statistic] <NEW_LINE> <DEDENT> stats = Calculations.linear_regression_sing...
Creates simple statistical reports (via plots) on time series, outputting results
62598f9ad53ae8145f918209
class ImmediateReport(pep8.BaseReport): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> super(ImmediateReport, self).__init__(options) <NEW_LINE> self._fmt = pep8.REPORT_FORMAT.get(options.format.lower(), options.format) <NEW_LINE> self._repeat = options.repeat <NEW_LINE> self._show_source = option...
Collect and print the results of the checks.
62598f9a44b2445a339b682a
class User(Base): <NEW_LINE> <INDENT> __tablename__ = "user" <NEW_LINE> username: str = Column(String(64), primary_key=True)
Tiny database table for testing.
62598f9aa05bb46b3848a5fb
class Transaction(MailSyncBase, HasPublicID): <NEW_LINE> <INDENT> namespace_id = Column(Integer, ForeignKey(Namespace.id, ondelete='CASCADE'), nullable=False) <NEW_LINE> namespace = relationship(Namespace) <NEW_LINE> object_type = Column(String(20), nullable=False, index=True) <NEW_LINE> record_id = Column(Integer, nul...
Transactional log to enable client syncing.
62598f9a3c8af77a43b67dfb
class BaseSubnet(BaseACIObject): <NEW_LINE> <INDENT> def __init__(self, name, parent=None): <NEW_LINE> <INDENT> super(BaseSubnet, self).__init__(name, parent) <NEW_LINE> self._addr = None <NEW_LINE> self._scope = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def ip(self): <NEW_LINE> <INDENT> return self.get_addr() <NEW...
Base class for Subnet and OutsideNetwork
62598f9a07f4c71912baf1c7
class DockerAuthzPluginTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_inspect_user(self): <NEW_LINE> <INDENT> plugin = plugins.DockerInspectUserPlugin() <NEW_LINE> (allow, msg) = plugin.run_res( 'GET', '/v1.26/images/foo/json', {}, {'Config': {'User': 'user1'}} ) <NEW_LINE> self.assertTrue(allow) <NEW_LINE> self...
Tests for treadmill.api.docker_authz plugin
62598f9a21bff66bcd7229e0
class SendNotificationEventHandler(EventHandler): <NEW_LINE> <INDENT> def __init__(self, loop, event_bus, logger, config=None): <NEW_LINE> <INDENT> super().__init__(loop, event_bus, logger, config) <NEW_LINE> self.providers = {} <NEW_LINE> for provider_type, provider_config in config["providers"].items(): <NEW_LINE> <I...
Handles ConversationInputEvents
62598f9ad58c6744b42dc18f
class ProgressBarWidget(object): <NEW_LINE> <INDENT> def update(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.update() <NEW_LINE> <DEDENT> def __add__(self, other): <NEW_LINE> <INDENT> if isinstance(other, unicode): <NEW_LINE> <INDENT> return str(self) + other.en...
This is an element of ProgressBar formatting. The ProgressBar object will call it's update value when an update is needed. It's size may change between call, but the results will not be good if the size changes drastically and repeatedly.
62598f9a379a373c97d98d90
class ClassifierConverter(EstimatorConverter): <NEW_LINE> <INDENT> def __init__(self, estimator, context): <NEW_LINE> <INDENT> super(ClassifierConverter, self).__init__(estimator, context, ModelMode.CLASSIFICATION) <NEW_LINE> assert isinstance(estimator, ClassifierMixin), 'Classifier converter should only be applied to...
Base class for classifier converters. It is required that the output schema contains only categorical features. The serializer will output result labels as output::feature_name and probabilities for each value of result feature as output::feature_name::feature_value.
62598f9aa79ad16197769de0
class Advertiser(ImageMixin, models.Model): <NEW_LINE> <INDENT> name = models.CharField( max_length=100, null=False, blank=False, default='' ) <NEW_LINE> slug = models.SlugField(blank=True) <NEW_LINE> address = models.CharField(max_length=200, default='') <NEW_LINE> country = models.SmallIntegerField(choices=COUNTRY_CH...
Advertisers within the Theeventdiary system are represented by this model. name is required. Other fields are optional.
62598f9ae76e3b2f99fd87b2
class myTransform(Transform): <NEW_LINE> <INDENT> def __init__(self, root): <NEW_LINE> <INDENT> self.root = root <NEW_LINE> <DEDENT> def __call__(self, arg1, arg2, arg3): <NEW_LINE> <INDENT> return self.yourMethod(arg1, arg2, arg3) <NEW_LINE> <DEDENT> def yourMethod(self, arg1, arg2, arg3): <NEW_LINE> <INDENT> return
:Author: Karl Norby <knorby@uchicago.edu> :Date: Wed, 30 Aug 2006 :Description: A template for developers to help with the constuction of transform functions
62598f9a24f1403a92685770
@tf_export( "initializers.glorot_normal", v1=[ "glorot_normal_initializer", "initializers.glorot_normal" ]) <NEW_LINE> @deprecation.deprecated_endpoints("glorot_normal_initializer") <NEW_LINE> class GlorotNormal(VarianceScaling): <NEW_LINE> <INDENT> def __init__(self, seed=None, dtype=dtypes.float32): <NEW_LINE> <INDEN...
The Glorot normal initializer, also called Xavier normal initializer. It draws samples from a truncated normal distribution centered on 0 with `stddev = sqrt(2 / (fan_in + fan_out))` where `fan_in` is the number of input units in the weight tensor and `fan_out` is the number of output units in the weight tensor. Args...
62598f9abde94217f3707528
class MiniPlots(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__( self, parent = None , nplot = 16, dpi = 100): <NEW_LINE> <INDENT> QtGui.QWidget.__init__( self, parent) <NEW_LINE> self.nplot = nplot <NEW_LINE> self.canvas = MiniCanvas(self.nplot, dpi=dpi) <NEW_LINE> self.updateGeometry() <NEW_LINE> self.vbl = QtGui.QV...
Class encapsulating a matplotlib plot
62598f9a8e7ae83300ee8e1a
class Deck(Pile): <NEW_LINE> <INDENT> def __init__(self, name="Deck"): <NEW_LINE> <INDENT> Pile.__init__(self, name) <NEW_LINE> <DEDENT> def shuffle(self): <NEW_LINE> <INDENT> import random <NEW_LINE> num_cards = self.count() <NEW_LINE> for dummy in range(1, 3): <NEW_LINE> <INDENT> for i in range(num_cards): <NEW_LINE>...
An empty deck with common methods.
62598f9a4428ac0f6e6582a8
class OperationAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('equipment', 'status', 'quantity', 'date_time') <NEW_LINE> search_fields = ['equipment__name', 'status', 'date_time'] <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Operation
docstring for ClassName
62598f9a8da39b475be02f61
class Public_Key_Packet(Generic_Packet): <NEW_LINE> <INDENT> def __init__(self, header, handle): <NEW_LINE> <INDENT> super().__init__(header, handle) <NEW_LINE> self.packet_tag = 6 <NEW_LINE> algo_field_len = 1 <NEW_LINE> version_field_len = 1 <NEW_LINE> timestamp_field_len = 4 <NEW_LINE> public_algorithms = { 1: publi...
This is just a public key container, it contains - a length which is to be determined, 1, 2 and 4 byte are supported - a version number (one byte with value 4) - unix timestamp of the key creation, 4 byte - an algorithm marker, one byte
62598f9aa8ecb03325870f88
class ShipmentInputSet(InputSet): <NEW_LINE> <INDENT> def set_APIKey(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'APIKey', value) <NEW_LINE> <DEDENT> def set_Carrier(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Carrier', value) <NEW_LINE> <DEDENT> def set_DestinationZipCode(self, value):...
An InputSet with methods appropriate for specifying the inputs to the Shipment Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598f9a004d5f362081eebb
class DotDict(MutableMapping): <NEW_LINE> <INDENT> def __init__(self, original_dict=None): <NEW_LINE> <INDENT> if not original_dict: <NEW_LINE> <INDENT> original_dict = dict() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> for key, value in original_dict.iteritems(): <NEW_LINE> <INDENT> if isinstance(value, dict): <NEW_...
A dictionary that allows accessing every key with dot notation, like a class property.
62598f9a596a8972361279fe
class Route(): <NEW_LINE> <INDENT> def __init__(self, route_name, ignored_trips): <NEW_LINE> <INDENT> self.directions = {} <NEW_LINE> self.route_name = route_name <NEW_LINE> self.ignored_trips = ignored_trips <NEW_LINE> <DEDENT> def update_route(self, json): <NEW_LINE> <INDENT> for direction in json['direction']: <NEW_...
Route class houses all of the Direction objects.
62598f9a56ac1b37e6301f67
@dataclass(frozen=True) <NEW_LINE> class ExprStmt(BaseNoFqnProcessing): <NEW_LINE> <INDENT> expr: Base <NEW_LINE> __slots__ = ['expr'] <NEW_LINE> def name_astns(self) -> Iterable[Tuple[ast_node.Astn, str]]: <NEW_LINE> <INDENT> yield from self.expr.name_astns()
Corresponds an expr-only from AssignMultipleExprStmt (q.v.). Doesn't allow reprocessing, even though probably benign (see AssignExprStmt).
62598f9acc0a2c111447ad89
class Output: <NEW_LINE> <INDENT> file = FileField(label="File with reads")
Output fields to process BaseSpaceImport.
62598f9a8e71fb1e983bb833
class ISurveyLine(Interface): <NEW_LINE> <INDENT> name = Str <NEW_LINE> data_file_path = Str <NEW_LINE> locations = Array(shape=(None, 2)) <NEW_LINE> locations_unit = Str <NEW_LINE> lat_long = Array(shape=(None, 2)) <NEW_LINE> frequencies = Dict <NEW_LINE> freq_trace_num = Dict <NEW_LINE> trace_num = Array <NEW_LINE> c...
A class representing a single survey line
62598f9aa17c0f6771d5bfb8
class GridSpecFromSubplotSpec(GridSpecBase): <NEW_LINE> <INDENT> def __init__(self, nrows, ncols, subplot_spec, wspace=None, hspace=None, height_ratios=None, width_ratios=None): <NEW_LINE> <INDENT> self._wspace = wspace <NEW_LINE> self._hspace = hspace <NEW_LINE> self._subplot_spec = subplot_spec <NEW_LINE> GridSpecBas...
GridSpec whose subplot layout parameters are inherited from the location specified by a given SubplotSpec.
62598f9aa05bb46b3848a5fd
class TestCreateProductAccessRequest(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 testCreateProductAccessRequest(self): <NEW_LINE> <INDENT> model = kinow_client.models.create_product_access_requ...
CreateProductAccessRequest unit test stubs
62598f9a3c8af77a43b67dfc
class getspsbit(base.StackInstruction): <NEW_LINE> <INDENT> code = base.opcodes['GETSPSBIT'] <NEW_LINE> arg_format = ['rw']
GETSPSBIT i Assigns the current stack pointer on the sbit stack to register r_i
62598f9a379a373c97d98d92
class DisPost(Handler): <NEW_LINE> <INDENT> def get(self, post_id): <NEW_LINE> <INDENT> key = db.Key.from_path('Post', int(post_id), parent=blog_key()) <NEW_LINE> pdis = db.get(key) <NEW_LINE> if not pdis: <NEW_LINE> <INDENT> self.error(404) <NEW_LINE> return <NEW_LINE> <DEDENT> lpdisd_by = pdis.disd_by <NEW_LINE> luse...
this class handles Disliking a post submission
62598f9a60cbc95b063640c9
class Consensus: <NEW_LINE> <INDENT> def __init__(self, ns_map, sorted_r, router_map, nick_map, consensus_count): <NEW_LINE> <INDENT> self.ns_map = ns_map <NEW_LINE> self.sorted_r = sorted_r <NEW_LINE> self.routers = router_map <NEW_LINE> self.name_to_key = nick_map <NEW_LINE> self.consensus_count = consensus_count
A Consensus is a pickleable container for the members of ConsensusTracker. This should only be used as a temporary reference, and will change after a NEWDESC or NEWCONSENUS event. If you want a copy of a consensus that is independent of subsequent updates, use copy.deepcopy()
62598f9add821e528d6d8cb3
class _PyBcryptBackend(_BcryptCommon): <NEW_LINE> <INDENT> _calc_lock = None <NEW_LINE> @classmethod <NEW_LINE> def _load_backend_mixin(mixin_cls, name, dryrun): <NEW_LINE> <INDENT> global _pybcrypt <NEW_LINE> if not _detect_pybcrypt(): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> impor...
backend which uses 'pybcrypt' package
62598f9a01c39578d7f12afc
class DetonationMessage(TurnMessage): <NEW_LINE> <INDENT> prefix = "D" <NEW_LINE> message_type = "detonation" <NEW_LINE> min_part_count = 5 <NEW_LINE> def __init__(self, message): <NEW_LINE> <INDENT> super(DetonationMessage, self).__init__(self.prefix, self.message_type, self.min_part_count, message) <NEW_LINE> self.lo...
Message of detonation that occurred in this turn
62598f9a435de62698e9bb73
class TrafficAnalyticsConfigurationProperties(Model): <NEW_LINE> <INDENT> _validation = { 'enabled': {'required': True}, 'workspace_id': {'required': True}, 'workspace_region': {'required': True}, 'workspace_resource_id': {'required': True}, } <NEW_LINE> _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'},...
Parameters that define the configuration of traffic analytics. All required parameters must be populated in order to send to Azure. :param enabled: Required. Flag to enable/disable traffic analytics. :type enabled: bool :param workspace_id: Required. The resource guid of the attached workspace :type workspace_id: str...
62598f9a6e29344779b003da
class DataConversionWarning(UserWarning): <NEW_LINE> <INDENT> pass
A warning on implicit data conversions happening in the code
62598f9a99cbb53fe6830c51
class ForwardShootMover(EngineMover): <NEW_LINE> <INDENT> def __init__(self, ensemble, selector, engine=None): <NEW_LINE> <INDENT> super(ForwardShootMover, self).__init__( ensemble=ensemble, target_ensemble=ensemble, selector=selector, engine=engine ) <NEW_LINE> <DEDENT> @property <NEW_LINE> def direction(self): <NEW_L...
A forward shooting sample generator
62598f9abe8e80087fbbedde
class Distribution(object): <NEW_LINE> <INDENT> def to_readable(self): <NEW_LINE> <INDENT> pp = [] <NEW_LINE> for nary in self.result: <NEW_LINE> <INDENT> pp.append( "{}: {}\n".format( nary, self.result[nary])) <NEW_LINE> <DEDENT> return ''.join(pp)
Base class for analysis routines for symbol distributions. Results are dictionary objects with human readable keys. - class copied from Paul A. Lambert
62598f9a0a50d4780f705157
class OptionalParameter(OptionalParameterMixin, Parameter): <NEW_LINE> <INDENT> expected_type = str
Class to parse optional parameters.
62598f9aadb09d7d5dc0a308
class NonZeroDistribution(FieldValidator): <NEW_LINE> <INDENT> def __init__(self, minwidth, minsize, *fields): <NEW_LINE> <INDENT> super(NonZeroDistribution, self).__init__(*fields) <NEW_LINE> self.minwidth = minwidth <NEW_LINE> self.minsize = minsize <NEW_LINE> <DEDENT> def validate_fields(self, fields): <NEW_LINE> <I...
Validator that ensures that the distribution of values has some width. Initiated to cover the case where field was initialized but never copied over, resulting in all 0's
62598f9a3cc13d1c6d4654eb
class FakeFFI(object): <NEW_LINE> <INDENT> NULL = object()
A fake of a cryptography's ffi object. @cvar NULL: Symbolic constant for CFFI's NULL objects.
62598f9a2ae34c7f260aae60
class AppListView(MongonautViewMixin, ListView): <NEW_LINE> <INDENT> template_name = "mongonaut/app_list.html"
:args: <app_label>
62598f9a596a897236127a00
class NeteaseCloudClassSpider(scrapy.Spider): <NEW_LINE> <INDENT> name = 'netease_cloud_class' <NEW_LINE> allowed_domains = ['study.163.com'] <NEW_LINE> start_urls = ['https://study.163.com/'] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def start_requests(self): <NEW_LINE> <INDENT> data ...
网易云课堂爬虫
62598f9a8e7ae83300ee8e1d
class ExtractSkeletonCacheExport(pyblish.api.InstancePlugin): <NEW_LINE> <INDENT> order = pyblish.api.ExtractorOrder + 0.4811 <NEW_LINE> hosts = ["maya"] <NEW_LINE> label = "Extract SkeletonCache" <NEW_LINE> families = [ "reveries.skeletoncache", ] <NEW_LINE> def process(self, instance): <NEW_LINE> <INDENT> from reveri...
Publish parent pointcache usd file.
62598f9a56ac1b37e6301f69
class VirtualizationNode_TextObjectRenderer(text.TextObjectRenderer): <NEW_LINE> <INDENT> renders_type = "VirtualizationNode" <NEW_LINE> renderers = ["TextRenderer", "WebConsoleRenderer", "TestRenderer"] <NEW_LINE> def __init__(self, *args, **options): <NEW_LINE> <INDENT> self.quick = options.pop("quick", False) <NEW_L...
Virtualization nodes can be Hypervisors, VirtualMachine or VMCS.
62598f9a7047854f4633f161