code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Mapping(object): <NEW_LINE> <INDENT> def __init__(self, minimum=None, image=None): <NEW_LINE> <INDENT> self._uint8Max = float(np.iinfo(np.uint8).max) <NEW_LINE> try: <NEW_LINE> <INDENT> len(minimum) <NEW_LINE> <DEDENT> except TypeError: <NEW_LINE> <INDENT> minimum = 3*[minimum] <NEW_LINE> <DEDENT> if len(minimum)...
Baseclass to map red, blue, green intensities into uint8 values. Parameters ---------- minimum : float or sequence(3) Intensity that should be mapped to black (a scalar or array for R, G, B). image : `~numpy.ndarray`, optional An image used to calculate some parameters of some mappings.
62598ee630bbd722464682d9
class linux_keyboard_notifier(linux_common.AbstractLinuxCommand): <NEW_LINE> <INDENT> def calculate(self): <NEW_LINE> <INDENT> linux_common.set_plugin_members(self) <NEW_LINE> knl_addr = self.addr_space.profile.get_symbol("keyboard_notifier_list") <NEW_LINE> if not knl_addr: <NEW_LINE> <INDENT> debug.error("Symbol keyb...
Parses the keyboard notifier call chain
62598ee69c8ee8231303f4a8
class TestFoldingInfo6(NetAppObject): <NEW_LINE> <INDENT> _zfield3 = None <NEW_LINE> @property <NEW_LINE> def zfield3(self): <NEW_LINE> <INDENT> return self._zfield3 <NEW_LINE> <DEDENT> @zfield3.setter <NEW_LINE> def zfield3(self, val): <NEW_LINE> <INDENT> if val != None: <NEW_LINE> <INDENT> self.validate('zfield3', va...
Test input typedef 1
62598ee6bd1bec0571e1441b
class Time: <NEW_LINE> <INDENT> __slots__ = ["_samples", "_step"] <NEW_LINE> def __init__(self, start, step, num, dtype=None): <NEW_LINE> <INDENT> step = step * 1.0 <NEW_LINE> if step < 0: <NEW_LINE> <INDENT> raise ValueError("'step' must be positive.") <NEW_LINE> <DEDENT> samples = ut.make_timevect(num, step, start, d...
Linearly spaced time vector. Parameters ---------- samples : ndarray start : float Start time (second) step : float Time step (second) num : int Number of samples dtype : numpy.dtype Attributes ---------- samples : ndarray Time vector start : float end : float step : float Notes ----- Use len() to ge...
62598ee6aad79263cf42ceaa
class Event: <NEW_LINE> <INDENT> _last_id = 0 <NEW_LINE> def __init__(self, type, src_id, f, **kwargs): <NEW_LINE> <INDENT> self._id = Event._last_id <NEW_LINE> Event._last_id += 1 <NEW_LINE> self._type = type <NEW_LINE> self._f = f <NEW_LINE> self._kwargs = kwargs <NEW_LINE> self._src_id = src_id <NEW_LINE> <DEDENT> @...
Event object to run. This object contains a function to run with any arguments. This is used by other objects to run specific functions at some time. Parameters ---------- type : string A message specifying the type of the event. src_id : string The id of the source object creating the event. f : func The...
62598ee6009cb60464cffbef
class StunIpAddress(models.Model): <NEW_LINE> <INDENT> Kinds = enum(LOCAL=1, REMOTE=2, DOTLOCAL=3, NA=0) <NEW_LINE> ip_address = models.GenericIPAddressField(default="127.0.0.1") <NEW_LINE> ip_address_kind = models.IntegerField(default=0) <NEW_LINE> country = models.CharField( max_length=3, default='DEF', help_text="Co...
Place to store each IP address for that client for that measurement
62598ee6d7e4931a7ef3a740
class McastBridgeHandler(BaseRequestHandler): <NEW_LINE> <INDENT> def handle ( self ): <NEW_LINE> <INDENT> own_addr = self.request[1].getsockname() <NEW_LINE> if self.client_address != own_addr: <NEW_LINE> <INDENT> self.server.peer.send(self.request[0])
A handler class for multicast bridges (see class McastBridge). Gets the incoming datagram and puts it through to the opposite side of the bridge.
62598ee6f7d966606f746691
class Server(models.Model): <NEW_LINE> <INDENT> sub_asset_type_choice = ( (0, 'PC服务器'), (1, '刀片机'), (2, '小型机'), ) <NEW_LINE> created_by_choice = ( ('auto', '自动添加'), ('manual', '手工录入'), ) <NEW_LINE> asset = models.OneToOneField('Asset', on_delete=models.CASCADE) <NEW_LINE> sub_asset_type = models.SmallIntegerField(choic...
服务器设备
62598ee6d486a94d0ba2a66e
class Test(testing.AutoTest): <NEW_LINE> <INDENT> TAGS = [ testing.LONG ] <NEW_LINE> def test_longComputation( self ): <NEW_LINE> <INDENT> self.m = MyClass() <NEW_LINE> self.result = self.m.longComputation() <NEW_LINE> if self.local: <NEW_LINE> <INDENT> print('long computation result: %r' % self.result) <NEW_LINE> <DED...
Example Test
62598ee645492302aabfab4e
class GuiNoteOption(gtk.HBox): <NEW_LINE> <INDENT> def __init__(self, option, dbstate, uistate, track, override): <NEW_LINE> <INDENT> gtk.HBox.__init__(self) <NEW_LINE> self.__option = option <NEW_LINE> self.__dbstate = dbstate <NEW_LINE> self.__db = dbstate.get_database() <NEW_LINE> self.__uistate = uistate <NEW_LINE>...
This class displays an option that allows a note from the database to be selected.
62598ee67d847024c075aa6f
class SentinelTiles(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def tile_url(image, viz_params=None): <NEW_LINE> <INDENT> logging.info("TILE_URL function") <NEW_LINE> if viz_params: <NEW_LINE> <INDENT> d = image.getMapId(viz_params) <NEW_LINE> logging.info(d) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> d = ...
Create dictionary with two urls to be used as webmap tiles for Sentinel 2 data. One should be the tile outline, and the other is the RGB data visulised. Metadata should also be returned. Note that the URLs from Earth Engine expire every 3 days.
62598ee6be383301e0251e7a
class CMEEquityExchangeCalendar(MarketCalendar): <NEW_LINE> <INDENT> aliases = ['CME_Equity', 'CBOT_Equity'] <NEW_LINE> regular_market_times = { "market_open": ((None, time(17), -1),), "market_close": ((None, time(16)),), "break_start": ((None, time(15,15)),), "break_end": ((None, time(15,30)),) } <NEW_LINE> @property ...
Exchange calendar for CME for Equity products Open Time: 6:00 PM, America/New_York / 5:00 PM Chicago Close Time: 5:00 PM, America/New_York / 4:00 PM Chicago Break: 4:15 - 4:30pm America/New_York / 3:15 - 3:30 PM Chicago
62598ee6e76e3b2f99fd70d9
class IOptOutEntrySubitem(Interface): <NEW_LINE> <INDENT> lang = schema.Choice( title=_(u'Language'), defaultFactory=default_language, missing_value=u'', required=True, vocabulary=u'rer.cookieconsent.vocabularies.AvailableLanguages', ) <NEW_LINE> app_title = schema.TextLine( title=_(u'Application name'), description=_(...
A single translation entry for a OutOut configuration See IOptOutEntry
62598ee63c8af77a43b67284
class Init(Resource): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> writeLog('[INFO] Init page requested') <NEW_LINE> username = 'admin' <NEW_LINE> if User.query.filter_by(username = username).first() is not None: <NEW_LINE> <INDENT> writeLog('[ERROR] Users database already initialized') <NEW_LINE> return Res...
Generate the initial 'admin' account. Creates a password and a token in the database without authentication. If the user 'admin' already exists returns an error Parameters: - password: The admin password to create
62598ee67d847024c075aa70
class NoRouteFoundException(Exception): <NEW_LINE> <INDENT> pass
Unable to find a route in the matrix provided
62598ee6d58c6744b42db607
class FreeChecking(Account): <NEW_LINE> <INDENT> withdraw_fee = 1 <NEW_LINE> free_withdrawals = 2 <NEW_LINE> "*** YOUR CODE HERE ***" <NEW_LINE> def withdraw(self, amount): <NEW_LINE> <INDENT> self.free_withdrawals -= 1 <NEW_LINE> if self.free_withdrawals < 0: <NEW_LINE> <INDENT> return Account.withdraw(self, amount + ...
A bank account that charges for withdrawals, but the first two are free! >>> ch = FreeChecking('Jack') >>> ch.balance = 20 >>> ch.withdraw(100) # First one's free 'Insufficient funds' >>> ch.withdraw(3) # And the second 17 >>> ch.balance 17 >>> ch.withdraw(3) # Ok, two free withdrawals is enough 13 >>> ch.withd...
62598ee601c39578d7f1144b
class PublishBeforeYumDistTestCase( _RsyncDistUtilsMixin, TemporaryUserMixin, unittest.TestCase): <NEW_LINE> <INDENT> def test_all(self): <NEW_LINE> <INDENT> cfg = config.get_config() <NEW_LINE> if not selectors.bug_is_fixed(2187, cfg.pulp_version): <NEW_LINE> <INDENT> self.skipTest('https://pulp.plan.io/issues/2187') ...
Publish a repo with the rsync distributor before the yum distributor. Do the following: 1. Create a repository with a yum distributor and rsync distributor. 2. Publish with the rpm rsync distributor. Verify that: * The publish has a result of "skipped." * No files are placed on the remote system. 3. Publish w...
62598ee60a50d4780f703a4c
class GeocodeEarth(Pelias): <NEW_LINE> <INDENT> def __init__( self, api_key, *, domain='api.geocode.earth', timeout=DEFAULT_SENTINEL, proxies=DEFAULT_SENTINEL, user_agent=None, scheme=None, ssl_context=DEFAULT_SENTINEL, adapter_factory=None ): <NEW_LINE> <INDENT> super().__init__( api_key=api_key, domain=domain, timeou...
geocode.earth, a Pelias-based service provided by the developers of Pelias itself.
62598ee660cbc95b063629df
class WidgetPackerW(Process): <NEW_LINE> <INDENT> def pack(self, buffer): <NEW_LINE> <INDENT> weightLeft = 0 <NEW_LINE> while True: <NEW_LINE> <INDENT> packWeight = weightLeft <NEW_LINE> weightLeft = 0 <NEW_LINE> while True: <NEW_LINE> <INDENT> yield get, self, buffer, 1 <NEW_LINE> weightReceived = self.got[0].weight <...
Packs a number of widgets into a package
62598ee61f5feb6acb1612f3
class layoutiomode4(Enum): <NEW_LINE> <INDENT> _enumdict = const.layoutiomode4
enum layoutiomode4
62598ee6925a0f43d25e66cf
class IsAdminUserOrAuthenticatedAndReadOnlyOrOptions(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> return ( request.method == 'OPTIONS' or request.method in permissions.SAFE_METHODS and request.user and request.user.is_authenticated or request.user and req...
The request is authenticated as a user, or is a read-only request.
62598ee671ff763f4b5e5dfd
class CollectionError(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.value
Error used to report Collection errors
62598ee6cad5886f8bdc39a3
class Panel: <NEW_LINE> <INDENT> def __init__(self, xa, ya, xb, yb): <NEW_LINE> <INDENT> self.xa, self.ya = xa, ya <NEW_LINE> self.xb, self.yb = xb, yb <NEW_LINE> self.xc, self.yc = (xa+xb)/2, (ya+yb)/2 <NEW_LINE> self.length = math.sqrt((xb-xa)**2+(yb-ya)**2) <NEW_LINE> if xb-xa <= 0.: <NEW_LINE> <INDENT> self.beta = ...
Contains information related to one panel.
62598ee6090684286d592a31
class res_partner_agent(orm.Model): <NEW_LINE> <INDENT> _name = "res.partner.agent" <NEW_LINE> def name_get(self, cr, uid, ids, context=None): <NEW_LINE> <INDENT> if context is None: <NEW_LINE> <INDENT> context = {} <NEW_LINE> <DEDENT> res = [] <NEW_LINE> for obj in self.browse(cr, uid, ids): <NEW_LINE> <INDENT> res.ap...
objeto de comportamiento many2many que relaciona agentes o comerciales con partners
62598ee62ae34c7f260a978a
class SecuritySpyBinarySensor(SecuritySpyEntity, BinarySensorEntity): <NEW_LINE> <INDENT> def __init__( self, secspy_object, secspy_data, server_info, device_id, description: SecSpyBinaryEntityDescription, ): <NEW_LINE> <INDENT> super().__init__( secspy_object, secspy_data, server_info, device_id, description.key ) <NE...
A SecuritySpy Binary Sensor.
62598ee64428ac0f6e656bf4
class VirtualBoxPreferencesPage(QtGui.QWidget, Ui_VirtualBoxPreferencesPageWidget): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> QtGui.QWidget.__init__(self) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.uiUseLocalServercheckBox.stateChanged.connect(self._useLocalServerSlot) <NEW_LINE> self.uiRestoreDefa...
QWidget preference page for VirtualBox.
62598ee663d6d428bbee0e6f
class UnidadeCondicionadora(Componente): <NEW_LINE> <INDENT> source = 'images/flr.png' <NEW_LINE> fator = 1 <NEW_LINE> def remove_bubble(self): <NEW_LINE> <INDENT> self.fator = self.slider.value / 100 <NEW_LINE> if self.menu in self.parent.children: <NEW_LINE> <INDENT> self.parent.remove_widget(self.menu) <NEW_LINE> <D...
unidade condicionadora de ar comprimido sua função no software é apenas de ajustar a saída de pressão
62598ee6a79ad161977686bc
class files(object): <NEW_LINE> <INDENT> @HTTPCompatible(allow_all=True) <NEW_LINE> def PUT(self, ws_name, st_type, st_name, f_type, format): <NEW_LINE> <INDENT> import zipfile <NEW_LINE> if f_type == "file": <NEW_LINE> <INDENT> data = web.data() <NEW_LINE> <DEDENT> elif f_type == "url": <NEW_LINE> <INDENT> raise webap...
http://hostname/mra/workspaces/<ws>/datastores/<cs>/file.<extension> http://hostname/mra/workspaces/<ws>/coveragestores/<cs>/file.<extension>
62598ee6ac7a0e7691f70bb9
class IntegrationTest(TestCase): <NEW_LINE> <INDENT> _wrapped_func_blacklist = ('assertRaises', 'assertWarns', 'assertLogs', 'assertRaisesRegex', 'assertWarnsRegex') <NEW_LINE> patches = () <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self.asserter = TestCase() <NEW_LINE>...
Contains some common functionality for patching, and quality-oriented assertion logging.
62598ee657b8e32f52507456
class QuotedGraph(Graph): <NEW_LINE> <INDENT> def __init__(self, store, identifier): <NEW_LINE> <INDENT> super(QuotedGraph, self).__init__(store, identifier) <NEW_LINE> <DEDENT> def add(self, triple: Tuple[Node, Node, Node]): <NEW_LINE> <INDENT> s, p, o = triple <NEW_LINE> assert isinstance(s, Node), "Subject %s must b...
Quoted Graphs are intended to implement Notation 3 formulae. They are associated with a required identifier that the N3 parser *must* provide in order to maintain consistent formulae identification for scenarios such as implication and other such processing.
62598ee6f7d966606f746693
class SBDecoder(HybridBlock): <NEW_LINE> <INDENT> def __init__(self, dim2, classes, out_size, bn_epsilon, **kwargs): <NEW_LINE> <INDENT> super(SBDecoder, self).__init__(**kwargs) <NEW_LINE> with self.name_scope(): <NEW_LINE> <INDENT> self.decode1 = SBDecodeBlock( channels=classes, out_size=((out_size[0] // 8, out_size[...
SB decoder for SINet. Parameters: ---------- dim2 : int Size of dimension #2. classes : int Number of segmentation classes. out_size : tuple of 2 int Spatial size of the output tensor for the bilinear upsampling operation. bn_epsilon : float Small float added to variance in Batch norm.
62598ee66aa9bd52df0d3553
class CreateCommand(Command): <NEW_LINE> <INDENT> def handle(self): <NEW_LINE> <INDENT> app_directory = self.argument("app-directory") <NEW_LINE> force = self.option("force") <NEW_LINE> if Path(app_directory).exists(): <NEW_LINE> <INDENT> if force: <NEW_LINE> <INDENT> shutil.rmtree(app_directory) <NEW_LINE> <DEDENT> el...
Create an application using a template create {app-directory : path to the directory containing the application} {template-name? : template to use as the base for the application} {--force : overwrite directory if it already exists}
62598ee6d486a94d0ba2a670
class Discoverable(MDNSDiscoverable): <NEW_LINE> <INDENT> def info_from_entry(self, entry): <NEW_LINE> <INDENT> properties = {} <NEW_LINE> for key, value in entry.properties.items(): <NEW_LINE> <INDENT> if isinstance(value, bytes): <NEW_LINE> <INDENT> value = value.decode('utf-8') <NEW_LINE> <DEDENT> properties[key.dec...
Add support for discovering Axis devices.
62598ee60c0af96317c54a40
class ClipperCardWebSession(requests.Session): <NEW_LINE> <INDENT> LOGIN_URL = 'https://www.clippercard.com/ClipperCard/loginFrame.jsf' <NEW_LINE> BALANCE_URL = 'https://www.clippercard.com/ClipperWeb/cardValue.do?cardNumber=%s' <NEW_LINE> HEADERS = { 'FAKE_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) A...
A stateful session for clippercard.com
62598ee6462c4b4f79dba09d
class ABCQSet(Set): <NEW_LINE> <INDENT> def __init__(self, card=None, data=None, comment=''): <NEW_LINE> <INDENT> Set.__init__(self, card, data) <NEW_LINE> if comment: <NEW_LINE> <INDENT> self._comment = comment <NEW_LINE> <DEDENT> self.IDs = [] <NEW_LINE> self.components = [] <NEW_LINE> nterms = len(card) // 2 <NEW_LI...
Generic Class ASET, BSET, CSET, QSET cards inherit from. Defines degrees-of-freedom in the analysis set (A-set) +------+-----+----+-----+------+-----+----+-----+----+ | ASET | ID1 | C1 | ID2 | C2 | ID3 | C3 | ID4 | C4 | +------+-----+----+-----+------+-----+----+-----+----+ | ASET | 16 | 2 | 23 | 3516 | 1 | 4 ...
62598ee67d847024c075aa71
class AddWorkoutTestCase(WorkoutManagerTestCase): <NEW_LINE> <INDENT> def create_workout(self): <NEW_LINE> <INDENT> count_before = Workout.objects.count() <NEW_LINE> response = self.client.get(reverse('manager:workout:add')) <NEW_LINE> count_after = Workout.objects.count() <NEW_LINE> self.assertEqual(response.status_co...
Tests adding a Workout
62598ee68da39b475be0184e
class HuaweiSaveRestoreException(HuaweiBaseException): <NEW_LINE> <INDENT> pass
Huawei save/restore configuration exception.
62598ee6fff4ab517ebcbe7c
class Contact(models.Model): <NEW_LINE> <INDENT> owner = models.ForeignKey('auth.User', help_text='The user that created this contact') <NEW_LINE> contact_name = models.SlugField( help_text='A unique name for this contact') <NEW_LINE> human_readable_name = models.CharField( max_length=MAX_HUMAN_READABLE_NAME_LENGTH, bl...
Contains information about how to contact a Nagios user.
62598ee62c8b7c6e89bd1e64
class Alias(object): <NEW_LINE> <INDENT> def __init__(self, url=None, creator=None, created_date=datetime.datetime.utcnow()): <NEW_LINE> <INDENT> self.__url = url <NEW_LINE> self.__creator = creator <NEW_LINE> self.__created_date = created_date <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def from_json(str): <NEW_LINE>...
classdocs
62598ee68e7ae83300ee7732
class ObjectReadOnly(Exception): <NEW_LINE> <INDENT> pass
This is a read only model; no writes to AWS permitted.
62598ee68a43f66fc4bf0816
class ParenthesisGroup(list): <NEW_LINE> <INDENT> pass
List of tokens representing an expression in parentheses.
62598ee676e4537e8c3edc5c
class TaskEvent(MSONable): <NEW_LINE> <INDENT> INITIALIZED = 'initialized' <NEW_LINE> CORRECTIONS = 'corrections' <NEW_LINE> RESTART = 'restart' <NEW_LINE> AUTOPARAL = 'autoparal' <NEW_LINE> UNCONVERGED = 'unconverged' <NEW_LINE> FINALIZED = 'finalized' <NEW_LINE> UNCONVERGED_PARAMS = 'unconverged parameters' <NEW_LINE...
Object used to categorize the events in the TaskHistory.
62598ee62ae34c7f260a978b
class Turn(object): <NEW_LINE> <INDENT> def __init__(self, author): <NEW_LINE> <INDENT> self._author = author <NEW_LINE> self.is_runned = False <NEW_LINE> self._action = None <NEW_LINE> <DEDENT> def receive_action(self, action): <NEW_LINE> <INDENT> self._action = action <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def ...
Ожидает определённое действие конкретного игрока
62598ee6f9cc0f698b1c4620
@attr.s(frozen=True) <NEW_LINE> class ListenerConfig: <NEW_LINE> <INDENT> port = attr.ib(type=int, validator=attr.validators.instance_of(int)) <NEW_LINE> bind_addresses = attr.ib(type=List[str]) <NEW_LINE> type = attr.ib(type=str, validator=attr.validators.in_(KNOWN_LISTENER_TYPES)) <NEW_LINE> tls = attr.ib(type=bool, ...
Object describing the configuration of a single listener.
62598ee65fdd1c0f98e5c648
class DictionaryWrapper(Model): <NEW_LINE> <INDENT> _attribute_map = { 'default_program': {'key': 'defaultProgram', 'type': '{str}'}, } <NEW_LINE> def __init__(self, default_program=None, **kwargs): <NEW_LINE> <INDENT> self.default_program = default_program
DictionaryWrapper :param default_program: :type default_program: dict
62598ee6796e427e5384ce3c
class BaseMakefileLexer(RegexLexer): <NEW_LINE> <INDENT> name = 'Makefile' <NEW_LINE> aliases = ['basemake'] <NEW_LINE> filenames = [] <NEW_LINE> mimetypes = [] <NEW_LINE> tokens = { 'root': [ (r'^(?:[\t ]+.*\n|\n)+', using(BashLexer)), (r'\$\((?:.*\\\n|.*\n)+', using(BashLexer)), (r'\s+', Text), (r'#.*?\n', Comment), ...
Lexer for simple Makefiles (no preprocessing). *New in Pygments 0.10.*
62598ee67047854f4633da79
class TextMessageType(MessageType): <NEW_LINE> <INDENT> def message_type_name(self): <NEW_LINE> <INDENT> return 'txt' <NEW_LINE> <DEDENT> def message_to_bytes(self, message): <NEW_LINE> <INDENT> if not isinstance(message, basestring): <NEW_LINE> <INDENT> raise ValueError("Text channel requires string messages.") <NEW_L...
BinaryMessageType() To let channels handle Unicode text messages. Available as yoton.TEXT.
62598ee671ff763f4b5e5dff
class Discriminator( nn.Module ): <NEW_LINE> <INDENT> def __init__( self, n_channels = 3, n_fmaps = 64, activate = False ): <NEW_LINE> <INDENT> super( Discriminator, self ).__init__() <NEW_LINE> self.layer = nn.Sequential( nn.Conv2d(n_channels, n_fmaps, kernel_size=4, stride=2, padding=1, bias=False), nn.LeakyReLU(0.2,...
識別器側のネットワーク構成を記述したモデル。
62598ee64a966d76dd5ed588
class NovaUsage(base.APIResourceWrapper): <NEW_LINE> <INDENT> _attrs = ['start', 'server_usages', 'stop', 'tenant_id', 'total_local_gb_usage', 'total_memory_mb_usage', 'total_vcpus_usage', 'total_hours'] <NEW_LINE> def get_summary(self): <NEW_LINE> <INDENT> return {'instances': self.total_active_instances, 'memory_mb':...
Simple wrapper around contrib/simple_usage.py.
62598ee65166f23b2e241a7b
class ContentTypeXMLAdapter(XMLAdapterBase): <NEW_LINE> <INDENT> __used_for__ = IContentType <NEW_LINE> def _exportNode(self): <NEW_LINE> <INDENT> node = self._getObjectNode('object') <NEW_LINE> for prop in ('title', 'ct_type', 'ct_interface', 'ct_default_location'): <NEW_LINE> <INDENT> child = self._doc.createElement(...
Generic setup import/export xml adapter
62598ee676e4537e8c3edc5d
class GMMModel(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def trainGMM(cls, data, n_components, n_iter=100, ct=1e-3): <NEW_LINE> <INDENT> gmmObj = GMMclustering().fit(data, n_components, n_iter, ct) <NEW_LINE> return gmmObj <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def resultPredict(cls, gmmObj, data): <NEW...
A clustering model derived from the Gaussian Mixture model. >>> data = sc.parallelize(np.array([0.5,1,0.75,1,-0.75,0.5,-0.5,0.5, -1,-0.5,-0.75,-0.75,0.75,-0.5,0.75,-0.75]).reshape(8,2)) >>> model = GMMModel.trainGMM(data,4,10) >>> np.argmax(model.predict(np.array([0.5,1]))) == np.argmax(model.predict(np...
62598ee6435de62698e9a47b
class BootFastboot(Boot): <NEW_LINE> <INDENT> def __init__(self, parent, parameters): <NEW_LINE> <INDENT> super(BootFastboot, self).__init__(parent) <NEW_LINE> self.action = BootFastbootAction() <NEW_LINE> self.action.section = self.action_type <NEW_LINE> self.action.job = self.job <NEW_LINE> parent.add_action(self.act...
Expects fastboot bootloader, and boots.
62598ee6d7e4931a7ef3a744
class TestRandOpForDygraph(unittest.TestCase): <NEW_LINE> <INDENT> def run_net(self, use_cuda=False): <NEW_LINE> <INDENT> place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace() <NEW_LINE> with fluid.dygraph.guard(place): <NEW_LINE> <INDENT> rand([3, 4]) <NEW_LINE> rand([3, 4], 'float64') <NEW_LINE> dim_1 = fluid....
This class test the common usages of randop.
62598ee663d6d428bbee0e71
class Model(object): <NEW_LINE> <INDENT> _driver = None <NEW_LINE> _name = None <NEW_LINE> @property <NEW_LINE> def driver(self): <NEW_LINE> <INDENT> return self._driver <NEW_LINE> <DEDENT> def apply_value(self, actuator, value): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def read_value(self, sensor): <NEW_LINE> <IND...
Base class that is inherited by the rest of the models.
62598ee616aa5153ce3feba2
class CodeHandler(Handler): <NEW_LINE> <INDENT> _io_functions = ['output_notebook', 'output_file', 'show', 'save', 'reset_output'] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(CodeHandler, self).__init__(*args, **kwargs) <NEW_LINE> if 'source' not in kwargs: <NEW_LINE> <INDENT> raise ValueE...
Run source code which modifies a Document Args: source (str) : python source code filename (str) : a filename to use in any debugging or error output
62598ee6f548e778e5969c30
class _LinearLogicParser(_LogicParser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> _LogicParser.__init__(self) <NEW_LINE> self.operator_precedence = {APP: 1, Tokens.IMP: 2, None: 3} <NEW_LINE> self.right_associated_operations += [Tokens.IMP] <NEW_LINE> <DEDENT> def get_all_symbols(self): <NEW_LINE> <IN...
A linear logic expression parser.
62598ee67047854f4633da7a
class NotifyForFields(Enum): <NEW_LINE> <INDENT> all_ = 'All' <NEW_LINE> referenced = 'Referenced' <NEW_LINE> select = 'Select' <NEW_LINE> where = 'Where'
Specifies how the records are evaluated against the PushTopic query
62598ee6462c4b4f79dba09f
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'print_area03.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.got_filename = test_dir + '_test_' + filename <NEW_LINE> self.exp_filename = test_di...
Test file created by XlsxWriter against a file created by Excel.
62598ee6a17c0f6771d5a8f9
class UkladPolarny: <NEW_LINE> <INDENT> def __init__(self,theta,phi,r): <NEW_LINE> <INDENT> self.theta = theta <NEW_LINE> self.phi = phi <NEW_LINE> self.r = r
Struktura modelująca układ współrzędnych polarnych. do zastosowania w rozwiązaniu zadania pierwszego.
62598ee6d268445f26638ee1
class FeatureRegistration(GridTestcase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.switch, created = Switch.objects.get_or_create(name="Registration", active=True, note='') <NEW_LINE> <DEDENT> def visit(self, rel_url): <NEW_LINE> <INDENT> self.browser.visit('%s%s' % (self.live_server_url, rel_url)) ...
Feature: Registering a user
62598ee667a9b606de544673
class BLCmdLine(object): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.key_list = [] <NEW_LINE> self.key_to_val = {} <NEW_LINE> if val: <NEW_LINE> <INDENT> for item in shlex.split(val): <NEW_LINE> <INDENT> key, val = self.splititem(item) <NEW_LINE> self.key_list.append(key) <NEW_LINE> self.key_t...
A data type for handling bootloader cmdline values.
62598ee6a8370b77170eea89
class SummonerSpellSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = SummonerSpell
A serializer that returns summoner spell data.
62598ee68e7ae83300ee7734
class ScheduleAllView(ConfigurationView): <NEW_LINE> <INDENT> toolbar = View.nested(ScheduleToolbar) <NEW_LINE> table = Table('//div[@id="main_div"]//table') <NEW_LINE> paginator = PaginationPane() <NEW_LINE> @property <NEW_LINE> def is_displayed(self): <NEW_LINE> <INDENT> return ( self.in_configuration and self.accord...
Shedule All view on the shedule configuration page
62598ee63317a56b869bd8b9
class ImageMetadata(Model): <NEW_LINE> <INDENT> _attribute_map = { 'width': {'key': 'width', 'type': 'int'}, 'height': {'key': 'height', 'type': 'int'}, 'format': {'key': 'format', 'type': 'str'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(ImageMetadata, self).__init__(**kwargs) <NEW_LINE> sel...
Image metadata. :param width: Image width, in pixels. :type width: int :param height: Image height, in pixels. :type height: int :param format: Image format. :type format: str
62598ee68e7ae83300ee7735
class EventSource(object): <NEW_LINE> <INDENT> sockets = [] <NEW_LINE> def __init__(self, event_name, event_type, user_name, application_name): <NEW_LINE> <INDENT> assert(isinstance(event_name, types.StringType)) <NEW_LINE> assert(isinstance(event_type, types.StringType)) <NEW_LINE> self.event_type = event_type <NEW_LI...
The EventSource class is the base class for all event type objects. The EventSource class creates the socket layer and discovery mechanisms for the event and provides an API to send event messages.
62598ee6a8370b77170eea8a
class FixedPointInitializer(Initializer): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "Fixed Point Initializer" <NEW_LINE> <DEDENT> def __init__(self, start: float): <NEW_LINE> <INDENT> super(FixedPointInitializer, self).__init__() <NEW_LINE> self._start = start <NEW_LINE> <DEDENT> def initialize(...
Initializes every ability at the same point.
62598ee6e76e3b2f99fd70dd
class SpaceSwitchReservedIndex: <NEW_LINE> <INDENT> world = -3 <NEW_LINE> local = -2 <NEW_LINE> root = -1
Fake enum as class with constant variable to represent the reserved index in controller space switch
62598ee68a43f66fc4bf0817
class User(AbstractUser): <NEW_LINE> <INDENT> last_logout = models.DateTimeField(blank=True, null=True) <NEW_LINE> last_session_duration = models.PositiveIntegerField(blank=True, null=True) <NEW_LINE> button1_count = models.PositiveIntegerField(default=0) <NEW_LINE> button2_count = models.PositiveIntegerField(default=0...
Extends from Django Abstract User, customed for this example.
62598ee6a8ecb0332586f88e
class AvailableEndpointServicesOperations(object): <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config ...
AvailableEndpointServicesOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.network.v2020_11_01.mo...
62598ee60a50d4780f703a51
class POSTagger(StanfordTagger): <NEW_LINE> <INDENT> _SEPARATOR = '_' <NEW_LINE> _JAR = 'stanford-postagger.jar' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(POSTagger, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> @property <NEW_LINE> def _cmd(self): <NEW_LINE> <INDENT> return ['edu....
A class for pos tagging with Stanford Tagger. The input is the paths to: - a model trained on training data - (optionally) the path to the stanford tagger jar file. If not specified here, then this jar file must be specified in the CLASSPATH envinroment variable. - (optionally) the encoding of the training data (...
62598ee663b5f9789fe83803
class Prog(Aspect): <NEW_LINE> <INDENT> pass
progressive aspect
62598ee6dd821e528d6d75eb
class PopularInCommunity(GenericListAPIView): <NEW_LINE> <INDENT> today = date.today() <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> slug = self.kwargs.get('community_slug') <NEW_LINE> community = Tag.objects.get(slug=slug) <NEW_LINE> return Post.objects.filter(communities=community, date_posted__year=self.tod...
retrieve most popular posts of a given community
62598ee697e22403b3839596
class DynamicPixbuf(object): <NEW_LINE> <INDENT> def __init__(self, filepath): <NEW_LINE> <INDENT> self.update(filepath) <NEW_LINE> <DEDENT> def update(self, filepath): <NEW_LINE> <INDENT> self.pixbuf = gtk.gdk.pixbuf_new_from_file(filepath) <NEW_LINE> <DEDENT> def get_pixbuf(self): <NEW_LINE> <INDENT> return self.pixb...
Dynamic pixbuf.
62598ee63eb6a72ae0388ce9
class GitPluginType(AbstractPluginType): <NEW_LINE> <INDENT> def __init__( self, path, plugin, repo, tag=None, commit=None, local=False, ) -> None: <NEW_LINE> <INDENT> assert not (tag is not None and commit is not None) <NEW_LINE> self.__path = path <NEW_LINE> self.__plugin = plugin <NEW_LINE> self.__repo = repo <NEW_L...
実装途中
62598ee6bd1bec0571e1441e
class TestHtmlTools(unittest2.TestCase): <NEW_LINE> <INDENT> def test_plaintext2html(self): <NEW_LINE> <INDENT> cases = [ ("First \nSecond \nThird\n \nParagraph\n\r--\nSignature paragraph", 'div', "<div><p>First <br/>Second <br/>Third</p><p>Paragraph</p><p>--<br/>Signature paragraph</p></div>"), ("First<p>It should be ...
Test some of our generic utility functions about html
62598ee64f6381625f19880f
class ExactiveLockMass(tables.IsDescription): <NEW_LINE> <INDENT> mass = tables.Float32Col(pos=0) <NEW_LINE> start = tables.Float32Col(pos=1) <NEW_LINE> end = tables.Float32Col(pos=2) <NEW_LINE> polarity = tables.StringCol(3, pos=3) <NEW_LINE> comment = tables.StringCol(100, pos=4)
@brief HDF5 table definition for ExactiveLockMass data table
62598ee6fbf16365ca792749
class UserManager: <NEW_LINE> <INDENT> _range = 4_294_967_294 <NEW_LINE> _online_users = [] <NEW_LINE> @classmethod <NEW_LINE> def get_online_user_by_key(cls, key): <NEW_LINE> <INDENT> for user in cls._online_users: <NEW_LINE> <INDENT> if user.key == key: <NEW_LINE> <INDENT> return user <NEW_LINE> <DEDENT> <DEDENT> ret...
This class keeps track of users currently logged in.
62598ee68e71fb1e983ba111
class SubscriberContext(abc.ABC): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def add_static_rule(self, id): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def add_dynamic_rule(self, policy_rule): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDE...
Interface for SubscriberContext SubscriberContext handles adding new subscribers to pipelined: - Stores all subscriber information - Communicates with the Enforcement Table to activate flows
62598ee65166f23b2e241a7d
class HostNetworkSystem(ManagedObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(HostNetworkSystem, self).__init__("HostNetworkSystem") <NEW_LINE> self.set("name", "networkSystem") <NEW_LINE> pnic_do = DataObject() <NEW_LINE> pnic_do.device = "vmnic0" <NEW_LINE> net_info_pnic = DataObject() <NE...
HostNetworkSystem class.
62598ee67b25080760ed5b40
class TestConfigureUIDGID(testing.CharmTestCase): <NEW_LINE> <INDENT> TO_PATCH = [ 'check_call', 'service_restart' ] <NEW_LINE> UIDMAP = [ 'lxd:100000:65536', 'root:100000:65536', 'ubuntu:165536:65536', ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(TestConfigureUIDGID, self).setUp( lxd_utils, self.TO_PATCH) <...
Tests for hooks.lxd_utils.configure_uid_mapping.
62598ee61b99ca400228e860
class SuccessView(DetailView): <NEW_LINE> <INDENT> model = Payment <NEW_LINE> def render_to_response(self, context, **response_kwargs): <NEW_LINE> <INDENT> return http.HttpResponseRedirect(reverse('getpaid:success-fallback', kwargs={'pk': self.object.pk})) <NEW_LINE> <DEDENT> def post(self, *args, **kwargs): <NEW_LINE>...
This view just redirects to standard backend success link.
62598ee63539df3088eca958
class ProjectManagementServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.GetConfig = channel.unary_unary( '/google.cloud.ml.v1beta1.ProjectManagementService/GetConfig', request_serializer=GetConfigRequest.SerializeToString, response_deserializer=GetConfigResponse.FromString,...
Copyright 2016 Google Inc. All Rights Reserved. Proto file for the Google Cloud Machine Learning Engine. Describes the project management service. Allows retrieving project related information.
62598ee6435de62698e9a47d
class LstorageExtension(ManagedObject): <NEW_LINE> <INDENT> consts = LstorageExtensionConsts() <NEW_LINE> naming_props = set([]) <NEW_LINE> mo_meta = MoMeta("LstorageExtension", "lstorageExtension", "extension", VersionMeta.Version131a, "InputOutput", 0x3f, [], ["admin", "ls-storage"], [], [], [None]) <NEW_LINE> prop_m...
This is LstorageExtension class.
62598ee6090684286d592a33
class RepliedToDataset: <NEW_LINE> <INDENT> def __init__(self, email_database): <NEW_LINE> <INDENT> replied_to = {} <NEW_LINE> def is_a_reply(email): <NEW_LINE> <INDENT> reply = parse(email).get('In-Reply-To', None) <NEW_LINE> if reply: <NEW_LINE> <INDENT> replied_to[reply] = True <NEW_LINE> <DEDENT> <DEDENT> email_dat...
Build a dataset of emails that generated replies, along with a balanced number of negative samples that did not generate a reply. This visits every sent email in the provided database, extracts identifiers of emails that generated replies, and hashes them. With a hash of all emails that generated replies in hand, al...
62598ee626068e7796d4b002
class MetadataHandler(MetadataHandler): <NEW_LINE> <INDENT> pass
This class is for the /metadata endpoint.
62598ee65fdd1c0f98e5c64b
class UserSerializerMixin(): <NEW_LINE> <INDENT> def filter_field(self, fields, key, model): <NEW_LINE> <INDENT> fields[key].queryset = model.objects.filter( created_by=self.context['request'].user) <NEW_LINE> return fields
The mixin class for filtering by the user
62598ee667a9b606de544675
class AdViewSet(ModelViewSet): <NEW_LINE> <INDENT> queryset = Advertisement.objects.all() <NEW_LINE> serializer_class = AdSerializer
view set serializer for advertisement
62598ee6e5267d203ee69fad
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> def area(self): <NEW_LINE> <INDENT> return (self.__size * self.__size) <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return (self.__size) <NEW_LINE> <DEDENT> @size.setter...
Square Class
62598ee62c8b7c6e89bd1e67
class ContentListView(ListView,MultipleObjectMixin): <NEW_LINE> <INDENT> template_name = 'contents.html' <NEW_LINE> context_object_name = 'contents' <NEW_LINE> queryset = Post.objects.filter(is_published=True)
В оглавлении будут показываться только опубликованные статьи. Делать отдельную страницу оглавления для неопубликованных смысла нет.
62598ee64e4d562566370ac0
class InternalVersionTestCase(BaseTestGenerator): <NEW_LINE> <INDENT> scenarios = [ ('TestCase with INTERNAL_VERSION_PARAM none', dict( app_version=30100, version_param='', version_extn=('.js',), endpoint='static', filename='js/generated/pgadmin_commons.js', version_expected=False )), ('TestCase with INTERNAL_VERSION_P...
This test case verifies application creation with new versions parameters
62598ee68e7ae83300ee7736
class PackDB(stormbase.StormFoundationDB, stormbase.UIDFieldMixin): <NEW_LINE> <INDENT> RESOURCE_TYPE = ResourceType.PACK <NEW_LINE> UID_FIELDS = ['ref'] <NEW_LINE> ref = me.StringField(required=True, unique=True) <NEW_LINE> name = me.StringField(required=True, unique=True) <NEW_LINE> description = me.StringField(requi...
System entity which represents a pack.
62598ee666656f66f7d58a88
class ModifiedRole(NamedTuple): <NEW_LINE> <INDENT> added_types: Set[Type] <NEW_LINE> removed_types: Set[Type] <NEW_LINE> matched_types: Set[Type]
Difference details for a modified role.
62598ee6a8370b77170eea8c
class Datalist(HtmlTag): <NEW_LINE> <INDENT> pass
Specifies a list of pre-defined options for input controls
62598ee68e7ae83300ee7737
class Settings(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def load_settings(cls, module_name): <NEW_LINE> <INDENT> self = cls() <NEW_LINE> module = sys.modules[module_name] <NEW_LINE> for (member, value) in inspect.getmembers(self): <NEW_LINE> <INDENT> if member.isupper() and not member.startswith('_'): <NEW_...
Class-based settings wrapper.
62598ee6379a373c97d9769c
class Registry(ABC): <NEW_LINE> <INDENT> __instance = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._availableImplementations = self.__scan_package() <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def _get_package(self) -> str: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def _...
Scans for available implementations and provides access to them via class name. Note: The scanning process will not recursively descend into subdirectories.
62598ee6851cf427c66b6979
class RugTrack(Track): <NEW_LINE> <INDENT> def __init__(self, data, hue=None, hue_order=None, palette=None, height=1.0, line_kws=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._data = data <NEW_LINE> self._height = height <NEW_LINE> self._hue = hue <NEW_LINE> self._color_map = build_colormap( data, hue=h...
Track that plots density ticks for features. Parameters ---------- data : pandas.Dataframe Dataset for plotting. Each row in the DataFrame is expected to correspond with a single feature. The DataFrame should have the following columns: seqname, position, strand; which together specify the location and...
62598ee6baa26c4b54d4d976
class CharsetTokenizer(Tokenizer): <NEW_LINE> <INDENT> __inittype__ = dict(charmap=str) <NEW_LINE> def __init__(self, charmap): <NEW_LINE> <INDENT> self.charmap = charmap <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return (other and self.__class__ is other.__class__ and self.charmap == other.charma...
Tokenizes and translates text according to a character mapping object. Characters that map to None are considered token break characters. For all other characters the map is used to translate the character. This is useful for case and accent folding. This tokenizer loops character-by-character and so will likely be mu...
62598ee69c8ee8231303f4ac
class RetriableBrokerResponseError(BrokerResponseError): <NEW_LINE> <INDENT> retriable = True
`RetriableBrokerResponseError` is the shared superclass of all broker errors which can be retried.
62598ee610dbd63aa1c6f21b
class Fight_checker: <NEW_LINE> <INDENT> in_fight = [] <NEW_LINE> async def is_in_fight(self, ctx): <NEW_LINE> <INDENT> can_fight = True <NEW_LINE> player = ctx.message.author <NEW_LINE> if player.id in self.in_fight: <NEW_LINE> <INDENT> can_fight = False <NEW_LINE> await ctx.send(f"<@{player.id}> ❌ You are already in ...
Represents the fight checker
62598ee6aad79263cf42ceb2
class GeoRssBox(atom.core.XmlElement): <NEW_LINE> <INDENT> _qname = GEORSS_TEMPLATE % 'box'
Describes a geographical region.
62598ee621bff66bcd7212fb