code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class GridLayout(CellLayout): <NEW_LINE> <INDENT> def __init__(self, content: Sequence[Sequence[Any]], **kwargs): <NEW_LINE> <INDENT> grid_shape = [] <NEW_LINE> num_rows = len(content) <NEW_LINE> height = 1/num_rows <NEW_LINE> for row in content: <NEW_LINE> <INDENT> num_columns = len(row) <NEW_LINE> width = 1/num_colum...
Evenly spaced grid layout. Creates a CellLayout, automatically setting widths and heights as an even split based on the shape of the content passed to make a grid
6259904aa8ecb033258725ec
class NamedApplicationKey(models.Model): <NEW_LINE> <INDENT> nickname = models.CharField(max_length=256) <NEW_LINE> description = models.TextField(blank=True) <NEW_LINE> application_key = models.ForeignKey('ApplicationKey') <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.nickname <NEW_LINE> <DEDENT> d...
The reason to create a named key is if you want to pre-select it as the start key for a Login. For example, perhaps you want to preconfigure a master VM with this start key.
6259904ae64d504609df9dbd
class ReportType(CrashType): <NEW_LINE> <INDENT> def __init__(self, search, report_type): <NEW_LINE> <INDENT> super(ReportType, self).__init__(report_type) <NEW_LINE> self.original_search = search <NEW_LINE> search=Search(search=search, type=report_type) <NEW_LINE> self.reports = search <NEW_LINE> self.buckets = cached...
API object representing a particular type inside a search context.
6259904ad99f1b3c44d06a76
class get_openstack_host_usage_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'request', None, None, ), ) <NEW_LINE> def __init__(self, request=None,): <NEW_LINE> <INDENT> self.request = request <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBina...
Attributes: - request
6259904a26068e7796d4dd1f
class CooperatorHunter(Player): <NEW_LINE> <INDENT> name = 'Cooperator Hunter' <NEW_LINE> classifier = { 'memory_depth': float('inf'), 'stochastic': False, 'inspects_source': False, 'manipulates_source': False, 'manipulates_state': False } <NEW_LINE> def strategy(self, opponent): <NEW_LINE> <INDENT> if len(self.history...
A player who hunts for cooperators.
6259904a21a7993f00c67344
class ExpressRouteCircuitListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ExpressRouteCircuit]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ExpressRouteCircuitListResult, self)...
Response for ListExpressRouteCircuit API service call. :param value: A list of ExpressRouteCircuits in a resource group. :type value: list[~azure.mgmt.network.v2019_12_01.models.ExpressRouteCircuit] :param next_link: The URL to get the next set of results. :type next_link: str
6259904a711fe17d825e168b
class TrafficParticipant(Actor): <NEW_LINE> <INDENT> def __init__(self, carla_actor, parent, node, prefix): <NEW_LINE> <INDENT> self.classification_age = 0 <NEW_LINE> super(TrafficParticipant, self).__init__(carla_actor=carla_actor, parent=parent, node=node, prefix=prefix) <NEW_LINE> self.odometry_publisher = node.new_...
actor implementation details for traffic participant
6259904a23e79379d538d8d9
class DeleteWarModeForm(_WarModeBoundForm): <NEW_LINE> <INDENT> def delete_warmode(self): <NEW_LINE> <INDENT> db.delete(self.warmode)
Used to delete a warmode from the admin panel.
6259904a63b5f9789fe86548
class MessageError(IOError): <NEW_LINE> <INDENT> pass
An error occurred from message communication.
6259904a8e05c05ec3f6f848
class SessionConfig(object): <NEW_LINE> <INDENT> _HostName = "" <NEW_LINE> User = "" <NEW_LINE> Port = 22 <NEW_LINE> Protocol = "ssh" <NEW_LINE> UserKnownHostsFile = "/dev/null" <NEW_LINE> StrictHostKeyChecking = False <NEW_LINE> PasswordAuthentication = False <NEW_LINE> IdentityFile = None <NEW_LINE> IdentitiesOnly = ...
Connection settings for a session
6259904aec188e330fdf9c79
class ForumCategoryAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('title', ) <NEW_LINE> search_fields = ('title', ) <NEW_LINE> fields = ('title', 'ordering')
``ForumCategory`` admin form.
6259904ab5575c28eb7136b7
class PublicIngredientApiTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_login_required(self): <NEW_LINE> <INDENT> res = self.client.get(INGREDIENTS_URL) <NEW_LINE> self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test the publicly available ingredients API
6259904a009cb60464d02912
class NoHeader(BasicReader): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Basic.__init__(self) <NEW_LINE> self.header.start_line = None <NEW_LINE> self.data.start_line = 0
Read a table with no header line. Columns are autonamed using header.auto_format which defaults to "col%d". Otherwise this reader the same as the :class:`Basic` class from which it is derived. Example:: # Table data 1 2 "hello there" 3 4 world
6259904a435de62698e9d1e3
@synceventregister <NEW_LINE> class ServerSMDisable(SMSyncEvent): <NEW_LINE> <INDENT> pass
Disable Server
6259904a07f4c71912bb0810
class Password(BASE): <NEW_LINE> <INDENT> __tablename__ = 'password' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> local_user_id = Column(Integer) <NEW_LINE> password = Column(String(128))
password table
6259904a07f4c71912bb0811
class ConnectModule(BaseModule): <NEW_LINE> <INDENT> pass
Module which will be started just after connecting to the server.
6259904ad53ae8145f91983e
class Test_Sample_Problem(unittest.TestCase): <NEW_LINE> <INDENT> def test_optimization(self): <NEW_LINE> <INDENT> beam = SampleProblemBeam() <NEW_LINE> self.assertAlmostEqual(beam.frequency(), 113.0, delta=0.5) <NEW_LINE> self.assertAlmostEqual(beam.cost(), 1060.0) <NEW_LINE> self.assertAlmostEqual(beam.mass(), 2230.0...
Test by optimizing a beam problem from the literature.
6259904a71ff763f4b5e8b83
class BVConcatToZeroExtend: <NEW_LINE> <INDENT> def filter(self, node): <NEW_LINE> <INDENT> if not node.has_ident() or node.get_ident() != 'concat': <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> if not is_bv_const(node[1]): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return get_bv_constant_value(node[1]...
Replace a ``concat`` with zero by ``zero_extend``.
6259904a07d97122c4218080
class Range: <NEW_LINE> <INDENT> def __init__(self, location: int, length: int): <NEW_LINE> <INDENT> self.__location = location <NEW_LINE> self.__length = length <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "[{}, {})".format(self.location, self.location + self.length) <NEW_LINE> <DEDENT> @property...
Describes a range of integers. :param location: The first value in the range. :param length: The number of values in the range.
6259904a1f5feb6acb163fd2
class TestV1TypedLocalObjectReference(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testV1TypedLocalObjectReference(self): <NEW_LINE> <INDENT> pass
V1TypedLocalObjectReference unit test stubs
6259904a16aa5153ce4018cb
@implementer(ITransport) <NEW_LINE> class WrappingWebSocketAdapter: <NEW_LINE> <INDENT> def onConnect(self, requestOrResponse): <NEW_LINE> <INDENT> if isinstance(requestOrResponse, protocol.ConnectionRequest): <NEW_LINE> <INDENT> request = requestOrResponse <NEW_LINE> for p in request.protocols: <NEW_LINE> <INDENT> if ...
An adapter for stream-based transport over WebSocket. This follows "websockify" (https://github.com/kanaka/websockify) and should be compatible with that. It uses WebSocket subprotocol negotiation and 2+ subprotocols: - binary (or a compatible subprotocol) - base64 Octets are either transmitted as the payload of...
6259904a0a50d4780f7067ac
class MediaOption(StringOption): <NEW_LINE> <INDENT> def __init__(self, label): <NEW_LINE> <INDENT> StringOption.__init__(self, label, "")
This class describes an option that allows a media object from the database to be selected.
6259904a8da39b475be045ce
class ChineseAnimalIntentHandler(AbstractRequestHandler): <NEW_LINE> <INDENT> def can_handle(self, handler_input): <NEW_LINE> <INDENT> return is_intent_name("ChineseAnimalIntent")(handler_input) <NEW_LINE> <DEDENT> def handle(self, handler_input): <NEW_LINE> <INDENT> year = handler_input.request_envelope.request.intent...
Handler for Chinese Animal Intent.
6259904a94891a1f408ba0e4
class Profile(object): <NEW_LINE> <INDENT> def __init__(self, info): <NEW_LINE> <INDENT> self.name = info['name'] <NEW_LINE> self.constants = tuple((cst['name'], cst['value']) for cst in info['constants']) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Profile(name=%s, constants=%r}' % (self.name, ...
Information about a profile.
6259904a91af0d3eaad3b202
class PBPackageRequirement(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.compare = None <NEW_LINE> self.version = None <NEW_LINE> <DEDENT> def ev(self, func): <NEW_LINE> <INDENT> return func(self.name, self.compare or ">=", self.version) <NEW_LINE> <DEDENT> ...
Store info on a dependency package: - Package name (typically deb or rpm or something like that) - Version + Comparator
6259904ad7e4931a7ef3d455
@dataclass <NEW_LINE> class Venue(Base): <NEW_LINE> <INDENT> location: Location <NEW_LINE> title: str <NEW_LINE> address: str <NEW_LINE> foursquare_id: Optional[str] = None <NEW_LINE> foursquare_type: Optional[str] = None <NEW_LINE> google_place_id: Optional[str] = None <NEW_LINE> google_place_type: Optional[str] = Non...
This object represents a venue.
6259904a96565a6dacd2d978
class CedulaField(MultiValueField): <NEW_LINE> <INDENT> widget = CedulaWidget <NEW_LINE> default_error_messages = { 'invalid_choices': _("Debe seleccionar una nacionalidad válida") } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> error_messages = { 'required': _("Debe indicar un número de Cédula"),...
! Clase que agrupa los campos de la nacionalidad y número de cédula de identidad en un solo campo del formulario @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve) @copyright <a href='http://www.gnu.org/licenses/gpl-3.0.html'>GNU Public License versión 3 (GPLv3)</a> @date 26-04-2016 @version 1.0.0
6259904a462c4b4f79dbcdde
class Timetable(models.Model): <NEW_LINE> <INDENT> form = models.ForeignKey( TimetableSchoolForm, on_delete=models.PROTECT, related_name='lessons', verbose_name=_('Form') ) <NEW_LINE> day_of_week = models.PositiveSmallIntegerField( blank=False, null=False, choices=DAYS_OF_WEEK, verbose_name=_('Day of week') ) <NEW_LINE...
Represents timetable
6259904a6e29344779b01a20
class WebClient(object): <NEW_LINE> <INDENT> def __init__(self, host, port): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> <DEDENT> def _get_json_data_from_endpoint(self, endpoint): <NEW_LINE> <INDENT> url = "http://%s:%d/aircraft/%s" % (self.host, self.port, endpoint) <NEW_LINE> response ...
The WebClient is used to retrieve flight data from Huginn's web server
6259904a30dc7b76659a0c12
class EchoListener(DecisionBase): <NEW_LINE> <INDENT> id = "echo-listener" <NEW_LINE> def __init__(self, interval=10, threshold=90.0, **kwargs): <NEW_LINE> <INDENT> if "id" not in kwargs: <NEW_LINE> <INDENT> LOG.error("exchange parameter (id=...) not specified!") <NEW_LINE> return <NEW_LINE> <DEDENT> self.id = kwargs['...
A basic class to detect CPU peaks. Initial threshold is max 90% load over 5 min period.
6259904a0fa83653e46f62bd
class UnDirectedGraph(Graph): <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> super(UnDirectedGraph, self).__init__(size) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if isinstance(other, UnDirectedGraph): <NEW_LINE> <INDENT> return self.is_equal(other) <NEW_LINE> <DEDENT> <DEDENT>...
The interface of an undirected graph data structure.
6259904ab57a9660fecd2e5c
class State(enum.Enum): <NEW_LINE> <INDENT> up = 'up' <NEW_LINE> down = 'down' <NEW_LINE> frozen = 'frozen'
Enumeration of node/server states.
6259904a63b5f9789fe8654c
class User(Base): <NEW_LINE> <INDENT> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String, nullable=False, unique=True) <NEW_LINE> admin = Column(Boolean, nullable=False, server_default=false())
User model used for: - authentication and authorization - querying user's packages (by user name) - logging user actions Note: existence of a User entry does not imply existence of a corresponding user in the authentication system. For example, when adding group maintainers, the User entry is created witho...
6259904ad4950a0f3b111832
class TestCommon: <NEW_LINE> <INDENT> def test_integrate_column(self): <NEW_LINE> <INDENT> t = math.integrate_column(np.arange(5)) <NEW_LINE> assert(np.isclose(t, 8)) <NEW_LINE> <DEDENT> def test_integrate_column_coordinates(self): <NEW_LINE> <INDENT> x = np.linspace(0, 1, 5) <NEW_LINE> t = math.integrate_column(np.ara...
Testing common mathematical functions.
6259904a7cff6e4e811b6e19
class DatumAttachment(models.Model): <NEW_LINE> <INDENT> owner = models.ForeignKey(User, related_name='+') <NEW_LINE> datum = models.ForeignKey(Datum) <NEW_LINE> name = models.CharField(max_length=256) <NEW_LINE> package = models.FileField(_('file'), upload_to=get_package_file_path('attachment'), max_length=100, storag...
Attachment with possible results of processing the datum
6259904a29b78933be26aab2
class HTTPNotAcceptable(falcon.HTTPNotAcceptable): <NEW_LINE> <INDENT> pass
wrapper for HTTP Not Acceptable response status code: 406
6259904a8e71fb1e983bcea5
class RectDrawingObject(DrawingObject): <NEW_LINE> <INDENT> def __init__(self, *varg, **kwarg): <NEW_LINE> <INDENT> DrawingObject.__init__(self, *varg, **kwarg) <NEW_LINE> <DEDENT> def objectContainsPoint(self, x, y): <NEW_LINE> <INDENT> if x < self.position.x: return False <NEW_LINE> if x > self.position.x + self.size...
DrawingObject subclass that represents an axis-aligned rectangle.
6259904a379a373c97d9a40a
class Exception(exceptions.Exception): <NEW_LINE> <INDENT> pass
Base class for any kind of exceptions used by this package.
6259904a8da39b475be045d0
class Category(Document): <NEW_LINE> <INDENT> structure = { 'name': unicode, 'description': unicode, 'icon_small': unicode, 'icon_big': unicode, "is_hidden": bool, "order": int, "items_order": [ObjectId], 'parent': ObjectId, } <NEW_LINE> default_values = { "order": 0, "is_hidden": True, "name": u"", "description": u"",...
Category Forms tree
6259904a94891a1f408ba0e5
class IsPresentPlaceholder(ModelBase): <NEW_LINE> <INDENT> _serialized_names = { 'input_name': 'isPresent', } <NEW_LINE> def __init__( self, input_name: str, ): <NEW_LINE> <INDENT> super().__init__(locals())
Represents the command-line argument placeholder that will be replaced at run-time by a boolean value specifying whether the caller has passed an argument for the specified optional input.
6259904abe383301e0254bfa
class AquiferMaterialListAPIView(ListAPIView): <NEW_LINE> <INDENT> swagger_schema = None <NEW_LINE> queryset = AquiferMaterial.objects.all() <NEW_LINE> serializer_class = serializers.AquiferMaterialSerializer
List aquifer materials codes get: return a list of aquifer material codes
6259904a507cdc57c63a617f
class Reduction(Layer): <NEW_LINE> <INDENT> def __init__(self, reduction, axis=-2, **kwargs): <NEW_LINE> <INDENT> self.reduction = reduction <NEW_LINE> self.axis = axis <NEW_LINE> super(Reduction, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def call(self, inputs, weights=None): <NEW_LINE> <INDENT> if weights is None: ...
Performs an optionally-weighted reduction. This layer performs a reduction across one axis of its input data. This data may optionally be weighted by passing in an identical float tensor. Args: reduction: The type of reduction to perform. Can be one of the following: "max", "mean", "min", "prod", or "sum". This...
6259904a435de62698e9d1e7
class TestInsertXlsxWorksheetRequest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testInsertXlsxWorksheetRequest(self): <NEW_LINE> <INDENT> pass
InsertXlsxWorksheetRequest unit test stubs
6259904ae64d504609df9dc0
class MonochromaticNarrow(XRaySource): <NEW_LINE> <INDENT> def __init__(self, tilt): <NEW_LINE> <INDENT> super(MonochromaticNarrow, self).__init__(tilt) <NEW_LINE> self.stddev = 0.0033 / 6 <NEW_LINE> self.mean = tilt <NEW_LINE> self.anggenerator = norm(loc=self.mean, scale=self.stddev) <NEW_LINE> <DEDENT> def get_wave(...
This class implements a monochromatic X-ray source with a lower angular spread
6259904adc8b845886d5499d
class RegenerateurDeDocumentsSansEffet(RegenerateurDeDocuments): <NEW_LINE> <INDENT> def supprimer_documents(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def creer_generateur_transactions(self): <NEW_LINE> <INDENT> return GroupeurTransactionsSansEffet()
Empeche la regeneration d'un domaine
6259904a50485f2cf55dc36b
class Module(object): <NEW_LINE> <INDENT> def __init__(self, filename, ast_list): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.normalized_filename = os.path.abspath(filename) <NEW_LINE> self.ast_list = ast_list <NEW_LINE> self.public_symbols = self._get_exported_symbols() <NEW_LINE> <DEDENT> def _get_ex...
Data container represting a single source file.
6259904ad99f1b3c44d06a7c
class Globals(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.cache = CacheManager(**parse_cache_config_options(config)) <NEW_LINE> self.dbhost="localhost" <NEW_LINE> self.dbport=3306 <NEW_LINE> self.dbuser="pstar" <NEW_LINE> self.dbpasswd="zp910131" <NEW_LINE> self.dbdb="mhtrade"
Globals acts as a container for objects available throughout the life of the application
6259904a07d97122c4218083
class DataXRR(Graphical_view): <NEW_LINE> <INDENT> def __init__(self, parent, data): <NEW_LINE> <INDENT> Graphical_view.__init__(self, parent, data) <NEW_LINE> self._data = data <NEW_LINE> self._theta_array = self._data["data"]["theta_array"].value <NEW_LINE> self._simulation = self._data["data"]["XRR"].value <NEW_LINE...
data xrr view
6259904ad53ae8145f919841
class CueTrack(CueBase): <NEW_LINE> <INDENT> TimeOffset = namedtuple('TimeOffset', ['mins', 'secs', 'frames']) <NEW_LINE> class Index: <NEW_LINE> <INDENT> number = PropertyDescriptor() <NEW_LINE> time_offset = TimeOffsetPropertyDescriptor() <NEW_LINE> def __init__(self, number, time_offset): <NEW_LINE> <INDENT> self.nu...
Cue track attributes / processing
6259904a21a7993f00c6734a
class EmissionType(str): <NEW_LINE> <INDENT> pass
The type of emission Values are: chlorine, carbonDioxide, hydrogenSulfide, nitrogenOxide, sulfurDioxide, carbonDisulfide
6259904a26068e7796d4dd25
class RadiusNthSelector(_NthSelector): <NEW_LINE> <INDENT> def key(self, obj: Shape) -> float: <NEW_LINE> <INDENT> if isinstance(obj, (Edge, Wire)): <NEW_LINE> <INDENT> return obj.radius() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError("Can not get a radius from this object")
Select the object with the Nth radius. Applicability: All Edge and Wires. Will ignore any shape that can not be represented as a circle or an arc of a circle.
6259904a23e79379d538d8df
class QVideoFrame(): <NEW_LINE> <INDENT> def bits(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def bytesPerLine(self): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def endTime(self): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def fieldType(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def handle(...
QVideoFrame() QVideoFrame(QAbstractVideoBuffer, QSize, QVideoFrame.PixelFormat) QVideoFrame(int, QSize, int, QVideoFrame.PixelFormat) QVideoFrame(QImage) QVideoFrame(QVideoFrame)
6259904ad10714528d69f07e
class GetFields(Get): <NEW_LINE> <INDENT> def get_client_request(self, parameters = {}): <NEW_LINE> <INDENT> return self.client_io.get_fields(parameters) <NEW_LINE> <DEDENT> def export_fields(self, parameters={}): <NEW_LINE> <INDENT> df = self.append_df(parameters) <NEW_LINE> df.to_csv(root + raw_fields, encoding='utf-...
Inherited Class that deals with contact fields get requests.
6259904a0a366e3fb87dddc7
class ApplicationRunner: <NEW_LINE> <INDENT> def __init__(self, url, realm, extra = None, debug = False, debug_wamp = False, debug_app = False): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.realm = realm <NEW_LINE> self.extra = extra or dict() <NEW_LINE> self.debug = debug <NEW_LINE> self.debug_wamp = debug_wamp ...
This class is a convenience tool mainly for development and quick hosting of WAMP application components. It can host a WAMP application component in a WAMP-over-WebSocket client connecting to a WAMP router.
6259904a29b78933be26aab3
class TestIntradayStockPrice(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testIntradayStockPrice(self): <NEW_LINE> <INDENT> pass
IntradayStockPrice unit test stubs
6259904a16aa5153ce4018cf
class CMakeCurrentModule(Directive): <NEW_LINE> <INDENT> has_content = False <NEW_LINE> required_arguments = 1 <NEW_LINE> optional_arguments = 0 <NEW_LINE> final_argument_whitespace = False <NEW_LINE> option_spec = {} <NEW_LINE> def run(self): <NEW_LINE> <INDENT> env = self.state.document.settings.env <NEW_LINE> modnam...
This directive is just to tell Sphinx that we're documenting stuff in module foo, but links to module foo won't lead here.
6259904ab830903b9686ee6b
class PyScikitImage(PythonPackage): <NEW_LINE> <INDENT> homepage = "http://scikit-image.org/" <NEW_LINE> url = "https://pypi.io/packages/source/s/scikit-image/scikit-image-0.12.3.tar.gz" <NEW_LINE> version('0.12.3', '04ea833383e0b6ad5f65da21292c25e1') <NEW_LINE> extends('python', ignore=r'bin/.*\.py$') <NEW_LINE> ...
Image processing algorithms for SciPy, including IO, morphology, filtering, warping, color manipulation, object detection, etc.
6259904a94891a1f408ba0e6
class MyHtmlParser(HTMLParser): <NEW_LINE> <INDENT> A, TD, TR, TABLE = ('a', 'td', 'tr', 'table') <NEW_LINE> def __init__(self, url): <NEW_LINE> <INDENT> HTMLParser.__init__(self) <NEW_LINE> self.url = url <NEW_LINE> self.current_item = {} <NEW_LINE> self.item_name = None <NEW_LINE> self.page_empty = 29500 <NEW_LINE> s...
Sub-class for parsing results
6259904a507cdc57c63a6181
class DarcyFlowModel(OneDimensionalFlowRelationship): <NEW_LINE> <INDENT> non_Darcy = False <NEW_LINE> def __init__(self, k=1.0): <NEW_LINE> <INDENT> self._attribute_list = ['k'] <NEW_LINE> self.k = k <NEW_LINE> <DEDENT> def v_from_i(self, hyd_grad, **kwargs): <NEW_LINE> <INDENT> return self.k * hyd_grad <NEW_LINE> <DE...
Darcian flow model Parameters ---------- k : float, optional Darcian permeability. Default k=1. Notes ----- Darcian flow is described by: .. math:: v = ki
6259904a3eb6a72ae038ba3d
class DuplicateColumnNameError(Exception): <NEW_LINE> <INDENT> def __init__(self, name: str, index: int, filename: Optional[str] = None) -> None: <NEW_LINE> <INDENT> super().__init__(name, index, filename) <NEW_LINE> self.name = name <NEW_LINE> self.index = index <NEW_LINE> self.filename = filename
Raised when a duplicate column name is found in a TXT file. Column names are considered duplicates when they are exactly the same. Column names that differ only in casing (e.g. `mycolumn` and `MyColumn`) do not cause this exception. Attributes: name: Duplicate column name. index: Index of the duplicate column...
6259904acb5e8a47e493cb78
class AsyncResponseHandler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.mutex = Lock() <NEW_LINE> self.mutex.acquire() <NEW_LINE> <DEDENT> def __call__(self, status, response, hostlist): <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.response = response <NEW_LINE> self.hostlist = ...
Utility class to handle asynchronous method calls.
6259904a0c0af96317c57752
class ListArchiverForm(forms.Form): <NEW_LINE> <INDENT> archivers = forms.MultipleChoiceField( widget=forms.CheckboxSelectMultiple, label=_('Activate archivers for this list')) <NEW_LINE> def __init__(self, archivers, *args, **kwargs): <NEW_LINE> <INDENT> super(ListArchiverForm, self).__init__(*args, **kwargs) <NEW_LIN...
Select archivers for a list.
6259904aac7a0e7691f738be
class SubRubricInline(admin.TabularInline): <NEW_LINE> <INDENT> model = SubRubric
Встроенный редактор подрубрик
6259904ad6c5a102081e34ff
class Scoreboard(object): <NEW_LINE> <INDENT> def refresh(self, jsonScoreboard, teams): <NEW_LINE> <INDENT> self.games.clear() <NEW_LINE> for jsonGame in jsonScoreboard['games']: <NEW_LINE> <INDENT> self.games.append(Game(jsonGame, teams)) <NEW_LINE> <DEDENT> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.games ...
Todays Games
6259904a82261d6c527308b7
class CompanyPayment(models.Model): <NEW_LINE> <INDENT> company_membership = models.ForeignKey(CompanyMembership, null=True, on_delete=models.SET_NULL) <NEW_LINE> amount = models.DecimalField(max_digits=12, decimal_places=2, default=0.00, help_text='Amount paid for membership (including VAT)') <NEW_LINE> payment_date =...
Model represents company payment record
6259904ad53ae8145f919843
class Prod(Config): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Prod, self).__init__() <NEW_LINE> self.DEBUG = False <NEW_LINE> self.TESTING = False <NEW_LINE> self.ENVIROMENT = "Production" <NEW_LINE> self.SECURITY_LOGIN_WITHOUT_CONFIRMATION = False <NEW_LINE> self.SECURITY_CONFIRMABLE = True <NE...
Production Config.
6259904a21a7993f00c6734c
class CommandDontExistException(Exception): <NEW_LINE> <INDENT> pass
Исключение для случая если команда с заданным именем не существует
6259904a71ff763f4b5e8b89
class Color(util.AutoNumberEnum): <NEW_LINE> <INDENT> red = () <NEW_LINE> blue = () <NEW_LINE> green = () <NEW_LINE> yellow = ()
Enumerated colors of cards. Attributes: red blue green yellow
6259904a0a366e3fb87dddc9
class Lesson(BaseModel): <NEW_LINE> <INDENT> lesson_id = PrimaryKeyField() <NEW_LINE> title = CharField(max_length=256) <NEW_LINE> description = CharField(max_length=256, null=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> table_name = 'lessons'
课程
6259904a29b78933be26aab4
class Member(Person, TimeStampedModel): <NEW_LINE> <INDENT> subteam = models.ForeignKey( "SubTeam", on_delete=models.SET_NULL, related_name='members', blank=True, null=True, verbose_name='subteam of member', ) <NEW_LINE> description = models.CharField( max_length=75, blank=True, verbose_name='description (e.g. departme...
Team member model, a member is a person.
6259904a8da39b475be045d4
class CsvEventFormatter(CsvFormatter): <NEW_LINE> <INDENT> implements(IMessageFormatter) <NEW_LINE> FIELDS = ( 'timestamp', 'event_id', 'status', 'user_message_id', 'nack_reason', ) <NEW_LINE> def _format_field_status(self, message): <NEW_LINE> <INDENT> return message.status() <NEW_LINE> <DEDENT> def _format_field_nack...
Formatter for writing messages to requests as CSV.
6259904a23849d37ff8524a0
class MatchCondition(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'match_variable': {'required': True}, 'operator': {'required': True}, 'match_value': {'required': True}, } <NEW_LINE> _attribute_map = { 'match_variable': {'key': 'matchVariable', 'type': 'str'}, 'selector': {'key': 'selector', 'type'...
Define a match condition. All required parameters must be populated in order to send to Azure. :param match_variable: Required. Request variable to compare with. Possible values include: "RemoteAddr", "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeader", "RequestBody", "Cookies", "SocketAddr". ...
6259904a379a373c97d9a40e
class AtomScan(win32k_core.Win32kPluginMixin, common.PoolScannerPlugin): <NEW_LINE> <INDENT> allocation = ['_POOL_HEADER', '_RTL_ATOM_TABLE'] <NEW_LINE> __name = "atomscan" <NEW_LINE> @classmethod <NEW_LINE> def args(cls, parser): <NEW_LINE> <INDENT> parser.add_argument( "-S", "--sort-by", choices=["atom", "refcount", ...
Pool scanner for _RTL_ATOM_TABLE
6259904a8a349b6b43687632
class ChildSiteDescriptor(object): <NEW_LINE> <INDENT> pass
A placeholder for the old descriptor. Sites migrated from an older Lineage need this.
6259904a3eb6a72ae038ba3f
class OccurrenceDetailView(OccurrenceViewMixin, DetailView): <NEW_LINE> <INDENT> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(OccurrenceViewMixin, self).get_context_data(**kwargs) <NEW_LINE> context['form'] = peticionForm <NEW_LINE> return context <NEW_LINE> <DEDENT> def form_valid(self, fo...
View to show information of an occurrence of an event.
6259904a6fece00bbacccd9c
class UnifiWirelessClients: <NEW_LINE> <INDENT> def __init__(self, hass): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.data = {} <NEW_LINE> self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY) <NEW_LINE> <DEDENT> async def async_load(self): <NEW_LINE> <INDENT> data = await self._store.async_lo...
Class to store clients known to be wireless. This is needed since wireless devices going offline might get marked as wired by UniFi.
6259904a3cc13d1c6d466b1c
@inherit_doc <NEW_LINE> class Zero(MeanFunction): <NEW_LINE> <INDENT> def __init__(self, input_dim, output_dim, name='zero'): <NEW_LINE> <INDENT> super().__init__(input_dim, output_dim, name) <NEW_LINE> <DEDENT> def f(self, Xs): <NEW_LINE> <INDENT> self._validate_inputs(Xs) <NEW_LINE> return [np.zeros(len(X)) for X in ...
The zero mapping. Note that leaving the `mean_function` parameter as none in all of the models does the same job.
6259904a462c4b4f79dbcde4
class ThumbnailMixin(object): <NEW_LINE> <INDENT> thumb_image_field_name = 'image' <NEW_LINE> thumb_image_filter_spec = 'fill-100x100' <NEW_LINE> thumb_image_width = 50 <NEW_LINE> thumb_classname = 'admin-thumb' <NEW_LINE> thumb_col_header_text = _('image') <NEW_LINE> thumb_default = None <NEW_LINE> def admin_thumb(sel...
Mixin class to help display thumbnail images in ModelAdmin listing results. `thumb_image_field_name` must be overridden to name a ForeignKey field on your model, linking to `wagtailimages.Image`.
6259904aa8ecb033258725f6
class CoverageTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.chr1 = (GenomeRegion('hg19', 'chr1', 0, GenomeInfo.GENOMES['hg19']['size']['chr1'])) <NEW_LINE> self.chromosomes = (GenomeRegion('hg19', c, 0, l) for c, l in GenomeInfo.GENOMES['hg19']['size'].iteritems()) <NEW_LINE> <D...
Tests of the coverage operation Test objectives * Find correct cover for a non overlapping track * Find correct cover for a overlapping track
6259904a50485f2cf55dc36f
class SimpleApplication(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ApplicationId = None <NEW_LINE> self.ApplicationName = None <NEW_LINE> self.ApplicationType = None <NEW_LINE> self.MicroserviceType = None <NEW_LINE> self.ApplicationDesc = None <NEW_LINE> self.ProgLang = None <NEW_...
简单应用
6259904ad53ae8145f919846
class TestRedisSessionNew_RedisTTL_Classic( _TestRedisSessionNew__MIXIN_A, _TestRedisSessionNew_CORE, unittest.TestCase ): <NEW_LINE> <INDENT> PYTHON_EXPIRES = False <NEW_LINE> set_redis_ttl = True <NEW_LINE> set_redis_ttl_readheavy = False <NEW_LINE> timeout = 1 <NEW_LINE> timeout_trigger = None <NEW_LINE> def test_re...
these are 1.4x+ tests
6259904a21a7993f00c6734e
class __FRONTEND_VIEW__(pstruct.type): <NEW_LINE> <INDENT> def __init__(self, **attrs): <NEW_LINE> <INDENT> super(_HEAP_ENTRY.__FRONTEND_VIEW__, self).__init__(**attrs) <NEW_LINE> f = self._fields_ = [] <NEW_LINE> if getattr(self, 'WIN64', False): <NEW_LINE> <INDENT> f.extend([ (pint.uint64_t, 'Unencoded'), (pint.uint6...
This type is used strictly for encoding/decoding and is used when casting the backing type.
6259904a07d97122c4218088
@attr.s(frozen=True, slots=True, hash=True) <NEW_LINE> class SerdeOptions: <NEW_LINE> <INDENT> omit_null_values = attr.ib(validator=instance_of(bool), default=True) <NEW_LINE> convert_datetimes = attr.ib(validator=instance_of(bool), default=True) <NEW_LINE> datetime_format = attr.ib( validator=instance_of(str), default...
Settings for serialisation and deserialisation
6259904ab57a9660fecd2e62
class AccerciserPreferencesDialog(gtk.Dialog): <NEW_LINE> <INDENT> def __init__(self, plugins_view=None, hotkeys_view=None): <NEW_LINE> <INDENT> gtk.Dialog.__init__(self, _('accerciser Preferences'), buttons=(gtk.STOCK_CLOSE, gtk.ResponseType.CLOSE)) <NEW_LINE> self.connect('response', self._onResponse) <NEW_LINE> self...
Class that creates a preferences dialog.
6259904a26068e7796d4dd29
class CutIntoDeterministicTiles(object): <NEW_LINE> <INDENT> def __init__(self, n=3, piece_crop_percentage=0.88, image_size=(99, 99)): <NEW_LINE> <INDENT> assert isinstance(n, int), "The input parameter 'number_of_tiles' for the constructor of " "CutIntoDeterministicTiles " ...
Cut an image into tiles and crop each tile at a random location.
6259904a71ff763f4b5e8b8b
class Fifo: <NEW_LINE> <INDENT> def __init__(self, path, mode): <NEW_LINE> <INDENT> self.trick = None <NEW_LINE> if not os.path.exists(path): <NEW_LINE> <INDENT> os.mkfifo(path) <NEW_LINE> <DEDENT> if mode == 'w': <NEW_LINE> <INDENT> self.trick = OpenTrick(path) <NEW_LINE> self.trick.start() <NEW_LINE> <DEDENT> self.fd...
Just a simple file handler, writing and reading in a fifo. Mode is either 'r' or 'w', just like the mode for the open() function.
6259904a8a43f66fc4bf357b
class RecordSizeMismatchError(RecordValidationError): <NEW_LINE> <INDENT> def __init__(self, path, record_size, actual_size): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.record_size = record_size <NEW_LINE> self.actual_size = actual_size <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ( f"Siz...
Raised when the size of a file as declared in a wheel's :file:`RECORD` does not match the file's actual size
6259904a23e79379d538d8e4
class ClockDrift(FloatWithUncertaintiesFixedUnit): <NEW_LINE> <INDENT> _minimum = 0 <NEW_LINE> unit = "SECONDS/SAMPLE"
ClockDrift object :type value: float :param value: ClockDrift value :type lower_uncertainty: float :param lower_uncertainty: Lower uncertainty (aka minusError) :type upper_uncertainty: float :param upper_uncertainty: Upper uncertainty (aka plusError) :type measurement_method: str :param measurement_method: Method used...
6259904a0a366e3fb87dddcb
class Popen(Process): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__subproc = subprocess.Popen(*args, **kwargs) <NEW_LINE> self._pid = self.__subproc.pid <NEW_LINE> self._gone = False <NEW_LINE> self._ppid = None <NEW_LINE> self._platform_impl = _psplatform.Process(self._pid) <NEW_...
A more convenient interface to stdlib subprocess module. It starts a sub process and deals with it exactly as when using subprocess.Popen class but in addition also provides all the property and methods of psutil.Process class in a single interface: >>> import psutil >>> from subprocess import ...
6259904abaa26c4b54d50690
class RangePollChoiceVoteForm(happyforms.Form): <NEW_LINE> <INDENT> def __init__(self, choices, *args, **kwargs): <NEW_LINE> <INDENT> super(RangePollChoiceVoteForm, self).__init__(*args, **kwargs) <NEW_LINE> nominees = tuple((i, '%d' % i) for i in range(0, choices.count()+1)) <NEW_LINE> for choice in choices: <NEW_LINE...
Range voting vote form.
6259904ad7e4931a7ef3d45c
class NoopRunner(ActionRunner): <NEW_LINE> <INDENT> KEYS_TO_TRANSFORM = ['stdout', 'stderr'] <NEW_LINE> def __init__(self, runner_id): <NEW_LINE> <INDENT> super(NoopRunner, self).__init__(runner_id=runner_id) <NEW_LINE> <DEDENT> def pre_run(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def run(self, action_parame...
Runner which does absolutely nothing. No-op action.
6259904a7d847024c075d7b8
class cFilePicker(QtCore.QObject): <NEW_LINE> <INDENT> sigValidFilename = pyqtSignal('bool') <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(cFilePicker, self).__init__() <NEW_LINE> self.isFilenameInserted = False <NEW_LINE> self.lblCaption = QtGui.QLabel() <NEW_LINE> self.cbxFilename = QtGui.QComboBox() <NEW_...
A file picker widget with a label, a combobox and a button. Pressing the button opens a file dialog. Layouting the label, line edit and button is not done by this class.
6259904aec188e330fdf9c83
class MockObject(MockAnything, object): <NEW_LINE> <INDENT> def __init__(self, class_to_mock): <NEW_LINE> <INDENT> MockAnything.__dict__['__init__'](self) <NEW_LINE> self._known_methods = set() <NEW_LINE> self._known_vars = set() <NEW_LINE> self._class_to_mock = class_to_mock <NEW_LINE> for method in dir(class_to_mock)...
A mock object that simulates the public/protected interface of a class.
6259904a96565a6dacd2d97c
class RegisterView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> return render(request, 'register.html') <NEW_LINE> <DEDENT> def post(self, request): <NEW_LINE> <INDENT> form = RegisterForm(request.POST) <NEW_LINE> if form.is_valid(): <NEW_LINE> <INDENT> email = form.cleaned_data.get('email') <...
注册类视图
6259904ab5575c28eb7136bc
class OneToOnePage(Page): <NEW_LINE> <INDENT> body = RichTextBlock(blank=True) <NEW_LINE> page_ptr = models.OneToOneField(Page, parent_link=True, related_name='+')
A Page containing a O2O relation.
6259904aac7a0e7691f738c2
class Game: <NEW_LINE> <INDENT> def __init__(self, size, method_num): <NEW_LINE> <INDENT> self.done = False <NEW_LINE> self.paused = False <NEW_LINE> self.gol = GoL(size) <NEW_LINE> self.time_list = [] <NEW_LINE> self.method_num = method_num <NEW_LINE> self.methods = {1: self.gol.conv_method, 2: self.gol.loop_method, 3...
Handles pygame events, pausing etc; along with timing the code
6259904ad6c5a102081e3503
class VCFSeq(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = '' <NEW_LINE> self.header = [] <NEW_LINE> self.speciesL = [] <NEW_LINE> self.nSpecies = 0 <NEW_LINE> self.baseL = [] <NEW_LINE> self.nBases = 0 <NEW_LINE> <DEDENT> def get_header_line_string(self, indiv): <NEW_LINE> <INDENT> string ...
Store data retrieved from a VCF file. Initialized with :func:`open_seq`. :ivar str name: Sequence name. :ivar str header: Sequence header. :ivar [str] speciesL: List with species / individuals. :ivar int nSpecies: Number of species / individuals. :ivar [NucBase] baseL: List with stored :class:`NucBase` objects. :ivar...
6259904a21a7993f00c67350
@register(OSType.BOOLEAN) <NEW_LINE> class Bool(BooleanElement): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def read(cls, fp): <NEW_LINE> <INDENT> return cls(read_fmt('?', fp)[0]) <NEW_LINE> <DEDENT> def write(self, fp): <NEW_LINE> <INDENT> return write_fmt(fp, '?', self.value)
Bool structure. .. py:attribute:: value
6259904a15baa72349463379
class TwoLayerNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=3*32*32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.params['W1'] = np.random.normal(scale=weight_scale, size=(input_dim, hidden_dim)) <NEW_LINE> se...
A two-layer fully-connected neural network with ReLU nonlinearity and softmax loss that uses a modular layer design. We assume an input dimension of D, a hidden dimension of H, and perform classification over C classes. The architecure should be affine - relu - affine - softmax. Note that this class does not implemen...
6259904aa79ad1619776b467
class TestSeriesValidate(object): <NEW_LINE> <INDENT> s = Series([1, 2, 3, 4, 5]) <NEW_LINE> def test_validate_bool_args(self): <NEW_LINE> <INDENT> invalid_values = [1, "True", [1, 2, 3], 5.0] <NEW_LINE> for value in invalid_values: <NEW_LINE> <INDENT> with pytest.raises(ValueError): <NEW_LINE> <INDENT> self.s.reset_in...
Tests for error handling related to data types of method arguments.
6259904a498bea3a75a58f07