code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
@mock.patch('pywikibot.comms.eventstreams.EventSource', new=mock.MagicMock()) <NEW_LINE> class TestEventStreamsStreamTests(DefaultSiteTestCase): <NEW_LINE> <INDENT> def test_url_with_stream(self): <NEW_LINE> <INDENT> site = self.get_site() <NEW_LINE> fam = site.family <NEW_LINE> if not isinstance(fam, WikimediaFamily):...
Stream tests for eventstreams module.
62598f8823849d37ff850bf5
class BloomFilter(Hashing): <NEW_LINE> <INDENT> def __init__(self, capacity, error_rate=0.001): <NEW_LINE> <INDENT> if not (0 < error_rate < 1): <NEW_LINE> <INDENT> raise ValueError('error_rate must be 0 and 1.') <NEW_LINE> <DEDENT> if capacity <= 0: <NEW_LINE> <INDENT> raise ValueError('capacity must be greater than 1...
A bloom filter implementation for a space efficient way to test for membership in a large amount of data.
62598f88b830903b9686e20d
@dataclass(frozen=True) <NEW_LINE> class NumericProperty(DataProperty): <NEW_LINE> <INDENT> measurement_bounds: Optional[ValuePair] = None <NEW_LINE> scale_bounds: ValuePair = ValuePair(0, 1) <NEW_LINE> def __hash__(self) -> int: <NEW_LINE> <INDENT> return super().__hash__()
A property that contains numeric data. These values will be normalized to the given scale (default [0, 1]). If measurement bounds are provided then those are what will align to the lower and upper values on the scale, otherwise the measurement bounds will be automatically determined such that the least value in the d...
62598f8845492302aabfc00b
class FeatureNotFound(Exception): <NEW_LINE> <INDENT> pass
Raise this exception in case a feature is not represented in the feature list of the feature order validator.
62598f88b57a9660fecd15b3
class CommandHandler(BaseHandler): <NEW_LINE> <INDENT> def run(self, profile_name, args=[]): <NEW_LINE> <INDENT> profile = self.profiles.get(profile_name) <NEW_LINE> if profile: <NEW_LINE> <INDENT> logging.info(f"profile: {profile.name} ({profile.description})") <NEW_LINE> try: <NEW_LINE> <INDENT> exit(profile.run(args...
Run a single command and output to stdout
62598f8845492302aabfc00c
class Development(object): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> TESTING = False <NEW_LINE> JWT_SECRET_KEY = 'hhgaghhgsdhdhdd' <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'postgres://jhenbvzzxcjukg:f2f44fb6e0a10677c848586917f80cccae04d488bd03f809ba98398edad3030d@ec2-54-217-237-93.eu-west-1.compute.amazonaws.com:5432/d87...
Development environment configuration
62598f880fa83653e46f4a25
class TestDancefloorEnabled(DanceFloorTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> _ = self.folder.invokeFactory("Folder", "dancefloor") <NEW_LINE> self.dancefloor = self.folder.get(_) <NEW_LINE> <DEDENT> def test_interface_default_disabled(self): <NEW_LINE> <INDENT> self.assertEqual(IDanceF...
Test enable/disable dancefloor
62598f88097d151d1a2c0b5d
class CommunicatorConnector(util.threadedsocket.ThreadedSocket): <NEW_LINE> <INDENT> def __init__(self, host, port, modules, retry_timeout=5): <NEW_LINE> <INDENT> util.threadedsocket.ThreadedSocket.__init__(self, host, port, server=False, giveup=-1, retry_timeout=1) <NEW_LINE> self.send_buffer = [] <NEW_LINE> self.host...
This class connects to a vision communicator
62598f88379a373c97d98b4a
class NoWitnessData(Exception): <NEW_LINE> <INDENT> pass
The block does not have witness data
62598f886aa9bd52df0d4a0a
class Full_Health(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.image = pygame.image.load("Full_Healthbar.png") <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.rect.y = y <NEW_LINE> self.rect.x = x
This class creates the full health bar
62598f88bde94217f3707402
class Title(atom.core.XmlElement): <NEW_LINE> <INDENT> _qname = DC_TEMPLATE % 'title'
Name given to the resource
62598f88d53ae8145f917fc8
class relatedToProp(SchemaProperty): <NEW_LINE> <INDENT> _prop_schema = 'relatedTo' <NEW_LINE> _expected_schema = 'Person' <NEW_LINE> _enum = False <NEW_LINE> _format_as = "ForeignKey"
SchemaField for relatedTo Usage: Include in SchemaObject SchemaFields as your_django_field = relatedToProp() schema.org description:The most generic familial relation. prop_schema returns just the property without url# format_as is used by app templatetags based upon schema.org datatype used to reference Person
62598f88e76e3b2f99fd8566
class Filters(SqlComponents): <NEW_LINE> <INDENT> @property <NEW_LINE> def where(self): <NEW_LINE> <INDENT> return sorted((str(Filter(f)) for f in self.children)) <NEW_LINE> <DEDENT> def remove(self, filters): <NEW_LINE> <INDENT> if not filters: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> self.children = [c for...
Represents a bunch of SQL conditions.
62598f8850485f2cf55daaac
class PackagistBackend(BaseBackend): <NEW_LINE> <INDENT> name = 'Packagist' <NEW_LINE> examples = [ 'https://packagist.org/packages/phpunit/php-code-coverage', 'https://packagist.org/packages/phpunit/php-timer', 'https://packagist.org/packages/<owner or group>/<project-name>' ] <NEW_LINE> @classmethod <NEW_LINE> def ge...
The custom class for projects hosted on packagist.org. This backend allows to specify a version_url that will be used to retrieve the version information.
62598f8821bff66bcd7227a5
class FasterRCNNVGG16(FasterRCNN): <NEW_LINE> <INDENT> feat_stride = 16 <NEW_LINE> def __init__(self, num_classses=21, anchor_ratios=[0.5, 1, 2], anchor_scales=[8, 16, 32]): <NEW_LINE> <INDENT> extractor, classifier = decomVGG16() <NEW_LINE> rpn = RegionProposalNetwork(512, 512, anchor_ratios=anchor_ratios, anchor_scal...
FasterRCNNVGG16是以VGG16为特征提取器的FasterRCNN
62598f88dc8b845886d530f0
class RTtr(RPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/joshuaulrich/TTR" <NEW_LINE> url = "https://cran.r-project.org/src/contrib/TTR_0.23-1.tar.gz" <NEW_LINE> list_url = "https://cran.r-project.org/src/contrib/Archive/TTR" <NEW_LINE> version('0.23-1', '35f693ac0d97e8ec742ebea2da222986') <NEW_LIN...
Functions and data to construct technical trading rules with R.
62598f8866656f66f7d59f2f
class AParseException(AFixtureException): <NEW_LINE> <INDENT> pass
Base class for exceptions concerning parsing errors.
62598f8873bcbd0ca4bc9d8b
class UpdateUdevRulesAction(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, value, option_string=None): <NEW_LINE> <INDENT> if platform.system() != "Linux": <NEW_LINE> <INDENT> print("E: The --update-udev option can only be used on Linux.") <NEW_LINE> sys.exit(2) <NEW_LINE> <DEDENT> if os.ge...
Updates udev rules and exit.
62598f8873bcbd0ca4bc9d8c
class PressureDiagram(): <NEW_LINE> <INDENT> def __init__(self, pressureDistribution): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.pressureDistribution = pressureDistribution <NEW_LINE> self.fig = plt.figure(1) <NEW_LINE> self.fig.set_size_inches(8, 4) <NEW_LINE> self.barAx = self.fig.add_subplot(121) <NEW_L...
压强分析图
62598f8807f4c71912baef7d
class Class: <NEW_LINE> <INDENT> _start = None <NEW_LINE> _name = None <NEW_LINE> _code = None <NEW_LINE> _weeks = [] <NEW_LINE> def __init__(self, config): <NEW_LINE> <INDENT> self._name = config['name'] <NEW_LINE> self._code = config['code'] <NEW_LINE> self._weeks = config['weeks'] <NEW_LINE> self._start = datetime.s...
Represents a Class schedule for a quarter/semester
62598f8896565a6dacd2cd14
class Panel(QGroupBox): <NEW_LINE> <INDENT> selection_update = pyqtSignal(ossia.LocalDevice) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Panel, self).__init__() <NEW_LINE> self.layout = QGridLayout() <NEW_LINE> self.layout.setSpacing(0) <NEW_LINE> self.layout.setContentsMargins(0, 0, 0, 0)...
A QGroupBox to put one or several remote inside
62598f88d7e4931a7ef3bbd4
class TFModule: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.Tensor = NonInstanceType <NEW_LINE> self.TensorShape = NonInstanceType <NEW_LINE> self.dtypes = DTypes() <NEW_LINE> self.dtypes.DType = NonInstanceType <NEW_LINE> self.bfloat16 = NonInstanceType <NEW_LINE> self.bool = NonInstanceTy...
A dummy tensorflow module for when tf is not installed.
62598f888a349b6b43685d7e
class BM25(object): <NEW_LINE> <INDENT> def __init__(self, corpus): <NEW_LINE> <INDENT> self.corpus_size = len(corpus) <NEW_LINE> self.avgdl = sum(float(len(x)) for x in corpus) / self.corpus_size <NEW_LINE> self.corpus = corpus <NEW_LINE> self.f = [] <NEW_LINE> self.df = {} <NEW_LINE> self.idf = {} <NEW_LINE> self.doc...
Implementation of Best Matching 25 ranking function. Attributes ---------- corpus_size : int Size of corpus (number of documents). avgdl : float Average length of document in `corpus`. corpus : list of list of str Corpus of documents. f : list of dicts of int Dictionary with terms frequencies for each d...
62598f880fa83653e46f4a27
class LBMemberPollster(_BasePollster): <NEW_LINE> <INDENT> FIELDS = ['admin_state_up', 'address', 'pool_id', 'protocol_port', 'status', 'status_description', 'weight', ] <NEW_LINE> def _get_lb_members(self): <NEW_LINE> <INDENT> return self.nc.member_get_all() <NEW_LINE> <DEDENT> def get_samples(self, manager, cache, re...
Pollster to capture Load Balancer Member status samples.
62598f8829b78933be269e77
class Ship(): <NEW_LINE> <INDENT> def __init__(self, ship_type, horizontal_string_reps, vertical_string_reps, *, orientation='h'): <NEW_LINE> <INDENT> if orientation not in {'v', 'h'}: <NEW_LINE> <INDENT> raise ValueError( "'orientation' argument must equal 'v' or 'h'." ) <NEW_LINE> <DEDENT> self.ship_type = ship_type ...
A class to represent a ship on the board. Attributes ---------- owner : Player object the object representing who owns the ship ship_type : str indicates the type of ship for reference in messages horizontal_string_reps : list of tuples a list of tuples that contain string representations for hit and n...
62598f888e05c05ec3f6ebe4
class ChatViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = ChatSerializer <NEW_LINE> permission_classes = [IsAuthenticated] <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> user = self.request.user <NEW_LINE> if user.is_anonymous: <NEW_LINE> <INDENT> return Chat.objects.all() <NEW_LINE> <DED...
params: user_id - отфильтровать чаты по тем, в которых участвовал данный юзер
62598f88fb3f5b602db47f4d
class SquareNumberApp(App): <NEW_LINE> <INDENT> def build(self): <NEW_LINE> <INDENT> Window.size = (300, 100) <NEW_LINE> self.title = "Square Number" <NEW_LINE> self.root = Builder.load_file('squaring.kv') <NEW_LINE> return self.root <NEW_LINE> <DEDENT> def handle_calculate(self, value): <NEW_LINE> <INDENT> result = va...
SquareNumberApp is a Kivy App for squaring a number
62598f88a05bb46b3848a3b3
class JsonPatchType(wtypes.Base): <NEW_LINE> <INDENT> path = wtypes.wsattr(wtypes.StringType(pattern='^(/[\w-]+)+$'), mandatory=True) <NEW_LINE> op = wtypes.wsattr(wtypes.Enum(str, 'add', 'replace', 'remove'), mandatory=True) <NEW_LINE> value = wsme.wsattr(jsontype, default=wtypes.Unset) <NEW_LINE> @staticmethod <NEW_L...
A complex type that represents a single json-patch operation.
62598f88462c4b4f79dbb53b
class AsyncIOBackend: <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> if config.ssl: <NEW_LINE> <INDENT> raise NotImplementedError("SSL not supported for this backend") <NEW_LINE> <DEDENT> <DEDENT> def send_request(self, request): <NEW_LINE> <INDENT> method = request....
Adapter for the aiohttp module. This backend is only availble for python 3 users and doesn't support SSL. :param config: pusher.Config instance
62598f88097d151d1a2c0b5f
class rx_logger(): <NEW_LINE> <INDENT> def __init__(self, samp_rate, snr_meter_obj, snr_log_period, frame_synchronizer_obj, frame_sync_log_period, decoder_obj, ber_log_period, cfo_rec_obj, cfo_log_period, phase_rec_obj, enabled_start, fs_label_setter, ber_label_setter, fo_label_setter): <NEW_LINE> <INDENT> global sampl...
Rx Logger Initiates threads to log useful receiver metrics into the console.
62598f88d10714528d69da0a
class HandleResponseException(Exception): <NEW_LINE> <INDENT> pass
Exception raised when response could not be sent to client @package FastyBird:WsServerPlugin! @module exceptions @author Adam Kadlec <adam.kadlec@fastybird.com>
62598f88b57a9660fecd15b6
class GetSortedLangListTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_getSortedLangList(self): <NEW_LINE> <INDENT> origFunc = translations.getSupportedLangs <NEW_LINE> translations.getSupportedLangs = lambda: ["en", "de"] <NEW_LINE> l = server.getSortedLangList(rebuild=True) <NEW_LINE> self.assertEqual(l, [("de...
Tests for :func:`bridgedb.distributors.https.server.getSortedLangList`.
62598f88d4950a0f3b110bd2
class getVersion_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelera...
Attributes: - success
62598f88f8510a7c17d7df13
class IndexHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> self.render('index.html')
Home Page for user,photo feeds of follow.
62598f8815fb5d323ce7e865
class AdditionalTestClassForTestAddMoreBaseClassesByCall: <NEW_LINE> <INDENT> AdditionalTestClassForTestAddMoreBaseClassesByCall = True
definable_serializer.tests.test_serializers.AdditionalTestClassForTestAddMoreBaseClassesByCall
62598f884e696a045264dba0
class ErrorController(object): <NEW_LINE> <INDENT> @expose('tg2express.templates.error') <NEW_LINE> def document(self, *args, **kwargs): <NEW_LINE> <INDENT> resp = request.environ.get('pylons.original_response') <NEW_LINE> default_message = ("<p>We're sorry but we weren't able to process " " this request.</p>") <NEW_LI...
Generates error documents as and when they are required. The ErrorDocuments middleware forwards to ErrorController when error related status codes are returned from the application. This behaviour can be altered by changing the parameters to the ErrorDocuments middleware in your config/middleware.py file.
62598f8850485f2cf55daaae
class URLPathVersioning(BaseVersioning): <NEW_LINE> <INDENT> invalid_version_message = _('Invalid version in URL path.') <NEW_LINE> def determine_version(self, request, *args, **kwargs): <NEW_LINE> <INDENT> version = kwargs.get(self.version_param, self.default_version) <NEW_LINE> if version is None: <NEW_LINE> <INDENT>...
To the client this is the same style as `NamespaceVersioning`. The difference is in the backend - this implementation uses Django's URL keyword arguments to determine the version. An example URL conf for two views that accept two different versions. urlpatterns = [ re_path(r'^(?P<version>[v1|v2]+)/users/$', users...
62598f88596a8972361277ae
class PublishAuto(atom.core.XmlElement): <NEW_LINE> <INDENT> _qname = DOCUMENTS_TEMPLATE % 'publishAuto' <NEW_LINE> value = 'value'
The DocList docs:publishAuto element.
62598f8863d6d428bbee22f3
class EnterpriseRepositoryInfo(sgqlc.types.Type, Node): <NEW_LINE> <INDENT> __schema__ = github_schema <NEW_LINE> __field_names__ = ('is_private', 'name', 'name_with_owner') <NEW_LINE> is_private = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name='isPrivate') <NEW_LINE> name = sgqlc.types.Field(sgqlc.types...
A subset of repository information queryable from an enterprise.
62598f8810dbd63aa1c706f0
class Solution: <NEW_LINE> <INDENT> def findClosestElements(self, arr, k, x): <NEW_LINE> <INDENT> left = 0 <NEW_LINE> right = len(arr) - k <NEW_LINE> while left < right: <NEW_LINE> <INDENT> mid = (left + right) // 2 <NEW_LINE> if x - arr[mid] > arr[mid+k] -x: <NEW_LINE> <INDENT> left = mid + 1 <NEW_LINE> <DEDENT> else:...
THE OPTIMAL CODE VERSION Improvement: Think the output window should be [left, left+k), which is left closure and right open form Here we should better use the other form of template that 1. left = 0, right = len(arr), then shift right by k and becomes right = len(arr) - k 2. while-loop condition goes witho...
62598f88b57a9660fecd15b7
class ViewPackageCommand(BaseCommand): <NEW_LINE> <INDENT> name = 'view' <NEW_LINE> help = ("View install.py of a package") <NEW_LINE> args = 'package' <NEW_LINE> option_list = ( make_option('-i', '--index', dest='index', default=[], action='append', help='Package index link, it can be a directory or an url.'), make_op...
View install.py of a package
62598f88f7d966606f747b23
class ParentheseTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_is_parenthese_match(self): <NEW_LINE> <INDENT> self.assertFalse(check_parenthese_match('((()())))')[0]) <NEW_LINE> self.assertFalse(check_parenthese_match('))')[0]) <NEW_LINE> self.assertEqual(check_parenthese_match('(), (), ())'), (False, 10)) <...
test for parenthese match
62598f8882261d6c5272fc72
@GROUP_MATCH() <NEW_LINE> class FanGroup(BaseFan, ZhaGroupEntity): <NEW_LINE> <INDENT> def __init__( self, entity_ids: List[str], unique_id: str, group_id: int, zha_device, **kwargs ) -> None: <NEW_LINE> <INDENT> super().__init__(entity_ids, unique_id, group_id, zha_device, **kwargs) <NEW_LINE> self._available: bool = ...
Representation of a fan group.
62598f8807f4c71912baef7f
class TextMessage(Message): <NEW_LINE> <INDENT> def __init__(self, pText): <NEW_LINE> <INDENT> assert isinstance(pText, unicode) <NEW_LINE> super(TextMessage, self).__init__() <NEW_LINE> self.__aText = pText <NEW_LINE> <DEDENT> @property <NEW_LINE> def text(self): <NEW_LINE> <INDENT> return self.__aText <NEW_LINE> <DED...
Basic implementation of Message with simple text information
62598f883eb6a72ae038a16c
class HAProxyBaseError(Exception): <NEW_LINE> <INDENT> message = '' <NEW_LINE> def __init__(self, message=''): <NEW_LINE> <INDENT> if message: <NEW_LINE> <INDENT> self.message = message <NEW_LINE> <DEDENT> super(HAProxyBaseError, self).__init__(self.message)
haproxyadmin base exception. :param message: error message. :type message: ``string``
62598f88442bda511e95bf97
@gin.constants_from_enum <NEW_LINE> class Gait(enum.Enum): <NEW_LINE> <INDENT> WALK = 0 <NEW_LINE> TROT = 1
The possible gaits.
62598f886aa9bd52df0d4a0e
class Menu(models.Model) : <NEW_LINE> <INDENT> name = models.CharField(max_length=40) <NEW_LINE> url = models.CharField(max_length=100, unique=True) <NEW_LINE> desc = models.CharField(max_length=1000, null=True ,blank=True) <NEW_LINE> padre = models.ForeignKey('self',null=True, blank=True) <NEW_LINE> posicion = models...
Maneja los menus para la aplicacion, aquellos menus que no tengan padre son aquellos que son raices y los menus que tengan padre son submenus ademas se tiene el atributo posicion para determinar con que orden deben ir dentro de la aplicacion
62598f888da39b475be02d23
class I_tblrdh(Instruction_wp_wp_B): <NEW_LINE> <INDENT> name = 'tlbrdh' <NEW_LINE> mask = 0xFF8000 <NEW_LINE> code = 0xBA8000
TBLRDH{.B} [Ws], [Wd]
62598f88a4f1c619b294e122
class Solution: <NEW_LINE> <INDENT> def countOfSmallerNumber(self, A, queries): <NEW_LINE> <INDENT> mapdict1 = [0] * 10001 <NEW_LINE> mapdict2 = [0] * 10001 <NEW_LINE> res = [] <NEW_LINE> for val in A: <NEW_LINE> <INDENT> mapdict1[val] = mapdict1[val] + 1 if mapdict1[val] != 0 else 1 <NEW_LINE> <DEDENT> count = 0 <NEW_...
@param A: A list of integer @return: The number of element in the array that are smaller that the given integer
62598f880383005118f6d236
class KVP(models.Model): <NEW_LINE> <INDENT> key = models.ForeignKey(Key) <NEW_LINE> value = models.CharField(max_length=128) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "%s=%s" % (self.key, self.value) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get(key, value): <NEW_LINE> <INDENT> (key, _) = Key.obj...
Key-Value Pair associate a key with a set of values.
62598f88c432627299fa2b0c
class exSVM(SVM): <NEW_LINE> <INDENT> def __init__(self, data, labs=None, weights=(0.05, 0.1, 0.5, 0.9, 0.95), **kwargs): <NEW_LINE> <INDENT> SVM.__init__(self, data, labs, scenario="EX", **kwargs) <NEW_LINE> self.set("WEIGHTS", weights) <NEW_LINE> self.weights = weights <NEW_LINE> self._predict_cols = range(len(weight...
This class performs non-parametric, asymmetric least squares regression using SVMs. The tested estimators are therefore estimating the conditional tau-e;xpectiles of Y given X. By default, estimators for five different tau values are computed. Parameters ---------- weights : arr of doubles The list of expectiles t...
62598f8815fb5d323ce7e867
class InvGroup(models.Model): <NEW_LINE> <INDENT> id = models.IntegerField(unique=True, primary_key=True) <NEW_LINE> category = models.ForeignKey(InvCategory, blank=True, null=True) <NEW_LINE> name = models.CharField(max_length=150) <NEW_LINE> description = models.TextField() <NEW_LINE> icon = models.ForeignKey('EveIco...
Inventory groups are a further sub-classification within an InvCategory. For example, the 'MapRegion' inventory group's category is 'Celestial'. CCP Table: invGroups CCP Primary key: "groupID" smallint(6)
62598f8821bff66bcd7227a9
class Duty(UGen): <NEW_LINE> <INDENT> _ordered_input_names = collections.OrderedDict( [("duration", 1.0), ("reset", 0.0), ("level", 1.0), ("done_action", 0.0)] ) <NEW_LINE> _valid_calculation_rates = (CalculationRate.AUDIO, CalculationRate.CONTROL)
A value is demanded of each UGen in the list and output according to a stream of duration values. :: >>> duty = supriya.ugens.Duty.kr( ... done_action=0, ... duration=supriya.ugens.Drand( ... sequence=[0.01, 0.2, 0.4], ... repeats=2, ... ), ... reset=0, ...
62598f8873bcbd0ca4bc9d8f
class Platforms(YamlConfigItem): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> YamlConfigItem.__init__(self) <NEW_LINE> self.set_description( "Specify supported platforms (any, linux, macos, nt, os2, posix,", "unix, win32, windows, ...) [mandatory]", ) <NEW_LINE> self.set_key(PLA...
Platforms list config item.
62598f880a366e3fb87dc50c
class StatsMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> request.start_time = time() <NEW_LINE> request._num_queries = len(connection.queries) <NEW_LINE> <DEDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if request.path.startswith("/media/"): <...
Inspiration from http://davidavraamides.net/blog/2006/07/03/page-stats-middleware/
62598f883cc13d1c6d4652a4
class VehicleCreateView(CreateView): <NEW_LINE> <INDENT> model = Vehicle <NEW_LINE> template_name = "vehicle_form.html" <NEW_LINE> fields = ["name", "plate", "manufacturer"] <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> return reverse('vehicle_list')
View para tratar HTTP POST para veiculo
62598f880a50d4780f704f0a
class Lot(DeclarativeBaseGuid): <NEW_LINE> <INDENT> __tablename__ = 'lots' <NEW_LINE> __table_args__ = {} <NEW_LINE> account_guid = Column('account_guid', VARCHAR(length=32), ForeignKey('accounts.guid')) <NEW_LINE> is_closed = Column('is_closed', INTEGER(), nullable=False) <NEW_LINE> title = pure_slot_property('title')...
A GnuCash Lot. Each lot is linked to an account. Splits in this account can be associated to a Lot. Whenever the balance of the splits goes to 0, the Lot is closed (otherwise it is opened) Attributes: is_closed (int) : 1 if lot is closed, 0 otherwise account (:class:`piecash.core.account.Account`): account of ...
62598f8891af0d3eaad3993a
class FirstTitleGatherer(TextGatherer): <NEW_LINE> <INDENT> _gather = False <NEW_LINE> def visit_title(self, node): <NEW_LINE> <INDENT> self._gather = True <NEW_LINE> <DEDENT> def depart_title(self, node): <NEW_LINE> <INDENT> raise nodes.StopTraversal() <NEW_LINE> <DEDENT> def visit_Text(self, node): <NEW_LINE> <INDENT...
A visitor gathering text in first title.
62598f88fb3f5b602db47f4f
class Address(models.Model): <NEW_LINE> <INDENT> contractor = models.IntegerField(null=True, blank=True) <NEW_LINE> add_line1 = models.CharField(max_length=255, blank=False, null=False) <NEW_LINE> add_line2 = models.CharField(max_length=255, blank=False, null=False) <NEW_LINE> city = models.CharField(max_length=255, bl...
Embedded model to store address of user
62598f881f037a2d8b9e3c14
class Beach : <NEW_LINE> <INDENT> def __init__(self, nesting_period=NestingPeriod(), north_pt=[1,1], south_pt=[0,0], orientation="east", d_min=30, d_max=50, ref="no reference", beach_name="no name", file_name="no name"): <NEW_LINE> <INDENT> self.nesting_period=nesting_period <NEW_LINE> self.north_pt=north_pt <NEW_LINE>...
class beach is used as a structure contains all information needed about the nesting beach => launching area => nesting season => geographic coordinates of the beach => name of the beach => eventually the reference of those information
62598f8821a7993f00c65ab1
class MediaSnapshotByTimePicInfoItem(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TimeOffset = None <NEW_LINE> self.Url = None <NEW_LINE> self.WaterMarkDefinition = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TimeOffset = params.get("TimeOffset")...
指定时间点截图信息
62598f89d4950a0f3b110bd4
class _PrettyPrintDict(dict): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> body = '\n '.join([repr(k) + ': ' + self._indent(repr(v)) for k, v in self.items()]) <NEW_LINE> return '{\n ' + body + '\n}' <NEW_LINE> <DEDENT> def _indent(self, s): <NEW_LINE> <INDENT> lines = s.split('\n') <NEW_LINE> return '...
simple wrapper for a dict to repr its items on separate lines with a bit of indentation
62598f89d99f1b3c44d051e6
class BurstDAO(RootDAO): <NEW_LINE> <INDENT> def get_bursts_for_project(self, project_id, page_start=0, page_size=None, count=False): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> bursts = self.session.query(BurstConfiguration2 ).filter_by(project_id=project_id ).order_by(desc(BurstConfiguration2.start_time)) <NEW_LINE>...
DAO layer for Burst entities.
62598f89d53ae8145f917fce
class MobileNotification(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, verbose_name=_('user')) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'profile_mobile_notification' <NEW_LINE> app_label= 'profiles'
User Mobile Notification Model Takes care of tracking the user's mobile notification preferences
62598f89bde94217f3707405
class PositionAndFormatCrop(PositionCrop): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> self.options = options <NEW_LINE> self.crop_position_field = options['crop_field'] <NEW_LINE> self.format_field = options['format_field'] <NEW_LINE> self.resize_method = options['resize_method'] <NEW_LINE> se...
Resize based on crop and format
62598f89b5575c28eb712a67
class PasswordResetError(Exception): <NEW_LINE> <INDENT> pass
Raised if password reset fails
62598f893c8af77a43b67cd4
class DataController(metaclass=ABCMeta): <NEW_LINE> <INDENT> __slots__ = ('logger',) <NEW_LINE> def __init__(self, logger): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> async def get_identifier(self, query: str, medium: Medium) -> Optional[Dict[Site, str]]: <NEW_LINE> <INDENT>...
An ABC (abstract base class) that deals with database caching.
62598f8907d97122c42167e4
class IndexedCollectionTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.collection = codec.IndexedCollection() <NEW_LINE> <DEDENT> def test_clear(self): <NEW_LINE> <INDENT> o = object() <NEW_LINE> self.assertEqual(self.collection.getReferenceTo(o), -1) <NEW_LINE> self.collectio...
Tests for L{codec.IndexedCollection}
62598f8950485f2cf55daab2
class LineScaling(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(self,*args): <N...
An enumerated type listing possible LineType scaling modes. enum LineScaling,values: ModelSpace (1),PaperSpace (2),ViewScale (0)
62598f89fbf16365ca793bea
class KC(KCaChannel): <NEW_LINE> <INDENT> annotation = {'cno': 'cno_0000106'} <NEW_LINE> abstract = False <NEW_LINE> Xpower = 1 <NEW_LINE> Zpower = 1 <NEW_LINE> tableA_z = where(ca_conc < 250.0, ca_conc / 250.0, 1.0) <NEW_LINE> tableB_z = ones(ca_divs + 1) <NEW_LINE> alpha_x = where(v_array < -10e-3, 2e3 / 37.95 * ( ex...
C type K+ channel
62598f89507cdc57c63a48cc
class ESPaginator(Paginator): <NEW_LINE> <INDENT> def validate_number(self, number): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> number = int(number) <NEW_LINE> <DEDENT> except (TypeError, ValueError): <NEW_LINE> <INDENT> raise PageNotAnInteger('That page number is not an integer') <NEW_LINE> <DEDENT> if number < 1: <...
A better paginator for search results The normal Paginator does a .count() query and then a slice. Since ES results contain the total number of results, we can take an optimistic slice and then adjust the count.
62598f89596a8972361277b2
class IASValue(Alarm): <NEW_LINE> <INDENT> def __init__(self, core_timestamp, core_id, running_id, value, mode=0, validity=0, timestamps={}, state_change_timestamp=0): <NEW_LINE> <INDENT> Alarm.__init__( self, core_timestamp, core_id, running_id, mode=mode, validity=validity, timestamps=timestamps, state_change_timesta...
IASValue from some device in the observatory.
62598f896aa9bd52df0d4a11
class VrayModel(BaseModel): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def is_compatible_with_renderer(actual_renderer_name): <NEW_LINE> <INDENT> return 'v-ray' in actual_renderer_name.lower() <NEW_LINE> <DEDENT> def __init__(self, version, rt_engine_type, scene_path_generator, standalone): <NEW_LINE> <INDENT> super(...
V-Ray-specific data model for 3ds Max Zync plugin.
62598f8950485f2cf55daab3
class ROTModel(db.Model): <NEW_LINE> <INDENT> def put(self): <NEW_LINE> <INDENT> count = 0 <NEW_LINE> while count < 3: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return db.Model.put(self) <NEW_LINE> <DEDENT> except db.Timeout: <NEW_LINE> <INDENT> count += 1 <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <INDENT> raise...
ROTModel overrides the db.Model put function, having it retry up to 3 times when it encounters a datastore timeout. This is to try an maximize the chance the data makes it into the datastore when attempted. If it fails, it raises the db.Timeout error and the calling application will need to handle that.
62598f893617ad0b5ee05c81
class DriverPassthruController(rest.RestController): <NEW_LINE> <INDENT> _custom_actions = { 'methods': ['GET'] } <NEW_LINE> @expose.expose(wtypes.text, wtypes.text) <NEW_LINE> def methods(self, driver_name): <NEW_LINE> <INDENT> if driver_name not in _VENDOR_METHODS: <NEW_LINE> <INDENT> topic = pecan.request.rpcapi.get...
REST controller for driver passthru. This controller allow vendors to expose cross-node functionality in the Ironic API. Ironic will merely relay the message from here to the specified driver, no introspection will be made in the message body.
62598f8945492302aabfc014
class STL10: <NEW_LINE> <INDENT> def __init__(self, is_gpu, args): <NEW_LINE> <INDENT> self.train_transforms, self.val_transforms = self.__get_transforms(args.patch_size) <NEW_LINE> self.trainset, self.valset = self.get_dataset() <NEW_LINE> self.train_loader, self.val_loader = self.get_dataset_loader(args.batch_size, a...
STL10 dataset featuring tiny 96x96 color images of objects belonging to hundred different classes. Dataloader adapted from STL10. Parameters: args (dict): Dictionary of (command line) arguments. Needs to contain batch_size (int) and workers(int). is_gpu (bool): True if CUDA is enabled. Sets val...
62598f89462c4b4f79dbb541
class PollensUpdateCoordinator(DataUpdateCoordinator): <NEW_LINE> <INDENT> def __init__( self, hass: HomeAssistant, name: str, scan_interval: int, api: str, county: str, ) -> None: <NEW_LINE> <INDENT> super().__init__( hass=hass, logger=_LOGGER, name=name, update_interval=timedelta(hours=scan_interval), ) <NEW_LINE> se...
Class to manage fetching Pollens data API
62598f89d10714528d69da0f
class JsonFetcher(fetcher.AaFetcher): <NEW_LINE> <INDENT> def __init__(self, hostname, port): <NEW_LINE> <INDENT> super(JsonFetcher, self).__init__(hostname, port) <NEW_LINE> self._url = "{}/retrieval/data/getData.json".format(self._endpoint) <NEW_LINE> <DEDENT> def _parse_raw_data(self, response, pv, start, end, count...
Class to fetch data from the Archiver Appliance using JSON.
62598f890c0af96317c55ecb
@dataclass <NEW_LINE> class NYTimes(Site): <NEW_LINE> <INDENT> web: Web <NEW_LINE> def __init__(self, web): <NEW_LINE> <INDENT> self.web = web <NEW_LINE> <DEDENT> def parse_rows(self, table: Soup) -> List[LeaderBoard]: <NEW_LINE> <INDENT> result = [] <NEW_LINE> rows = table.findAll("tr") <NEW_LINE> for row in rows: <NE...
NYTimes object. NYTimes is a custom class to parse a Web instance from the nytimes website. Variables: web: Web -- The web object stores the information needed to process the data. Methods: find_table: -> str -- Parses the Web object for table elements and returns the first one that it finds ...
62598f893c8af77a43b67cd5
class DocumentDetailView(DetailView): <NEW_LINE> <INDENT> model = Document <NEW_LINE> @conditional_decorator( method_decorator(login_required), settings.LOGIN_REQUIRED) <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return super(DocumentDetailView, self).dispatch( request, *args, **kwargs)
A view that displays detailed information about an event.
62598f89e76e3b2f99fd856e
class Nod(object): <NEW_LINE> <INDENT> S = None <NEW_LINE> C = None <NEW_LINE> def __init__(self, astring, bstring, C=None, S=None): <NEW_LINE> <INDENT> self.a = astring <NEW_LINE> self.b = bstring <NEW_LINE> if C is not None: <NEW_LINE> <INDENT> self.C = C <NEW_LINE> <DEDENT> if S is not None: <NEW_LINE> <INDENT> Nod....
# Class of non-orthogonal determinants
62598f89507cdc57c63a48ce
class Miner(Occupation): <NEW_LINE> <INDENT> def __init__(self, person, company, shift): <NEW_LINE> <INDENT> super(Miner, self).__init__(person=person, company=company, shift=shift)
A miner at a coal mine.
62598f8973bcbd0ca4bc9d93
class PluginDisableBuiltins(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.disabled = [] <NEW_LINE> <DEDENT> schema = { 'oneOf': [ {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string', 'enum': [p.name for p in all_builtins()]}} ] } <NEW_LINE> def debug(self): <NEW_LINE> <INDENT> ...
Disables all (or specific) builtin plugins from a task.
62598f89656771135c4891bb
class LinkedList(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.list = SingleNode(None) <NEW_LINE> self.num = 0 <NEW_LINE> <DEDENT> def isEmpty(self): <NEW_LINE> <INDENT> return self.num == 0 <NEW_LINE> <DEDENT> def addHead(self, item): <NEW_LINE> <INDENT> self.list.next = SingleNode(item, se...
LinkedList --------- empty = isEmpty(): tell list is empty. addHead(item): insert at the beginning. addTail(item): insert at the ending. node = get(index): get item at index(begin in 0). index = index(item): get index of that item. item = remove(index): remove the node in index. size = size(): size of list.
62598f896aa9bd52df0d4a13
class SetColorUnique(effect.Effect): <NEW_LINE> <INDENT> def __init__(self, bead_set, color=color.Color(), **kwargs): <NEW_LINE> <INDENT> super().__init__(name="set_color_unique", bead_set=bead_set, color=color, **kwargs) <NEW_LINE> self.bead_colors = [copy.copy(color) for b in bead_set] <NEW_LINE> <DEDENT> def next(se...
Similar to SetColor, but each bead gets its own instance of the color object. This is for dynamic colors so that each bead will act similarly, but not identically.
62598f896fece00bbaccb4ca
class KeyValue(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self._data = data <NEW_LINE> self.key = data.get('key') <NEW_LINE> self.create_revision = data.get('create_revision') <NEW_LINE> self.mod_revision = data.get('mod_revision') <NEW_LINE> self.value = data.get('value') <NEW_LINE> sel...
Model of the key-value of the event
62598f8950485f2cf55daab5
class cartridge(Layer): <NEW_LINE> <INDENT> def __init__(self, img_size=29, **kwargs): <NEW_LINE> <INDENT> self.filters = 1 <NEW_LINE> self.img_size = img_size <NEW_LINE> self.k_h, self.k_w = (3, 3) <NEW_LINE> super(cartridge, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def build(self, input_shape): <NEW_LINE> <INDENT...
Implemeting a Conv2D with strides=1, and 'valid' padding
62598f89a79ad16197769ba3
class ParsedItemLocator: <NEW_LINE> <INDENT> NAME_LOCATOR = 'article.product_pod h3 a' <NEW_LINE> LINK_LOCATOR = 'article.product_pod h3 a' <NEW_LINE> PRICE_LOCATOR = 'article.product_pod p.price_color' <NEW_LINE> RATING_LOCATOR = 'article.product_pod p.star-rating'
Locators for an item in the HTML page. This allows us to easily see what our code will be looking at as well as change it quickly if we notice it is now different.
62598f893cc13d1c6d4652a8
class ReferenceModel(ModelObject): <NEW_LINE> <INDENT> def Delete(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetChildren(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetConvertedObjects(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetCurrentRevision(self): <NEW_LINE> <INDENT> pass <NE...
ReferenceModel() ReferenceModel(filename: str, position: Point, scale: float)
62598f89be383301e025333c
class Graphviz(Directive): <NEW_LINE> <INDENT> has_content = True <NEW_LINE> required_arguments = 0 <NEW_LINE> optional_arguments = 1 <NEW_LINE> final_argument_whitespace = False <NEW_LINE> option_spec = { 'alt': directives.unchanged, 'align': align_spec, 'inline': directives.flag, 'caption': directives.unchanged, 'gra...
Directive to insert arbitrary dot markup.
62598f8982261d6c5272fc75
class ThreadInterrupt(BaseException): <NEW_LINE> <INDENT> pass
Raised when a thread is interrupted.
62598f8996565a6dacd2cd18
class Job: <NEW_LINE> <INDENT> def __init__(self, status=JobStatus.queued, running_time=None): <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.running_time = running_time <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return ('<Job({status})>' .format(status=self.status)) <NEW_LINE> <DEDENT> def r...
A task to be run by one of the MPI processes Redefine the `run` method in a descendant to do something useful.
62598f8971ff763f4b5e72b0
class RandomWalk: <NEW_LINE> <INDENT> def __init__(self, num_points=5000): <NEW_LINE> <INDENT> self.num_points = num_points <NEW_LINE> self.x_values = [0] <NEW_LINE> self.y_values = [0] <NEW_LINE> <DEDENT> def fill_walk(self): <NEW_LINE> <INDENT> while len(self.x_values) < self.num_points: <NEW_LINE> <INDENT> x_step = ...
A class to generate random walks.
62598f898e05c05ec3f6ebe8
class GaborData: <NEW_LINE> <INDENT> def __init__(self, features = [0.0 for i in range(2176)]): <NEW_LINE> <INDENT> self.features = features <NEW_LINE> <DEDENT> def copy(self): <NEW_LINE> <INDENT> return GaborData(self.features.copy()) <NEW_LINE> <DEDENT> def isEmpty(self): <NEW_LINE> <INDENT> return all(v == 0 for v i...
Represents the responses of the Gabor bank to the facial landmarks.
62598f898e71fb1e983bb5f1
class Transaction: <NEW_LINE> <INDENT> def __init__(self, uri, depth, srcId, idno, method="GET", data=None): <NEW_LINE> <INDENT> self.uri = uri <NEW_LINE> self.aliases = set([uri]) <NEW_LINE> self.depth = depth <NEW_LINE> self.type = None <NEW_LINE> self.file = None <NEW_LINE> self.idno = idno <NEW_LINE> self.srcId = s...
Information about a web page is represented by this class.
62598f8929b78933be269e7b
class TestCase(object): <NEW_LINE> <INDENT> def take_screenshot(self, name): <NEW_LINE> <INDENT> if not self.test_name: <NEW_LINE> <INDENT> raise RuntimeError('self.test_name is not set') <NEW_LINE> <DEDENT> filename = '{}__{}.png'.format(self.test_name, name) <NEW_LINE> self.selenium.get_screenshot_as_file(os.path.abs...
Subclasses have to declare the following fields: self.test_name self.selenium
62598f89711fe17d825e022c
class BucketDict(OrderedDict): <NEW_LINE> <INDENT> def __init__(self, *args, **kargs): <NEW_LINE> <INDENT> OrderedDict.__init__(self) <NEW_LINE> self.append(*args, **kargs) <NEW_LINE> <DEDENT> def add(self, key, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> v = self[key] <NEW_LINE> <DEDENT> except KeyError: <NEW...
A bucket dictionary is an ordered dictionary allowing to add mappings by storing them in lists: d = BucketDict() d.add('a', 1) assert(d == {'a': 1}) d.add('a', 2) assert(d == {'a': [1, 2]}) # keywords are executed before the initialization list d = BucketDict([('a', 1), ('b', 1)], a = 2) assert(d == {'a': [2, 1], '...
62598f89a05bb46b3848a3bb
class _Node: <NEW_LINE> <INDENT> def __init__(self, element, prev, nxt): <NEW_LINE> <INDENT> self._element = element <NEW_LINE> self._prev = prev <NEW_LINE> self._next = nxt
A lightweight object representing a node of the doubly linked list
62598f89097d151d1a2c0b67
class Zero_Mobile_Page(Mobile_Base_Page): <NEW_LINE> <INDENT> def start(self): <NEW_LINE> <INDENT> pass
Page Object for the dummy page
62598f890383005118f6d23c
class PrivateKey(): <NEW_LINE> <INDENT> sec_key_ref = None <NEW_LINE> asn1 = None <NEW_LINE> def __init__(self, sec_key_ref, asn1): <NEW_LINE> <INDENT> self.sec_key_ref = sec_key_ref <NEW_LINE> self.asn1 = asn1 <NEW_LINE> <DEDENT> @property <NEW_LINE> def algorithm(self): <NEW_LINE> <INDENT> return self.asn1.algorithm ...
Container for the OS crypto library representation of a private key
62598f8915fb5d323ce7e86d