code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ManifestItemMeta(ABCMeta): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs, **kwargs): <NEW_LINE> <INDENT> rv = ABCMeta.__new__(cls, name, bases, attrs, **kwargs) <NEW_LINE> item_types[rv.item_type] = rv <NEW_LINE> return rv
Custom metaclass that registers all the subclasses in the item_types dictionary according to the value of their item_type attribute, and otherwise behaves like an ABCMeta.
625990617d43ff2487427f70
class Projects(object): <NEW_LINE> <INDENT> def __init__(self, items=None): <NEW_LINE> <INDENT> self.swagger_types = { 'items': 'list[Project]' } <NEW_LINE> self.attribute_map = { 'items': 'items' } <NEW_LINE> self._items = items <NEW_LINE> <DEDENT> @property <NEW_LINE> def items(self): <NEW_LINE> <INDENT> return self....
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259906144b2445a339b74c1
class LinearColormap(LinearSegmentedColormap): <NEW_LINE> <INDENT> def __init__(self, name, segmented_data, **kwargs): <NEW_LINE> <INDENT> segmented_data = dict((key, [(x, y, y) for x, y in value]) for key, value in segmented_data.items()) <NEW_LINE> LinearSegmentedColormap.__init__(self, name, segmented_data, **kwargs...
LinearSegmentedColormap in which color varies smoothly. This class is a simplification of LinearSegmentedColormap, which doesn't support jumps in color intensities. Parameters ---------- name : str Name of colormap. segmented_data : dict Dictionary of 'red', 'green', 'blue', and (optionally) 'alpha' values. ...
625990614e4d562566373ac8
class Moon(Sol): <NEW_LINE> <INDENT> bodytype = 'moon' <NEW_LINE> def __init__(self, name='Moon'): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> assert (type(name) == str), 'Name must be a string.' <NEW_LINE> self.name = name <NEW_LINE> if name in moon_data: <NEW_LINE> <INDENT> for key in moon_data[name]: <NEW_LINE...
Create a new Moon object. Moons are natural satellites of planets or minor bodies. Args: name dtype: str | Must match one of: 'Moon'. Defaults to 'Moon' if not specified. Initial physical attributes are generated from values stored in spacepy.data.bodydata.moon_data. For Earth's Moon, the following parameters are...
62599061d6c5a102081e37e6
class DoubanBackend(OAuthBackend): <NEW_LINE> <INDENT> name = 'douban' <NEW_LINE> EXTRA_DATA = [('id', 'id')] <NEW_LINE> def get_user_id(self, details, response): <NEW_LINE> <INDENT> return response['db:uid']['$t'] <NEW_LINE> <DEDENT> def get_user_details(self, response): <NEW_LINE> <INDENT> return {'username': respons...
Douban OAuth authentication backend
62599061adb09d7d5dc0bc2c
class ChangePassword(ChangePasswordBase): <NEW_LINE> <INDENT> class SimpleIO(ChangePasswordBase.SimpleIO): <NEW_LINE> <INDENT> request_elem = 'zato_outgoing_sql_change_password_request' <NEW_LINE> response_elem = 'zato_outgoing_sql_change_password_response' <NEW_LINE> <DEDENT> def handle(self): <NEW_LINE> <INDENT> def ...
Changes the password of an outgoing SQL connection.
625990616e29344779b01d11
class File(Validator): <NEW_LINE> <INDENT> def __init__(self, mode='r', buffering=-1): <NEW_LINE> <INDENT> self.mode = mode <NEW_LINE> self.buffering = buffering <NEW_LINE> <DEDENT> def __call__(self, value): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> path = str(value) <NEW_L...
Validates file option values.
6259906163b5f9789fe86835
class Dia(Package): <NEW_LINE> <INDENT> homepage = 'https://wiki.gnome.org/Apps/Dia' <NEW_LINE> url = 'https://ftp.gnome.org/pub/gnome/sources/dia/0.97/dia-0.97.3.tar.xz' <NEW_LINE> version('0.97.3', '0e744a0f6a6c4cb6a089e4d955392c3c') <NEW_LINE> depends_on('intltool', type='build') <NEW_LINE> depends_on('get...
Dia is a program for drawing structured diagrams.
62599061009cb60464d02bf9
class ExperimentalPlugins(BasePluginManager): <NEW_LINE> <INDENT> def get_query_set(self): <NEW_LINE> <INDENT> return super(ExperimentalPlugins, self).get_query_set().filter(pluginversion__approved=True, pluginversion__experimental=True).distinct()
Shows only public plugins: i.e. those with "approved" flag set and with one "experimental" version
6259906121bff66bcd724327
class InputError(Exception): <NEW_LINE> <INDENT> pass
入力に関するエラーの例外クラス
625990614e4d562566373ac9
class Provider(object): <NEW_LINE> <INDENT> DUMMY = 'dummy' <NEW_LINE> S3 = 's3' <NEW_LINE> S3_US_WEST = 's3_us_west' <NEW_LINE> S3_EU_WEST = 's3_eu_west' <NEW_LINE> S3_AP_SOUTHEAST = 's3_ap_southeast' <NEW_LINE> S3_AP_NORTHEAST = 's3_ap_northeast' <NEW_LINE> NINEFOLD = 'ninefold' <NEW_LINE> GOOGLE_STORAGE = 'google_st...
Defines for each of the supported providers :cvar DUMMY: Example provider :cvar CLOUDFILES_US: CloudFiles US :cvar CLOUDFILES_UK: CloudFiles UK :cvar S3: Amazon S3 US :cvar S3_US_WEST: Amazon S3 US West (Northern California) :cvar S3_EU_WEST: Amazon S3 EU West (Ireland) :cvar S3_AP_SOUTHEAST_HOST: Amazon S3 Asia South...
62599061f7d966606f74941a
class Critic: <NEW_LINE> <INDENT> def __init__(self, state_size, action_size): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.build_model() <NEW_LINE> <DEDENT> def build_model(self): <NEW_LINE> <INDENT> states = layers.Input(shape=(self.state_size,), name='sta...
Critic (Value) Model.
625990613cc13d1c6d466e04
class Car(): <NEW_LINE> <INDENT> def __init__(self, make, model, year): <NEW_LINE> <INDENT> self.make = make <NEW_LINE> self.model = model <NEW_LINE> self.year = year <NEW_LINE> self.odometer_reading = 0 <NEW_LINE> <DEDENT> def get_descriptive_name(self): <NEW_LINE> <INDENT> long_name = str(self.year) + ' ' + self.make...
A simple attempt to represent a car.
625990613539df3088ecd95f
class GeneSequenceGenerator(object): <NEW_LINE> <INDENT> def __init__(self, max_size=None): <NEW_LINE> <INDENT> self.max_size = max_size if max_size is not None else float('inf') <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> from classes import Gene <NEW_LINE> i = 0 <NEW_LINE> while i < self.max_size: <NE...
Generate a sequence of genes
625990613eb6a72ae038bd22
class SwingViableDay: <NEW_LINE> <INDENT> day_date: date <NEW_LINE> prev_day_volume: int <NEW_LINE> avg_volume_50: int <NEW_LINE> range_75: float <NEW_LINE> prev_day_high: float <NEW_LINE> def __init__(self, day_date: date, prev_day_volume: int, avg_volume_50: int, range_75: float, prev_day_high: float): <NEW_LINE> <IN...
Contains json-serializable info on a single day that was viable for SwingStrategy.
62599061498bea3a75a59160
class CancelAggregationTask(IcontrolRestCommand): <NEW_LINE> <INDENT> def __init__(self, name=None, itemid=None, timeout=60, *args, **kwargs): <NEW_LINE> <INDENT> super(CancelAggregationTask, self).__init__(*args, **kwargs) <NEW_LINE> self.name = name <NEW_LINE> self.itemid = itemid <NEW_LINE> self.timeout = timeout <N...
Cancels an Aggregation Task via the icontrol rest api using task id or name Type: PATCH @param name: name @type name: string @param itemid: the item id @type itemid: string @return: the api resp @rtype: attr dict json
6259906145492302aabfdb9d
class Hand(object): <NEW_LINE> <INDENT> def __init__(self, cards): <NEW_LINE> <INDENT> self.cards = cards <NEW_LINE> self.rank = None <NEW_LINE> <DEDENT> def by_suit(self): <NEW_LINE> <INDENT> self.cards.sort(key=lambda card: card.suit) <NEW_LINE> <DEDENT> def by_rank(self): <NEW_LINE> <INDENT> self.cards.sort(key=lamb...
a poker hand
625990617d847024c075da98
class AccountPage(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> logger.info("Initializing Account Page's Element") <NEW_LINE> self.home_path = BuiltIn().get_variable_value("${globalTestBed}")["AutomationServer"]["HOME_PATH"] <NEW_LINE> self.driver = BuiltIn().get_variable_value("${cur_session}")[...
classdocs Created on Oct 23, 2016 @author: tarun Provides element of the Account page and the associated methods.
625990614a966d76dd5f05b7
class ToFieldNameTest(TestCase): <NEW_LINE> <INDENT> def test_filter(self): <NEW_LINE> <INDENT> self.assertEqual( di_tags.to_field_name('TextField'), 'Text' ) <NEW_LINE> self.assertEqual( di_tags.to_field_name('NumericField'), 'Numeric' ) <NEW_LINE> self.assertEqual( di_tags.to_field_name('DateTimeField'), 'Date and Ti...
Test to_field_name filter.
62599061009cb60464d02bfa
class FamilyName(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=120, help_text="The family name") <NEW_LINE> def __str__(self) -> str: <NEW_LINE> <INDENT> return self.name
Reperesents a given family name (surname)
625990618e71fb1e983bd18e
class FoolAgent: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> def act(self, state): <NEW_LINE> <INDENT> return np.random.choice(state.allowed_actions)
This agent selects the next action at random.
6259906167a9b606de547603
class CheckoutSerializer(serializers.Serializer): <NEW_LINE> <INDENT> customer_tag = SerializeFormAsTextField('CustomerForm') <NEW_LINE> shipping_address_tag = SerializeFormAsTextField('ShippingAddressForm') <NEW_LINE> billing_address_tag = SerializeFormAsTextField('BillingAddressForm') <NEW_LINE> shipping_method_tag =...
Serializer to digest a summary of data required for the checkout.
62599061d486a94d0ba2d68b
class DisplayPlugin(capture_gui.plugin.Plugin): <NEW_LINE> <INDENT> id = "Display Options" <NEW_LINE> label = "Display Options" <NEW_LINE> section = "config" <NEW_LINE> order = 70 <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(DisplayPlugin, self).__init__(parent=parent) <NEW_LINE> self._colors =...
Plugin to apply viewport visibilities and settings
625990618a43f66fc4bf3852
class Box(box.Box): <NEW_LINE> <INDENT> def update(self, item=None, **kwargs): <NEW_LINE> <INDENT> source = Box(item) <NEW_LINE> if kwargs: <NEW_LINE> <INDENT> source.update(kwargs) <NEW_LINE> <DEDENT> for key, value in source.items(): <NEW_LINE> <INDENT> if isinstance(value, dict): <NEW_LINE> <INDENT> node = self.setd...
- Merges on update instead of overriding. - Supports loading from TOML
6259906199cbb53fe68325a5
class Config(object): <NEW_LINE> <INDENT> SECRET_KEY = '9hQaY2nGqS9YQbs_b033vA' <NEW_LINE> WTF_CSRF_SECRET_KEY = 'lCgqy2NPRYY5NYkk25bhuQ' <NEW_LINE> CWD = dirname(abspath(__file__)) <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'sqlite:///' + join(CWD, 'spaceless.db') <NEW_LINE> UPLOAD_FOLDER = join(CWD, 'static/profile_picture...
Set Flask base configuration
625990618e7ae83300eea750
class RunParameters(typing.NamedTuple): <NEW_LINE> <INDENT> freq_max: float <NEW_LINE> freq_min: float = 0.05 <NEW_LINE> Rayleigh_or_Love: str = 'Rayleigh' <NEW_LINE> phase_or_group_velocity: str = 'ph' <NEW_LINE> l_min: int = 0 <NEW_LINE> l_max: int = 7000 <NEW_LINE> l_increment_standard: int = 2 <NEW_LINE> l_incremen...
Parameters needed to run MINEOS. Fields: Rayleigh_or_Love: - str - 'Rayleigh' or 'Love' for Rayleigh or Love - Default value = 'Rayleigh' phase_or_group_velocity: - str - 'ph' or 'gr' for phase or group velocity - Default value = 'ph' l_min: - int ...
62599061627d3e7fe0e0854e
class ReferendumStaticViewSitemap(Sitemap): <NEW_LINE> <INDENT> priority = 0.5 <NEW_LINE> changefreq = 'never' <NEW_LINE> def items(self): <NEW_LINE> <INDENT> return ['referendum_create', 'legal'] <NEW_LINE> <DEDENT> def location(self, obj): <NEW_LINE> <INDENT> return reverse(obj)
Never updated pages sitemap
62599061ac7a0e7691f73ba7
class ProjectMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if request.session.get('CURRENT_PROJECT'): <NEW_LINE> <INDENT> request.project = Project.objects.get(pk=request.session['CURRENT_PROJECT']) <NEW_LINE> return <NEW_LINE> <DEDENT> if request.path.startswith('/desi...
Stores current project in request object makes redirect if project not set
62599061a17c0f6771d5d706
class P2TRConst: <NEW_LINE> <INDENT> FIELD_SIZE: int = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F <NEW_LINE> TAP_TWEAK_SHA256: bytes = BytesUtils.FromHexString( "e80fe1639c9ca050e3af1b39c143c63e429cbceb15d940fbb5c5a1f4af57c5e9" ) <NEW_LINE> WITNESS_VER: int = 1
Class container for P2TR constants.
62599061e64d504609df9f30
class File_toolbar(QToolBar, object): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.setObjectName("File Toolbar") <NEW_LINE> self.setMovable(False) <NEW_LINE> self.setFloatable(False) <NEW_LINE> self.new_button = self.addAction(self.style().standardIcon( QS...
Toolbar with file open, save, etc
62599061460517430c432bb5
class SteelFusionLUNIOReport(BaseStatsReport): <NEW_LINE> <INDENT> resource = 'granite_lun_io' <NEW_LINE> link = 'report' <NEW_LINE> data_key = 'response_data' <NEW_LINE> required_fields = ['device', 'start_time', 'end_time'] <NEW_LINE> non_required_fields = ['traffic_type', 'lun_subclass_id']
Report class to return the SteelFusion lun io timeseries
62599061a8370b77170f1a92
class InternationalMelonOrder(AbstractMelonOrder): <NEW_LINE> <INDENT> def __init__(self, species, qty, country_code): <NEW_LINE> <INDENT> super(InternationalMelonOrder, self).__init__(species, qty, country_code, "international", 0.17)
An international (non-US) melon order.
62599061009cb60464d02bfb
class FeedStats: <NEW_LINE> <INDENT> cfg = None <NEW_LINE> def __init__(self,cfg): <NEW_LINE> <INDENT> self.cfg = cfg <NEW_LINE> return <NEW_LINE> <DEDENT> def incr(self,statname): <NEW_LINE> <INDENT> if self.cfg.has_section("stats") == False: <NEW_LINE> <INDENT> self.cfg.add_section("stats") <NEW_LINE> <DEDENT> statva...
Handles counters etc for drawing nice graphs
62599061e76e3b2f99fda0c4
class Logger(logging.Logger): <NEW_LINE> <INDENT> def __init__(self, name, level): <NEW_LINE> <INDENT> logging.Logger.__init__(self, name, level) <NEW_LINE> self.nomFichierLogs = dateExecution + ".log" <NEW_LINE> logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s") <NE...
classdocs
62599061dd821e528d6da4e3
@total_ordering <NEW_LINE> class Package(object): <NEW_LINE> <INDENT> def __init__(self, name, version, filename, last_modified=None, **kwargs): <NEW_LINE> <INDENT> self.name = normalize_name(name) <NEW_LINE> self.version = version <NEW_LINE> self.filename = filename <NEW_LINE> if last_modified is not None: <NEW_LINE> ...
Representation of a versioned package Parameters ---------- name : str The name of the package (will be normalized) version : str The version number of the package filename : str The name of the package file last_modified : datetime, optional The datetime when this package was uploaded (default now) **...
62599061f548e778e596cc4d
class BaseShippingBackend(BaseBackend): <NEW_LINE> <INDENT> def __init__(self, shop=ShippingBackendAPI()): <NEW_LINE> <INDENT> self.shop = shop <NEW_LINE> super(BaseShippingBackend, self).__init__() <NEW_LINE> <DEDENT> def finished(self): <NEW_LINE> <INDENT> return HttpResponseRedirect('checkout_shipping')
This is the base class for all shipping backends to implement. Class members: url_namespace backend_name shop
6259906155399d3f05627be4
class NumpyGenericOperator(Operator): <NEW_LINE> <INDENT> def __init__(self, mapping, adjoint_mapping=None, dim_source=1, dim_range=1, linear=False, parameters={}, source_id=None, range_id=None, solver_options=None, name=None): <NEW_LINE> <INDENT> self.__auto_init(locals()) <NEW_LINE> self.source = NumpyVectorSpace(dim...
Wraps an arbitrary Python function between |NumPy arrays| as an |Operator|. Parameters ---------- mapping The function to wrap. If `parameters` is `None`, the function is of the form `mapping(U)` and is expected to be vectorized. In particular:: mapping(U).shape == U.shape[:-1] + (dim_range,). If...
62599061d7e4931a7ef3d6e7
class ProtocolLayer4Registry(Registry): <NEW_LINE> <INDENT> entry_point = 'dhcpkit_vpp.protocols.layer4'
Registry for Protocols
625990617cff6e4e811b710a
class ExpressRouteServiceProvider(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'ty...
A ExpressRouteResourceProvider object. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param location: Resource location. :type location: str :para...
62599061d268445f2663a6bf
class PrivateIngredientsAPITest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.user = get_user_model().objects.create_user( 'test@user.com', 'testpass' ) <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_ingredient_l...
Test the private ingredients API
625990618e71fb1e983bd190
class CardDeck(object): <NEW_LINE> <INDENT> def __init__(self, decks=1): <NEW_LINE> <INDENT> self.deck = deque() <NEW_LINE> self.deck_count = int(decks) <NEW_LINE> self.shuffle_count = self.deck_count * 7 <NEW_LINE> self.suits = ( 'Clubs', 'Diamonds', 'Hearts', 'Spades', ) <NEW_LINE> self.names = ( 'Ace', 'Two', 'Three...
Contains 52 or more playing cards and the methods for using them.
62599061fff4ab517ebceeec
class ScoreHandler(PermissionHandler, StarkHandler): <NEW_LINE> <INDENT> model_form_class = ScoreModelForm <NEW_LINE> list_display = ['content', 'score', 'user'] <NEW_LINE> def get_list_display(self, request, *args, **kwargs): <NEW_LINE> <INDENT> value = [] <NEW_LINE> if self.list_display: <NEW_LINE> <INDENT> value.ext...
stark配置:积分记录表
6259906115baa72349463658
class ImageConfiguration(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "Port": (str, False), "RuntimeEnvironmentVariables": ([KeyValuePair], False), "StartCommand": (str, False), }
`ImageConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imageconfiguration.html>`__
62599061a17c0f6771d5d707
class EndpointNotFoundError(RpcError): <NEW_LINE> <INDENT> def convert(self): <NEW_LINE> <INDENT> return _EndpointNotFoundError(self.message)
Exception class for endpoint not found error
625990618da39b475be048ae
class Param(NamedTuple): <NEW_LINE> <INDENT> data: torch.Tensor <NEW_LINE> optim_args: Dict[str, Any] = {}
Data structure for model parameters
62599061f548e778e596cc4e
class DayWeatherForecastParser: <NEW_LINE> <INDENT> def __init__(self, period_weather_forecast_parsers: list[PeriodWeatherForecastParser]) -> None: <NEW_LINE> <INDENT> self._period_parsers = period_weather_forecast_parsers <NEW_LINE> <DEDENT> @property <NEW_LINE> def period_parsers(self) -> list[PeriodWeatherForecastPa...
Implements daily weather forecast parser. Gather all `PeriodWeatherForecastParser` instances that contain the same day information (but different time-periods). Used in the other weather-parsers classes in composition way.
625990616e29344779b01d15
class ProximalConvexConjKLCrossEntropy(Operator): <NEW_LINE> <INDENT> def __init__(self, sigma): <NEW_LINE> <INDENT> self.sigma = float(sigma) <NEW_LINE> super(ProximalConvexConjKLCrossEntropy, self).__init__( domain=space, range=space, linear=False) <NEW_LINE> <DEDENT> def _call(self, x, out): <NEW_LINE> <INDENT> impo...
Proximal operator of conjugate of cross entropy KL divergence.
62599061a8370b77170f1a94
class Part(object): <NEW_LINE> <INDENT> def __init__(self, shape, name): <NEW_LINE> <INDENT> self._shape = shape <NEW_LINE> self._part_transformation_matrices = [] <NEW_LINE> self._name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def shape(self): <NEW_LINE> <INDENT> return self._shape <NEW_LINE> <DEDENT> @property ...
A Part is the simplest possible element Parameters ---------- shape : OCC shape name : str
62599061e64d504609df9f31
class HOCMethod(HOCObject): <NEW_LINE> <INDENT> option_spec: OptionSpec = HOCObject.option_spec.copy() <NEW_LINE> option_spec.update({ 'abstractmethod': directives.flag, 'async': directives.flag, 'classmethod': directives.flag, 'final': directives.flag, 'property': directives.flag, 'staticmethod': directives.flag, }) <...
Description of a method.
6259906176e4537e8c3f0c53
class MoveZeroesTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_case_1(self): <NEW_LINE> <INDENT> numbers = [0, 1, 0, 3, 12] <NEW_LINE> move_zeroes(numbers) <NEW_LINE> self.assertEqual(numbers, [1, 3, 12, 0, 0]) <NEW_LINE> <DEDENT> def test_case_2(self): <NEW_LINE> <INDENT> numbers = [0, 0, 0, 0, 0] <NEW_LINE> m...
Tests for move zeroes challenge.
625990613d592f4c4edbc5a3
class DotDict(dict): <NEW_LINE> <INDENT> def __init__(self, value=None): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> for key in value: <NEW_LINE> <INDENT> self.__setitem__(key, value[key]) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def __setitem__(self, key, v...
Wrapper dict that allows to get dotted attributes
625990614e4d562566373acd
class Min(FunctionBase): <NEW_LINE> <INDENT> def __init__(self, name, pos): <NEW_LINE> <INDENT> FunctionBase.__init__(self, name, pos) <NEW_LINE> self.shapeImage = 'min.png' <NEW_LINE> self.minValue = 1e38 <NEW_LINE> <DEDENT> def drawShape(self, gc): <NEW_LINE> <INDENT> gc.setPen(QPen(self.shapeColor, 0.6)) <NEW_LINE> ...
! @if English @endif @if Slovak Minimalna hodnota vstupnej hodnoty. Ak je vstupná hodnota vektor, berie sa minimálna hodnota z položiek vektora. @endif
62599061cc0a2c111447c632
class EmptyError(Exception): <NEW_LINE> <INDENT> pass
Exception class for empty queue ADT
62599061d7e4931a7ef3d6e8
class IpRange(models.Model): <NEW_LINE> <INDENT> start_ip = models.BigIntegerField(_('Ip range block beginning, as integer'), db_index=True) <NEW_LINE> end_ip = models.BigIntegerField(_('Ip range block ending, as integer'), db_index=True) <NEW_LINE> country = models.ForeignKey(Country) <NEW_LINE> region = models.Foreig...
IP ranges are stored in separate table, one row for each ip range. Each range might be associated with either country (for IP ranges outside of Russia and Ukraine) or country, region and city together. Ip range borders are `stored as long integers <http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/commtrf2...
6259906191af0d3eaad3b4ee
class WM_OT_studiolight_uninstall(Operator): <NEW_LINE> <INDENT> bl_idname = 'wm.studiolight_uninstall' <NEW_LINE> bl_label = "Uninstall Studio Light" <NEW_LINE> index: bpy.props.IntProperty() <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> import os <NEW_LINE> prefs = context.preferences <NEW_LINE> for stud...
Delete Studio Light
625990613539df3088ecd963
class Section(ABC): <NEW_LINE> <INDENT> def __init__(self, section_name, parser): <NEW_LINE> <INDENT> self._section_name = section_name <NEW_LINE> self._parser = parser <NEW_LINE> <DEDENT> def _has_option(self, option_name): <NEW_LINE> <INDENT> return self._parser.has_option(self._section_name, option_name) <NEW_LINE> ...
A base class for representation of a configuration section.
6259906191f36d47f22319f2
class ProviderResourceType(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'default_api_version': {'readonly': True}, 'api_profiles': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'resource_type': {'key': 'resourceType', 'type': 'str'}, 'locations': {'key': 'locations', 'type': '[str]'}, 'aliases...
Resource type managed by the resource provider. Variables are only populated by the server, and will be ignored when sending a request. :ivar resource_type: The resource type. :vartype resource_type: str :ivar locations: The collection of locations where this resource type can be created. :vartype locations: list[str...
625990614a966d76dd5f05bb
class Solution(object): <NEW_LINE> <INDENT> def isSameTree(self, p, q): <NEW_LINE> <INDENT> if not p and not q: return True <NEW_LINE> if not p or not q: return False <NEW_LINE> if p.val == q.val: <NEW_LINE> <INDENT> return self.isSameTree(p.left, q.left) and self.isSameTree(p.right, q.right) <NEW_LINE> <DEDENT> else: ...
https://leetcode-cn.com/problems/same-tree/
6259906167a9b606de547605
class SerialPort(object): <NEW_LINE> <INDENT> def __init__( self, portName, baudRate, numDataBits, parity, numStopBits, readTimeout=None, writeTimeout=None, exceptionClass=None): <NEW_LINE> <INDENT> self._exceptionClass = exceptionClass <NEW_LINE> byteSize = _getByteSize(numDataBits) <NEW_LINE> parity = _getParity(pari...
Serial communication port. An instance of this class wraps an instance of the `Serial` class of the PySerial serial communications Python extension, optionally transforming exceptions raised by `Serial` methods into exceptions of another type. Note that the functionality of this class is quite limited. It does not su...
625990611b99ca4002290099
class HeadRecordVisualCompass(AbstractActionElement): <NEW_LINE> <INDENT> def perform(self): <NEW_LINE> <INDENT> self.blackboard.blackboard.set_head_duty(HeadMode.RECORD_VISUAL_COMPASS) <NEW_LINE> return self.pop()
Record ground truth for the visual compass
625990618e71fb1e983bd192
class RandomTranslateWithReflect: <NEW_LINE> <INDENT> def __init__(self, max_translation): <NEW_LINE> <INDENT> if not _PIL_AVAILABLE: <NEW_LINE> <INDENT> raise ModuleNotFoundError("You want to use `Pillow` which is not installed yet.") <NEW_LINE> <DEDENT> self.max_translation = max_translation <NEW_LINE> <DEDENT> def _...
Translate image randomly Translate vertically and horizontally by n pixels where n is integer drawn uniformly independently for each axis from [-max_translation, max_translation]. Fill the uncovered blank area with reflect padding.
625990615166f23b2e244a99
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> if isinstance(size, int): <NEW_LINE> <INDENT> if size >= 0: <NEW_LINE> <INDENT> self._Square__size = size <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError("size must be >= 0") <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <I...
Square class
625990612c8b7c6e89bd4eb6
class RibmosaicRender(bpy.types.RenderEngine): <NEW_LINE> <INDENT> bl_use_preview = True <NEW_LINE> bl_idname = rm.ENGINE <NEW_LINE> bl_label = rm.ENGINE <NEW_LINE> compile_library = "" <NEW_LINE> preview_samples = 2 <NEW_LINE> preview_shading = 2.0 <NEW_LINE> preview_compile = True <NEW_LINE> preview_optimize = True <...
The render engine class, used for scene and preview renders
625990619c8ee82313040ced
class HorizontalAsymptotes(Asymptotes): <NEW_LINE> <INDENT> def __init__(self, info): <NEW_LINE> <INDENT> Asymptotes.__init__(self, info) <NEW_LINE> self.scale = self.yscale <NEW_LINE> <DEDENT> def value_from_spline(self, spline): <NEW_LINE> <INDENT> px = spline[0][1] <NEW_LINE> y = self.px_to_yval(px) <NEW_LINE> retur...
Horizontal Asymptote. Note: Use this class to interact with any horizontal asymptotes in the function you are grading.
625990617d43ff2487427f73
class mbType16(): <NEW_LINE> <INDENT> def __init__(self,fmt,endian): <NEW_LINE> <INDENT> self.fmt = fmt <NEW_LINE> self.endian= endian <NEW_LINE> <DEDENT> def pack(self,value): <NEW_LINE> <INDENT> assert type(value)==int <NEW_LINE> if self.endian=='big': <NEW_LINE> <INDENT> return struct.pack(">"+self.fmt,value) <NEW_L...
fmt : H , h suffixes: > , < (optional-default <)
625990614e4d562566373ace
class FeatureExtractor(object): <NEW_LINE> <INDENT> def __init__(self, pooling=False, device='cpu', dtype=torch.float32): <NEW_LINE> <INDENT> self.preprocess = transforms.Compose([ transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), ]) <NEW_LINE> self.device, self.dtype = device, dtype <NEW_LIN...
Image feature extraction with MobileNet.
62599061462c4b4f79dbd0cd
class AutoDiscoverPyLibMCCache(PyLibMCCache): <NEW_LINE> <INDENT> def __init__(self, server, params): <NEW_LINE> <INDENT> super(AutoDiscoverPyLibMCCache, self).__init__(server, params) <NEW_LINE> for method_name in ('set', 'set_many', 'get', 'get_many', 'delete'): <NEW_LINE> <INDENT> method = getattr(self, method_name)...
Handle multiple servers in a single A record. Simple auto-discover for use with Kubernetes.
6259906163d6d428bbee3dec
class BaseGeometry: <NEW_LINE> <INDENT> def area(self): <NEW_LINE> <INDENT> raise Exception("area() is not implemented") <NEW_LINE> <DEDENT> """Validate as positive number""" <NEW_LINE> def integer_validator(self, name, value): <NEW_LINE> <INDENT> if type(value) != int: <NEW_LINE> <INDENT> raise TypeError("{} must be a...
Class base geometry
62599061f548e778e596cc50
class HTTPTimeoutException(httplib.HTTPException): <NEW_LINE> <INDENT> pass
A timeout occurred while waiting on the server.
62599061435de62698e9d4cf
class Algorithm(object): <NEW_LINE> <INDENT> def __init__(self, chromo_length, pop_size, crossover_rate, mutation_rate): <NEW_LINE> <INDENT> self.chromo_length = chromo_length <NEW_LINE> self.pop_size = pop_size <NEW_LINE> self.crossover_rate = crossover_rate <NEW_LINE> self.mutation_rate = mutation_rate <NEW_LINE> sel...
Genetic Algorithm class
6259906145492302aabfdba2
class _FilterHandlerMixIn: <NEW_LINE> <INDENT> def initfilters(self, filters: Optional[List]) -> None: <NEW_LINE> <INDENT> self._filters = filters or [] <NEW_LINE> <DEDENT> async def prepare(self) -> Awaitable[None]: <NEW_LINE> <INDENT> super().prepare() <NEW_LINE> for filt in self._filters: <NEW_LINE> <INDENT> await f...
Handle filter handlers
625990611f5feb6acb1642b3
class _NotNaRowFunc(object): <NEW_LINE> <INDENT> def __init__( self, label: object, ) -> None: <NEW_LINE> <INDENT> self.label = label <NEW_LINE> self.__doc__ = f"df[{label}] is not NA" <NEW_LINE> <DEDENT> def __call__(self, df: pandas.DataFrame) -> pandas.Series: <NEW_LINE> <INDENT> return df[self.label].notna()
A pickle-able notna callable class.
62599061cb5e8a47e493cce9
class ElementsException(Exception): <NEW_LINE> <INDENT> pass
An exception for element formats.
62599061379a373c97d9a6ec
class CartDiscountKeyReference(KeyReference): <NEW_LINE> <INDENT> def __init__(self, *, key: str): <NEW_LINE> <INDENT> super().__init__(key=key, type_id=ReferenceType.CART_DISCOUNT) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def deserialize( cls, data: typing.Dict[str, typing.Any] ) -> "CartDiscountKeyReference": <NEW...
References a cart discount by key.
62599061d7e4931a7ef3d6e9
class Actor(object): <NEW_LINE> <INDENT> name_only_regex = re.compile( r'<(.+)>' ) <NEW_LINE> name_email_regex = re.compile( r'(.*) <(.+?)>' ) <NEW_LINE> def __init__(self, name, email): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.email = email <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> r...
Actors hold information about a person acting on the repository. They can be committers and authors or anything with a name and an email as mentioned in the git log entries.
6259906191af0d3eaad3b4f0
class Producer: <NEW_LINE> <INDENT> existing_topics = set([]) <NEW_LINE> def __init__( self, topic_name, key_schema, value_schema=None, num_partitions=1, num_replicas=1, ): <NEW_LINE> <INDENT> self.topic_name = topic_name <NEW_LINE> self.key_schema = key_schema <NEW_LINE> self.value_schema = value_schema <NEW_LINE> sel...
Defines and provides common functionality amongst Producers
625990610c0af96317c578c3
class _ArtifactoryFlavour(pathlib._Flavour): <NEW_LINE> <INDENT> sep = '/' <NEW_LINE> altsep = '/' <NEW_LINE> has_drv = True <NEW_LINE> pathmod = pathlib.posixpath <NEW_LINE> is_supported = (True) <NEW_LINE> def parse_parts(self, parts): <NEW_LINE> <INDENT> drv, root, parsed = super(_ArtifactoryFlavour, self).parse_par...
Implements Artifactory-specific pure path manipulations. I.e. what is 'drive', 'root' and 'path' and how to split full path into components. See 'pathlib' documentation for explanation how those are used. drive: in context of artifactory, it's the base URI like http://mysite/artifactory root: repository, e.g. 'libs...
625990614f88993c371f1083
class TestGeneralFunctions(unittest.TestCase): <NEW_LINE> <INDENT> def test_dummy(self): <NEW_LINE> <INDENT> d = Dummy() <NEW_LINE> d.foo = 'bar' <NEW_LINE> d.bar = 'baz' <NEW_LINE> self.assertIs(d.foo, 'bar') <NEW_LINE> self.assertIs(d.bar, 'baz') <NEW_LINE> <DEDENT> def test_json_encoder(self): <NEW_LINE> <INDENT> je...
Test general functions and objects. (Dummy, JSONEncoder, JSONDecoder, dump_dict, load_dict)
625990611b99ca400229009a
class MainObjectListView(generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = MainObjectSerializer <NEW_LINE> filter_backends = (DjangoFilterBackend,) <NEW_LINE> filterset_class = MainObjectFilter <NEW_LINE> permission_classes = [permissions.IsAuthenticatedOrReadOnly] <NEW_LINE> def get_queryset(self): <NEW_LI...
object list
625990617b25080760ed8845
class OutputTypeDescription(StorableMixin): <NEW_LINE> <INDENT> def __init__(self, filename=None, stride=1, selection=None): <NEW_LINE> <INDENT> super(OutputTypeDescription, self).__init__() <NEW_LINE> if filename is None: <NEW_LINE> <INDENT> filename = 'stride-%d.dcd' % stride <NEW_LINE> <DEDENT> self.filename = filen...
A description of a general trajectory type Attributes ---------- filename : str a filename to store these type of trajectory in stride : int the stride to be used relative to native engine timesteps selection : str a :meth:`mdtraj.Topolopgy.select` like selection of an atom subset
62599061435de62698e9d4d0
class HeatStacks(utils.HeatScenario): <NEW_LINE> <INDENT> RESOURCE_NAME_PREFIX = "rally_stack_" <NEW_LINE> RESOURCE_NAME_LENGTH = 7 <NEW_LINE> @staticmethod <NEW_LINE> def _get_template_from_file(template_path): <NEW_LINE> <INDENT> template = None <NEW_LINE> if template_path: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT...
Benchmark scenarios for Heat stacks.
62599061a79ad1619776b621
class PTRansition(SCPINode, SCPIQuery, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "PTRansition" <NEW_LINE> args = ["1"]
`STATus:OPERation:PTRansition <http://www.rohde-schwarz.com/webhelp/smb100a_webhelp/Content/19ddd521fccc4c10.htm#ID_7baf119671e812690a00206a0185198a-e4673fbb71e812690a00206a012bc823-en-US>`_ Arguments: 1
62599061379a373c97d9a6ed
class TestPersonalInfoResponse(SimpleTestCase): <NEW_LINE> <INDENT> def test_equality(self): <NEW_LINE> <INDENT> pr_rimmer = PersonalInfoResponse('smeg_head', 'H', sentinel.request_type, 'rimmer', sentinel.custom_email, sentinel.confirmation_method) <NEW_LINE> pr_clone = PersonalInfoResponse('smeg_head', 'H', sentinel....
Test `PersonalInfoResponse` class.
62599061442bda511e95d8be
class Solution1: <NEW_LINE> <INDENT> def romanToInt(self, string): <NEW_LINE> <INDENT> prev_char = string[-1] <NEW_LINE> total_value = mapping[prev_char] <NEW_LINE> string = string[:-1] <NEW_LINE> while string: <NEW_LINE> <INDENT> current_char = string[-1] <NEW_LINE> current_value = mapping[current_char] <NEW_LINE> str...
思路:直接利用 List 的 reverse 思路,比较当前字符和上一个字符的数值大小。 优点:利用 Stack 思路是一致的,但是节约了时间消耗
6259906116aa5153ce401ba5
class KNearestNeighbor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, X, y): <NEW_LINE> <INDENT> self.X_train = X <NEW_LINE> self.y_train = y <NEW_LINE> <DEDENT> def predict(self, X, k=1, num_loops=0): <NEW_LINE> <INDENT> if num_loops == 0: <NEW_LINE> <INDE...
a kNN classifier with L2 distance
625990619c8ee82313040cee
class NewReleaseMessageStatus (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'NewReleaseMessageStatus') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/20110630/ddex.xsd', 1423, 4) <NEW_LINE> _D...
A status of a NewReleaseMessage.
62599061b7558d5895464a92
class Season(Entity): <NEW_LINE> <INDENT> def __init__(self, hass, hemisphere, season_tracking_type): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.hemisphere = hemisphere <NEW_LINE> self.datetime = datetime.now() <NEW_LINE> self.type = season_tracking_type <NEW_LINE> self.season = get_season(self.datetime, self...
Representation of the current season.
625990614e4d562566373ad0
class Battery(): <NEW_LINE> <INDENT> def __init__(self, battery_size=70): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size)) + "-kWh battery." <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDE...
A simple attempt to model a battery for an electric car.
6259906138b623060ffaa3b5
class GroupUserListApiView(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = GroupUser.objects.all() <NEW_LINE> serializer_class = GroupUserModelSerializer <NEW_LINE> permission_classes = (IsAuthenticated, ) <NEW_LINE> filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter) <NEW_LINE> search_fields = ...
分组用户列表
62599061d6c5a102081e37ee
class PickleSerialize: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def save(file_name, data): <NEW_LINE> <INDENT> with open("./databases/" + file_name + ".pickle", "wb") as f: <NEW_LINE> <INDENT> pickle.dump(data, f) <NEW_LINE> f.close() <NEW_LINE> <DEDENT> <DEDENT> @staticmethod <NEW_LINE> def load(file_name): <NEW_L...
Serialize database to pickle file
625990616e29344779b01d19
class Section(FigureCanvas): <NEW_LINE> <INDENT> def __init__(self, well, dpi=90): <NEW_LINE> <INDENT> self.well = well <NEW_LINE> self.figure = Figure(dpi=dpi, facecolor="white") <NEW_LINE> super().__init__(self.figure) <NEW_LINE> self.refresh() <NEW_LINE> <DEDENT> def refresh(self): <NEW_LINE> <INDENT> self.figure.cl...
Object of this class displays one section
625990614428ac0f6e659bfc
class AverageSpeakerScoreMetricAnnotator(SpeakerScoreQuerySetMetricAnnotator): <NEW_LINE> <INDENT> key = "average" <NEW_LINE> name = _("average") <NEW_LINE> abbr = _("Avg") <NEW_LINE> function = Avg
Metric annotator for average speaker score.
62599061a8370b77170f1a98
class ArithmeticDecoder(ArithmeticCoder): <NEW_LINE> <INDENT> def __init__(self, numbits, bitin): <NEW_LINE> <INDENT> super(ArithmeticDecoder, self).__init__(numbits) <NEW_LINE> self.input = bitin <NEW_LINE> self.code = 0 <NEW_LINE> for _ in range(self.num_state_bits): <NEW_LINE> <INDENT> self.code = self.code << 1 | s...
Reads from an arithmetic-coded bit stream and decodes symbols.
62599061f7d966606f74941e
class ContainsEagerMultipleOfType( fixtures.DeclarativeMappedTest, testing.AssertsCompiledSQL ): <NEW_LINE> <INDENT> __dialect__ = "default" <NEW_LINE> @classmethod <NEW_LINE> def setup_classes(cls): <NEW_LINE> <INDENT> Base = cls.DeclarativeBasic <NEW_LINE> class X(Base): <NEW_LINE> <INDENT> __tablename__ = "x" <NEW_L...
test for #5107
62599061dd821e528d6da4e6
class NamePaginator(object): <NEW_LINE> <INDENT> def __init__(self, object_list, on=None, per_page=25): <NEW_LINE> <INDENT> self.object_list = object_list <NEW_LINE> self.count = len(object_list) <NEW_LINE> self.pages = [] <NEW_LINE> chunks = {} <NEW_LINE> for obj in self.object_list: <NEW_LINE> <INDENT> if on: obj_str...
Pagination for string-based objects
6259906132920d7e50bc7710
class DataProvider(object): <NEW_LINE> <INDENT> def __init__(self, source_id): <NEW_LINE> <INDENT> self._source_id = source_id <NEW_LINE> <DEDENT> def setup_data(self): <NEW_LINE> <INDENT> raise NotImplementedError("Method must be redefined") <NEW_LINE> <DEDENT> def iteration_data(self): <NEW_LINE> <INDENT> raise NotIm...
Interface to be implemented by any data provider.
6259906132920d7e50bc7711
class ProjectWizardPage(WizardPage): <NEW_LINE> <INDENT> project_name = Str <NEW_LINE> location = Directory(auto_set=True) <NEW_LINE> abs_path = Property(Str, depends_on=["project_name", "location"]) <NEW_LINE> use_default = Bool(True) <NEW_LINE> _label = Property(Str("Create a new project resource."), depends_on=["pro...
Wizard page for project creation.
625990615166f23b2e244a9d
class cmdPasswd: <NEW_LINE> <INDENT> spec = { 'name':'Passwd', 'params':[ {'name':'username','req':1,'type':'unicode'}, {'name':'oldPassword','req':1,'type':'unicode'}, {'name':'newPassword','req':1,'type':'unicode'}, {'name':'newPasswordConfirm','req':1,'type':'unicode'} ]} <NEW_LINE> def executeCommand(self,command):...
change user password
62599061d486a94d0ba2d693
class ChunkIterator(object): <NEW_LINE> <INDENT> def __init__(self, dset, source_sel=None): <NEW_LINE> <INDENT> self._shape = dset.shape <NEW_LINE> rank = len(dset.shape) <NEW_LINE> if not dset.chunks: <NEW_LINE> <INDENT> raise TypeError("Chunked dataset required") <NEW_LINE> <DEDENT> if isinstance(dset.chunks, dict): ...
Class to iterate through list of chunks of a given dataset
625990611b99ca400229009b
class TLSSNI01ServerTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.certs = {b'localhost': ( test_util.load_pyopenssl_private_key('rsa512_key.pem'), test_util.load_cert('cert.pem'), )} <NEW_LINE> from acme.standalone import TLSSNI01Server <NEW_LINE> self.server = TLSSNI01Server(("...
Test for acme.standalone.TLSSNI01Server.
6259906156ac1b37e630384c