code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@Vows.batch <NEW_LINE> class AlgNoneVerification(Vows.Context): <NEW_LINE> <INDENT> def topic(self): <NEW_LINE> <INDENT> return jwt_alg_none <NEW_LINE> <DEDENT> class VerifyJWTNoPublicKeyNoneAllowed(Vows.Context): <NEW_LINE> <INDENT> def topic(self, topic): <NEW_LINE> <INDENT> return jwt.verify_jwt(topic, None, ['none'... | Check we get an error when verifying token that has alg none with
a public key | 6259906e97e22403b383c76b |
class QueueController(RoutingController): <NEW_LINE> <INDENT> _resource_name = 'queue' <NEW_LINE> def __init__(self, shard_catalog): <NEW_LINE> <INDENT> super(QueueController, self).__init__(shard_catalog) <NEW_LINE> self._lookup = self._shard_catalog.lookup <NEW_LINE> <DEDENT> def list(self, project=None, marker=None,... | Controller to facilitate special processing for queue operations.
| 6259906e01c39578d7f14368 |
class intSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.vals = [] <NEW_LINE> <DEDENT> def insert(self, e): <NEW_LINE> <INDENT> if not e in self.vals: <NEW_LINE> <INDENT> self.vals.append(e) <NEW_LINE> <DEDENT> <DEDENT> def member(self, e): <NEW_LINE> <INDENT> return e in self.vals <NEW_LI... | An intSet is a set of integers
The value is represented by a list of ints, self.vals.
Each int in the set occurs in self.vals exactly once. | 6259906e1b99ca4002290169 |
class Node(object): <NEW_LINE> <INDENT> def __init__(self, data, next=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.next = next | Linked list node | 6259906efff4ab517ebcf082 |
class Environment: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.things = [] <NEW_LINE> self.agents = [] <NEW_LINE> <DEDENT> def thing_classes(self): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> def percept(self, agent): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def execu... | Abstract class representing an Environment. 'Real' Environment classes
inherit from this. Your Environment will typically need to implement:
percept: Define the percept that an agent sees.
execute_action: Define the effects of executing an action.
Also update the agent.performance slo... | 6259906e76e4537e8c3f0deb |
class BillingReport(object): <NEW_LINE> <INDENT> swagger_types = { 'created': 'int', 'id': 'str', 'last_known_failures': 'list[str]', 'statistics': 'dict(str, int)' } <NEW_LINE> attribute_map = { 'created': 'created', 'id': 'id', 'last_known_failures': 'last_known_failures', 'statistics': 'statistics' } <NEW_LINE> def ... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259906eadb09d7d5dc0bdd2 |
class test_Applogin_class(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> unittest.TestCase.setUp(self) <NEW_LINE> self.url="http://yun.geneedu.cn/passport/login.do" <NEW_LINE> <DEDENT> def test_Applogin(self): <NEW_LINE> <INDENT> self.data={ "appId":1, "deviceType":1, "password":"", "userN... | 测试类 | 6259906ea17c0f6771d5d7dd |
class Team: <NEW_LINE> <INDENT> def __init__(self, team=None): <NEW_LINE> <INDENT> self.__my_team = [None, None, None, None, None, None] <NEW_LINE> if team: <NEW_LINE> <INDENT> i = 0 <NEW_LINE> for member in team: <NEW_LINE> <INDENT> self[i] = member <NEW_LINE> i += 1 <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def __getitem... | A class that represents a team of pokemon | 6259906e1f5feb6acb164458 |
class WePayClientError(WePayHTTPError): <NEW_LINE> <INDENT> pass | This is a 4xx type error, which, most of the time, carries important
error information about the object of interest. | 6259906e26068e7796d4e1a3 |
class CBRWError(Exception): <NEW_LINE> <INDENT> pass | Base exception raised by the CBRW class | 6259906ea05bb46b3848bd61 |
class InRamStore(StoreInterface): <NEW_LINE> <INDENT> def delete(self, key): <NEW_LINE> <INDENT> self.pop(key, None) <NEW_LINE> <DEDENT> def wipe(self): <NEW_LINE> <INDENT> keys = list(self.keys()).copy() <NEW_LINE> for key in keys: <NEW_LINE> <INDENT> self.delete(key) | The InRamStore inherits
:class:`graphenestore.interfaces.StoreInterface` and extends it by two
further calls for wipe and delete.
The store is syntactically equivalent to a regular dictionary.
.. warning:: If you are trying to obtain a value for a key that does
**not** exist in the store, the library will **NOT**... | 6259906e7047854f46340c1f |
class SubjectLocalityType_(SamlBase): <NEW_LINE> <INDENT> c_tag = 'SubjectLocalityType' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = SamlBase.c_children.copy() <NEW_LINE> c_attributes = SamlBase.c_attributes.copy() <NEW_LINE> c_child_order = SamlBase.c_child_order[:] <NEW_LINE> c_cardinality = SamlBase.c_... | The urn:oasis:names:tc:SAML:2.0:assertion:SubjectLocalityType element | 6259906ebe8e80087fbc08f7 |
class JumptapRenderer(HtmlDataRenderer): <NEW_LINE> <INDENT> pass | Inheritance Hierarchy:
JumptapRenderer => HtmlDataRenderer =>
BaseHtmlRenderer => BaseCreativeRenderer | 6259906ebf627c535bcb2d33 |
class TestPageDeprecation(DefaultSiteTestCase, DeprecationTestCase): <NEW_LINE> <INDENT> def test_creator(self): <NEW_LINE> <INDENT> mainpage = self.get_mainpage() <NEW_LINE> creator = mainpage.getCreator() <NEW_LINE> self.assertEqual(creator, (mainpage.oldest_revision.user, mainpage.oldest_revision.timestamp.isoformat... | Test deprecation of Page attributes. | 6259906e99cbb53fe6832750 |
class AbstractSubsystem(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=128, blank=True, db_index=True, unique=True, help_text='no spaces and unique') <NEW_LINE> displayName = models.CharField(max_length=128, blank=True) <NEW_LINE> group = models.ForeignKey(SubsystemGroup, null=True, blank=True, r... | Data quality, Video, etc. Each individual device. | 6259906e9c8ee82313040dbc |
class FilterModule(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def filters(): <NEW_LINE> <INDENT> return { 'bit_length_power_of_2': bit_length_power_of_2, 'netloc': get_netloc, 'netloc_no_port': get_netloc_no_port, 'netorigin': get_netorigin, 'string_2_int': string_2_int, 'pip_requirement_names': pip_requirem... | Ansible jinja2 filters. | 6259906e67a9b606de5476d7 |
class SpriteSheet(object): <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> self.sheet = load_alpha_image(SPRITES_FOLDER + file) <NEW_LINE> self.file = file <NEW_LINE> loaded_sheets.append(self) <NEW_LINE> <DEDENT> def get_image(self, rect): <NEW_LINE> <INDENT> return self.sheet.subsurface(rect) <NEW_L... | Contains the image of a sprite sheet and methods to extract sprites from it.
| 6259906e0c0af96317c57992 |
class Malware(Entity): <NEW_LINE> <INDENT> _collection_name = 'entities' <NEW_LINE> type = 'malware' <NEW_LINE> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._stix_object.name <NEW_LINE> <DEDENT> @property <NEW_LINE> def description(self): <NEW_LINE> <INDENT> return self._stix_object.description ... | Malware Yeti object.
Extends the Malware STIX2 definition. | 6259906e55399d3f05627d8b |
class Product(Operation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Operation.__init__(self, 'product', 1, 1, leftparenthesis='<', rightparenthesis='>') <NEW_LINE> <DEDENT> def getreturntype(self, args): <NEW_LINE> <INDENT> newargs1 = [] <NEW_LINE> newargs = [] <NEW_LINE> for arg in args: <NEW_LINE> <... | Represents the product Operation, which can be applied to two or more
'elements'. It yields an 'element'.
Note: Product should be thought of as functional product: the 'functions'
(or rather: 'elements') to which it is applied should have a common domain.
Attributes:
See the attributes of the Operation base clas... | 6259906e56ac1b37e6303917 |
class Plan(BaseModel): <NEW_LINE> <INDENT> description = models.TextField(blank=True, null=True) <NEW_LINE> status = models.CharField(max_length=1, choices=PLAN_STATUS_TYPES, default='A') <NEW_LINE> date_activated = models.DateTimeField(blank=True, null=True, default=None) <NEW_LINE> date_inactivated = models.DateTimeF... | Define different plans. A plan should never be modified, only new plans added with revised parameters.
- Max value of 0 = feature is disabled
- Max value of -1 = unlimited | 6259906e3539df3088ecdb05 |
class TranslateBase(compile_rule.CompileBase): <NEW_LINE> <INDENT> def __init__(self, lang=None): <NEW_LINE> <INDENT> self.lang = lang <NEW_LINE> <DEDENT> def translate(infile_name, outfile_lang_moentries_context): <NEW_LINE> <INDENT> raise NotImplementedError('Subclasses must implement translate') <NEW_LINE> <DEDENT> ... | A compile rule for translating a file from one language to another.
Compile-rules that derive from TranslateBase define a translate()
routine rather than a build() or build_many() routine.
These rules *must* have the following format for their input files:
input[0]: the English file to translate
input[1]: the... | 6259906eac7a0e7691f73d51 |
class invalid_capital_gain_exception(Exception): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'The input of capital gain is not a valid integer.' | Raise exception when the input of capital gain is not a valid integer. | 6259906e4f88993c371f1154 |
@route("/mps") <NEW_LINE> class IndexHandler(BasicHandler): <NEW_LINE> <INDENT> def check_xsrf_cookie(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_error_html(self, status_code=500, **kwargs): <NEW_LINE> <INDENT> self.set_header("Content-Type", "application/xml;charset=utf-8") <NEW_LINE> if self.touser an... | 微信消息主要处理控制器 | 6259906ed486a94d0ba2d828 |
class PageOfAssetPolicy(object): <NEW_LINE> <INDENT> swagger_types = { 'links': 'list[Link]', 'page': 'PageInfo', 'resources': 'list[AssetPolicy]' } <NEW_LINE> attribute_map = { 'links': 'links', 'page': 'page', 'resources': 'resources' } <NEW_LINE> def __init__(self, links=None, page=None, resources=None): <NEW_LINE> ... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259906eaad79263cf43001e |
class FileError(BoltError): <NEW_LINE> <INDENT> def __init__(self, in_name, message): <NEW_LINE> <INDENT> super(FileError, self).__init__(message) <NEW_LINE> self._in_name = (in_name and '%s' % in_name) or 'Unknown File' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f'{self._in_name}: {self.message}... | An error that occurred while handling a file. | 6259906efff4ab517ebcf084 |
class Login(MyScreen): <NEW_LINE> <INDENT> def login(self): <NEW_LINE> <INDENT> app = App.get_running_app() <NEW_LINE> try: <NEW_LINE> <INDENT> app.backend.login(self.ids.email.text, self.ids.password.text) <NEW_LINE> app.show(Home, True) <NEW_LINE> <DEDENT> except BackEndError as e: <NEW_LINE> <INDENT> Alert(title="Lo... | Represent the screen to login | 6259906eadb09d7d5dc0bdd4 |
class VariantField(ProtoField): <NEW_LINE> <INDENT> VARIANTS = frozenset([pmessages.Variant.DOUBLE, pmessages.Variant.FLOAT, pmessages.Variant.BOOL, pmessages.Variant.INT64, pmessages.Variant.UINT64, pmessages.Variant.SINT64, pmessages.Variant.INT32, pmessages.Variant.UINT32, pmessages.Variant.SINT32, pmessages.Variant... | Field definition for a completely variant field. Allows containment
of any valid Python value supported by Protobuf/ProtoRPC. | 6259906ea17c0f6771d5d7de |
class TestFieldOverrideSplitPerformance(FieldOverridePerformanceTestCase): <NEW_LINE> <INDENT> MODULESTORE = TEST_DATA_SPLIT_MODULESTORE <NEW_LINE> __test__ = True <NEW_LINE> TEST_DATA = { ('no_overrides', 1, True, False): (23, 4, 9), ('no_overrides', 2, True, False): (68, 19, 54), ('no_overrides', 3, True, False): (26... | Test cases for instrumenting field overrides against the Split modulestore. | 6259906e21bff66bcd7244d1 |
class SequenceIdentityDenominator(IntEnum): <NEW_LINE> <INDENT> SHORTER_LENGTH = 1 <NEW_LINE> NUM_ALIGNED_WITH_GAPS = 2 <NEW_LINE> NUM_ALIGNED_WITHOUT_GAPS = 3 <NEW_LINE> MEAN_LENGTH = 4 <NEW_LINE> OTHER = 5 | The denominator used while calculating the sequence identity.
One of these constants can be passed to :class:`SequenceIdentity`. | 6259906ecb5e8a47e493cdb7 |
class CommonColumns(Base): <NEW_LINE> <INDENT> __abstract__ = True <NEW_LINE> _created = Column(DateTime) <NEW_LINE> _updated = Column(DateTime) <NEW_LINE> _etag = Column(String) <NEW_LINE> _id = Column(Integer, primary_key=True) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> h = hashlib.sha1() <NE... | Master SQLAlchemy Model. All the SQL tables defined for the application
should inherit from this class. It provides common columns such as
_created, _updated and _id.
WARNING: the _id column name does not respect Eve's setting for custom
ID_FIELD. | 6259906eb7558d5895464b67 |
class Angel(BasePlayer): <NEW_LINE> <INDENT> color = 'White' <NEW_LINE> def make_move(self, round): <NEW_LINE> <INDENT> return True | Player which always plays nice. | 6259906e435de62698e9d670 |
class ProcLoadavg(SingleLineFile): <NEW_LINE> <INDENT> fields = (("load1", float), ("load5", float), ("load15", float)) | Parse :file:`/proc/loadavg`. | 6259906e8e7ae83300eea8fb |
class SparseBinnedObjects(object): <NEW_LINE> <INDENT> def __init__(self, positioned_objects, gridsize=1): <NEW_LINE> <INDENT> self.gridsize = gridsize <NEW_LINE> self.reciproke = 1/gridsize <NEW_LINE> self.bins = {} <NEW_LINE> for positioned_object in positioned_objects: <NEW_LINE> <INDENT> indices = tuple(numpy.floor... | A SparseBinnedObjects instance divides 3D space into a sparse grid.
Each cell in the grid is called a bin. Each bin can contain a set of
Positioned objects. This implementation works with sparse bins: A bin is
only created in memory when an object is encountered that belongs in that
bin.
All bins are uniquely defined... | 6259906e55399d3f05627d8d |
class FeedNotFoundError(Exception): <NEW_LINE> <INDENT> pass | Raised when page does not exist any feed | 6259906e16aa5153ce401d45 |
class SessionModel(db.Model): <NEW_LINE> <INDENT> pdump = db.BlobProperty() | Contains session data. key_name is the session ID and pdump contains a
pickled dictionary which maps session variables to their values. | 6259906e99cbb53fe6832753 |
class DependencyKind(object): <NEW_LINE> <INDENT> undefined = 0 <NEW_LINE> http_only = 1 <NEW_LINE> http_any = 2 <NEW_LINE> sql = 3 | Data contract class for type DependencyKind. | 6259906e97e22403b383c76f |
class DevfreqOutPower(Base): <NEW_LINE> <INDENT> name = "devfreq_out_power" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(DevfreqOutPower, self).__init__( unique_word="thermal_power_devfreq_limit:", ) <NEW_LINE> <DEDENT> def get_all_freqs(self): <NEW_LINE> <INDENT> return pd.DataFrame(self.data_frame["freq"]... | Process de devfreq cooling device data regarding power2state in an
ftrace dump | 6259906e76e4537e8c3f0def |
class Normalise(object): <NEW_LINE> <INDENT> def __init__(self, scale, mean, std, depth_scale=1.0): <NEW_LINE> <INDENT> self.scale = scale <NEW_LINE> self.mean = mean <NEW_LINE> self.std = std <NEW_LINE> self.depth_scale = depth_scale <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> sample["image"] =... | Normalise a tensor image with mean and standard deviation.
Given mean: (R, G, B) and std: (R, G, B),
will normalise each channel of the torch.*Tensor, i.e.
channel = (scale * channel - mean) / std
Args:
scale (float): Scaling constant.
mean (sequence): Sequence of means for R,G,B channels respecitvely.
std... | 6259906ebaa26c4b54d50b15 |
class RandomColor(Operation): <NEW_LINE> <INDENT> def __init__(self, probability, min_factor, max_factor): <NEW_LINE> <INDENT> Operation.__init__(self, probability) <NEW_LINE> self.min_factor = min_factor <NEW_LINE> self.max_factor = max_factor <NEW_LINE> <DEDENT> def perform_operation(self, images): <NEW_LINE> <INDENT... | This class is used to random change saturation of an image. | 6259906e167d2b6e312b81c4 |
class export_task(): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self.signature = args <NEW_LINE> <DEDENT> def __call__(self, m): <NEW_LINE> <INDENT> global _export_info_l <NEW_LINE> info = BfmMethodInfo(m, self.signature) <NEW_LINE> info.id = len(_export_info_l) <NEW_LINE> _export_info_l.append(... | Identifies a BFM-class method that can be called from the HDL | 6259906e8a43f66fc4bf39ff |
class CNN(CNNBase): <NEW_LINE> <INDENT> def __init__(self, mean, std, gpu, channel_list, dc_channel_list, ksize_list, dc_ksize_list, inter_list, last_list, pad_list): <NEW_LINE> <INDENT> super(CNN, self).__init__(mean, std, gpu) <NEW_LINE> if len(ksize_list) > 0 and len(dc_ksize_list) == 0: <NEW_LINE> <INDENT> dc_ksize... | Baseline: location only | 6259906e4c3428357761bb1f |
class echoList_result: <NEW_LINE> <INDENT> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <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.thrift_spec is not None: <NEW_LINE... | Attributes:
- success | 6259906e21bff66bcd7244d3 |
class Author(models.Model): <NEW_LINE> <INDENT> first_name = models.CharField(max_length=100) <NEW_LINE> last_name = models.CharField(max_length=100) <NEW_LINE> date_of_birth = models.DateField(null=True, blank=True) <NEW_LINE> date_of_death = models.DateField('died', null=True, blank=True) <NEW_LINE> def get_absolute_... | Model representing an author. | 6259906ecb5e8a47e493cdb8 |
class ConsistentTreesHlistArbor(RockstarArbor): <NEW_LINE> <INDENT> _has_uids = True <NEW_LINE> _field_info_class = ConsistentTreesFieldInfo <NEW_LINE> _data_file_class = ConsistentTreesHlistDataFile <NEW_LINE> def _parse_parameter_file(self): <NEW_LINE> <INDENT> ConsistentTreesArbor._parse_parameter_file( self, ntrees... | Class for Arbors created from consistent-trees hlist_*.list files.
This is a hybrid type with multiple catalog files like the rockstar
frontend, but with headers structured like consistent-trees. | 6259906e7d847024c075dc4a |
class ObjectTypeFlags(Enum): <NEW_LINE> <INDENT> OBJECT = 1 << 0 <NEW_LINE> ITEM = 1 << 1 <NEW_LINE> CONTAINER = 1 << 2 <NEW_LINE> UNIT = 1 << 3 <NEW_LINE> PLAYER = 1 << 4 <NEW_LINE> GAME_OBJECT = 1 << 5 <NEW_LINE> DYNAMIC_OBJECT = 1 << 6 <NEW_LINE> CORPSE = 1 << 7 | BaseObject descriptors "flags" (field 0x8). | 6259906e99cbb53fe6832754 |
class TestFixGridOrca025U(NcoDataFixBaseTest): <NEW_LINE> <INDENT> def test_subprocess_called_correctly(self): <NEW_LINE> <INDENT> fix = FixGridOrca025U('uo_1.nc', '/a') <NEW_LINE> fix.apply_fix() <NEW_LINE> calls = [ mock.call( "ncks -h --no_alphabetize -3 /a/uo_1.nc /a/uo_1.nc.temp", stderr=subprocess.STDOUT, shell=T... | Test FixGridOrca025U | 6259906e44b2445a339b7595 |
@register_df_node <NEW_LINE> class AttrPattern(DFPattern): <NEW_LINE> <INDENT> def __init__(self, pattern: "DFPattern", attrs: tvm.ir.attrs.Attrs): <NEW_LINE> <INDENT> self.__init_handle_by_constructor__(ffi.AttrPattern, pattern, attrs) | Get match an expression with a certain attributes.
Currently only supports Op Attributes, not call Attributes.
Parameters
----------
pattern: tvm.relay.dataflow_pattern.DFPattern
The input pattern.
attrs: tvm.ir.attrs.Attrs
The attributes to match. | 6259906e97e22403b383c770 |
class REPL(commands.Cog): <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self._last_result = None <NEW_LINE> self.sessions = set() <NEW_LINE> <DEDENT> async def __local_check(self, ctx): <NEW_LINE> <INDENT> return await self.bot.is_owner(ctx.author) <NEW_LINE> <DEDENT> def cl... | Admin-only commands that make the bot dynamic. | 6259906e16aa5153ce401d47 |
class PeriodSpecTest(unittest.TestCase): <NEW_LINE> <INDENT> @unittest.skip("Period spec not covered") <NEW_LINE> def test_period_spec(self): <NEW_LINE> <INDENT> period = Period(id='0', start=None, duration=None) | from ISO/IEC 23009-1:
Overview:
A Media Presentation consists of one or more Periods. A Period is defined by a Period element in the MPD element.
- Each Period contains one or more Adaptation Sets as described in 5.3.3.
- Each Period may contain one or more Subsets that restrict combination of Adaptation Sets for p... | 6259906e97e22403b383c771 |
class FoundAttachment(FoundPage): <NEW_LINE> <INDENT> def __init__(self, page_name, attachment, matches=None, page=None, rev=0): <NEW_LINE> <INDENT> self.page_name = page_name <NEW_LINE> self.attachment = attachment <NEW_LINE> self.rev = rev <NEW_LINE> self.page = page <NEW_LINE> if matches is None: <NEW_LINE> <INDENT>... | Represents an attachment in search results | 6259906e283ffb24f3cf5116 |
class RpcZmqEnvelopeEnabledTestCase(_RpcZmqBaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(RpcZmqEnvelopeEnabledTestCase, self).setUp() <NEW_LINE> self.stubs.Set(rpc_common, '_SEND_RPC_ENVELOPE', True) | This sends messages with envelopes enabled. | 6259906e99fddb7c1ca63a08 |
class Phantom(Shape): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def draw(self,centroid,color): <NEW_LINE> <INDENT> pass | Dummy | 6259906e63b5f9789fe869d0 |
class ShareForm(ModelForm): <NEW_LINE> <INDENT> url = forms.URLField(label=u'链接',widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': u'链接', 'required': ''})) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Share <NEW_LINE> fields = ('title', 'url') <NEW_LINE> widgets = { 'title': forms.TextInput(at... | 添加分享链接 | 6259906ecb5e8a47e493cdb9 |
class SleepInMultiInput(BaseTestClass): <NEW_LINE> <INDENT> def _initialize(self): <NEW_LINE> <INDENT> self.__data = connectors.MultiInputData() <NEW_LINE> <DEDENT> @connectors.MultiInput("get_values", parallelization=connectors.Parallelization.THREAD) <NEW_LINE> def add_value(self, value): <NEW_LINE> <INDENT> time.sle... | Sleeps one second, when the multi-input connector is executed | 6259906e2ae34c7f260ac958 |
class Populaire(EventMixin, Base): <NEW_LINE> <INDENT> __tablename__ = 'populaires' <NEW_LINE> event_name = Column(Text) <NEW_LINE> short_name = Column(Text, index=True) <NEW_LINE> distance = Column(Text) <NEW_LINE> start_locn = Column(Text) <NEW_LINE> start_map_url = Column(Text) <NEW_LINE> entry_form_url = Column(Tex... | Populaire event.
| 6259906ebf627c535bcb2d39 |
class Expr(stmt): <NEW_LINE> <INDENT> _fields = ("value",) | An expression in statement context. The value of expression is discarded.
:ivar value: (:class:`expr`) value | 6259906e5fc7496912d48ea0 |
class FacebookFriend(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, verbose_name=_(u'User')) <NEW_LINE> facebook_id = models.BigIntegerField(_(u'Facebook id')) <NEW_LINE> name = models.CharField(_(u'Name'), max_length=128, blank=True, null=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = '... | Abstract base class for Facebook user profile | 6259906e7d43ff2487428049 |
class TestPNG(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.png = image_png.PngReader <NEW_LINE> self.out = sys.stdout <NEW_LINE> sys.stdout = FakeStdOut() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> sys.stdout = self.out <NEW_LINE> <DEDENT> def test_png_01(self): <NE... | testuje korektní načítání podmnožiny PNG-obrázků | 6259906ee5267d203ee6cff4 |
class TestLinkedList(unittest.TestCase): <NEW_LINE> <INDENT> def test_empty_list(self): <NEW_LINE> <INDENT> ll = LinkedList() <NEW_LINE> self.assertEqual(str(ll), "") <NEW_LINE> <DEDENT> def test_single_node(self): <NEW_LINE> <INDENT> ll = LinkedList(1) <NEW_LINE> self.assertEquals(str(ll), "1") <NEW_LINE> <DEDENT> def... | This is the absolute vanilla linked list implementation
I can print the list
I can add a node to the front of the list
I can create a list | 6259906ea8370b77170f1c36 |
class Efm8HidPort(hidport.HidPort): <NEW_LINE> <INDENT> SIZE_IN = 4 <NEW_LINE> SIZE_OUT = 64 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(Efm8HidPort, self).__init__() <NEW_LINE> if sys.platform == 'win32': <NEW_LINE> <INDENT> self.make_report = lambda r: b'\x00' + r <NEW_LINE> <DEDENT> else: <NEW_LINE> <IN... | Class demonstrates how to communicate with EFM8 HID bootloader.
This class provides functions for writing a boot frame and for reading
the response from the EFM8 HID bootloader. Because the EFM8 HID device
only defines one input and one output report, there is no report number.
For Windows hosts only, read/write dat... | 6259906ea8370b77170f1c37 |
class ArchiveViewlet(ViewletBase): <NEW_LINE> <INDENT> def update(self): <NEW_LINE> <INDENT> info = queryAdapter(self.context, IObjectArchivator) or queryAdapter(self.context, IObjectArchivator, name='annotation_storage_dexterity') <NEW_LINE> rv = NamedVocabulary('eea.workflow.reasons') <NEW_LINE> vocab = rv... | Viewlet that appears only when the object is archived
| 6259906e9c8ee82313040dbf |
class EmployeeUpdateView(LoginRequiredMixin, UpdateView): <NEW_LINE> <INDENT> model = Employee <NEW_LINE> template_name = 'profiles/employee/update.html' <NEW_LINE> form_class = EmployeeUpdateForm <NEW_LINE> login_url = reverse_lazy('users_app:login') <NEW_LINE> success_url = reverse_lazy('profiles_app:employee-list') ... | vista para actualizar datos de Empleados | 6259906e442bda511e95d98f |
class Exists(FunctionalTest): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT> build_address(id=5) <NEW_LINE> db.session.commit() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def teardown_class(cls): <NEW_LINE> <INDENT> delete_addresses() <NEW_LINE> db.session.commit() <NEW_LINE> <DE... | Check if the webservice exists | 6259906e0c0af96317c57995 |
class QtMpl (FigureCanvasQTAgg): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> self.fig = matplotlib.figure.Figure() <NEW_LINE> self.fig.gca().xaxis.set_major_formatter(mdates.DateFormatter('%m/%d/%Y')) <NEW_LINE> self.fig.gca().xaxis.set_major_locator(mdates.DayLocator()) <NEW_LINE> FigureCanvasQ... | This class will plot a figure on the UI window | 6259906e7b25080760ed891a |
class Plan(GitHubObject): <NEW_LINE> <INDENT> def __init__(self, plan): <NEW_LINE> <INDENT> super(Plan, self).__init__(plan) <NEW_LINE> self.collaborators = plan.get('collaborators') <NEW_LINE> self.name = plan.get('name') <NEW_LINE> self.private_repos = plan.get('private_repos') <NEW_LINE> self.space = plan.get('space... | The :class:`Plan <Plan>` object. This makes interacting with the plan
information about a user easier. Please see GitHub's `Authenticated User
<http://developer.github.com/v3/users/#get-the-authenticated-user>`_
documentation for more specifics. | 6259906ef548e778e596cdfc |
class LibxdoKeyboard(BaseX11Keyboard): <NEW_LINE> <INDENT> _log = logging.getLogger("keyboard") <NEW_LINE> display = Xlib.display.Display() <NEW_LINE> libxdo = xdo.Xdo(os.environ.get('DISPLAY', '')) <NEW_LINE> @classmethod <NEW_LINE> def send_keyboard_events(cls, events): <NEW_LINE> <INDENT> cls._log.debug("Keyboard.se... | Static class for typing keys with python-libxdo. | 6259906ed486a94d0ba2d82e |
class IsSuperuser(BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> return is_superuser(request.user) | Only superusers are authorised | 6259906efff4ab517ebcf089 |
class SlicedPepperoni(Pepperoni): <NEW_LINE> <INDENT> pass | 薄切りペパロニ | 6259906e32920d7e50bc78b6 |
class itkMaskImageFilterIRGBAUS3IUC3IRGBAUS3_Superclass(itkInPlaceImageFilterAPython.itkInPlaceImageFilterIRGBAUS3IRGBAUS3): <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("N... | Proxy of C++ itkMaskImageFilterIRGBAUS3IUC3IRGBAUS3_Superclass class | 6259906e1b99ca400229016d |
class Action(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> actor = db.Column(db.String(20)) <NEW_LINE> action = db.Column(db.String(500)) <NEW_LINE> status = db.Column(db.String(20)) <NEW_LINE> edited_time = db.Column(db.DateTime, default=datetime.datetime.utcnow) | Class for storing user variant log. | 6259906e76e4537e8c3f0df3 |
class DPTControllerStatus(DPTBase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_knx(cls, raw): <NEW_LINE> <INDENT> cls.test_bytesarray(raw, 1) <NEW_LINE> if raw[0] & 8 > 0: <NEW_LINE> <INDENT> return HVACOperationMode.FROST_PROTECTION <NEW_LINE> <DEDENT> if raw[0] & 4 > 0: <NEW_LINE> <INDENT> return HVACOperat... | Abstraction for KNX HVAC Controller status.
Non-standardised DP type (in accordance with KNX AN 097/07 rev 3).
Help needed:
The values of this type were retrieved by reverse engineering. Any
notes on the correct implementation of this type are highly appreciated. | 6259906e167d2b6e312b81c6 |
class WebrootBase(object): <NEW_LINE> <INDENT> exposed = True <NEW_LINE> def __init__(self, templatePath): <NEW_LINE> <INDENT> self.vars = {} <NEW_LINE> self.config = config.getConfig() <NEW_LINE> self._templateDirs = [] <NEW_LINE> self.setTemplatePath(templatePath) <NEW_LINE> <DEDENT> def updateHtmlVars(self, vars): <... | Serves a template file in response to GET requests.
This will typically be the base class of any non-API endpoints. | 6259906e460517430c432c8e |
class Resource: <NEW_LINE> <INDENT> def __init__(self, name, resource_type, resource_id, status, status_reason): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type = resource_type <NEW_LINE> self.id = resource_id <NEW_LINE> self.status = status <NEW_LINE> self.status_reason = status_reason | SNAPS domain object for a resource created by a heat template | 6259906e63b5f9789fe869d2 |
class AccountSettingsView(LoginRequiredMixin, generic.DetailView): <NEW_LINE> <INDENT> model = User <NEW_LINE> template_name = 'accounts/account_settings.html' | Account settings view. Accessible only to owner. Staff will
have access to modify settings here, but through the admin console
app. | 6259906e5fcc89381b266d8f |
class ElementWrapper(object): <NEW_LINE> <INDENT> in_html_document = False <NEW_LINE> def __init__(self, obj): <NEW_LINE> <INDENT> self.object = obj <NEW_LINE> <DEDENT> @property <NEW_LINE> def id(self): <NEW_LINE> <INDENT> return self.object.attrib.get('id') <NEW_LINE> <DEDENT> @property <NEW_LINE> def etree_element(s... | lxml element wrapper to partially match the API from cssselect2.ElementWrapper
so as element can be passed to rules.match(). | 6259906e26068e7796d4e1ab |
class Raja(CMakePackage): <NEW_LINE> <INDENT> homepage = "http://software.llnl.gov/RAJA/" <NEW_LINE> version('develop', git='https://github.com/LLNL/RAJA.git', branch="master", submodules="True") <NEW_LINE> depends_on('cmake@3.3:', type='build') | RAJA Parallel Framework. | 6259906e7d847024c075dc4e |
class ExpiredOAuthTokenError(Exception): <NEW_LINE> <INDENT> pass | Raised when an expired L{OAuthAccessToken} or L{OAuthRenewalToken} is used
in a request. | 6259906eb7558d5895464b6a |
class NoNorm(Normalize): <NEW_LINE> <INDENT> def __call__(self, value, clip=None): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> def inverse(self, value): <NEW_LINE> <INDENT> return value | Dummy replacement for `Normalize`, for the case where we want to use
indices directly in a `~matplotlib.cm.ScalarMappable`. | 6259906e7b180e01f3e49c9c |
@attr('UNIT', group='mi') <NEW_LINE> class TestConfig(MiUnitTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> Config().cm.destroy() <NEW_LINE> if not exists(ROOTDIR): <NEW_LINE> <INDENT> makedirs(ROOTDIR) <NEW_LINE> <DEDENT> if exists(self.config_file()): <NEW_LINE> <INDENT> log.debug("remove test dir %s"... | Test the config object. | 6259906e4c3428357761bb23 |
class Vocabulary(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._token_to_id = {} <NEW_LINE> self._token_to_count = collections.Counter() <NEW_LINE> self._id_to_token = [] <NEW_LINE> self._num_tokens = 0 <NEW_LINE> self._total_count = 0 <NEW_LINE> self._s_id = None <NEW_LINE> self._unk_id = N... | A dictionary for words.
Adapeted from @rafaljozefowicz's implementation. | 6259906ea8370b77170f1c38 |
class TypeQuantity(object): <NEW_LINE> <INDENT> def __init__(self, typeid, quantity): <NEW_LINE> <INDENT> self.typeid = typeid <NEW_LINE> self.quantity = quantity | represents a typed lump of stuff from eve. generated and consumed by jobs and market orders | 6259906e3d592f4c4edbc751 |
class ExecuteWorker(Worker): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ExecuteWorker, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def process_task(self, task): <NEW_LINE> <INDENT> print("-----------------------") <NEW_LINE> print("Working on task: {0}".format(task.id)) <... | Executes a job locally, all tasks provided by its iterator.
Tasks are assumed to have input parameters. It creates a new input, output
and temporary directory for each tasks, and attaches files that are
generated in the output directory to the task when the task is finished.
If the command exits with non-zero, the ta... | 6259906e99cbb53fe6832759 |
class Spine: <NEW_LINE> <INDENT> def __init__(self, parent_axes, transform): <NEW_LINE> <INDENT> self.parent_axes = parent_axes <NEW_LINE> self.transform = transform <NEW_LINE> self.data = None <NEW_LINE> self.pixel = None <NEW_LINE> self.world = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> ... | A single side of an axes.
This does not need to be a straight line, but represents a 'side' when
determining which part of the frame to put labels and ticks on. | 6259906e55399d3f05627d93 |
class Interpellation(Act): <NEW_LINE> <INDENT> ANSWER_TYPES = Choices( ('WRITTEN', 'written', _('Written')), ('VERBAL', 'verbal', _('Verbal')), ) <NEW_LINE> FINAL_STATUSES = ( ('ANSWERED', _('answered')), ('NOTANSWERED', _('not answered')), ) <NEW_LINE> STATUS = Choices( ('PRESENTED', 'presented', _('presented')), ('AN... | WRITEME | 6259906e56ac1b37e630391b |
class Field(object, metaclass=FieldBase): <NEW_LINE> <INDENT> def __init__(self, pk=False, required=False, hidden=False): <NEW_LINE> <INDENT> self.pk = pk <NEW_LINE> self.required = required <NEW_LINE> self.hidden = hidden <NEW_LINE> <DEDENT> def consume(self, prev, data): <NEW_LINE> <INDENT> return data <NEW_LINE> <DE... | Field base class. All other fields inherit from this class, so usually you
want to use one of the more specialized fields. However, there might be
cases where you wanna store an arbitrary value that does not fit well into
any other standard field, and in that case you could use Field to store any
value. | 6259906efff4ab517ebcf08b |
class LineReader(object): <NEW_LINE> <INDENT> def __init__(self, src): <NEW_LINE> <INDENT> self.lines = src.readlines() <NEW_LINE> self.line_cnt = 0 <NEW_LINE> <DEDENT> def getline(self): <NEW_LINE> <INDENT> ls = cleanline(self.lines[self.line_cnt]).split() <NEW_LINE> self.line_cnt += 1 <NEW_LINE> return CommandLine(ls... | Read linear command from file
| 6259906e38b623060ffaa48c |
class TestPieceWiseConstant(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.particles = HydroParticleCreator(num=2, dim=2) <NEW_LINE> self.recon = PieceWiseConstant() <NEW_LINE> <DEDENT> def test_add_fields(self): <NEW_LINE> <INDENT> particles = CarrayContainer(1, {"wrong_type": "int"}... | Tests for the constant reconstruction class. | 6259906e1f5feb6acb164462 |
class CourseBookmarksView(View): <NEW_LINE> <INDENT> @method_decorator(login_required) <NEW_LINE> @method_decorator(ensure_csrf_cookie) <NEW_LINE> @method_decorator(cache_control(no_cache=True, no_store=True, must_revalidate=True)) <NEW_LINE> @method_decorator(ensure_valid_course_key) <NEW_LINE> def get(self, request, ... | View showing the user's bookmarks for a course. | 6259906e56b00c62f0fb413f |
class QlearnDeepAgent(QlearnTabularAgent): <NEW_LINE> <INDENT> def __init__(self, env, nb_episodes=1, epsilon=0.1, learning_rate=0.1, discount=1, verbose=False, nb_hidden_1=100, nb_hidden_2=100, activation='relu', optim='SGD'): <NEW_LINE> <INDENT> self.nb_hidden_1 = nb_hidden_1 <NEW_LINE> self.nb_hidden_2 = nb_hidden_2... | Q-Learning with a neural network model
observation space : continuous
action space : discrete | 6259906ecb5e8a47e493cdbb |
class UserUpdateMe(UserBase): <NEW_LINE> <INDENT> email: Optional[EmailStr] <NEW_LINE> first_name: Optional[str] <NEW_LINE> last_name: Optional[str] <NEW_LINE> password: Optional[str] | Properties to receive via API on update of current user. | 6259906e7b180e01f3e49c9d |
class IS_UUR(Validator): <NEW_LINE> <INDENT> def __init__(self, error_message="Uur (UU:MM) foutief !"): <NEW_LINE> <INDENT> self.error_message = error_message <NEW_LINE> <DEDENT> def __call__(self, uur): <NEW_LINE> <INDENT> error = None <NEW_LINE> if not self.valideer_lengte(uur): <NEW_LINE> <INDENT> error = self.error... | Valideer of een uur geldig is.
Formaat : UU:MM
Geldige waarden :
- uren : tussen 00 en 23
- minuten : tussen 00 en 59 | 6259906ebe8e80087fbc0901 |
class FailedToCreatePath(AsyncV20Exception): <NEW_LINE> <INDENT> pass | Unable to construct the path for the requested endpoint | 6259906e3317a56b869bf17d |
class AsyncMsg(object): <NEW_LINE> <INDENT> def __init__(self, element, msgType): <NEW_LINE> <INDENT> self.src_ne = element <NEW_LINE> self.msg_type = msgType <NEW_LINE> <DEDENT> def do_event(self, source): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> OnepAsyncMsgType = enum('ONEP_ASYNC_MESSAGE_TYPE_APICALL', 'ONEP_ASY... | This abstract class is meant to be implemented by a any class acting as a
event object. | 6259906e4c3428357761bb25 |
class ShapeOptimizer(Optimizer): <NEW_LINE> <INDENT> def add_requirements(self, fgraph): <NEW_LINE> <INDENT> fgraph.attach_feature(ShapeFeature()) <NEW_LINE> <DEDENT> def apply(self, fgraph): <NEW_LINE> <INDENT> pass | Optimizer that serves to add ShapeFeature as an fgraph feature. | 6259906ea8370b77170f1c3a |
class ConfigDirective(Directive): <NEW_LINE> <INDENT> def add_line(self, line: str, source: str, *lineno: int) -> None: <NEW_LINE> <INDENT> self.result.append(line, source, *lineno) <NEW_LINE> <DEDENT> def generate_docs( self, component_name: str, component_index: str, docstring: str, sourcename: str, option_data: List... | Base class for generating configuration | 6259906e3d592f4c4edbc753 |
class SSHPower(base.PowerInterface): <NEW_LINE> <INDENT> def validate(self, node): <NEW_LINE> <INDENT> _parse_driver_info(node) <NEW_LINE> <DEDENT> def get_power_state(self, task, node): <NEW_LINE> <INDENT> driver_info = _parse_driver_info(node) <NEW_LINE> driver_info['macs'] = _get_nodes_mac_addresses(task, node) <NEW... | SSH Power Interface.
This PowerInterface class provides a mechanism for controlling the power
state of virtual machines via SSH.
NOTE: This driver supports VirtualBox and Virsh commands.
NOTE: This driver does not currently support multi-node operations. | 6259906e009cb60464d02da9 |
class Solution2(object): <NEW_LINE> <INDENT> def isSymmetric(self, root): <NEW_LINE> <INDENT> if root == None: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> stack1 = [root.left] <NEW_LINE> stack2 = [root.right] <NEW_LINE> while len(stack1) != 0 and len(stack2) != 0: <NEW_LINE> <INDENT> t1 = stack1.pop(0) <NEW_LIN... | use two queues,
one for left half tree, other for right half tree.
queue 1, enqueue from left to right,
queue 2, enqueue from right to left,
then two queue should be same. | 6259906ef548e778e596cdff |
class MsgLauncher2Portal(amp.Command): <NEW_LINE> <INDENT> key = "MsgLauncher2Portal" <NEW_LINE> arguments = [('operation', amp.String()), ('arguments', amp.String())] <NEW_LINE> errors = {Exception: 'EXCEPTION'} <NEW_LINE> response = [] | Message Launcher -> Portal | 6259906e9c8ee82313040dc1 |
class ComponentEditFrame(wx.Frame): <NEW_LINE> <INDENT> def __init__(self, parent, title): <NEW_LINE> <INDENT> super(ComponentEditFrame, self).__init__(parent, title=title, size=(600, 400)) <NEW_LINE> self.Centre() <NEW_LINE> self.panel = CompEditPanel(self) <NEW_LINE> self.panel.SetBackgroundColour("gray") <NEW_LINE> ... | Platform Component Edit window. | 6259906ee1aae11d1e7cf445 |
class SymbolData: <NEW_LINE> <INDENT> def __init__(self, symbol, macd): <NEW_LINE> <INDENT> self.Symbol = symbol <NEW_LINE> self.MACD = macd | Contains data specific to a symbol required by this model | 6259906e71ff763f4b5e901b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.