code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class NullPresenter(Presenter): <NEW_LINE> <INDENT> _VALUE_CHANGED_SIGNAL = "null_signal" <NEW_LINE> _NULL_GUI_ELEMENT = type(b"NullGuiElement", (), {})() <NEW_LINE> def __init__(self, setting, element, *args, **kwargs): <NEW_LINE> <INDENT> self._value = None <NEW_LINE> self._sensitive = True <NEW_LINE> self._visible =...
This class acts as an empty `Presenter` object whose methods do nothing. This class is attached to `Setting` objects with no `Presenter` object specified upon its instantiation. This class also records the GUI state. In case a proper `Presenter` instance is assigned to the setting, the GUI state is copied over to the...
6259902d50485f2cf55dbfab
class AnnotationIndexAPI(views.APIView): <NEW_LINE> <INDENT> pass
Placeholder view for use in `urlpatterns` so we can `reverse()` our API endpoint
6259902d0a366e3fb87dda18
class DmesgFinder(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.node = remote.tempesta <NEW_LINE> self.log = '' <NEW_LINE> self.get_log_cmd = ( 'dmesg | tac | grep -m 1 -B 10000 "Start Tempesta DB" | tac') <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> self.log, _ = self.node.run_...
dmesg helper class.
6259902d287bf620b6272c18
class PizzaList(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> snippets = Pizza.objects.all() <NEW_LINE> serializer = PizzaSerializer(snippets, many=True) <NEW_LINE> return Response(serializer.data)
List all snippets, or create a new snippet.
6259902d5166f23b2e244408
class GB3sgRNA(GB3Part, GB3OmegaModule): <NEW_LINE> <INDENT> signature = ("GTTT", "CGCT")
A GoldenBraid 3.0 sgRNA coding sequence.
6259902d1d351010ab8f4b49
class IExposure(zope.interface.Interface): <NEW_LINE> <INDENT> title = zope.schema.TextLine( title=u'Title', required=False, ) <NEW_LINE> workspace = zope.schema.TextLine( title=u'Workspace', description=u'The model workspace this exposure encapsulates.', ) <NEW_LINE> commit_id = zope.schema.TextLine( title=u'Commit ID...
Container for all exposure pages.
6259902dd99f1b3c44d066d4
class ResponseXY(ResponseThing): <NEW_LINE> <INDENT> XMLNAME = 'response_xy' <NEW_LINE> def GetBaseType(self, interaction): <NEW_LINE> <INDENT> if isinstance(interaction, qtiv2.interactions.SelectPointInteraction): <NEW_LINE> <INDENT> return qtiv2.variables.BaseType.point <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> r...
The <response_xy> element contains the instructions for the presentation of questions whose response will be the 'x-y' co-ordinate of the selected answer. The question can be rendered in a variety of ways depending on the way in which the material is to be presented to the participant:: <!ELEMENT response_xy ((materia...
6259902d50485f2cf55dbfae
class GpuRasterizationTestsStorySet(story_set_module.StorySet): <NEW_LINE> <INDENT> def __init__(self, expectations): <NEW_LINE> <INDENT> super(GpuRasterizationTestsStorySet, self).__init__() <NEW_LINE> self.AddStory(GpuRasterizationBlueBoxPage(self, expectations)) <NEW_LINE> self.AddStory(GpuRasterizationConcavePathsP...
Basic test cases for GPU rasterization.
6259902dd10714528d69eea6
class XDecimal(XBuiltin): <NEW_LINE> <INDENT> if sys.version_info < (2, 7): <NEW_LINE> <INDENT> _decimal_canonical = staticmethod(lambda decimal: decimal) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> _decimal_canonical = decimal.Decimal.canonical <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _decimal_to_xsd_format(...
Represents an XSD <xsd:decimal/> built-in type. Excerpt from the XSD datatype specification (http://www.w3.org/TR/2004/REC-xmlschema-2-20041028): > 3.2.3 decimal > > [Definition:] decimal represents a subset of the real numbers, which can > be represented by decimal numerals. The ·value space· of decimal is the > set...
6259902da4f1c619b294f629
class EvolvedANN(ANN): <NEW_LINE> <INDENT> name = "Evolved ANN" <NEW_LINE> def __init__(self) -> None: <NEW_LINE> <INDENT> num_features, num_hidden, weights = nn_weights["Evolved ANN"] <NEW_LINE> super().__init__( num_features=num_features, num_hidden=num_hidden, weights=weights )
A strategy based on a pre-trained neural network with 17 features and a hidden layer of size 10. Trained using the `axelrod_dojo` version: 0.0.8 Training data is archived at doi.org/10.5281/zenodo.1306926 Names: - Evolved ANN: Original name by Martin Jones.
6259902dc432627299fa4028
class TestWithChrom(unittest.TestCase): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> in_path = samples['small_features'][1]['sql'] <NEW_LINE> with track.load(in_path) as t: <NEW_LINE> <INDENT> data = t.read() <NEW_LINE> got = list(data) <NEW_LINE> <DEDENT> expected = [('chrI', 0, 10, u'Validation feature ...
Read all features from a track
6259902d1f5feb6acb163c24
class MapTile: <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def intro_text(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def modify_player(self, player): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DED...
An abstract base class for Tiles.
6259902d9b70327d1c57fdb7
class PageTypeNotMounted(NoReverseMatch): <NEW_LINE> <INDENT> pass
Raised when the :func:`app_reverse` function can't find the required plugin in the page tree.
6259902d5e10d32532ce411d
class BooreAtkinson2011(BooreAtkinson2008): <NEW_LINE> <INDENT> kind = '2011'
Implements GMPE based on the corrections proposed by Gail M. Atkinson and D. Boore in 2011 and published as "Modifications to Existing Ground-Motion Prediction Equations in Light of New Data " (2011, Bulletin of the Seismological Society of America, Volume 101, No. 3, pages 1121-1135).
6259902d8c3a8732951f758c
class GxFilterGeoDataServers(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{1208F728-F2D1-4AF1-97C7-6E8FCEC94DD1}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{ADC7DE29-DC0B-448E-BBF6-27E4E34CF2EC}', 10, 2)
A filter for displaying/choosing geodataserver objects.
6259902d711fe17d825e14b4
class StateMachine(object): <NEW_LINE> <INDENT> status_attr = "status" <NEW_LINE> userid_attr = "user_id" <NEW_LINE> def __init__(self, default_state='draft', transition_dict=None): <NEW_LINE> <INDENT> self.default_state = default_state <NEW_LINE> self.transitions = dict() <NEW_LINE> if transition_dict: <NEW_LINE> <IND...
a state machine storing the transitions as: (state, new_state) : (permission, callback)
6259902d287bf620b6272c1b
class StepWithDetails(Step): <NEW_LINE> <INDENT> NAME = "StepWithDetails" <NEW_LINE> def _run(self, on_update=None): <NEW_LINE> <INDENT> for i, _ in enumerate(self.step_args): <NEW_LINE> <INDENT> self.update_details({"index": i, "value": "done"}) <NEW_LINE> <DEDENT> <DEDENT> def _init_details(self): <NEW_LINE> <INDENT>...
Test step generating some details.
6259902d23e79379d538d53e
class Result: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.min_cost = float('inf')
必须需要这个class,否则 object这个参数无法进行修改 因为如果不return,就不能pass through functions
6259902d1d351010ab8f4b4c
@implementer(IRoot) <NEW_LINE> class Root(Resource): <NEW_LINE> <INDENT> __acl__ = [ (Allow, Authenticated, 'authenticated'), (Allow, "superuser:superuser", 'shell'), ] <NEW_LINE> def __init__(self, request): <NEW_LINE> <INDENT> self.request = request <NEW_LINE> self.__name__ = "" <NEW_LINE> <DEDENT> @classmethod <NEW_...
Pyramid routing root with default permission set up. These permission mappings are used unless you supply your own traversing context. For the sake of simplicity, we only declare one permission named ``authenticated`` which is given to all authenticated users. Permissions are as: * authenticated: Pseudopermission gi...
6259902dd164cc6175821fa7
class itkInPlaceImageFilterIF3ICVF33(itkImageToImageFilterBPython.itkImageToImageFilterIF3ICVF33): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <N...
Proxy of C++ itkInPlaceImageFilterIF3ICVF33 class
6259902d96565a6dacd2d7a9
class IS_TIME(Validator): <NEW_LINE> <INDENT> def __init__(self, error_message='Enter time as hh:mm:ss (seconds, am, pm optional)'): <NEW_LINE> <INDENT> self.error_message = error_message <NEW_LINE> <DEDENT> def __call__(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ivalue = value <NEW_LINE> value = regex_...
Example: Use as:: INPUT(_type='text', _name='name', requires=IS_TIME()) understands the following formats hh:mm:ss [am/pm] hh:mm [am/pm] hh [am/pm] [am/pm] is optional, ':' can be replaced by any other non-space non-digit:: >>> IS_TIME()('21:30') (datetime.time(21, 30), None) >>> IS_TIME()('...
6259902db57a9660fecd2ab8
class ExerciseLogForm(forms.Form): <NEW_LINE> <INDENT> exercise_id = forms.CharField(max_length=100) <NEW_LINE> streak_progress = forms.IntegerField() <NEW_LINE> points = forms.IntegerField() <NEW_LINE> correct = forms.BooleanField(required=False) <NEW_LINE> def clean_exercise_id(self): <NEW_LINE> <INDENT> if not self....
Form that represents the schema for data API requests
6259902d8a349b6b43687271
class Encoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_features): <NEW_LINE> <INDENT> super(Encoder, self).__init__() <NEW_LINE> self.prenet = Prenet(in_features, out_features=[256, 128]) <NEW_LINE> self.cbhg = EncoderCBHG() <NEW_LINE> <DEDENT> def forward(self, inputs): <NEW_LINE> <INDENT> outputs = self....
Encapsulate Prenet and CBHG modules for encoder
6259902d56b00c62f0fb38f7
class count_progress_risk(stats.count_progress): <NEW_LINE> <INDENT> def get_task_data(self, job_id, units, *_args): <NEW_LINE> <INDENT> num_items = get_num_items(units) <NEW_LINE> return job_id, num_items
Extend :class:`openquake.engine.utils.stats.count_progress` to work with celery task where the number of items (i.e. assets) are embedded in calculation units.
6259902d0a366e3fb87dda1e
class ImageRegionCreateEntry(Model): <NEW_LINE> <INDENT> _validation = { 'image_id': {'required': True}, 'tag_id': {'required': True}, 'left': {'required': True}, 'top': {'required': True}, 'width': {'required': True}, 'height': {'required': True}, } <NEW_LINE> _attribute_map = { 'image_id': {'key': 'imageId', 'type': ...
Entry associating a region to an image. All required parameters must be populated in order to send to Azure. :param image_id: Required. Id of the image. :type image_id: str :param tag_id: Required. Id of the tag associated with this region. :type tag_id: str :param left: Required. Coordinate of the left boundary. :ty...
6259902dc432627299fa402c
@util.export <NEW_LINE> class Plugin(plugin.PluginBase): <NEW_LINE> <INDENT> def __init__(self, context): <NEW_LINE> <INDENT> super(Plugin, self).__init__(context=context) <NEW_LINE> <DEDENT> @plugin.event( stage=plugin.Stages.STAGE_INIT, ) <NEW_LINE> def _init(self): <NEW_LINE> <INDENT> self.environment.setdefault( oe...
Engine-remove plugin.
6259902d8e05c05ec3f6f677
class Reservoir(): <NEW_LINE> <INDENT> def __init__(self,resID,num,catchID,subID,subNm,damObj): <NEW_LINE> <INDENT> self.id=resID <NEW_LINE> self.num=num <NEW_LINE> self.catchID=catchID <NEW_LINE> self.subID=subID <NEW_LINE> self.subNm=subNm <NEW_LINE> self.floodZoneRast=None <NEW_LINE> self.floodZoneVect=None <NEW_LIN...
Class definition for a reservoir object
6259902d5e10d32532ce411f
class Exploit(exploits.Exploit): <NEW_LINE> <INDENT> __info__ = { 'name': 'Netgear R7000 & R6400 RCE', 'description': 'Module exploits remote command execution in Netgear R7000 and R6400 devices. If the target is ' 'vulnerable, command loop is invoked that allows executing commands on operating system level.', 'authors...
Exploit implementation for Netgear R7000 and R6400 Remote Code Execution vulnerability. If the target is vulnerable, command loop is invoked that allows executing commands on operating system level.
6259902d711fe17d825e14b6
class ExcludeFilter: <NEW_LINE> <INDENT> def __init__(self, arg_lst): <NEW_LINE> <INDENT> if isinstance(arg_lst, str): <NEW_LINE> <INDENT> lst = self._load_patterns_from_file(arg_lst) <NEW_LINE> <DEDENT> elif isinstance(arg_lst, list): <NEW_LINE> <INDENT> lst = arg_lst <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> rais...
ExcludeFilter is an exclusion filter.
6259902d8c3a8732951f7590
class PollingConsumer(AbstractBasicMessagingEndpoint): <NEW_LINE> <INDENT> _SENTINEL = Ellipsis <NEW_LINE> def __init__( self, exchange=_SENTINEL, queue=_SENTINEL, callback_method=_SENTINEL, qos=_SENTINEL ): <NEW_LINE> <INDENT> self._exchange = exchange <NEW_LINE> self._exchange_converter = lambda _pkid: Exchange( spec...
Basic Message Enterprise Integration Pattern for messaging endpoint > Polling Consumer. A Sentinel is declared default for various pattern parameters, as the possible None declaration is a posteriori.
6259902d6fece00bbaccc9e7
class TextEntityTypePre(Object): <NEW_LINE> <INDENT> ID = "textEntityTypePre" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(q: dict, *args) -> "TextEntityTypePre": <NEW_LINE> <INDENT> return TextEntityTypePre()
Text that must be formatted as if inside a pre HTML tag Attributes: ID (:obj:`str`): ``TextEntityTypePre`` No parameters required. Returns: TextEntityType Raises: :class:`telegram.Error`
6259902dd6c5a102081e315f
class SerializeResponder(object): <NEW_LINE> <INDENT> def __init__(self, format, mimetype=None, paginate_by=None, allow_empty=False): <NEW_LINE> <INDENT> self.format = format <NEW_LINE> self.mimetype = mimetype <NEW_LINE> self.paginate_by = paginate_by <NEW_LINE> self.allow_empty = allow_empty <NEW_LINE> self.expose_fi...
Class for all data formats that are possible with Django's serializer framework.
6259902de76e3b2f99fd9a45
class StorageProfileUpdate(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'disks': {'key': 'disks', 'type': '[VirtualDiskUpdate]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(StorageProfileUpdate, self).__init__(**kwargs) <NEW_LINE> self.disks = kwargs.get('disks', None)
Defines the resource update properties. :param disks: Gets or sets the list of virtual disks associated with the virtual machine. :type disks: list[~azure.mgmt.connectedvmware.models.VirtualDiskUpdate]
6259902da8ecb03325872256
class RecoverRecycleTablesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ClusterId = None <NEW_LINE> self.SelectedTables = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ClusterId = params.get("ClusterId") <NEW_LINE> if params.get("SelectedTab...
RecoverRecycleTables request structure.
6259902d91af0d3eaad3ae63
class SubscriptionResourceMixin(object): <NEW_LINE> <INDENT> def list_subscriptions(self, **options): <NEW_LINE> <INDENT> return self.get(self._subscription_path(), params=options).json() <NEW_LINE> <DEDENT> def get_subscription(self, subscription_id): <NEW_LINE> <INDENT> return self.get(self._subscription_path(subscri...
Methods for managing Subscription resources.
6259902d30c21e258be99845
class IndexedString(Field): <NEW_LINE> <INDENT> _sphinx_field_name = 'sql_field_string' <NEW_LINE> _type = types.String
A Sphinx field and attribute (i.e. indexed and stored)
6259902d9b70327d1c57fdbd
class Triangle(): <NEW_LINE> <INDENT> def __init__(self, p0, p1, p2): <NEW_LINE> <INDENT> self.p0 = p0 <NEW_LINE> self.p1 = p1 <NEW_LINE> self.p2 = p2 <NEW_LINE> <DEDENT> def inCentre(self, coord) -> None: <NEW_LINE> <INDENT> len0 = self.p1.distance(self.p2) <NEW_LINE> len1 = self.p0.distance(self.p2) <NEW_LINE> len2 =...
* Represents a planar triangle, and provides methods for calculating various * properties of triangles.
6259902d6e29344779b01689
class TestTSHasManifest(TestCase): <NEW_LINE> <INDENT> _multiprocess_can_split_ = True <NEW_LINE> maxDiff = None <NEW_LINE> def test_good_ts_with_manifold(self): <NEW_LINE> <INDENT> res = _ts_has_manifest(helpers.FILES["timestream_manifold"]) <NEW_LINE> self.assertEqual(res, path.join(helpers.FILES["timestream_manifold...
Test function timestream.parse._ts_has_manifest
6259902dec188e330fdf98cd
class PriorityQueue(Queue): <NEW_LINE> <INDENT> def _init(self, maxsize): <NEW_LINE> <INDENT> self.queue = [] <NEW_LINE> <DEDENT> def _qsize(self): <NEW_LINE> <INDENT> return len(self.queue) <NEW_LINE> <DEDENT> def _put(self, item): <NEW_LINE> <INDENT> heappush(self.queue, item) <NEW_LINE> <DEDENT> def _get(self): <NEW...
Variant of Queue that retrieves open entries in priority order (lowest first). Entries are typically tuples of the form: (priority number, data).
6259902d50485f2cf55dbfb6
class Discriminator(chainer.Chain): <NEW_LINE> <INDENT> def __init__(self, in_ch=1, wscale=0.02, B=32, C=8): <NEW_LINE> <INDENT> super(Discriminator, self).__init__() <NEW_LINE> self.b, self.c = B, C <NEW_LINE> with self.init_scope(): <NEW_LINE> <INDENT> w = chainer.initializers.Normal(wscale) <NEW_LINE> self.c0 = L.Co...
Discriminator build Discriminator model applied feature matching Parametors --------------------- in_ch: int Channel when converting the output of the first layer to the 4-dimensional tensor wscale: float std of normal initializer B: int number of rows of M C: int number of columns of M Attribu...
6259902d8a43f66fc4bf31bf
class OpenCloseChargePort(command_with_properties.CommandWithProperties): <NEW_LINE> <INDENT> charge_port_prop_id = 0x0b <NEW_LINE> def __init__(self, arg): <NEW_LINE> <INDENT> log.debug(" ") <NEW_LINE> self.msg_type = msg_type.MsgType(Identifiers.CHARGING,0x01) <NEW_LINE> if isinstance(arg, (bytes, bytearray)): <NEW_L...
Constructs Open Close Charge Ports message bytes
6259902d30c21e258be99846
class Constant(Leaf): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> if intf.is_sparse(value): <NEW_LINE> <INDENT> self._value = intf.DEFAULT_SPARSE_INTERFACE.const_to_matrix(value) <NEW_LINE> self._sparse = True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._value = intf.DEFAULT_INTERFACE.cons...
A constant, either matrix or scalar.
6259902db57a9660fecd2abe
class CheckoutSetupBrowserKeyResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'browser_key': 'str' } <NEW_LINE> attribute_map = { 'browser_key': 'browser_key' } <NEW_LINE> def __init__(self, browser_key=None): <NEW_LINE> <INDENT> self._browser_key = None <NEW_LINE> self.discriminator = None <NEW_LINE> if browser...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259902d8e05c05ec3f6f679
class SecretStores(BASE, ModelBase): <NEW_LINE> <INDENT> __tablename__ = 'secret_stores' <NEW_LINE> store_plugin = sa.Column(sa.String(255), nullable=False) <NEW_LINE> crypto_plugin = sa.Column(sa.String(255), nullable=True) <NEW_LINE> global_default = sa.Column(sa.Boolean, nullable=False, default=False) <NEW_LINE> nam...
List of secret stores defined via service configuration. This class provides a list of secret stores entities with their respective secret store plugin and crypto plugin names. SecretStores deletes are NOT soft-deletes.
6259902d4e696a045264e640
class MappingsFileParser(MappingsParser): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> with open(filename, 'r') as f: <NEW_LINE> <INDENT> contents = f.read() <NEW_LINE> <DEDENT> MappingsParser.__init__(self, contents)
Parse mapping data from a file. @see MappingsParser for more information.
6259902d15baa72349462fd5
class Solution: <NEW_LINE> <INDENT> def reverseWords(self, s): <NEW_LINE> <INDENT> sArr = s.strip().split(' ') <NEW_LINE> sArr.reverse() <NEW_LINE> arr = [sa for sa in sArr if sa != ''] <NEW_LINE> return ' '.join(arr)
@param: s: A string @return: A string
6259902dbe8e80087fbc00b7
class ReleaseIpv6AddressesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.EcmRegion = None <NEW_LINE> self.NetworkInterfaceId = None <NEW_LINE> self.Ipv6Addresses = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.EcmRegion = params.get("EcmRegio...
ReleaseIpv6Addresses请求参数结构体
6259902dd18da76e235b796c
class OverflowableBuffer(object): <NEW_LINE> <INDENT> overflowed = 0 <NEW_LINE> buf = None <NEW_LINE> strbuf = '' <NEW_LINE> def __init__(self, overflow): <NEW_LINE> <INDENT> self.overflow = overflow <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> buf = self.buf <NEW_LINE> if buf is not None: <NEW_LINE> <IND...
This buffer implementation has four stages: - No data - String-based buffer - StringIO-based buffer - Temporary file storage The first two stages are fastest for simple transfers.
6259902dc432627299fa4031
class NullHandler(logging.Handler): <NEW_LINE> <INDENT> def emit(self, record): <NEW_LINE> <INDENT> pass
Nullhandler for logging.
6259902d96565a6dacd2d7ad
class Importer: <NEW_LINE> <INDENT> _parser = None <NEW_LINE> _daoFactory = None <NEW_LINE> def __init__(self, parser, daoFactory): <NEW_LINE> <INDENT> self._parser = parser <NEW_LINE> self._daoFactory = daoFactory <NEW_LINE> <DEDENT> def run(self, modelPath, language=None): <NEW_LINE> <INDENT> model = self._parser.par...
Import an RDF file into a data sink (e.g. semantic MediaWiki API).
6259902d9b70327d1c57fdc0
class OneSessionPerUserMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if isinstance(request.user, User): <NEW_LINE> <INDENT> current_key = request.session.session_key <NEW_LINE> if hasattr(request.user, 'concurrentuser'): <NEW_LINE> <INDENT> active_key = request.user.con...
Middleware to handle multiple logins with same credentials - Creates a Database entry to record the current user and active session key - Checks if the current user has already been logged in. If True, the new session key is stored with respect to the user and the old session key is deleted, effecti...
6259902dd53ae8145f9194a1
class RecipeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.RecipeSerializer <NEW_LINE> queryset = Recipe.objects.all() <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> ...
Mange recipes in the database
6259902d8e05c05ec3f6f67a
class Config: <NEW_LINE> <INDENT> x_size = 5000 <NEW_LINE> y_size = 5000 <NEW_LINE> base_name = "2018_BELA_ATV_South_RGB" <NEW_LINE> in_columns = 2 <NEW_LINE> in_rows = 1 <NEW_LINE> add_numbers = True <NEW_LINE> pad_column_with_leading_zeros = False <NEW_LINE> pad_row_with_leading_zeros = False <NEW_LINE> n_cols = 1 <N...
Configuration Constants; edit as necessary for each execution.
6259902d6fece00bbaccc9ec
class AreaInfoHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ret = self.redis.get("area_info") <NEW_LINE> <DEDENT> except Exception as e: <NEW_LINE> <INDENT> logging.error(e) <NEW_LINE> ret = None <NEW_LINE> <DEDENT> if ret: <NEW_LINE> <INDENT> logging.info("hit re...
提供城区信息
6259902dd99f1b3c44d066e1
class ConnectionError(Exception): <NEW_LINE> <INDENT> def __init__(self, expr, msg): <NEW_LINE> <INDENT> self.expr = expr <NEW_LINE> self.msg = msg
Exception raised for errors in the connection Attributes: expr -- input expression in which the error occurred msg -- explanation of the error
6259902d1f5feb6acb163c2e
class CompositeHintProvider(HintProvider): <NEW_LINE> <INDENT> def __init__(self, project): <NEW_LINE> <INDENT> super(CompositeHintProvider, self).__init__(project) <NEW_LINE> self.attributes_cache = {} <NEW_LINE> self.hint_provider = [] <NEW_LINE> self.db = ReScopeMatcher() <NEW_LINE> self.db.add_param_hint('ropehints...
Default snaked's hint provider It is created automatically for each rope project and passed to ``.ropeproject/ropehints.py`` ``init`` function as first parameter. Contains build-in :class:`ScopeHintProvider` with it's scope matcher accessed via ``self.db`` and :class:`DocStringHintProvider`. Also provides hints for ...
6259902d8a349b6b43687279
class Role: <NEW_LINE> <INDENT> rolenames = [ 'villager', 'werewolf', 'seer', 'warlock', 'fool', 'wolfsbane', 'herbalist', 'slayer', 'priest', 'granger', ] <NEW_LINE> evilroles = [ 'werewolf', 'warlock' ] <NEW_LINE> nightworkroles = [ 'werewolf', 'seer', 'warlock', 'fool', 'herbalist', 'slayer', 'priest' ] <NEW_LINE> s...
Role: Represents one class of players (villagers, werewolves, etc) at a table. During configuration, the Role object for a class keeps track of how many seats that class will have. (E.g., how many werewolves.) During play, the Role also keeps track of which seats they are.
6259902d8a43f66fc4bf31c3
class GetInitScriptListRequest(object): <NEW_LINE> <INDENT> swagger_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.discriminator = None <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in six.iteritems(self.swagger_types): ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259902d66673b3332c3142e
class TestContactRequest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return ContactRequest( ...
ContactRequest unit test stubs
6259902d6fece00bbaccc9ed
class Card(FundingInstrument): <NEW_LINE> <INDENT> type = 'cards' <NEW_LINE> uri_gen = txwac.URIGen('/cards', '{card}') <NEW_LINE> def hold(self, amount, **kwargs): <NEW_LINE> <INDENT> return CardHold( href=self.card_holds.href, amount=amount, **kwargs ).save()
A card represents a source of funds. You may Debit funds from the Card.
6259902dbe8e80087fbc00b9
class SettingsBackendYaml(SettingsBackendBase): <NEW_LINE> <INDENT> _default_filename = "boussole.yml" <NEW_LINE> _kind_name = "yaml" <NEW_LINE> _file_extension = "yml" <NEW_LINE> def dump(self, content, filepath, indent=4): <NEW_LINE> <INDENT> with open(filepath, "w") as fp: <NEW_LINE> <INDENT> pyaml.dump(content, dst...
YAML backend for settings Use PyYaml for parsing and pyaml for dumping. Attributes: _default_filename: Filename for settings file to load. Value is ``settings.yml``. _kind_name: Backend format name. Value is ``yaml``. _file_extension: Default filename extension. Value is ``yml``.
6259902dd18da76e235b796d
class ClickError(click.ClickException): <NEW_LINE> <INDENT> def show(self): <NEW_LINE> <INDENT> click.echo(str(self))
Raised with an error from the celery group.
6259902de76e3b2f99fd9a4b
class Test_States(unittest.TestCase): <NEW_LINE> <INDENT> def test_attrs(self): <NEW_LINE> <INDENT> state = State() <NEW_LINE> self.assertIsInstance(state, BaseModel) <NEW_LINE> self.assertIsInstance(state.created_at, dt) <NEW_LINE> self.assertIsInstance(state.updated_at, dt) <NEW_LINE> self.assertIsInstance(state.id, ...
class for states unittest
6259902dc432627299fa4034
class CCTrapControlsField(CCField): <NEW_LINE> <INDENT> TYPE = 4 <NEW_LINE> def __init__(self, traps): <NEW_LINE> <INDENT> if __debug__: <NEW_LINE> <INDENT> if type(traps) != list: <NEW_LINE> <INDENT> raise AssertionError("Traps controls must be a list of CCTrapControl. Value passed = '"+str(traps)+"'") <NEW_LINE> <DED...
A class defining the trap controls field Member vars: type_val (int) : the type identifier of this class (set to 4) traps (list of CCTrapControl): a list of traps for the map
6259902da4f1c619b294f634
class Product(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length = 100) <NEW_LINE> price = models.FloatField() <NEW_LINE> state = models.CharField(default = "En Venta", max_length = 100) <NEW_LINE> description = models.TextField() <NEW_LINE> seller = models.ForeignKey(User,related_name = 'seller', on...
Product model
6259902db57a9660fecd2ac2
class Persistence(ModuleProxy): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def load(self, id, collection=None, default=None): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def load_collection(self, collection, default=None): <NEW_LINE> <INDEN...
Persistence Module This class encapsulates the user-facing interface to NIO's persistence layer. Block writers use this module to save dynamic data at runtime, allowing it to persist in the block instance after a service/instance restart. Example: self.persistence.save(item, id) # saves the item item = self....
6259902d5166f23b2e244416
class LsbootUsbInternalImage(ManagedObject): <NEW_LINE> <INDENT> consts = LsbootUsbInternalImageConsts() <NEW_LINE> naming_props = set([]) <NEW_LINE> mo_meta = MoMeta("LsbootUsbInternalImage", "lsbootUsbInternalImage", "usb-intern", VersionMeta.Version221b, "InputOutput", 0x3f, [], ["admin", "ls-compute", "ls-config", ...
This is LsbootUsbInternalImage class.
6259902dd53ae8145f9194a3
class HubspotAuthenticationError(HubspotClientError): <NEW_LINE> <INDENT> pass
HubSpot rejected your authentication key. This represents an HTTP response code of 401.
6259902d1f5feb6acb163c30
class TestErrorPayload(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 testErrorPayload(self): <NEW_LINE> <INDENT> pass
ErrorPayload unit test stubs
6259902d21bff66bcd723ca4
class RegionAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ("name", "description")
View/edit which sites are in a given region.
6259902e56b00c62f0fb3901
class Favicon(BaseHandler): <NEW_LINE> <INDENT> @asynchronous <NEW_LINE> @coroutine <NEW_LINE> def get(self, *_args, **_kwargs): <NEW_LINE> <INDENT> base = str(time.time()).encode() <NEW_LINE> credit = md5(base).hexdigest() <NEW_LINE> self.session.update( { 'ip': self.request.remote_ip }, {'$set': { 'mixin': credit, 's...
Handle icon.
6259902e91af0d3eaad3ae6b
class instrumented_memorise(memorise): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(instrumented_memorise, self).__init__(*args, **kwargs) <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> func = super(instrumented_memorise, self)....
A version of the memorise decorator that records the number of cache and function calls it makes.
6259902ea8ecb0332587225e
class serverException_500(serverException): <NEW_LINE> <INDENT> def __init__(self, params): <NEW_LINE> <INDENT> clientException.__init__(self,params,500)
This will handle all http 500 exception, server error
6259902ed164cc6175821fb2
class InvalidIPException(BaseExceptionError): <NEW_LINE> <INDENT> pass
Invalid IP This exception is raised when some part of **fhost** code validates an IP address format. As /etc/hosts file is quite delicated beacuse it can affect the whole system, **fhost** performs aggressive validations on all input and output data. A common string message is shown to the user if this exeption rais...
6259902e5166f23b2e244418
class BuyActionSchema(SchemaObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.schema = 'BuyAction'
Schema Mixin for BuyAction Usage: place after django model in class definition, schema will return the schema.org url for the object The act of giving money to a seller in exchange for goods or services rendered. An agent buys an object, product, or service from a seller for a price. Reciprocal of SellAction.
6259902e8e05c05ec3f6f67c
class AppProbationCaseInformation(AppReinstatementCaseInformation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> AppReinstatementCaseInformation.__init__(self) <NEW_LINE> self.probation_period = StringVar() <NEW_LINE> self.reinstatement_date = StringVar() <NEW_LINE> self.appointment_date = StringVar() <N...
A subclassof the POL Case Information class that add fields for dates of court orders and filings and a field for relator counsel of record.
6259902e1d351010ab8f4b59
class UnionFind(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.weights = {} <NEW_LINE> self.parents = {} <NEW_LINE> <DEDENT> def __getitem__(self, object): <NEW_LINE> <INDENT> if object not in self.parents: <NEW_LINE> <INDENT> self.parents[object] = object <NEW_LINE> self.weights[object] = 1 ...
Union-find data structure. Each unionFind instance X maintains a family of disjoint sets of hashable objects, supporting the following two methods: - X[item] returns a name for the set containing the given item. Each set is named by an arbitrarily-chosen one of its members; as long as the set remains unchanged it w...
6259902e50485f2cf55dbfbe
class ReadWriteScopedResourceMixin(ScopedResourceMixin, OAuthLibMixin): <NEW_LINE> <INDENT> required_scopes = [] <NEW_LINE> read_write_scope = None <NEW_LINE> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> provided_scopes = oauth2_settings._SCOPES <NEW_LINE> read_write_scopes = [oauth2_settings.READ_SCOPE, oaut...
Helper mixin that implements "read and write scopes" behavior
6259902e15baa72349462fda
class DataFile(DictFile): <NEW_LINE> <INDENT> valid_formats = ['cpickle']
File class for data files, Inherited from DictFile, valid file formats [cpickle]
6259902e56b00c62f0fb3903
@ZWaveMessage(COMMAND_CLASS_NETWORK_MANAGEMENT_INCLUSION, NODE_ADD_DSK_REPORT) <NEW_LINE> class NodeAddDSKReport(Message): <NEW_LINE> <INDENT> NAME = "NODE_ADD_DSK_REPORT" <NEW_LINE> attributes = ( ("seqNo", uint8_t), ("-", reserved_t(4)), ("inputDSKLength", uint4_t), ("dsk", dsk_t), )
Command Class message COMMAND_CLASS_NETWORK_MANAGEMENT_INCLUSION NODE_ADD_DSK_REPORT
6259902e507cdc57c63a5deb
class PersonRegisteredBranchesView(PersonBaseBranchListingView): <NEW_LINE> <INDENT> page_title = _('Registered') <NEW_LINE> label_template = 'Bazaar branches registered by %(displayname)s' <NEW_LINE> no_sort_by = (BranchListingSort.DEFAULT, BranchListingSort.OWNER) <NEW_LINE> def _getCollection(self): <NEW_LINE> <INDE...
View for branch listing for a person's registered branches.
6259902e91af0d3eaad3ae6d
@register('IPython.IntRangeSlider') <NEW_LINE> class IntRangeSlider(_BoundedIntRange): <NEW_LINE> <INDENT> _view_name = Unicode('IntSliderView', sync=True) <NEW_LINE> orientation = CaselessStrEnum(values=['horizontal', 'vertical'], default_value='horizontal', allow_none=False, help="Vertical or horizontal.", sync=True)...
Slider widget that represents a pair of ints between a minimum and maximum value.
6259902e3eb6a72ae038b6a8
class Engine(TEBDEngine): <NEW_LINE> <INDENT> def __init__(self, psi, model, options): <NEW_LINE> <INDENT> msg = "Renamed `Engine` class to `TEBDEngine`." <NEW_LINE> warnings.warn(msg, category=FutureWarning, stacklevel=2) <NEW_LINE> TEBDEngine.__init__(self, psi, model, options)
Deprecated old name of :class:`TEBDEngine`. .. deprecated : v0.8.0 Renamed the `Engine` to `TEBDEngine` to have unique algorithm class names.
6259902ed6c5a102081e3169
class SockJSResource(resource.Resource): <NEW_LINE> <INDENT> isLeaf = True <NEW_LINE> def __init__(self, factory, options = None): <NEW_LINE> <INDENT> self._factory = SockJSFactory(factory, options) <NEW_LINE> <DEDENT> def render(self, request): <NEW_LINE> <INDENT> transport, request.transport = request.transport, None...
A resource that defers to a SockJS factory.
6259902e30c21e258be9984f
class simpleNetwork(object): <NEW_LINE> <INDENT> def __init__(self, window, neurony, forecast_type, arima): <NEW_LINE> <INDENT> self.layers = len(neurony) <NEW_LINE> self.topology = [[] for i in range(self.layers)] <NEW_LINE> for i in range(0, self.layers): <NEW_LINE> <INDENT> quantity = neurony[i] <NEW_LINE> for j in ...
Class defines a neural network of classic neurons, for input of size okno, topology specified in [[neurony]] dictionary
6259902e925a0f43d25e908b
class MainWindow(VCPMainWindow): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(MainWindow, self).__init__(*args, **kwargs) <NEW_LINE> self.mainModeTabWidget.currentChanged.connect(self.onModeTabIndexChanged) <NEW_LINE> STATUS.task_mode.notify(self.onTaskModeChanged) <NEW_LINE> STATU...
Main window class for the VCP.
6259902e6e29344779b01693
class ChartItemEventWrapper: <NEW_LINE> <INDENT> meta_type = 'ChartItemEventWrapper' <NEW_LINE> def __init__(self, mapping_name, patient, **object): <NEW_LINE> <INDENT> if mapping_name == 'medications': <NEW_LINE> <INDENT> self.prefix = 'Medicamento ' <NEW_LINE> self.title = object['medication'] <NEW_LINE> self.url_suf...
wrapper for creating chart_data events.
6259902e796e427e5384f7c0
class PayPalIPN(PayPalStandardBase): <NEW_LINE> <INDENT> format = u"<IPN: %s %s>" <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = "paypal_ipn" <NEW_LINE> verbose_name = "PayPal IPN" <NEW_LINE> <DEDENT> def _postback(self): <NEW_LINE> <INDENT> return urllib2.urlopen( self.get_endpoint(), "cmd=_notify-validate&%s" ...
Logs PayPal IPN interactions.
6259902e66673b3332c31434
@ddt.ddt <NEW_LINE> class CreateVideoPipelineIntegration(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(CreateVideoPipelineIntegration, self).setUp() <NEW_LINE> <DEDENT> def assert_integration_created(self, args, options): <NEW_LINE> <INDENT> integration = VideoPipelineIntegration.current() <...
Management command test class.
6259902e73bcbd0ca4bcb2d6
class IParticipantManager(Interface): <NEW_LINE> <INDENT> pass
storage and validation of participant registration
6259902eac7a0e7691f7352e
class GS568BatchRandomSampler(Sampler): <NEW_LINE> <INDENT> def __init__(self, dataset, batch_shape, seed=None, replace=False, name='gs568_batch_random_sampler'): <NEW_LINE> <INDENT> Sampler.__init__(self, dataset, name) <NEW_LINE> if isinstance(batch_shape, int): <NEW_LINE> <INDENT> self._batch_shape = (batch_shape,) ...
Parameters ---------- batch_shape : tuple, list or array-like object The shape of mini-batch
6259902e8a43f66fc4bf31cb
class Apple(produce.Produce): <NEW_LINE> <INDENT> def __init__(self, duration): <NEW_LINE> <INDENT> self.duration = '5356800' <NEW_LINE> <DEDENT> def duration(self): <NEW_LINE> <INDENT> return self.duration
Apple value update
6259902e8c3a8732951f759e
class Events(object): <NEW_LINE> <INDENT> def __init__(self, rss_url=""): <NEW_LINE> <INDENT> self.rss_url = rss_url <NEW_LINE> <DEDENT> def get_events_from_rss(self, rss_url=""): <NEW_LINE> <INDENT> if rss_url == "" and self.rss_url == "": <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> self.rss_url = rss_url <NEW...
Class for all events from a calendar @_data (private) @title (public) @events (public)
6259902ebe8e80087fbc00c1
class NetworkUpdate(): <NEW_LINE> <INDENT> networkId = "" <NEW_LINE> timestamp = None <NEW_LINE> type = None <NEW_LINE> def __init__(self, timestamp, type, networkId): <NEW_LINE> <INDENT> self.timestamp = timestamp <NEW_LINE> self.type = type <NEW_LINE> self.networkId = networkId
base class of any network update
6259902e23e79379d538d551
class HTTPPaymentChannelServer(PaymentChannelServerBase): <NEW_LINE> <INDENT> PROTOCOL_VERSION = 2 <NEW_LINE> def __init__(self, url): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._url = url <NEW_LINE> self._requests = RequestsWrapper() <NEW_LINE> <DEDENT> def get_info(self): <NEW_LINE> <INDENT> r = self._req...
RESTful HTTP Payment Channel Server interface. Protocol documented in docs/rest-handshake-402.txt.
6259902e30c21e258be99854
class KappaScore(ConfusionMatrix): <NEW_LINE> <INDENT> def on_epoch_end(self, **kwargs): <NEW_LINE> <INDENT> w = torch.ones((self.n_classes, self.n_classes)) <NEW_LINE> w[self.x, self.x] = 0 <NEW_LINE> sum0 = self.cm.sum(dim=0) <NEW_LINE> sum1 = self.cm.sum(dim=1) <NEW_LINE> expected = torch.einsum('i,j->ij', (sum0, su...
Compute the rate of agreement (Cohens Kappa). Ref.: https://github.com/scikit-learn/scikit-learn/blob/bac89c2/sklearn/metrics/classification.py
6259902e66673b3332c31438
class OicProviderSettings(OicServerSettings): <NEW_LINE> <INDENT> pass
Specific settings for OpenID Connect provider.
6259902e4e696a045264e646
class FeedEmitter(object): <NEW_LINE> <INDENT> def __init__(self, entries, html_base=None, html_entry=None): <NEW_LINE> <INDENT> self._log = logging.getLogger(self.__class__.__name__) <NEW_LINE> self._entries = entries <NEW_LINE> self._html_base = html_base <NEW_LINE> self._html_entry = html_entry <NEW_L...
FeedEmitter: Simple news item aggregator and emitter. This takes a list of FeedEntry objects and optionally, some HTML templates. The make_rss and make_html methods then generate RSS or HTML from these feed items.
6259902ed6c5a102081e316f
class Direction(models.Model): <NEW_LINE> <INDENT> id = models.CharField(max_length=50, verbose_name='Яндекс-индекс направления', primary_key=True) <NEW_LINE> name = models.CharField(max_length=255, verbose_name='Наименование направления') <NEW_LINE> region = models.ForeignKey(Region) <NEW_LINE> class Meta: <NEW_LINE> ...
Направление (Белорусское, Горьковское, Рижское, ...)
6259902ee76e3b2f99fd9a55
class PerformanceCounterPermission(ResourcePermissionBase,IPermission,ISecurityEncodable,IStackWalk,IUnrestrictedPermission): <NEW_LINE> <INDENT> def AddPermissionAccess(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Clear(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetPermissionEntries...
Allows control of code access permissions for System.Diagnostics.PerformanceCounter. PerformanceCounterPermission() PerformanceCounterPermission(state: PermissionState) PerformanceCounterPermission(permissionAccess: PerformanceCounterPermissionAccess,machineName: str,categoryName: str) PerformanceCounterPermissio...
6259902e30c21e258be99855