code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Command(BaseCommand): <NEW_LINE> <INDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> config = Configuration.load() <NEW_LINE> data = config.get_request_data() <NEW_LINE> headers = { 'Content-Type': 'application/json' } <NEW_LINE> r = requests.post( '{}/setup-client'.format(config.oxd_host), data=json...
Setup oxd client from oxd configuration in oxd.Configuration model.
62598f9416aa5153ce4001b9
class Lesson(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=300, help_text="Lesson title") <NEW_LINE> slug = models.SlugField(max_length=100, help_text="short-title-with-hyphens") <NEW_LINE> course = models.ForeignKey(Course) <NEW_LINE> description = models.TextField(max_lengt...
This is the main unit of content that will be distributed according to a schedule A lesson is part of a Course A lesson consists of many Chunks A lesson is associated with a User (student role) via a Schedule
62598f94dd821e528d6d8bf2
class Man(Person): <NEW_LINE> <INDENT> def __init__(self,name): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._age = 20 <NEW_LINE> <DEDENT> def reset_age(self): <NEW_LINE> <INDENT> self._age = 20 <NEW_LINE> <DEDENT> def incr_age(self): <NEW_LINE> <INDENT> self._age = self._age + 10 <NEW_LINE> <DEDENT> def get_n...
Class to represent a man
62598f94e64d504609df9215
class LanguageSource(Base, Versioned): <NEW_LINE> <INDENT> __table_args__ = (UniqueConstraint('language_pk', 'source_pk'),) <NEW_LINE> language_pk = Column(Integer, ForeignKey('language.pk')) <NEW_LINE> source_pk = Column(Integer, ForeignKey('source.pk'))
Association table.
62598f9407d97122c421696e
class GetFilenameFromTemporaryFromFar(OpenFromFar): <NEW_LINE> <INDENT> def __init__(self, far_file, far_stream): <NEW_LINE> <INDENT> OpenFromFar.__init__(self, far_file, far_stream) <NEW_LINE> self.content = dict((e.lower(), e) for e in self.far_file.filenames) <NEW_LINE> <DEDENT> def __call__(self, fullname): <NEW_LI...
case-insensitive! Extracts file into temporary file and returns its filename Relevant to load textures into Blender
62598f94287bf620b627187c
class Sigma(PhysCoefficient): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.omega = kwargs.pop('omega', 1.0) <NEW_LINE> super(Sigma, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def EvalValue(self, x): <NEW_LINE> <INDENT> v = super(Sigma, self).EvalValue(x) <NEW_LINE> v = -1j ...
-1j * omega * sigma
62598f948e71fb1e983bb771
class Blocker: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._count = 0 <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self._count += 1 <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> self._count -= 1 <NEW_LINE> <DEDENT> def blocked(self): <NEW_LINE> <INDENT> return s...
Object which can be used to temporarily block the execution of a body of code. This object is a context manager, and enters a 'blocked' state when used in a 'with' statement. The 'blocked()' method can be used to find if the Blocker is in this 'blocked' state. For example, this is used to prevent UI code from handling...
62598f9485dfad0860cbf8d2
class StyleDefinition(object): <NEW_LINE> <INDENT> def __init__(self, name, style, default_highlight, icon_path, minimap): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.color = style.get("color", default_highlight["color"]) <NEW_LINE> self.style = select_bracket_style(style.get("style", default_highlight["style"...
Styling definition.
62598f94097d151d1a2c0ce9
class TestFileOpe(unittest.TestCase): <NEW_LINE> <INDENT> def test_delete_file_on_desktop_success(self): <NEW_LINE> <INDENT> desktop_path = '/Users/matsukado/Desktop/hello_world.txt' <NEW_LINE> expected = False <NEW_LINE> self.assertTrue(os.path.isfile(desktop_path)) <NEW_LINE> file_ope.delete_file_on_desktop() <NEW_LI...
test module of file_ope
62598f9445492302aabfc196
class Critic(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fcs1_units=64, fc2_units=64): <NEW_LINE> <INDENT> super(Critic, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.bn1 = nn.BatchNorm1d(state_size) <NEW_LINE> self.fcs1 = nn.Linear(state_size, fcs...
Critic Model: implements DQV.
62598f9407d97122c421696f
class PluginConfig(MMCConfigParser): <NEW_LINE> <INDENT> USERDEFAULT = "userdefault" <NEW_LINE> HOOKS = "hooks" <NEW_LINE> SERVICE = "service" <NEW_LINE> def __init__(self, name, conffile = None): <NEW_LINE> <INDENT> MMCConfigParser.__init__(self) <NEW_LINE> self.name = name <NEW_LINE> self.userDefault = {} <NEW_LINE> ...
Class to hold a MMC agent plugin configuration
62598f94d53ae8145f91814a
class Fasta(object): <NEW_LINE> <INDENT> def __init__(self, reader): <NEW_LINE> <INDENT> self.reader = reader <NEW_LINE> self._length = None <NEW_LINE> self.fasta = '' <NEW_LINE> <DEDENT> @property <NEW_LINE> def length(self): <NEW_LINE> <INDENT> if self._length is None: <NEW_LINE> <INDENT> for item in self.reader.item...
keeps the whole fasta in memory for random access
62598f9432920d7e50bc5d1e
class SingleClickMode (InteractionMode): <NEW_LINE> <INDENT> cursor = None <NEW_LINE> def __init__(self, ignore_modifiers=False, **kwds): <NEW_LINE> <INDENT> super(SingleClickMode, self).__init__(**kwds) <NEW_LINE> self._button_pressed = None <NEW_LINE> <DEDENT> def enter(self, doc, **kwds): <NEW_LINE> <INDENT> super(S...
Base class for non-drag (single click) modes
62598f943617ad0b5ee05e0a
class GetWebcfgCommand(Command): <NEW_LINE> <INDENT> command_spec = { COMMAND_NAME : 'getwebcfg', COMMAND_NAME_ALIASES : [], MIN_ARGS : 1, MAX_ARGS : 1, SUPPORTED_SUB_ARGS : '', FILE_URIS_OK : False, PROVIDER_URIS_OK : False, URIS_START_ARG : 1, CONFIG_REQUIRED : True, } <NEW_LINE> help_spec = { HELP_NAME : 'getwebcfg'...
Implementation of gsutil getwebcfg command.
62598f943cc13d1c6d46542b
class ModifyScanConfigSetComment(graphene.Mutation): <NEW_LINE> <INDENT> class Arguments: <NEW_LINE> <INDENT> input_object = ModifyScanConfigSetCommentInput( required=True, name='input' ) <NEW_LINE> <DEDENT> ok = graphene.Boolean() <NEW_LINE> @staticmethod <NEW_LINE> @require_authentication <NEW_LINE> def mutate(_root,...
Modify comment of a scan config Args: input (ModifyScanConfigSetCommentInput): Input object for ModifyScanConfigSetComment. Example: .. code-block:: mutation { modifyScanConfigSetComment(input:{ id: "24f0ebae-fe78-4088-bc01-96bfb2eebe83", comment:"N...
62598f94004d5f362081ee5b
class ReadMetadata(beam.PTransform): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> super(ReadMetadata, self).__init__() <NEW_LINE> self._path = path <NEW_LINE> <DEDENT> def expand(self, pvalue): <NEW_LINE> <INDENT> return metadata_io.read_metadata(self._path)
A PTransform to read Metadata from disk.
62598f949b70327d1c57ea60
class CancelOrStopIntentHandler(AbstractRequestHandler): <NEW_LINE> <INDENT> def can_handle(self, handler_input): <NEW_LINE> <INDENT> return (ask_utils.is_intent_name("AMAZON.CancelIntent")(handler_input) or ask_utils.is_intent_name("AMAZON.StopIntent")(handler_input)) <NEW_LINE> <DEDENT> def handle(self, handler_input...
Single handler for Cancel and Stop Intent.
62598f94435de62698e9bab1
class mac_list_kauth_listeners(kauth_scopes.mac_list_kauth_scopes): <NEW_LINE> <INDENT> def render_text(self, outfd, data): <NEW_LINE> <INDENT> common.set_plugin_members(self) <NEW_LINE> self.table_header(outfd, [("Offset", "[addrpad]"), ("Scope", "24"), ("IData", "[addrpad]"), ("Callback Addr", "[addrpad]"), ("Callbac...
Lists Kauth Scope listeners
62598f94b830903b9686e2d3
class ButtonsToken(ProgramToken): <NEW_LINE> <INDENT> def execute(self, env): <NEW_LINE> <INDENT> return env.buttons <NEW_LINE> <DEDENT> @property <NEW_LINE> def return_type(self): <NEW_LINE> <INDENT> return ElementSet <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Buttons()" <NEW_LINE> <DEDENT> __r...
Executes to the set of all buttons (ElementSet).
62598f94a17c0f6771d5befa
class BasicRuleset(Ruleset): <NEW_LINE> <INDENT> MAXIMUM_PLAYER_COUNT = 1 <NEW_LINE> DECK_COUNT_IN_SHOE = 1 <NEW_LINE> AUTO_SHUFFLING_SHOE = False <NEW_LINE> MINIMUM_WAGER = 1 <NEW_LINE> DEALER_RECEIVES_HOLE_CARD = False <NEW_LINE> DEALER_REVEALS_BLACKJACK_HAND = None <NEW_LINE> BLACKJACK_PAYOUT_RATIO = 2/1
The most simple set of rules.
62598f9410dbd63aa1c70878
class AzureAsyncOperationResult(Model): <NEW_LINE> <INDENT> _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'error': {'key': 'error', 'type': 'Error'}, } <NEW_LINE> def __init__(self, status=None, error=None): <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.error = error
The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response bod...
62598f941b99ca400228f38c
class HeaderInvalidType(VCFPyWarning): <NEW_LINE> <INDENT> pass
Raised when compound header has invalid type
62598f947cff6e4e811b56dc
class Worker(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.from_current_project = config.from_current_project <NEW_LINE> self.source_project_path = config.source_project_path <NEW_LINE> self.server_output_path = config.server_output_path <NEW_LINE> self.client_output_path = config.client_out...
用于生成新的 RPC 信息,需要指定生成文件的输出目录,对应的 rpc server 及 client 都会 生成到指定的目录
62598f94a79ad16197769d20
class Prism(Recapture): <NEW_LINE> <INDENT> prism_image = games.load_image("prisma.jpg", transparent=False) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(Prism, self).__init__(image=Prism.prism_image, y=games.mouse.y, left=150) <NEW_LINE> <DEDENT> def touch(self): <NEW_LINE> <INDENT> for ball in self.overlap...
Movable object Prism. Changes the trajectory of the ball. The Descendant of Recaptur
62598f9416aa5153ce4001bb
class P2SConnectionConfiguration(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'vpn_client_address...
P2SConnectionConfiguration Resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param name: The name of the resource that is unique within a resource group. This name can be used to access the resource. :type name: str :ivar etag: A ...
62598f94d7e4931a7ef3bd62
class ListAccounts(BrowserView): <NEW_LINE> <INDENT> implements(IListAccounts) <NEW_LINE> def list(self, accounttype=None): <NEW_LINE> <INDENT> root = self.context.getAccountingRoot() <NEW_LINE> pc = getToolByName(self.context, 'portal_catalog') <NEW_LINE> portal_types = [] <NEW_LINE> if accounttype is None or accountt...
Return a list of accounts for a given accounting folder
62598f94b7558d58954632ed
class MissingStudentsGroup(Exception): <NEW_LINE> <INDENT> pass
Raised if a the group for the students has not already been created inside the course.
62598f94ac7a0e7691f721cb
class Resource: <NEW_LINE> <INDENT> def __init__(self, resource_id, delete_function): <NEW_LINE> <INDENT> self.resource_id = resource_id <NEW_LINE> self.delete_function = delete_function <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> self.delete_function(self.resource_id)
@summary: Keeps details of a resource like server or image and how to delete it.
62598f9424f1403a92685711
class CV(Technique): <NEW_LINE> <INDENT> data_fields = { 'common': [ DataField('Ec', c_float), DataField('I', c_float), DataField('Ewe', c_float), DataField('cycle', c_uint32), ] } <NEW_LINE> def __init__(self, vs_initial, voltage_step, scan_rate, record_every_dE=0.1, average_over_dE=True, N_cycles=0, begin_measuring_I...
Cyclic Voltammetry (CV) technique class. The CV technique returns data on fields (in order): * time (float) * Ec (float) * I (float) * Ewe (float) * cycle (int)
62598f9494891a1f408b9550
class InhibitoryArrowHead(arrow_head.ArrowHead): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(InhibitoryArrowHead, self).__init__() <NEW_LINE> self._radius = 3 <NEW_LINE> <DEDENT> @property <NEW_LINE> def radius(self): <NEW_LINE> <INDENT> return self._radius <NEW_LINE> <DEDENT> @radius.setter <NEW_...
Class is used to draw an inhibitory arrow head onto a surface referenced by a GraphicsContext object. The properties must be defined or default values will be used and it inherits from the ArrowHead class.
62598f94cc0a2c111447acd4
class HTTP1ServerConnection(object): <NEW_LINE> <INDENT> def __init__(self, stream, params=None, context=None): <NEW_LINE> <INDENT> self.stream = stream <NEW_LINE> if params is None: <NEW_LINE> <INDENT> params = HTTP1ConnectionParameters() <NEW_LINE> <DEDENT> self.params = params <NEW_LINE> self.context = context <NEW_...
An HTTP/1.x server.
62598f9585dfad0860cbf8d3
class OrderSettlementSerializer(serializers.Serializer): <NEW_LINE> <INDENT> freight = serializers.DecimalField(max_digits=10, decimal_places=2) <NEW_LINE> skus = CartSKUSerializer(many=True, read_only=True)
商品列表序列化器
62598f958a43f66fc4bf1e3b
class Day(models.Model): <NEW_LINE> <INDENT> conference = models.ForeignKey('Conference', related_name='days') <NEW_LINE> venue = models.ForeignKey('Venue', related_name='days') <NEW_LINE> event_date = models.DateField() <NEW_LINE> subtitle = models.TextField(null=True, blank=True) <NEW_LINE> sort_order = models.Intege...
used to organize a schedule for a given day for a Conference / Venue pair
62598f955f7d997b871f923c
class ResourceTestCase(BaseTestCaseWithConfiguration, ResourceCreatorMixin): <NEW_LINE> <INDENT> config_file_name = 'configure.zcml' <NEW_LINE> def set_up(self): <NEW_LINE> <INDENT> super(ResourceTestCase, self).set_up() <NEW_LINE> base_url = app_url = self.ini.get_app_url() <NEW_LINE> self._request = DummyRequest(appl...
Use this for test cases that need access to a configured registry, a request object and a service object.
62598f9521a7993f00c65c3e
class Multiplication: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._max_signs = 95 <NEW_LINE> self._starting_sign = 32 <NEW_LINE> <DEDENT> def generate_keys(self): <NEW_LINE> <INDENT> encryption_key = None <NEW_LINE> while True: <NEW_LINE> <INDENT> candidate = random.randint(2, self._max_signs) <NEW...
Multiplication cipher
62598f9507d97122c4216971
class GSHHSFeature(Feature): <NEW_LINE> <INDENT> _geometries_cache = {} <NEW_LINE> def __init__(self, scale='auto', levels=None, **kwargs): <NEW_LINE> <INDENT> super(GSHHSFeature, self).__init__(cartopy.crs.PlateCarree(), **kwargs) <NEW_LINE> if scale not in ('auto', 'a', 'coarse', 'c', 'low', 'l', 'intermediate', 'i',...
An interface to the GSHHS dataset. See https://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html Parameters ---------- scale The dataset scale. One of 'auto', 'coarse', 'low', 'intermediate', 'high, or 'full' (default is 'auto'). levels A list of integers 1-4 corresponding to the desired GSHHS feature level...
62598f9507f4c71912baf10b
class RdaFile(File): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(RdaFile, self).__init__() <NEW_LINE> <DEDENT> def check(self): <NEW_LINE> <INDENT> if super(RdaFile, self).check(): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise FileError("文件格式错误")
txt类
62598f95eab8aa0e5d30ba42
class TiledImage(object): <NEW_LINE> <INDENT> def __init__(self, tiles, tile_grid, tile_size, src_bbox, src_srs): <NEW_LINE> <INDENT> self.tiles = tiles <NEW_LINE> self.tile_grid = tile_grid <NEW_LINE> self.tile_size = tile_size <NEW_LINE> self.src_bbox = src_bbox <NEW_LINE> self.src_srs = src_srs <NEW_LINE> <DEDENT> d...
An image built-up from multiple tiles.
62598f953539df3088ecbf80
class WebsiteTemplateJinjaFilter(JinjaFilter): <NEW_LINE> <INDENT> ALIASES = ['ws'] <NEW_LINE> TEMPLATE_PLUGINS = [ DexyVersionTemplatePlugin, PrettyPrinterTemplatePlugin, PygmentsStylesheetTemplatePlugin, PythonBuiltinsTemplatePlugin, PythonDatetimeTemplatePlugin, RegularExpressionsTemplatePlugin, SubdirectoriesTempla...
Makes website-relevant tags available to a jinja-based website template.
62598f95b7558d58954632ee
class GeometricallyNearestParameters(Parameters): <NEW_LINE> <INDENT> selector = GeometricallyNearestSelector
Parameters for GeometricallyNearestSelector
62598f95d58c6744b42dc12f
class EditedChannelPostHook(Hook): <NEW_LINE> <INDENT> def _call(self, bot, update): <NEW_LINE> <INDENT> message = update.edited_channel_post <NEW_LINE> return bot._call(self.func, self.component_id, chat=message.chat, message=message)
Underlying hook for @bot.channel_post_edited
62598f953c8af77a43b67d9b
class FreqeuncyEncoding(Encoding): <NEW_LINE> <INDENT> def __init__(self, categorical_columns = None, return_df = False): <NEW_LINE> <INDENT> self.categorical_columns = categorical_columns <NEW_LINE> self.return_df = return_df <NEW_LINE> <DEDENT> def create_encoding_dict(self, X, y): <NEW_LINE> <INDENT> encoding_dict =...
class to perform FreqeuncyEncoding on Categorical Variables Initialization Variabes: categorical_columns: list of categorical columns from the dataframe or list of indexes of caategorical columns for numpy ndarray return_df: boolean if True: returns pandas dataframe on transformation else: return numpy ndarray
62598f956e29344779b0031a
class Post(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey('auth.User', related_name='posts', db_index=True) <NEW_LINE> visible = models.BooleanField(default=True, db_index=True) <NEW_LINE> title = models.CharField(max_length=255) <NEW_LINE> slug = models.SlugField(db_index=True, unique=True, editable=Fal...
A blog post entry
62598f95fff4ab517ebcd4ad
class BaseWriter(object): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.outf = args.outf <NEW_LINE> self.soln = read_pyfr_data(args.solnf) <NEW_LINE> self.mesh = read_pyfr_data(args.meshf) <NEW_LINE> self.mesh_inf = self.mesh.array_info <NEW_LINE> self.soln_inf = sel...
Functionality for post-processing PyFR data to visualisation formats
62598f956aa9bd52df0d4b8e
@ns.route('/worker') <NEW_LINE> class User(Resource): <NEW_LINE> <INDENT> @api.marshal_list_with(person) <NEW_LINE> def get(self): <NEW_LINE> <INDENT> persons = Person.query.all() <NEW_LINE> return [{'name':person.name, 'team':person.team} for person in persons] <NEW_LINE> <DEDENT> @api.doc(parser=parser_person) <NEW_L...
Operation to Add and View workers
62598f95b57a9660fecd173b
class CheckIpdbError(Exception): <NEW_LINE> <INDENT> pass
indicates an error during cipdb checks.
62598f95004d5f362081ee5c
class TestMealModel(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.sample_meal = { "eater": "John", "name": "Burger", "description": "great!", "calories": 300, "meal_time": str(datetime.datetime.now()), } <NEW_LINE> <DEDENT> def test_eater_is_not_validated(self): <NEW_LINE> <INDENT> serializer...
Test basic functionality of our meal model.
62598f95adb09d7d5dc0a248
class Illinois: <NEW_LINE> <INDENT> maxsteps = 30 <NEW_LINE> def __init__(self, ctx, f, x0, **kwargs): <NEW_LINE> <INDENT> self.ctx = ctx <NEW_LINE> if len(x0) != 2: <NEW_LINE> <INDENT> raise ValueError('expected interval of 2 points, got %i' % len(x0)) <NEW_LINE> <DEDENT> self.a = x0[0] <NEW_LINE> self.b = x0[1] <NEW_...
1d-solver generating pairs of approximative root and error. Uses Illinois method or similar to find a root of f in [a, b]. Might fail for multiple roots (needs sign change). Combines bisect with secant (improved regula falsi). The only difference between the methods is the scaling factor m, which is used to ensure co...
62598f95be8e80087fbbed1e
class NfsLogLevel(object): <NEW_LINE> <INDENT> swagger_types = { 'level': 'str' } <NEW_LINE> attribute_map = { 'level': 'level' } <NEW_LINE> def __init__(self, level=None): <NEW_LINE> <INDENT> self._level = None <NEW_LINE> self.discriminator = None <NEW_LINE> if level is not None: <NEW_LINE> <INDENT> self.level = level...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f9599cbb53fe6830b90
class Conv2GRUSeq2Seq(GRUSeq2Seq): <NEW_LINE> <INDENT> def __init__(self, mode, iterator, hparams): <NEW_LINE> <INDENT> super().__init__(mode, iterator, hparams) <NEW_LINE> self.conv_hidden_size = hparams.conv_hidden_size <NEW_LINE> self.kernel_size = hparams.kernel_size <NEW_LINE> <DEDENT> def _encoder(self, encoder_e...
Translation model class with a multi-layer 1-D Convolutional Neural Network as Encoder. The Decoder is still a RNN with GRU cells. Attribures: conv_hidden_size: List defining the number of filters in each layer. kernel_size: List defining the width of the 1-D conv-filters in each layer.
62598f952c8b7c6e89bd348f
@zope.interface.implementer(ZODB.interfaces.IBroken) <NEW_LINE> class Broken(object): <NEW_LINE> <INDENT> __Broken_state__ = __Broken_initargs__ = None <NEW_LINE> __name__ = 'broken object' <NEW_LINE> def __new__(class_, *args): <NEW_LINE> <INDENT> result = object.__new__(class_) <NEW_LINE> result.__dict__['__Broken_ne...
Broken object base class Broken objects are placeholders for objects that can no longer be created because their class has gone away. Broken objects don't really do much of anything, except hold their state. The Broken class is used as a base class for creating classes in leu of missing classes:: >>> Atall = typ...
62598f95a219f33f346c64db
class AccountMovement(Element): <NEW_LINE> <INDENT> def __init__(self, dateTime='', amount=0.0, reason='', *args, **kw_args): <NEW_LINE> <INDENT> self.dateTime = dateTime <NEW_LINE> self.amount = amount <NEW_LINE> self.reason = reason <NEW_LINE> super(AccountMovement, self).__init__(*args, **kw_args) <NEW_LINE> <DEDENT...
Credit/debit movements for an account.
62598f95be383301e02534c7
class HttpMock(object): <NEW_LINE> <INDENT> def __init__(self, filename=None, headers=None): <NEW_LINE> <INDENT> if headers is None: <NEW_LINE> <INDENT> headers = {"status": "200"} <NEW_LINE> <DEDENT> if filename: <NEW_LINE> <INDENT> with open(filename, "rb") as f: <NEW_LINE> <INDENT> self.data = f.read() <NEW_LINE> <D...
Mock of httplib2.Http
62598f95d7e4931a7ef3bd64
class MyList(list): <NEW_LINE> <INDENT> def print_sorted(self): <NEW_LINE> <INDENT> print(sorted(self))
class to inherit list
62598f9594891a1f408b9551
class TableauTuples_level(TableauTuples): <NEW_LINE> <INDENT> def __init__(self, level): <NEW_LINE> <INDENT> super(TableauTuples_level, self).__init__(category=Sets()) <NEW_LINE> self._level=level <NEW_LINE> <DEDENT> def __contains__(self,t): <NEW_LINE> <INDENT> if isinstance(t, self.element_class): <NEW_LINE> <INDENT>...
Class of all :class:`TableauTuples` with a fixed ``level`` and arbitrary ``size``.
62598f9585dfad0860cbf8d4
class Request(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def post(params = {}, priority = False): <NEW_LINE> <INDENT> path = "/keywords/priority.json" if priority == True else "/keywords.json" <NEW_LINE> return al_papi.AlHttp.post(params, priority, "/keywords.json") <NEW_LINE> <DEDENT> @staticmethod <NEW_LIN...
Request class is used to handle the API calls for the Partner API. The three methods you can call are post, priority post and get. To make a POST to the Partner API:: al_papi.Request.post({"keyword" : "Centaurs"}) To make a priority POST to the Partner API you have 2 options, use the post method:: al_papi.Reque...
62598f95d53ae8145f91814e
class CreateModelTests(tf.test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.model_cfg = ConfigLoader('./config/config.yaml') <NEW_LINE> self.models = list(self.model_cfg.cfg['models'].keys()) <NEW_LINE> self.labels = ['label/species', 'label/counts'] <NEW_LINE> self.labels_clean = ['label/%s...
Test Create Model
62598f95cb5e8a47e493bfd4
class UpdateCartView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> sku_id = request.POST.get('sku_id') <NEW_LINE> count = request.POST.get('count') <NEW_LINE> if not all([sku_id, count]): <NEW_LINE> <INDENT> return JsonResponse({'code':1, 'message':'缺少参数'}) <NEW_LINE> <DEDENT> try: <NEW_LINE> ...
更新购物车信息
62598f9526068e7796d4c623
class LargeConfig(object): <NEW_LINE> <INDENT> init_scale = 0.04 <NEW_LINE> use_adam = False <NEW_LINE> learning_rate = 1.0 <NEW_LINE> max_grad_norm = 10 <NEW_LINE> num_layers = 2 <NEW_LINE> num_steps = 35 <NEW_LINE> hidden_size = 1500 <NEW_LINE> max_epoch = 14 <NEW_LINE> max_max_epoch = 55 <NEW_LINE> keep_prob = 0.35 ...
Large config.
62598f95e76e3b2f99fd86fb
class GetProgramEnrollmentsTestCase(GetEnrollmentsTestMixin, TestCase): <NEW_LINE> <INDENT> program_uuid = '7fbefaa4-c0e8-431b-af69-8d3ddde543a2' <NEW_LINE> lms_url = urljoin(settings.LMS_BASE_URL, LMS_PROGRAM_ENROLLMENTS_API_TPL.format(program_uuid)) <NEW_LINE> status_choices = ['enrolled', 'pending', 'suspended', 'ca...
Tests for data.get_program_enrollments
62598f953cc13d1c6d46542f
class Spider(Animal): <NEW_LINE> <INDENT> def __init__(self, description): <NEW_LINE> <INDENT> i_am_a = 'spider' <NEW_LINE> emoji = '🕷' <NEW_LINE> super().__init__(i_am_a, description, emoji) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return """Spider(description={self.description}, i_am_a={self.i_am_...
Blueprint for a spider in the Dungeon of Doom! Extends Animal
62598f95b57a9660fecd173d
@skipIf(NO_MOCK, NO_MOCK_REASON) <NEW_LINE> @skipIf(sys.platform.startswith('openbsd'), 'OpenBSD does not use PAM') <NEW_LINE> class PamTestCase(TestCase): <NEW_LINE> <INDENT> def test_read_file(self): <NEW_LINE> <INDENT> with patch('salt.utils.files.fopen', mock_open(read_data=MOCK_FILE)): <NEW_LINE> <INDENT> self.ass...
Test cases for salt.modules.pam
62598f95baa26c4b54d4ef71
class SensorControl(object): <NEW_LINE> <INDENT> def __init__(self, pushback=None, suppress=True): <NEW_LINE> <INDENT> assert pushback is not None <NEW_LINE> self.mapping = {} <NEW_LINE> self.suppress = suppress <NEW_LINE> self.suppress_mapping = {} <NEW_LINE> self.pre={} <NEW_LINE> self.count={} <NEW_LINE> self.interv...
Manages the Pushback interconnect for sensors. Sensor inputs must be configured before they can be used.
62598f9596565a6dacd2cddb
class Indicoin(Bitcoin): <NEW_LINE> <INDENT> name = 'indicoin' <NEW_LINE> symbols = ('INDI', ) <NEW_LINE> seeds = ("dnsseed.inditrades.org", ) <NEW_LINE> port = 7366 <NEW_LINE> message_start = b'\xe4\xe8\xe9\xe5' <NEW_LINE> base58_prefixes = { 'PUBKEY_ADDR': 25, 'SCRIPT_ADDR': 20, 'SECRET_KEY': 153 }
Class with all the necessary Indicoin network information based on https://github.com/sarkarrajsingh1/indicoin/blob/master/src/net.cpp (date of access: 02/16/2018)
62598f95a4f1c619b294e2ae
class RequestListAPIView(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> queryset = Request.objects.all() <NEW_LINE> serializer = RequestSerializer(instance=queryset, many=True) <NEW_LINE> return Response(serializer.data) <NEW_LINE> <DEDENT> def post(self, request, format=None): <...
View to list all requests stored in the system.
62598f9563b5f9789fe84e39
class Python3EnamlLexer(BaseEnamlLexer): <NEW_LINE> <INDENT> operators = BaseEnamlLexer.operators + ((r'->', 'RETURNARROW'),) <NEW_LINE> delimiters = BaseEnamlLexer.delimiters + ('BYTES',) <NEW_LINE> t_RETURNARROW = r'->' <NEW_LINE> reserved = dict(list(BaseEnamlLexer.reserved.items()) + [('nonlocal', 'NONLOCAL'), ] ) ...
Lexer specialized for Python.
62598f9516aa5153ce4001bf
class Reason(object): <NEW_LINE> <INDENT> CONTROL = 0 <NEW_LINE> STARTED = 1 <NEW_LINE> NODE_CHANGED = 2
持久化的原因
62598f9530dc7b766599f516
class AccountSystemModelTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.person = Person.objects.create(name="Mario", surname="Rossi") <NEW_LINE> self.subject = self.person.subject <NEW_LINE> self.system = self.person.accounting.system <NEW_LINE> self.root = Account.objects.get(system=self....
Tests related to the ``AccountSystem`` model class
62598f9524f1403a92685713
class CommentForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Comment <NEW_LINE> fields = ('content',) <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.fields['content'].widget.attrs.update( {'class': 'form-c...
Form for the Comment model
62598f958da39b475be02ea5
class TogglePreHistoryHidden(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["channel", "enabled"] <NEW_LINE> ID = 0xeabbb94c <NEW_LINE> QUALNAME = "functions.channels.TogglePreHistoryHidden" <NEW_LINE> def __init__(self, *, channel: "raw.base.InputChannel", enabled: bool) -> None: <NEW_LINE> <INDENT> self.chann...
Telegram API method. Details: - Layer: ``122`` - ID: ``0xeabbb94c`` Parameters: channel: :obj:`InputChannel <pyrogram.raw.base.InputChannel>` enabled: ``bool`` Returns: :obj:`Updates <pyrogram.raw.base.Updates>`
62598f9507d97122c4216974
class WrongDofIndexException(Exception): <NEW_LINE> <INDENT> pass
Exception for wrong degree of freedom index
62598f95097d151d1a2c0cec
class KubePodView(ViewSet): <NEW_LINE> <INDENT> serializer_class = KubePodSerializer <NEW_LINE> def list(self, request, format=None): <NEW_LINE> <INDENT> pod = KubePod.objects.all() <NEW_LINE> serializer = KubePodSerializer(pod, many=True) <NEW_LINE> return Response(serializer.data)
Handles the /api/pods endpoint
62598f9571ff763f4b5e743b
class TestCredentialOfferSchema(TestCase): <NEW_LINE> <INDENT> credential_offer = CredentialOffer( comment="shaken, not stirred", credential_preview=TestCredentialOffer.preview, offers_attach=[AttachDecorator.from_indy_dict(TestCredentialOffer.indy_offer)], ) <NEW_LINE> def test_make_model(self): <NEW_LINE> <INDENT> da...
Test credential cred offer schema
62598f9507f4c71912baf10f
class Connect(object): <NEW_LINE> <INDENT> def __init__(self, db_name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.conn = sqlite3.connect(db_name) <NEW_LINE> self.cursor = self.conn.cursor() <NEW_LINE> print("Banco:", db_name) <NEW_LINE> self.cursor.execute('SELECT SQLITE_VERSION()') <NEW_LINE> self.data = self....
A classe Connect representa o banco de dados.
62598f957d847024c075c097
class PlayerItem (object): <NEW_LINE> <INDENT> def __init__(self, asset=None, objc_item=None): <NEW_LINE> <INDENT> if type(asset) == Asset: <NEW_LINE> <INDENT> self._objc = AVPlayerItem.playerItemWithAsset_(asset._objc) <NEW_LINE> self._asset = asset <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._objc = None <NEW_...
A player item that bridges AVPlayerItem Used with players
62598f95009cb60464d011e9
class ModifyDBInstanceNameRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.InstanceName = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.InstanceId = params.get("InstanceId") <NEW_LINE> self.InstanceName = param...
ModifyDBInstanceName请求参数结构体
62598f95498bea3a75a577ea
class AddNewTaskFromDocumentFileAction(UpgradeStep): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> self.install_upgrade_profile()
Add new_task_from_document file action.
62598f954527f215b58e9ba8
class ConsoleError(Exception): <NEW_LINE> <INDENT> pass
Base class for all exceptions that are raised by Console. You can raise this if you don't want your error to print the traceback.
62598f9523849d37ff850d8a
class carray(bcolz.carray): <NEW_LINE> <INDENT> pass
Subclass bcolz carray
62598f95a05bb46b3848a543
@EnableDebugWindow <NEW_LINE> class ContentSecurityPolicyVulnScan(Transform): <NEW_LINE> <INDENT> input_type = NettackerScan <NEW_LINE> def do_transform(self, request, response, config): <NEW_LINE> <INDENT> scan_request = request.entity <NEW_LINE> scan_id = "".join(random.choice("0123456789abcdef") for x in range(32)) ...
TODO: Your transform description.
62598f95fbf16365ca793d79
class Rectangle(Shape, Coordinate): <NEW_LINE> <INDENT> sides = 4 <NEW_LINE> def __init__(self, point_a=Coordinate(), point_b=Coordinate(), point_c=Coordinate(), point_d=Coordinate()): <NEW_LINE> <INDENT> self.point_a = point_a <NEW_LINE> self.point_b = point_b <NEW_LINE> self.point_c = point_c <NEW_LINE> self.point_d ...
사각형을 나타내는 클래스
62598f950c0af96317c56048
class GoogleCloudStorageConsistentRecordOutputWriterEndToEndTest( GCSRecordOutputWriterEndToEndTestBase, testutil.CloudStorageTestBase): <NEW_LINE> <INDENT> WRITER_CLS = output_writers.GoogleCloudStorageConsistentRecordOutputWriter <NEW_LINE> WRITER_NAME = output_writers.__name__ + "." + WRITER_CLS.__name__
End-to-end tests for CloudStorageConsistentRecordOutputWriter.
62598f9529b78933be269f3f
class VitalTaskTemplateFactory(factory.django.DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = 'tasks.VitalTaskTemplate'
Factory for :model:`tasks.VitalTaskTemplate`
62598f95a4f1c619b294e2b0
class Manager(Person): <NEW_LINE> <INDENT> def __init__(self, name, age, pay): <NEW_LINE> <INDENT> Person.__init__(self, name, age, pay, 'maneger') <NEW_LINE> <DEDENT> def give_raise(self, percent, bonus=0.1): <NEW_LINE> <INDENT> Person.give_raise(self, percent + bonus)
Класс со специализированным методом give_raise, наследующий обобщенные методы last_name и __str__
62598f95507cdc57c63a4a58
class Patch(models.Model): <NEW_LINE> <INDENT> objectid = models.IntegerField() <NEW_LINE> clcid = models.TextField() <NEW_LINE> year = models.IntegerField() <NEW_LINE> nomenclature = models.ForeignKey(Nomenclature) <NEW_LINE> change = models.BooleanField() <NEW_LINE> nomenclature_previous = models.ForeignKey(Nomenclat...
Corine Land Cover patch.
62598f95d99f1b3c44d05374
class TemplateMatch(object): <NEW_LINE> <INDENT> swagger_types = { 'document_end_page': 'str', 'document_start_page': 'str', 'match_percentage': 'str' } <NEW_LINE> attribute_map = { 'document_end_page': 'documentEndPage', 'document_start_page': 'documentStartPage', 'match_percentage': 'matchPercentage' } <NEW_LINE> def...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f95627d3e7fe0e06b6d
class ActiveEntity(Entity): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.physical = False <NEW_LINE> self.mass = 0 <NEW_LINE> self.x_speed = 0 <NEW_LINE> self.y_speed = 0 <NEW_LINE> <DEDENT> def physics(self): <NEW_LINE> <INDENT> if self.physical: <NEW_LINE> <INDENT> pa...
A type of entity that allows for movement within the world.
62598f953eb6a72ae038a300
class CSVCollection(object): <NEW_LINE> <INDENT> def __init__(self,name=None): <NEW_LINE> <INDENT> self.name=name <NEW_LINE> self.headers=[] <NEW_LINE> self.headerDict={} <NEW_LINE> self.data=[self.headerDict] <NEW_LINE> self.current={} <NEW_LINE> self.file=None <NEW_LINE> self.writer=None <NEW_LINE> self.renew=True <N...
Collects data like a dictionary. Writes it to a line in a CSV-file. If the dictionary is extended the whole file is rewritten
62598f958da39b475be02ea7
@add_metaclass(ABCMeta) <NEW_LINE> class AbstractAttentionRecurrent(BaseRecurrent): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def apply(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def take_glimpses(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractm...
The interface for attention-equipped recurrent transitions. When a recurrent network is equipped with an attention mechanism its transition typically consists of two steps: (1) the glimpses are taken by the attention mechanism and (2) the next states are computed using the current states and the glimpses. It is requir...
62598f958e71fb1e983bb779
class EmailSettingsForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> prefix = kwargs.pop("prefix", self.Meta.model.__name__) <NEW_LINE> super(EmailSettingsForm, self).__init__(*args, prefix=prefix, **kwargs) <NEW_LINE> self.user = kwarg...
EMailSettingsForm, form used for editing email settings for a user. Parameters: DjangoForm : Inherit from basic django form
62598f9515baa72349461c46
class UriCacher(peek_iterable.Tap): <NEW_LINE> <INDENT> def __init__(self, update_cache_op, transform_uri): <NEW_LINE> <INDENT> self._transform_uri = transform_uri <NEW_LINE> self._update_cache_op = update_cache_op <NEW_LINE> self._uris = [] <NEW_LINE> <DEDENT> def Tap(self, resource): <NEW_LINE> <INDENT> if resource_p...
A Tapper class that caches URIs based on the cache update op. Attributes: _transform_uri: The uri() transform function. _update_cache_op: The non-None return value from UpdateUriCache(). _uris: The list of changed URIs, None if it is corrupt.
62598f9576e4537e8c3ef278
class ItemViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Item.objects.all() <NEW_LINE> serializer_class = ItemSerializer
CRUD API endpoint for items.
62598f9507f4c71912baf110
class Plotter(object): <NEW_LINE> <INDENT> def __init__(self, om1, om2, om3, om4,temp): <NEW_LINE> <INDENT> self.room = self.room_setup(om1, om2, om3, om4,temp) <NEW_LINE> <DEDENT> def room_setup(self, om1, om2, om3, om4,temp): <NEW_LINE> <INDENT> tleft = np.hstack((om4,np.vstack((om3,np.full(om3.shape,temp))))) <NEW_L...
Takes the computed temperature solution matrices. Flips the individual matrices based on orientation and location, applies padding where needed and stacks them all together. Once the information has been pieced together it takes the heater temperature and applies that as the resolution to the filled contour plot, as w...
62598f95cb5e8a47e493bfd6
class MaskRCNNFPNResNet(FasterRCNNFPNResNet): <NEW_LINE> <INDENT> def __init__(self, n_fg_class=None, pretrained_model=None, return_values=['masks', 'labels', 'scores'], min_size=800, max_size=1333): <NEW_LINE> <INDENT> super(MaskRCNNFPNResNet, self).__init__( n_fg_class, pretrained_model, return_values, min_size, max_...
Mask R-CNN with a ResNet backbone and FPN. Please refer to :class:`~chainercv.links.model.fpn.FasterRCNNFPNResNet`.
62598f956aa9bd52df0d4b94
class String(Atom): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '"' + self.value + '"' <NEW_LINE> <DEDENT> def eval(self): <NEW_LINE> <INDENT> return self
An atom that holds a string.
62598f950c0af96317c5604a
class ChunkReaderError(Exception): <NEW_LINE> <INDENT> pass
Error raised in case :class:`.ChunkReaderBase` is not able to read properly the output. This indicates that we need a better algorithm for reading and writing in this case.
62598f95adb09d7d5dc0a24e
class AppsHandler(apimanager.EmpowerAPIHandler): <NEW_LINE> <INDENT> URLS = [r"/api/v1/projects/([a-zA-Z0-9-]*)/apps/?", r"/api/v1/projects/([a-zA-Z0-9-]*)/apps/([a-zA-Z0-9-]*)/?"] <NEW_LINE> @apimanager.validate(min_args=1, max_args=2) <NEW_LINE> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> project_id = uuid.UU...
Applications handler.
62598f952c8b7c6e89bd3495
class GetShouts(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/LastFm/User/GetShouts') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return GetShoutsInputSet() <NEW_LINE> <DEDENT> def _make_result_set(se...
Create a new instance of the GetShouts Choreography. A TembooSession object, containing a valid set of Temboo credentials, must be supplied.
62598f95e76e3b2f99fd8700
class State(BaseVar): <NEW_LINE> <INDENT> e_code = 'f' <NEW_LINE> v_code = 'x' <NEW_LINE> def __init__(self, name: Optional[str] = None, tex_name: Optional[str] = None, info: Optional[str] = None, unit: Optional[str] = None, v_str: Optional[Union[str, float]] = None, v_iter: Optional[str] = None, e_str: Optional[str] =...
Differential variable class, an alias of the `BaseVar`. Parameters ---------- t_const : BaseParam, DummyValue Left-hand time constant for the differential equation. Time constants will not be evaluated as part of the differential equation. They will be collected to array `dae.Tf` to multiply to the right-h...
62598f9545492302aabfc19f
class DBSCAN(BaseEstimator, ClusterMixin): <NEW_LINE> <INDENT> def __init__(self, eps=0.5, min_samples=5, metric='euclidean', algorithm='auto', leaf_size=30, p=None, random_state=None): <NEW_LINE> <INDENT> self.eps = eps <NEW_LINE> self.min_samples = min_samples <NEW_LINE> self.metric = metric <NEW_LINE> self.algorithm...
Perform DBSCAN clustering from vector array or distance matrix. DBSCAN - Density-Based Spatial Clustering of Applications with Noise. Finds core samples of high density and expands clusters from them. Good for data which contains clusters of similar density. Parameters ---------- eps : float, optional The maximum...
62598f9510dbd63aa1c7087c