code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class User(Base0): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> Base0.__init__(self) <NEW_LINE> self.username = require_value_from_dict(obj, 'username') <NEW_LINE> self.password = require_value_from_dict(obj, 'password') <NEW_LINE> self.email = require_value_from_dict(obj, 'email') <NEW_LINE> self.m... | 用户 | 62598fb2d7e4931a7ef3c118 |
class TCA6424(object): <NEW_LINE> <INDENT> pins_list = [ ( 'PWREN-CLK-MGT156MHz', 'NETCLK-CE', 'NETCLK-RESETn', 'NETCLK-PR0', 'NETCLK-PR1', 'NETCLK-OD0', 'NETCLK-OD1', 'NETCLK-OD2', 'PWREN-CLK-MAINREF', 'CLK-MAINSEL-25MHz', 'CLK-MAINSEL-EX_B', '12', 'CLK-MAINSEL-GPS', 'FPGA-GPIO-EN', 'PWREN-CLK-WB-20MHz', 'PWREN-CLK-WB... | Abstraction layer for the port/gpio expander
pins_list is an array of different version of TCA6424 pins map.
First element of this array corresponding to revC, second is revD etc... | 62598fb2379a373c97d99099 |
class G03_LMC2(BaseExtModel): <NEW_LINE> <INDENT> x_range = [0.3, 10.0] <NEW_LINE> Rv = 2.76 <NEW_LINE> obsdata_x = np.array( [0.455, 0.606, 0.800, 1.818, 2.273, 2.703, 3.375, 3.625, 3.875, 4.125, 4.375, 4.625, 4.875, 5.125, 5.375, 5.625, 5.875, 6.125, 6.375, 6.625, 6.875, 7.125, 7.375, 7.625, 7.875, 8.125] ) <NEW_LINE... | Gordon et al (2003) LMC2 Average Extinction Curve
Parameters
----------
None
Raises
------
None
Notes
-----
From Gordon et al. (2003, ApJ, 594, 279)
Example showing the average curve
.. plot::
:include-source:
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
from d... | 62598fb27d847024c075c446 |
class FakeServer(object): <NEW_LINE> <INDENT> def __init__(self, server_factory, auto_accept=True, on_connect=None): <NEW_LINE> <INDENT> self.server_factory = server_factory <NEW_LINE> self.auto_accept = auto_accept <NEW_LINE> self.connection_queue = DeferredQueue() <NEW_LINE> self.on_connect = on_connect <NEW_LINE> <D... | Fake server container for testing client/server interactions. | 62598fb221bff66bcd722ceb |
class QueueGroupItem(Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = "core" <NEW_LINE> db_table = "norc_queuegroupitem" <NEW_LINE> ordering = ["priority"] <NEW_LINE> unique_together = ("group", "queue_type", "queue_id") <NEW_LINE> <DEDENT> group = ForeignKey(QueueGroup, related_name="items") <NE... | Maps queues to QueueGroups. | 62598fb2ff9c53063f51a6d1 |
class DOMHTMLReleaseinfoParser(DOMParserBase): <NEW_LINE> <INDENT> extractors = [Extractor(label='release dates', path="//th[@class='xxxx']/../../tr", attrs=Attribute(key='release dates', multi=True, path={'country': ".//td[1]//text()", 'date': ".//td[2]//text()", 'notes': ".//td[3]//text()"})), Extractor(label='akas',... | Parser for the "release dates" page of a given movie.
The page should be provided as a string, as taken from
the akas.imdb.com server. The final result will be a
dictionary, with a key for every relevant section.
Example:
rdparser = DOMHTMLReleaseinfoParser()
result = rdparser.parse(releaseinfo_html_string) | 62598fb25fdd1c0f98e5e011 |
class HyperlinkedRelatedField(RelatedField): <NEW_LINE> <INDENT> pk_url_kwarg = 'pk' <NEW_LINE> slug_field = 'slug' <NEW_LINE> slug_url_kwarg = None <NEW_LINE> default_read_only = False <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.view_name = kwargs.pop('view_name') ... | Represents a to-one relationship, using hyperlinking. | 62598fb22c8b7c6e89bd384a |
class ImplementsNone(ObjectType, VirtualMethods): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ObjectType.__init__(self) <NEW_LINE> VirtualMethods.__init__(self) | Implements no virtual methods | 62598fb25fdd1c0f98e5e012 |
class TestTachographDriverFile(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return Tachograph... | TachographDriverFile unit test stubs | 62598fb2e1aae11d1e7ce866 |
class MyPlugin(CubePlugin): <NEW_LINE> <INDENT> label = "Information Plugin" <NEW_LINE> userLevel = 1 <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> self.my_float = SpecFloat(label='My Float', minval=0, maxval=100, stepsize=0.1, defaultValue=10.4) <NEW_LINE> self.my_float.units = 'my units' <NEW_LINE> self.my_float.he... | Extracts useful information about a datacube and displays it | 62598fb28e7ae83300ee9128 |
class MockRepo(object): <NEW_LINE> <INDENT> def __init__(self, name="", repoid="", enabled=True): <NEW_LINE> <INDENT> self.id = repoid <NEW_LINE> self.name = name <NEW_LINE> self.enabled = enabled <NEW_LINE> self.priority = 99 | mock class for repo | 62598fb230dc7b766599f8d1 |
class AsyncioEventLoop(_AbstractEventLoop): <NEW_LINE> <INDENT> def __init__(self, loop=None): <NEW_LINE> <INDENT> loop = loop or _real_asyncio.get_event_loop() <NEW_LINE> self._loop = loop <NEW_LINE> self.run_until_complete = ( self._run_until_complete if portage._internal_caller else loop.run_until_complete ) <NEW_LI... | Implementation of asyncio.AbstractEventLoop which wraps asyncio's
event loop and is minimally compatible with _PortageEventLoop. | 62598fb2442bda511e95c4dc |
class Shapes: <NEW_LINE> <INDENT> numShapes = 0 | Shapes Generic Class | 62598fb2a8370b77170f0462 |
class CustomUserManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, country, password=None, is_active=True): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('User\'s email address must be set') <NEW_LINE> <DEDENT> if not country: <NEW_LINE> <INDENT> raise ValueError('User\'... | Custom user manager for CustomUser. | 62598fb2283ffb24f3cf3912 |
class LocationModelTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> app = create_app() <NEW_LINE> db.drop_all() <NEW_LINE> db.create_all() <NEW_LINE> seed_db() <NEW_LINE> db.session.commit() <NEW_LINE> self.client = app.test_client() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE... | Test Location model. | 62598fb2cc0a2c111447b098 |
class Complex: <NEW_LINE> <INDENT> r = '' <NEW_LINE> i = '' <NEW_LINE> def __init__(self, realpart, imagpart): <NEW_LINE> <INDENT> self.r = realpart <NEW_LINE> self.i = imagpart | a simple class example | 62598fb23346ee7daa33768a |
class LoadJobConfig(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._properties = {} <NEW_LINE> self._schema = () <NEW_LINE> <DEDENT> allow_jagged_rows = _TypedApiResourceProperty( 'allow_jagged_rows', 'allowJaggedRows', bool) <NEW_LINE> allow_quoted_newlines = _TypedApiResourceProperty( 'allo... | Configuration options for load jobs.
All properties in this class are optional. Values which are ``None`` ->
server defaults. | 62598fb256ac1b37e6302270 |
class SimHeapFreelist(SimHeapLibc): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> return self.chunks() <NEW_LINE> <DEDENT> def chunks(self): <NEW_LINE> <INDENT> raise NotImplementedError("%s not implemented for %s" % (self.chunks.__func__.__name__, self.__class__.__name__)) <NEW_LINE> <DEDENT> def allocat... | A freelist-style heap implementation. Distinguishing features of such heaps include chunks containing heap
metadata in addition to user data and at least (but often more than) one linked list of free chunks. | 62598fb2090684286d593720 |
class TestAngleBetweenPlanes(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> unittest.TestCase.setUp(self) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> unittest.TestCase.tearDown(self) <NEW_LINE> <DEDENT> def testSkeleton(self): <NEW_LINE> <INDENT> self.assert_(True) <NEW_LIN... | TestCase class for the module `electronmicroscopy.tem.angle_between_planes`. | 62598fb2379a373c97d9909b |
class ScDrawerButton(Gtk.ToggleButton): <NEW_LINE> <INDENT> revealer = None <NEW_LINE> spinner = None <NEW_LINE> context = None <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> Gtk.ToggleButton.__init__(self) <NEW_LINE> self.context = context <NEW_LINE> box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0) <NEW_L... | Simple button to control the draw visibility, and also sliding
a spinner into view when jobs are currently running | 62598fb23539df3088ecc338 |
class GPXLoader(xml.sax.handler.ContentHandler): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(GPXLoader, self).__init__() <NEW_LINE> self.tag_list = [] <NEW_LINE> self.gpx_data = [] <NEW_LINE> self.gpx_data.append([]) <NEW_LINE> self.gpx_data.append([]) <NEW_LINE> self.gpx_data.append([]) <NEW_LINE... | This class loads in to memory the GPX [lat, lon, time] data generated
from a Garmin GPS device, uses | 62598fb2cc0a2c111447b099 |
class XspeedGateway(VtGateway): <NEW_LINE> <INDENT> def __init__(self, eventEngine, gatewayName='XSPEED'): <NEW_LINE> <INDENT> super(XspeedGateway, self).__init__(eventEngine, gatewayName) <NEW_LINE> self.mdApi = XspeedMdApi(self) <NEW_LINE> self.tdApi = XspeedTdApi(self) <NEW_LINE> self.mdConnected = False <NEW_LINE> ... | XSPEED接口 | 62598fb2ff9c53063f51a6d3 |
class MemoryBufferedJSONList(MemoryBufferedJSONCollection, SyncedList): <NEW_LINE> <INDENT> def __init__( self, filename=None, write_concern=False, data=None, parent=None, *args, **kwargs, ): <NEW_LINE> <INDENT> super().__init__( filename=filename, write_concern=write_concern, data=data, parent=parent, *args, **kwargs,... | A buffered :class:`JSONList`. | 62598fb266656f66f7d5a476 |
class WalmartSellersSpider(scrapy.Spider): <NEW_LINE> <INDENT> name = "walmart_sellers" <NEW_LINE> allowed_domains = ["walmart.com"] <NEW_LINE> def __init__(self, category='', domain=None, *args, **kwargs): <NEW_LINE> <INDENT> super(WalmartSellersSpider, self).__init__(*args, **kwargs) <NEW_LINE> self.start_urls = ['ht... | scrapy spider to crawl single walmart sellers page
input:inputSellersUrl
you can run it using something like that
scrapy crawl walmart_sellers -o output_file.json -a category='product/3921879/sellers'
category attribute will be concatenated to 'https://www.walmart.com/' to build the start_urls list | 62598fb226068e7796d4c9dc |
class UBusTestSystemReboot(rootfs_boot.RootFSBootTest): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> board = self.dev.board <NEW_LINE> lan = self.dev.lan <NEW_LINE> for i in range(1000): <NEW_LINE> <INDENT> print( "\nRunning iteration of ubus json-rpc system reboot nubmer %s\n" % i) <NEW_LINE> session_id ... | Various UBus tests | 62598fb27c178a314d78d523 |
class MusicPlayer(commands.Cog): <NEW_LINE> <INDENT> __slots__ = ('bot', '_guild', '_channel', '_cog', 'queue', 'next', 'current', 'np', 'volume') <NEW_LINE> def __init__(self, ctx): <NEW_LINE> <INDENT> self.bot = ctx.bot <NEW_LINE> self._guild = ctx.guild <NEW_LINE> self._channel = ctx.channel <NEW_LINE> self._cog = c... | A class which is assigned to each guild using the bot for Music.
This class implements a queue and loop, which allows for different guilds to listen to different playlists
simultaneously.
When the bot disconnects from the Voice it's instance will be destroyed. | 62598fb2851cf427c66b8342 |
class Time(): <NEW_LINE> <INDENT> ps = 1 <NEW_LINE> ns = 1000 <NEW_LINE> us = ns * 1000 <NEW_LINE> ms = us * 1000 <NEW_LINE> s = ms * 1000 | Time units | 62598fb28a43f66fc4bf2201 |
class QueueInput(FeedfreeInput): <NEW_LINE> <INDENT> def __init__(self, ds, queue=None): <NEW_LINE> <INDENT> if not isinstance(ds, DataFlow): <NEW_LINE> <INDENT> raise ValueError("QueueInput takes a DataFlow! Got {}".format(ds)) <NEW_LINE> <DEDENT> self.queue = queue <NEW_LINE> self.ds = ds <NEW_LINE> self._inf_ds = Re... | Enqueue datapoints from a DataFlow to a TF queue.
And the model receives dequeued tensors.
Calling :meth:`reset_state()` will clear the queue and reset the dataflow. | 62598fb2dd821e528d6d8fb5 |
class TcpSensor(Entity): <NEW_LINE> <INDENT> required = tuple() <NEW_LINE> def __init__(self, hass, config): <NEW_LINE> <INDENT> value_template = config.get(CONF_VALUE_TEMPLATE) <NEW_LINE> if value_template is not None: <NEW_LINE> <INDENT> value_template.hass = hass <NEW_LINE> <DEDENT> self._hass = hass <NEW_LINE> self... | Implementation of a TCP socket based sensor. | 62598fb2adb09d7d5dc0a612 |
class Env(object): <NEW_LINE> <INDENT> metadata = {'render.modes': []} <NEW_LINE> reward_range = (-float('inf'), float('inf')) <NEW_LINE> spec = None <NEW_LINE> action_space = None <NEW_LINE> observation_space = None <NEW_LINE> def step(self, action): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> de... | The main OpenAI Gym class. It encapsulates an environment with
arbitrary behind-the-scenes dynamics. An environment can be
partially or fully observed.
The main API methods that users of this class need to know are:
step
reset
render
close
seed
And set the following attributes:
action_space: The... | 62598fb255399d3f056265a1 |
@base.ReleaseTracks(base.ReleaseTrack.BETA, base.ReleaseTrack.ALPHA) <NEW_LINE> class CreateBeta(Create): <NEW_LINE> <INDENT> _ALLOW_RSA_ENCRYPTED_CSEK_KEYS = True <NEW_LINE> @classmethod <NEW_LINE> def Args(cls, parser): <NEW_LINE> <INDENT> _Args(parser, cls.ReleaseTrack()) <NEW_LINE> parser.display_info.AddCacheUpdat... | Create Google Compute Engine images. | 62598fb2d58c6744b42dc31c |
class ValueRegex: <NEW_LINE> <INDENT> def __init__(self, expr): <NEW_LINE> <INDENT> self.expr = expr <NEW_LINE> <DEDENT> def get_resource_value(self, resource): <NEW_LINE> <INDENT> if resource is None: <NEW_LINE> <INDENT> return resource <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> capture = re.match(self.expr, resourc... | Allows filtering based on the output of a regex capture.
This is useful for parsing data that has a weird format.
Instead of comparing the contents of the 'resource value' with the 'value',
it will instead apply the regex to contents of the 'resource value', and compare
the result of the capture group defined in that ... | 62598fb257b8e32f5250815f |
class AuthenticationFailed(GitHubError): <NEW_LINE> <INDENT> pass | Exception class for 401 responses.
Possible reasons:
- Need one time password (for two-factor authentication)
- You are not authorized to access the resource | 62598fb2f9cc0f698b1c530e |
class BenchmarkConfigSpec(spec.BaseSpec): <NEW_LINE> <INDENT> def __init__(self, component_full_name, expected_os_types=None, **kwargs): <NEW_LINE> <INDENT> super(BenchmarkConfigSpec, self).__init__(component_full_name, **kwargs) <NEW_LINE> if expected_os_types is not None: <NEW_LINE> <INDENT> mismatched_os_types = [] ... | Configurable options of a benchmark run.
Attributes:
description: None or string. Description of the benchmark to run.
flags: flags.FlagValues. Values to use for each flag while executing the
benchmark.
vm_groups: dict mapping VM group name string to _VmGroupSpec. Configurable
options for each VM gro... | 62598fb256b00c62f0fb293e |
class Worktree(object): <NEW_LINE> <INDENT> def __init__(self, repo, process_name): <NEW_LINE> <INDENT> self.repo = repo <NEW_LINE> self.pygit2_repo = pygit2_get(repo) <NEW_LINE> self._worktree = None <NEW_LINE> self.process_name = process_name <NEW_LINE> self.worktree_name = "-".join(str(item) for item in self.process... | Wrapper for accessing a git worktree for a specific process.
To access the worktree call .get() | 62598fb23d592f4c4edbaf48 |
class ExternalAddressbook(AddressBook): <NEW_LINE> <INDENT> def __init__(self, commandline, regex, reflags=0, external_filtering=True, **kwargs): <NEW_LINE> <INDENT> AddressBook.__init__(self, **kwargs) <NEW_LINE> self.commandline = commandline <NEW_LINE> self.regex = regex <NEW_LINE> self.reflags = reflags <NEW_LINE> ... | :class:`AddressBook` that parses a shell command's output | 62598fb25166f23b2e243462 |
class AGSDiscoveryImageCatalogPage(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{A3D46959-CF28-47FA-BCB8-BA69D1DFA56A}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{C0FC1503-7E6F-11D2-AABF-00C04FA375F1}', 10, 2) | Esri AGS Image Catalog Parameters Property Page. | 62598fb2097d151d1a2c10b5 |
class ApplicationAPIError(APIError): <NEW_LINE> <INDENT> pass | Exception raised when an :class:`ApplicationAPI` request fails. | 62598fb27047854f4633f463 |
@dataclass <NEW_LINE> class Lesson(DB.base, StandardFields): <NEW_LINE> <INDENT> language: str <NEW_LINE> __tablename__ = "lesson" <NEW_LINE> language = Column(String(LANG_ID_LEN), nullable=False) <NEW_LINE> versions = relationship( "LessonVersion", back_populates="lesson", cascade="all, delete" ) | Represent a logical lesson. | 62598fb256ac1b37e6302273 |
class RunnerResults(dict): <NEW_LINE> <INDENT> def __init__(self, results): <NEW_LINE> <INDENT> self.update(results) <NEW_LINE> <DEDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> return lambda server: self.acquire(server, key) <NEW_LINE> <DEDENT> def acquire(self, server, key): <NEW_LINE> <INDENT> if server not i... | Wraps the results of parsed module_runner output. The result may
be used just like it is in Ansible:
result['contacted']['server']['rc']
or it can alternatively be used thusly:
result.rc('server') | 62598fb267a9b606de546056 |
class SplitRoute(plugin.InputPreparationPlugin): <NEW_LINE> <INDENT> ROUTE_STEPS_SET=set(["ENG", "CAD","CAM","MILL", "MILL-SET","TURN", "DRILL", "QUAL","EDM", "EDM-SET","ASSM", "MAN","INJM", "INJM-MAN", "INJM-SET"]) <NEW_LINE> DESIGN_ROUTE_STEPS_SET=set(["ENG", "CAD"]) <NEW_LINE> def preprocess(self, data): <NEW_LINE> ... | Input preparation
reads the data from external data base and splits the routes if the parts described are design and mould | 62598fb2167d2b6e312b6ffb |
class Item(GameObject): <NEW_LINE> <INDENT> def __init__(self, x, y, levelnumber, char, **kwargs): <NEW_LINE> <INDENT> GameObject.__init__(self,x,y,levelnumber, char, **kwargs) <NEW_LINE> if self.char == ":": <NEW_LINE> <INDENT> self.longtext = self.generate_text() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.lon... | individual Item with all attributes | 62598fb2bf627c535bcb1528 |
class ZWaveSensor(zwave.ZWaveDeviceEntity): <NEW_LINE> <INDENT> def __init__(self, values): <NEW_LINE> <INDENT> zwave.ZWaveDeviceEntity.__init__(self, values, DOMAIN) <NEW_LINE> self.update_properties() <NEW_LINE> <DEDENT> def update_properties(self): <NEW_LINE> <INDENT> self._state = self.values.primary.data <NEW_LINE... | Representation of a Z-Wave sensor. | 62598fb2460517430c4320a2 |
class ComponentTests(ossie.utils.testing.ScaComponentTestCase): <NEW_LINE> <INDENT> def testScaBasicBehavior(self): <NEW_LINE> <INDENT> execparams = self.getPropertySet(kinds=("execparam",), modes=("readwrite", "writeonly"), includeNil=False) <NEW_LINE> execparams = dict([(x.id, any.from_any(x.value)) for x in execpara... | Test for all component implementations in skiphead_ss | 62598fb2a8370b77170f0465 |
@six.add_metaclass(abc.ABCMeta) <NEW_LINE> class AuthMethodHandler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def authenticate(self, context, auth_payload, auth_context): <NEW_LINE> <INDENT> raise exception.Unauthorized() | Abstract base class for an authentication plugin. | 62598fb2e5267d203ee6b98d |
class SplitConv(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, num_ways, divisible_by=8, batch_norm=False, activation_fn=torch.nn.ReLU(inplace=True)): <NEW_LINE> <INDENT> super(SplitConv, self).__init__() <NEW_LINE> if num_ways == 1 or min(in_channels // num_ways, out_channels // nu... | Creates a split convolution. | 62598fb28a349b6b436862c5 |
class Dialog_Xorg(QtGui.QDialog): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> QtGui.QDialog.__init__(self) <NEW_LINE> self.__the_dialog = Ui_DialogXorg() <NEW_LINE> self.__the_dialog.setupUi(self) <NEW_LINE> self.xorg_list = Utils.get_x11_windows_id_list() <NEW_LINE> self.add_xorg_windows() <NEW_LINE> s... | classdocs | 62598fb2dc8b845886d53640 |
class PackException(Exception): <NEW_LINE> <INDENT> pass | Error while unpacking. | 62598fb25fdd1c0f98e5e016 |
class NoTimeWaitTCPServer(socketserver.ThreadingTCPServer): <NEW_LINE> <INDENT> def server_bind(self): <NEW_LINE> <INDENT> self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) <NEW_LINE> self.socket.bind(self.server_address) | when a socket does is shutdown dance, it ends up in a TIME-WAIT state,
which can prevent rebinding on it quickly. here we say "shut up, socket",
let me rebind anyways even if you're in TIME-WAIT." that will teach it. | 62598fb230bbd722464699bd |
class ValidatedLineEdit(QtWidgets.QLineEdit): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.message_field = kwargs.pop('message_field', None) <NEW_LINE> super(ValidatedLineEdit, self).__init__(*args, **kwargs) <NEW_LINE> self.message_field.setVisible(False) <NEW_LINE> self.icon = Non... | A custom line edit that can display an icon
| 62598fb2a17c0f6771d5c2be |
class CallbackManager(object): <NEW_LINE> <INDENT> def __init__(self, pre=None, post=None): <NEW_LINE> <INDENT> self.pre = pre if pre is not None else _nop <NEW_LINE> self.post = post if post is not None else _nop <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return _ManagedCallbackContex... | Create a context manager from a pre-execution callback and a
post-execution callback.
Parameters
----------
pre : (...) -> any, optional
A pre-execution callback. This will be passed ``*args`` and
``**kwargs``.
post : (...) -> any, optional
A post-execution callback. This will be passed ``*args`` and
`... | 62598fb244b2445a339b69b6 |
class AriStatusBinFile(AriBinFile): <NEW_LINE> <INDENT> def __init__(self, sdir, status): <NEW_LINE> <INDENT> fn = self._getOutFname(status) <NEW_LINE> fname = "{0}/{1}".format(sdir, fn) <NEW_LINE> super( AriStatusBinFile, self ).__init__(fname) <NEW_LINE> <DEDENT> def _getOutFname(self, status): <NEW_LINE> <INDENT> re... | an AriBinFile that knows how to set its own name given a
TSnStatusUpdate object. a unique filename is guaranteed by
AriBinFile. | 62598fb22ae34c7f260ab16b |
class QueryTestablePermissionsRequest(_messages.Message): <NEW_LINE> <INDENT> fullResourceName = _messages.StringField(1) <NEW_LINE> pageSize = _messages.IntegerField(2, variant=_messages.Variant.INT32) <NEW_LINE> pageToken = _messages.StringField(3) | A request to get permissions which can be tested on a resource.
Fields:
fullResourceName: Required. The full resource name to query from the list
of testable permissions. The name follows the Google Cloud Platform
resource format. For example, a Cloud Platform project with id `my-
project` will be named... | 62598fb21f5feb6acb162ca8 |
class AddURLResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. ((integer) The response from Instapaper. Successful reqests will return a 201 status code.) | 62598fb255399d3f056265a3 |
class DigitalVILMapper(DataMapper): <NEW_LINE> <INDENT> def __init__(self, prod): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> lin_scale = float16(prod.thresholds[0]) <NEW_LINE> lin_offset = float16(prod.thresholds[1]) <NEW_LINE> log_start = prod.thresholds[2] <NEW_LINE> log_scale = float16(prod.thresholds[3]) <NE... | Mapper for digital VIL products. | 62598fb2851cf427c66b8345 |
class BeerIngredients(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'ingredients' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> ingredient_name = db.Column(db.String, nullable=False) <NEW_LINE> beer_id = db.Column(db.Integer, db.ForeignKey('beers.id'), nullable=False) <NEW_LINE> def save(self): <N... | Beer Ingredients Model | 62598fb2442bda511e95c4e1 |
class RealMatrix(Matrix): <NEW_LINE> <INDENT> def __new__(cls, stream): <NEW_LINE> <INDENT> return Matrix.__new__(cls, stream, precision=stream.precision) | Matrix with floats/doubles, depending on precision of stream. With index.
This requires the stream to have an attribute 'precision', which
determines whether floating points are encoded in single (4) or
in double (!4) precision. | 62598fb27047854f4633f464 |
class TestLocalApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = isi_sdk_8_2_2.api.local_api.LocalApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_cluster_time(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_ge... | LocalApi unit test stubs | 62598fb21b99ca400228f575 |
class Buttons(Device): <NEW_LINE> <INDENT> CLICKED, PRESSED, RELEASE = range(3) <NEW_LINE> PUD_UP = gpio.PUD_UP <NEW_LINE> PUD_DOWN = gpio.PUD_DOWN <NEW_LINE> def __init__(self, iface, name=None, clicked=None, pressed=None, release=None): <NEW_LINE> <INDENT> if not isinstance(iface, InterfaceGPIO): <NEW_LINE> <IN... | Supervise the state of one or more inputs channels when they change the state
to up or down. It calls a callback function and passes the channel that generated
the event and the new channel status. | 62598fb25fcc89381b266191 |
class GradResearchArea(GradHappening): <NEW_LINE> <INDENT> trans_areas, trans_choices, trans_acad_org = None, None, None <NEW_LINE> def __init__(self, emplid, adm_appl_nbr, acad_org, area, choice): <NEW_LINE> <INDENT> if not GradResearchArea.trans_areas: <NEW_LINE> <INDENT> GradMetadata.trans_areas, GradMetadata.trans_... | The research area given by this student on his/her application.
There may be several of these: they end up joined together into a text field. | 62598fb2cc0a2c111447b09c |
class LoginForm(Form): <NEW_LINE> <INDENT> name = StringField('Username', validators=[ Required(), Length(1, 64), Regexp('^[A-Za-z][A-Za-z0-9_.]*$', 0, 'Usernames must have only letters, ' 'numbers, dots or underscores')]) <NEW_LINE> password = PasswordField('password', validators=[InputRequired('Please enter your pass... | 用户登陆 | 62598fb221bff66bcd722cf1 |
class LSUN(data.Dataset): <NEW_LINE> <INDENT> def __init__(self, db_path, classes='train', transform=None, target_transform=None): <NEW_LINE> <INDENT> categories = ['bedroom', 'bridge', 'church_outdoor', 'classroom', 'conference_room', 'dining_room', 'kitchen', 'living_room', 'restaurant', 'tower'] <NEW_LINE> dset_opts... | db_path = root directory for the database files
classes = 'train' | 'val' | 'test' | ['bedroom_train', 'church_train', ...] | 62598fb24e4d5625663724b1 |
class RDFS_ClassMeta(type): <NEW_LINE> <INDENT> def __new__(meta_cls, name, bases, dct): <NEW_LINE> <INDENT> dct.setdefault("__properties__", []) <NEW_LINE> dct.setdefault("__uri__", None) <NEW_LINE> return super(RDFS_ClassMeta, meta_cls).__new__(meta_cls, name, bases, dct) <NEW_LINE> <DEDENT> def __init__(cls, name, b... | Metaclass for the `RDFS_Class` class.
This metaclass governs the creation of all classes which correspond
to an RDFS.Class resource. | 62598fb2167d2b6e312b6ffd |
class FontSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'ComplexScript': 'str', 'EastAsian': 'str', 'Latin': 'str' } <NEW_LINE> self.attributeMap = { 'ComplexScript': 'ComplexScript','EastAsian': 'EastAsian','Latin': 'Latin'} <NEW_LINE> self.ComplexScript = None <NEW_LIN... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fb2460517430c4320a3 |
class JSONEncoderWithRDFPrimitivesSupport(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, (rdfvalue.RDFInteger, rdfvalue.RDFBool, rdfvalue.RDFString)): <NEW_LINE> <INDENT> return obj.SerializeToDataStore() <NEW_LINE> <DEDENT> return json.JSONEncoder.default(self, ob... | Custom JSON encoder that encodes renderers output.
Custom encoder is required to facilitate usage of primitive values -
booleans, integers and strings - in renderers responses.
If renderer references an RDFString, RDFInteger or and RDFBOol when building a
response, it will lead to JSON encoding failure when response ... | 62598fb2ff9c53063f51a6d7 |
class MockModel(nn.Module): <NEW_LINE> <INDENT> r <NEW_LINE> def __init__(self, *args, use_ner=False, **kwargs): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.use_ner = use_ner <NEW_LINE> self.device = torch.device("cpu") <NEW_LINE> self.transformer = nn.Linear(512, 2) <NEW_LINE> self.head = nn.Linear(2, 2) <N... | Model imitating model for NTI RUCOS to test other components without problems with RAM | 62598fb28a349b6b436862c7 |
class Activity: <NEW_LINE> <INDENT> def __init__(self, activity_id, predecessor, duration, resource): <NEW_LINE> <INDENT> self.id = activity_id <NEW_LINE> self.predecessor = predecessor <NEW_LINE> self.duration = duration <NEW_LINE> self.resource = resource if resource is not None else None <NEW_LINE> self.est = None <... | basic structure of an activity having an id, predecessor, duration and a resource | 62598fb2dd821e528d6d8fb9 |
class OAuth2Decorator(object): <NEW_LINE> <INDENT> def __init__(self, client_id, client_secret, scope, user_agent, auth_uri='https://accounts.google.com/o/oauth2/auth', token_uri='https://accounts.google.com/o/oauth2/token'): <NEW_LINE> <INDENT> self.flow = OAuth2WebServerFlow(client_id, client_secret, scope, user_agen... | Utility for making OAuth 2.0 easier.
Instantiate and then use with oauth_required or oauth_aware
as decorators on webapp.RequestHandler methods.
Example:
decorator = OAuth2Decorator(
client_id='837...ent.com',
client_secret='Qh...wwI',
scope='https://www.googleapis.com/auth/buzz',
user_agen... | 62598fb2adb09d7d5dc0a616 |
class DataSpecificationUnknownTypeException(DataSpecificationException): <NEW_LINE> <INDENT> def __init__(self, type_id, command): <NEW_LINE> <INDENT> Exception.__init__( self, "Unknown id value {0:d} for data type during command " "{1:s}".format(type_id, command)) | An exception that indicates that the value of the requested type is unknown
| 62598fb25fc7496912d482c1 |
class S3Bucket: <NEW_LINE> <INDENT> def __init__(self, bucket): <NEW_LINE> <INDENT> self.bucket = bucket <NEW_LINE> <DEDENT> @property <NEW_LINE> def arn(self): <NEW_LINE> <INDENT> return s3_arn(self.bucket.name) <NEW_LINE> <DEDENT> def create(self): <NEW_LINE> <INDENT> return aws.create_bucket( self.bucket.name, self.... | Wraps a S3Bucket model to provide convenience methods for AWS | 62598fb2796e427e5384e820 |
class GroupPlacementViewServiceGrpcTransport(object): <NEW_LINE> <INDENT> _OAUTH_SCOPES = () <NEW_LINE> def __init__(self, channel=None, credentials=None, address='googleads.googleapis.com:443'): <NEW_LINE> <INDENT> if channel is not None and credentials is not None: <NEW_LINE> <INDENT> raise ValueError( 'The `channel`... | gRPC transport class providing stubs for
google.ads.googleads.v1.services GroupPlacementViewService API.
The transport provides access to the raw gRPC stubs,
which can be used to take advantage of advanced
features of gRPC. | 62598fb297e22403b383af9a |
class Agent(): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.seed = random.seed(seed) <NEW_LINE> self.qnetwork_local = QNetwork(state_size, action_size, seed).to(device) <NEW_LINE> self.qn... | Interacts with and learns from the environment. | 62598fb2be8e80087fbbf0f1 |
class UsersAttentionMiddlePeopleCreateView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> json_dict = json.loads(request.body.decode()) <NEW_LINE> AttentionMiddlePeople.objects.create(**json_dict) <NEW_LINE> return JsonResponse({"statue": 200, 'data': '添加成功'}, safe=Fals... | 用户关注的置业顾问记录/上传 | 62598fb2a79ad1619776a0f4 |
class UpdateNike(APIView): <NEW_LINE> <INDENT> permission_classes = [permissions.IsAuthenticated] <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> prof = Profile.objects.get(user=request.user) <NEW_LINE> ser = EditNike(prof, data=request.data) <NEW_LINE> if ser.is_valid(): <NEW_LINE> <INDENT> ser.save() <NEW_LIN... | Редактирование ника пользователя | 62598fb2f548e778e596b630 |
@pytest.mark.draft <NEW_LINE> @pytest.mark.components <NEW_LINE> @pytest.allure.story('Clients') <NEW_LINE> @pytest.allure.feature('PATCH') <NEW_LINE> class Test_PFE_Components(object): <NEW_LINE> <INDENT> @pytest.allure.link('https://jira.qumu.com/browse/TC-42301') <NEW_LINE> @pytest.mark.Clients <NEW_LINE> @pytest.ma... | PFE Clients test cases. | 62598fb27047854f4633f466 |
class LoginWithGoogleDto(object): <NEW_LINE> <INDENT> swagger_types = { 'id_token': 'str' } <NEW_LINE> attribute_map = { 'id_token': 'idToken' } <NEW_LINE> def __init__(self, id_token=None): <NEW_LINE> <INDENT> self._id_token = None <NEW_LINE> self.discriminator = None <NEW_LINE> if id_token is not None: <NEW_LINE> <IN... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fb27d43ff2487427448 |
class UFuncOperator(Operator): <NEW_LINE> <INDENT> symbol = None <NEW_LINE> nin = None <NEW_LINE> nout = None <NEW_LINE> operation = None <NEW_LINE> def __init__(self, op): <NEW_LINE> <INDENT> Operator.__init__(self, name=op.__name__) <NEW_LINE> self.symbol = op.__name__ <NEW_LINE> self.nin = op.nin <NEW_LINE> self.nou... | A operator wrapper around a numpy ufunc.
The name and symbol attributes are set equal to the ufunc.__name__
attribute. nin and nout are also taken from the ufunc. | 62598fb2283ffb24f3cf3918 |
class HealthchecksioBinarySensor(BinarySensorEntity): <NEW_LINE> <INDENT> def __init__(self, hass, config, config_entry): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.attr = {} <NEW_LINE> self.config_entry = config_entry <NEW_LINE> self._status = None <NEW_LINE> self.config = config <NEW_LINE> <DEDENT> async de... | Healthchecksio binary_sensor class. | 62598fb29c8ee823130401b8 |
class ConfigFilter(metaclass=MetaclassRegistry): <NEW_LINE> <INDENT> name = "identity" <NEW_LINE> sensitive_arg = False <NEW_LINE> def Filter(self, data: Text) -> Text: <NEW_LINE> <INDENT> precondition.AssertType(data, Text) <NEW_LINE> return data | A configuration filter can transform a configuration parameter. | 62598fb2cc0a2c111447b09e |
class Serializer(PythonSerializer): <NEW_LINE> <INDENT> internal_use_only = False <NEW_LINE> def handle_field(self, obj, field): <NEW_LINE> <INDENT> if isinstance(field, models.TimeField) and getattr(obj, field.name) is not None: <NEW_LINE> <INDENT> self._current[field.name] = str(getattr(obj, field.name)) <NEW_LINE> <... | Convert a queryset to YAML. | 62598fb2aad79263cf42e85f |
class ParticleRestartTestHarness(TestHarness): <NEW_LINE> <INDENT> def _run_openmc(self): <NEW_LINE> <INDENT> args = {'openmc_exec': self._opts.exe} <NEW_LINE> if self._opts.mpi_exec is not None: <NEW_LINE> <INDENT> args.update({'mpi_procs': self._opts.mpi_np, 'mpi_exec': self._opts.mpi_exec}) <NEW_LINE> <DEDENT> retur... | Specialized TestHarness for running OpenMC particle restart tests. | 62598fb23346ee7daa33768d |
class HeaderExists(Rule): <NEW_LINE> <INDENT> NAME = 'header-exists' <NEW_LINE> _log = logging.getLogger(NAME) <NEW_LINE> def __init__(self, rule_data, cfg): <NEW_LINE> <INDENT> super().__init__(rule_data, cfg) <NEW_LINE> self._header_name = rule_data['name'] <NEW_LINE> <DEDENT> def check(self, message): <NEW_LINE> <IN... | Looks for a message to have a given header. | 62598fb221bff66bcd722cf3 |
class AgentAssistantRecord(proto.Message): <NEW_LINE> <INDENT> article_suggestion_answer = proto.Field( proto.MESSAGE, number=5, oneof="answer", message=participant.ArticleAnswer, ) <NEW_LINE> faq_answer = proto.Field( proto.MESSAGE, number=6, oneof="answer", message=participant.FaqAnswer, ) | Represents a record of a human agent assist answer.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/... | 62598fb2379a373c97d990a1 |
class LetterGridFieldGroup(_GridFieldGroup): <NEW_LINE> <INDENT> def __init__(self, grid: Grid, horizontal_start: int, vertical_start: int, num_fields: int, field_length: int, field_orientation: geometry_utils.Orientation): <NEW_LINE> <INDENT> fields_vertical = field_orientation is geometry_utils.Orientation.VERTICAL <... | A letter grid field group is one group of fields that represents an
entire string. | 62598fb2be7bc26dc9251ea2 |
class Vereador(Politico): <NEW_LINE> <INDENT> def __init__(self, nome, partido, municipio, estado): <NEW_LINE> <INDENT> Politico.__init__(self) <NEW_LINE> self.set_nome(nome) <NEW_LINE> self.set_salario(5000) <NEW_LINE> self.set_partido(partido) <NEW_LINE> self.set_estado(estado) <NEW_LINE> self.__municipio = municipio... | Classe Senador | 62598fb2d486a94d0ba2c05c |
class ReceptiveFieldTransformer(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, width): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> <DEDENT> def fit(self, X, y=None): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def transform(self, X, y=None): <NEW_LINE> <INDENT> no_channels = Fals... | Obtain regularly spaced subimages belonging to the masked area of images in a collection.
Parameters
----------
width: width along every dimension [wx, wy, wz] - must be unpair | 62598fb2ff9c53063f51a6d9 |
class Card(NumType): <NEW_LINE> <INDENT> pass | cardinal number or corresponding interrogative / relative / indefinite / demonstrative word | 62598fb27d847024c075c44f |
class DeleteShadowResponse(awsiot.ModeledClass): <NEW_LINE> <INDENT> __slots__ = ['client_token', 'timestamp', 'version'] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.client_token = kwargs.get('client_token') <NEW_LINE> self.timestamp = kwargs.get('timestamp') <NEW_LINE> self.version = kwarg... | Response payload to a DeleteShadow request.
All attributes are None by default, and may be set by keyword in the constructor.
Keyword Args:
client_token (str): A client token used to correlate requests and responses.
timestamp (datetime.datetime): The time the response was generated by AWS IoT.
version (i... | 62598fb25fdd1c0f98e5e019 |
class Query(object): <NEW_LINE> <INDENT> def __init__(self, tables=None, where_clause=None, where_clause_params=None, joins=None): <NEW_LINE> <INDENT> self.tables = tables or [] <NEW_LINE> self.where_clause = where_clause or [] <NEW_LINE> self.where_clause_params = where_clause_params or [] <NEW_LINE> self.joins = join... | Dumb implementation of a Query object, using 3 string lists so far
for backwards compatibility with the (table, where_clause, where_params) previously used.
TODO: To be improved after v6.0 to rewrite part of the ORM and add support for:
- auto-generated multiple table aliases
- multiple joins to the same table with ... | 62598fb216aa5153ce40058f |
class Muster(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://github.com/llnl/muster" <NEW_LINE> url = "https://github.com/llnl/muster/archive/v1.0.tar.gz" <NEW_LINE> version('1.0.1', 'd709787db7e080447afb6571ac17723c') <NEW_LINE> version('1.0', '2eec6979a4a36d3a65a792d12969be16') <NEW_LINE> depends_on('bo... | The Muster library provides implementations of sequential and
parallel K-Medoids clustering algorithms. It is intended as a
general framework for parallel cluster analysis, particularly
for performance data analysis on systems with very large
numbers of processes. | 62598fb3e5267d203ee6b991 |
class CrossrefDOIAndISSNList(CrossrefTask): <NEW_LINE> <INDENT> date = ClosestDateParameter(default=datetime.date.today()) <NEW_LINE> def requires(self): <NEW_LINE> <INDENT> return {'input': CrossrefIntermediateSchema(date=self.date), 'jq': Executable(name='jq', message='https://github.com/stedolan/jq')} <NEW_LINE> <DE... | A list of Crossref DOIs with their ISSNs. | 62598fb38e7ae83300ee9130 |
class PaginatorEmbedInterface(PaginatorInterface): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._embed = kwargs.pop('embed', None) or discord.Embed() <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> @property <NEW_LINE> def send_kwargs(self): <NEW_LINE> <INDENT> disp... | A paginator interface that encloses content in an embed. | 62598fb391f36d47f2230eee |
class DescribeInsurePacksResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InsurePacks = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("InsurePacks") is not None: <NEW_LINE> <INDENT> self.InsurePacks = ... | DescribeInsurePacks返回参数结构体
| 62598fb397e22403b383af9c |
@use_strategy(BUILD_STRATEGY) <NEW_LINE> class LeafDescriptorFactory(Factory): <NEW_LINE> <INDENT> FACTORY_FOR = XModuleDescriptor <NEW_LINE> runtime = SubFactory(DescriptorSystemFactory) <NEW_LINE> url_name = LazyAttributeSequence('{.block_type}_{}'.format) <NEW_LINE> @lazy_attribute <NEW_LINE> def location(self): <NE... | Factory to generate leaf XModuleDescriptors. | 62598fb3be8e80087fbbf0f3 |
class DescribePublishSubscribeResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.PublishSubscribeSet = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("Tota... | DescribePublishSubscribe返回参数结构体
| 62598fb3097d151d1a2c10bb |
class GridWorld(object): <NEW_LINE> <INDENT> def __init__(self, m, n): <NEW_LINE> <INDENT> self.m = m <NEW_LINE> self.n = n <NEW_LINE> self.grid = np.zeros((m,n)) <NEW_LINE> self.stateSpace = [i+1 for i in range(self.m*self.n-2)] <NEW_LINE> self.stateSpacePlus = [i for i in range(self.m*self.n)] <NEW_LINE> self.actionS... | Gridworld defined by m x n matrix with
terminal states at top left corner and bottom right corner.
State transitions are deterministic; attempting to move
off the grid leaves the state unchanged, and rewards are -1 on
each step.
In this implementation we model the environment as a system of
equations to be solved, ra... | 62598fb338b623060ffa912a |
class TraceTracker(Printer): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> self.out = StringIO() <NEW_LINE> super(TraceTracker, self).__init__(self.out, *args, **kw) <NEW_LINE> self.checker = MinimockOutputChecker() <NEW_LINE> self.options = doctest.ELLIPSIS <NEW_LINE> self.options |= doctes... | :class:`AbstractTracker` implementation for using MiniMock in non-
:mod:`doctest` tests. Follows the pattern of recording minimocked
object usage as strings, then using the facilities of :mod:`doctest`
to assert the correctness of these usage strings. | 62598fb3498bea3a75a57bad |
class CFFICDataWrapper(object): <NEW_LINE> <INDENT> def __init__(self, cdecl, ffi): <NEW_LINE> <INDENT> self._cdata = ffi.new(cdecl) <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self._cdata, name) <NEW_LINE> <DEDENT> def __setattr__(self, name, value): <NEW_LINE> <INDENT> if name ... | Base class for exposing Python types and interfaces to pywincffi users:
* Wraps a CFFI cdata object in self._cdata.
* Delegates attribute getting/setting to self._cdata, supporting structs.
* Delegates item getting/setting to self._cdata, supporting arrays.
Attribute access is not delegated to the wrapped object if t... | 62598fb3a05bb46b3848a8f9 |
class CMSCalendarEntriesPlugin(ZinniaCMSPluginBase): <NEW_LINE> <INDENT> model = CalendarEntriesPlugin <NEW_LINE> name = _('Calendar entries') <NEW_LINE> render_template = 'cmsplugin_zinnia/calendar.html' <NEW_LINE> fieldsets = ((None, { 'fields': (('year', 'month'),), 'description': _("If you don't set year and month,... | Plugin for including calendar of published entries | 62598fb33346ee7daa33768e |
class SquareFeet: <NEW_LINE> <INDENT> def create_totalSqFeet(self, dataset): <NEW_LINE> <INDENT> if 'TotalArea' not in dataset: <NEW_LINE> <INDENT> dataset['TotalArea'] = dataset.apply(lambda row: self.add_GrLivArea_TotalBsmtSF(row), axis=1) <NEW_LINE> <DEDENT> <DEDENT> def add_GrLivArea_TotalBsmtSF(self, row): <NEW_LI... | process square feet related features
GrLivArea TotalBsmtSF
Total living space generally is very important
when people buying houses, adding a predictors that adds up the living spaces | 62598fb33539df3088ecc340 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.