code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class RRjsonio(RPackage): <NEW_LINE> <INDENT> homepage = "https://cloud.r-project.org/package=RJSONIO" <NEW_LINE> url = "https://cloud.r-project.org/src/contrib/RJSONIO_1.3-0.tar.gz" <NEW_LINE> list_url = "https://cloud.r-project.org/src/contrib/Archive/RJSONIO" <NEW_LINE> version('1.3-1.4', sha256='54142c931e15ec...
Serialize R Objects to JSON, JavaScript Object Notation This is a package that allows conversion to and from data in Javascript object notation (JSON) format. This allows R objects to be inserted into Javascript/ECMAScript/ActionScript code and allows R programmers to read and convert JSON content to R objects. This i...
62598ee691f36d47f22301ea
class StaffObject: <NEW_LINE> <INDENT> def __init__(self, parent: GraphicObject): <NEW_LINE> <INDENT> self._staff = StaffObject.find_staff(cast(Positioned, parent)) <NEW_LINE> if not self._staff: <NEW_LINE> <INDENT> raise NoAncestorStaffError <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def staff(self): <NEW_LINE>...
An object which must always be the descendant of a Staff This is a Mixin class, meant to be paired with GraphicObject classes. Usage within a GraphicObject will look something like: >>> class SomeMusicGlyph(MusicText, StaffObject): # doctest: +SKIP ... def __init__(self, ...): ... MusicText.__init__(sel...
62598ee6d6c5a102081e07be
class SCR0510a(Page): <NEW_LINE> <INDENT> locators = { "cancel": "OrganizationSignatureRulesCancelEvent" } <NEW_LINE> def cancel(self): <NEW_LINE> <INDENT> return self.go("cancel")
SCR_0510a Edit organization signatures
62598ee6236d856c2adc875b
class JenkinsApi(PythonJenkins): <NEW_LINE> <INDENT> def __init__(self, url, username=None, password=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): <NEW_LINE> <INDENT> super().__init__(url, username, password, timeout) <NEW_LINE> context = ssl._create_stdlib_context(check_hostname=False) <NEW_LINE> unverified_handler =...
Class to handle Jenkins integration
62598ee63eb6a72ae0388cd1
class NextSceneEvent(Event): <NEW_LINE> <INDENT> def __init__(self, index, value1, value2, value3, uk_data): <NEW_LINE> <INDENT> Event.__init__(self, index, ev_NEXT_SCENE, value1, value2, value3) <NEW_LINE> self.uk_data = uk_data <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return Event.__str__(self) + ",...
The ev_NEXT_SCENE-event is a special case. It has additional data attached to it. That's why we introduced a new class for that purpose
62598ee6f7d966606f74667f
class TestJIMMessage(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._correct_msg = JIMMessage(JIMMsgType.CTS_JOIN_CHAT, action='join', time=datetime.datetime.now().timestamp(), login='Andrew', room='#StackOverflow') <NEW_LINE> <DEDENT> def test_serialize(self): <NEW_LINE> <INDENT> msg...
Tests for JIMMessage class which manages JIM protocol and messages.
62598ee663d6d428bbee0e5b
class pong(Event): <NEW_LINE> <INDENT> pass
pong Event
62598ee6097d151d1a2bf6af
class InvalidCaptionsError(Exception): <NEW_LINE> <INDENT> pass
Error raised when passing wrong captions to the segmenter
62598ee644b2445a339b5caf
class bytestream_exception: <NEW_LINE> <INDENT> pass
读流异常类,当超过位置时抛出
62598ee692d797404e387ec2
class Interactions(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._usermap = {} <NEW_LINE> <DEDENT> def Update(self, user1, user2): <NEW_LINE> <INDENT> interaction_id = uuid.uuid4() <NEW_LINE> self._usermap.setdefault('%s%s' % (user1, user2), interaction_id) <NEW_LINE> self._usermap.setdefaul...
Manages all user to user interactions. An interaction is unique between two users, regardless of who is sending. A unique UUID is created for each 'interaction' which can be pulled by querying this object with two users in any order.
62598ee67047854f4633da64
class Graph: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.adjacencyList = {} <NEW_LINE> <DEDENT> def addVertex(self, vertex): <NEW_LINE> <INDENT> if not self.adjacencyList.get(vertex): <NEW_LINE> <INDENT> self.adjacencyList[vertex] = [] <NEW_LINE> <DEDENT> <DEDENT> def addEdge(self, vertex1, vertex2...
Graph data structure class (Undirected Graph)
62598ee67cff6e4e811b407c
class DatabaseExtract(Extract): <NEW_LINE> <INDENT> query = 'SELECT 1' <NEW_LINE> pack_size = 1000 <NEW_LINE> def __init__(self, engine, query=None): <NEW_LINE> <INDENT> super(DatabaseExtract, self).__init__() <NEW_LINE> self.engine = engine <NEW_LINE> self.query = query or self.query <NEW_LINE> <DEDENT> def extract(se...
Extract data from a database using some raw SQL and yield one output line per query result. .. attribute:: engine The sqlalchemy engine to use for extraction. .. attribute:: query The database query that will be used to extract data from database. Should not contain OFFSET/LIMIT, nor ";". .. attribute:: pa...
62598ee623849d37ff84f745
class ListAttr(list): <NEW_LINE> <INDENT> attrs = {} <NEW_LINE> def __getattr__(self, name): <NEW_LINE> <INDENT> if name in self.attrs: <NEW_LINE> <INDENT> return self.attrs[name] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return super().__getattr__(name) <NEW_LINE> <DEDENT> <DEDENT> def __setattr__(self, name, valu...
List with attributes support
62598ee6e64d504609df8706
class ESIMiddleware: <NEW_LINE> <INDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if getattr(request, '_esi_include_used', False): <NEW_LINE> <INDENT> response['X-ESI'] = '1' <NEW_LINE> <DEDENT> return response
Adds "X-ESI: 1" header into the response if and ESI include has been used
62598ee632920d7e50bc46bc
class Deconfigurable(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._param_methods = self._get_param_methods() <NEW_LINE> self._param_vals = {} <NEW_LINE> for param, method in self._param_methods.items(): <NEW_LINE> <INDENT> self._process_param(param, method, kwargs) <NEW_LINE> <DED...
A class that has rich(ish) keyword-parameter handling including explicit handling of required parameters and declaration of parameter dependencies. Keyword parameter processing will be performed for any method on the Configurable that is decorated with the 'parameter' decorator. Each of these decorated methods perform...
62598ee6baa26c4b54d4d95e
class CustomConfigParser(configparser.ConfigParser): <NEW_LINE> <INDENT> def __init__(self, paths): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.config_paths = paths <NEW_LINE> self.read(paths) <NEW_LINE> <DEDENT> def refresh(self): <NEW_LINE> <INDENT> self.read(self.config_paths)
ConfigParser with automatic read-on-init.
62598ee61f5feb6acb1612e1
class PostModelTest(TestCase): <NEW_LINE> <INDENT> filds_name = { 'datetime': 'Дата', 'author': 'Собственник', 'text': 'Сообщение', } <NEW_LINE> model = Post <NEW_LINE> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> user = User.objects.create(username='test0', email='test0@test.com', password='test...
Тестирование модели Post (названия меток и длины полей)
62598ee67d43ff2487426743
class INGCollection(base.ICollectionPortlet): <NEW_LINE> <INDENT> template = schema.Choice( title=_(u"Template"), description=_(u"Template to use for portlet rendering. If not set " u"then default one will be used."), required=False, default=u"", vocabulary='collective.portlet.ngcollection.PortletTemplates') <NEW_LINE>...
A portlet It inherits from IPortletDataProvider because for this portlet, the data that is being rendered and the portlet assignment itself are the same.
62598ee62eb69b55b15a06d1
class Recognizer(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Recognizer, self).__init__() <NEW_LINE> self.subscribers = [] <NEW_LINE> self._stop = False <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> self._stop = True <NEW_LINE> <DEDENT> def subscribe(self, subscriber):...
Threaded Recognizer base class. A queue can be subscribed to the Recognizer and hence, receive recognized :class:`pyjulius.Sentence` objects .. attribute:: subscribers List of subscribers
62598ee666656f66f7d58a70
class PluginDependency(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._requirement_has_network = True <NEW_LINE> if six.PY2: <NEW_LINE> <INDENT> self._requirement_python = plugin.PYTHON2 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._requirement_python = plugin.PYTHON3 <NEW_LINE> <DEDENT...
Plugins may have requirement - specified by require(). Please refere plugin-doku. This module checks if dependencies are fulfilled.
62598ee62ae34c7f260a9777
class TimeInterval(BaseInterval): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> def __init__(self, start=None, end=None): <NEW_LINE> <INDENT> if start and not isinstance(start, datetime.datetime): <NEW_LINE> <INDENT> raise ValueError("start should be a datetime value") <NEW_LINE> <DEDENT> if end and not isinstance(end,...
Time interval
62598ee699cbb53fe682f541
class gs_diff_navigate(GsNavigate): <NEW_LINE> <INDENT> offset = 0 <NEW_LINE> def get_available_regions(self): <NEW_LINE> <INDENT> return self.view.find_by_selector("meta.diff.range.unified, meta.commit-info.header")
Travel between hunks. It is also used by show_commit_view.
62598ee6851cf427c66b6961
class Start(cmd.Cmd): <NEW_LINE> <INDENT> @docopt_cmd <NEW_LINE> def do_create_room(self, args): <NEW_LINE> <INDENT> roomnames = args['<room_names>'] <NEW_LINE> roomtype = args['<type_of_room>'] <NEW_LINE> for roomname in roomnames: <NEW_LINE> <INDENT> dojo.create_room(roomname, roomtype) <NEW_LINE> <DEDENT> <DEDENT> @...
This class is what starts Sophia Interactive and makes her WORK
62598ee60a50d4780f703a3b
class EntityDetection(models.Model): <NEW_LINE> <INDENT> entity = models.ForeignKey(Entity) <NEW_LINE> document = models.ForeignKey(CalaisDocument, related_name='entity_detections') <NEW_LINE> urlhash = models.URLField() <NEW_LINE> relevance = models.FloatField() <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> re...
A specific entity detected within a document. This includes the OpenCalais hash URL as a unique identifier for a particular detection. Also stores the `relevance` field, a floating point value repesenting the entity's relevance to the document. Example usage:: # CalaisDocument contains an article about Apple iPod...
62598ee630bbd722464682c9
class MyBlowFish: <NEW_LINE> <INDENT> def __init__(self, key): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def padding_pcks5(clear_text): <NEW_LINE> <INDENT> byte_num = len(clear_text) <NEW_LINE> packing_len = 8 - byte_num % 8 <NEW_LINE> appendage = chr(packing_len) * packing_len <NE...
Blow fish encryption and decryption
62598ee69c8ee8231303f4a0
class Tree: <NEW_LINE> <INDENT> class Position: <NEW_LINE> <INDENT> def element(self): <NEW_LINE> <INDENT> raise NotImplementedError('must be implemented by subclass') <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> raise NotImplementedError('must be implemented by subclass') <NEW_LINE> <DEDENT> def __...
Abstract base class representing a tree structure.
62598ee63eb6a72ae0388cd3
@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( om...
Packages plugin.
62598ee6cad5886f8bdc3991
class SpyStep(object): <NEW_LINE> <INDENT> ran = False <NEW_LINE> def run(self): <NEW_LINE> <INDENT> self.ran = True
A build step which records the fact that it has been run. :ivar bool ran: ``False`` by default.
62598ee656b00c62f0fb0f60
class AggregateStats(graphene.ObjectType): <NEW_LINE> <INDENT> column = graphene.String( description='Name of the column the statistics are calculated for' ) <NEW_LINE> minimum = graphene.Float( name='min', description='The minimum value within the (sub)group' ) <NEW_LINE> maximum = graphene.Float( name='max', descript...
Object class representing aggregated data statistics within a data group or subgroup.
62598ee626068e7796d4afec
class TestSmartDataController(BaseTestCase): <NEW_LINE> <INDENT> def test_add_smart_nvme(self): <NEW_LINE> <INDENT> smartNvme = SmartNvme() <NEW_LINE> response = self.client.open( '/cs-739/DiskFailurePrediction/1.0.0/smart-nvme', method='POST', data=json.dumps(smartNvme), content_type='application/json') <NEW_LINE> sel...
SmartDataController integration test stubs
62598ee6adb09d7d5dc08c57
class UnsupportedEngineFeature(SMCException): <NEW_LINE> <INDENT> pass
If an operation is performed on an engine that does not support the functionality, this is thrown. For example, only Master Engine has virtual resources. IPS and Layer 2 Firewall do not have internal gateways (used for VPN).
62598ee6f7d966606f746681
class NullstrToNoneAction(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> if values.strip() == "": <NEW_LINE> <INDENT> setattr(namespace, self.dest, None) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> setattr(namespace, self.dest, values)
A custom action to convert empty strings passed by shell to None in python. This is necessary as shell scripts print null strings when a variable is not specified. We could use the more apt None in python.
62598ee6f548e778e5969c23
class EULossNode(Node, CaffeTreeNode): <NEW_LINE> <INDENT> bl_idname = 'EULossNodeType' <NEW_LINE> bl_label = 'EU Loss Node' <NEW_LINE> bl_icon = 'SOUND' <NEW_LINE> n_type = 'EuclideanLoss' <NEW_LINE> w = bpy.props.FloatProperty(default=0) <NEW_LINE> def init(self, context): <NEW_LINE> <INDENT> self.inputs.new('AFlatSo...
A Convolution node
62598ee6ac7a0e7691f70ba7
class BgpSettings(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'asn': {'maximum': 4294967295, 'minimum': 0}, } <NEW_LINE> _attribute_map = { 'asn': {'key': 'asn', 'type': 'long'}, 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, 'peer_weight': {'key': 'peerWeight', 'type': 'int'},...
BGP settings details. :param asn: The BGP speaker's ASN. :type asn: long :param bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. :type bgp_peering_address: str :param peer_weight: The weight added to routes learned from this BGP speaker. :type peer_weight: int :param bgp_peering_add...
62598ee644b2445a339b5cb0
class Flavor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> Flavor._fallbackFlavors <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> Flavor._fallbackFlavors = {} <NEW_LINE> self.setFallbackFlavors(None) <NEW_LINE> <DEDENT> <DEDENT> def setFallbackFlavors(self...
A class to handle flavors
62598ee6d7e4931a7ef3a730
class SavepointCase(SingleTransactionCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._savepoint_id = next(savepoint_seq) <NEW_LINE> self.cr.execute('SAVEPOINT test_%d' % self._savepoint_id) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.cr.execute('ROLLBACK TO SAVEPOINT test_%d' %...
Similar to :class:`SingleTransactionCase` in that all test methods are run in a single transaction *but* each test case is run inside a rollbacked savepoint (sub-transaction). Useful for test cases containing fast tests but with significant database setup common to all cases (complex in-db test data): :meth:`~.setUpCl...
62598ee66e29344779afecc2
class TestVisualizerRLlib(unittest.TestCase): <NEW_LINE> <INDENT> def test_visualizer_single(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ray.init(num_cpus=1) <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> current_path = os.path.realpath(__file__).rsplit('/', 1)[0] <NEW_LINE> ...
Tests visualizer_rllib
62598ee6e64d504609df8707
class DynamicWidget(Loggable): <NEW_LINE> <INDENT> def __init__(self, default): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.default = default <NEW_LINE> <DEDENT> def connect_value_changed(self, callback, *args): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def set_widget_value(self, valu...
Abstract widget providing a way to get, set and observe properties.
62598ee6fff4ab517ebcbe69
class SchiDigitDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, csv_file, num_samples, transform=None): <NEW_LINE> <INDENT> self.num_classes = 10 <NEW_LINE> temp_mat = pd.read_csv(csv_file, header=None) <NEW_LINE> self.mat = temp_mat.values <NEW_LINE> if num_samples == 0: <NEW_LINE> <INDENT> self.mat = self.mat...
Face Landmarks dataset.
62598ee64428ac0f6e656be3
class MethodForm(RepositoryForm): <NEW_LINE> <INDENT> score = forms.FileField(required=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Method <NEW_LINE> exclude = ('pub_date', 'version', 'slug', 'user',) <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if kwargs.has_key('request'):...
Form class for Method. @cvar score: is not required in form (but in model) @type score: forms.FileField
62598ee68e71fb1e983ba0fd
class Basket: <NEW_LINE> <INDENT> def __init__(self, name ,color, x, score, speed, highscore = 0): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self._color = color <NEW_LINE> self._x = x <NEW_LINE> self._score = score <NEW_LINE> self.speed = speed <NEW_LINE> self._highscore = highscore <NEW_LINE> <DEDENT> def get_sc...
Class used to instantiate all the values of the player
62598ee62eb69b55b15a06d2
class SMTPS(smtplib.SMTP): <NEW_LINE> <INDENT> def __init__(self, ui, keyfile=None, certfile=None, host=None, **kwargs): <NEW_LINE> <INDENT> self.keyfile = keyfile <NEW_LINE> self.certfile = certfile <NEW_LINE> smtplib.SMTP.__init__(self, **kwargs) <NEW_LINE> self._host = host <NEW_LINE> self.default_port = smtplib.SMT...
Derived class to verify the peer certificate for SMTPS. This class allows to pass any keyword arguments to SSL socket creation.
62598ee64e4d562566370aab
class AbstractDAOTest(base.AbstractDBTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> super().tearDown() <NEW_LINE> <DEDENT> def assertEquiv(self, model, actual): <NEW_LINE> <INDENT> for key in model: <NEW_LINE> <INDENT> self.ass...
Abstract base class for DAO tests.
62598ee6379a373c97d97688
class Bib(list): <NEW_LINE> <INDENT> def __init__(self, entries=None): <NEW_LINE> <INDENT> if entries is not None: <NEW_LINE> <INDENT> self.extend(entries) <NEW_LINE> <DEDENT> <DEDENT> def sort_by_date(self, reverse=True): <NEW_LINE> <INDENT> self.sort(key = lambda e: e.datetime(), reverse=reverse)
Class representing a bliography
62598ee6925a0f43d25e66bf
class TestLocalbitcoins(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.ex = pyexchange.localbitcoins.LocalBitcoins() <NEW_LINE> <DEDENT> def test_markets(self): <NEW_LINE> <INDENT> exp_markets = ['btc_ars', 'btc_aud', 'btc_brl', 'btc_cad', 'btc_eur', 'btc_gbp', 'btc_ghs', 'btc_huf', '...
Test case docstring
62598ee65166f23b2e241a69
class PollSinglSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Poll <NEW_LINE> fields = ('id','title','plot','start_at','end_at','is_published')
Серилизатор опросов "title": навзание, "plot": описание, "start_at": начала, "end_at": конец, "is_published": опубликован,
62598ee63eb6a72ae0388cd5
class CVItems(Base, Common): <NEW_LINE> <INDENT> __tablename__ = 'cvitems' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> text = Column(Text) <NEW_LINE> categories = relationship('CVItemCategories', secondary=cvitem_category_table, backref='cvitems')
short description items, like a skill
62598ee6cc0a2c1114479696
class Salary(models.Model): <NEW_LINE> <INDENT> employee = models.ForeignKey("user.Employee", related_name = '+', blank = True, null = True ) <NEW_LINE> date = models.DateField() <NEW_LINE> month_year = models.DateField(blank=True) <NEW_LINE> basic_percentage = models.FloatField(default = 35) <NEW_LINE> basic_amount=mo...
Salary details accepts allowance and deductions details and calculates gross earnings, gross deeductions and net salary
62598ee6627d3e7fe0e0551b
class ExpressionParser_Basic(object): <NEW_LINE> <INDENT> def assign(self,name,value): <NEW_LINE> <INDENT> self.name_bindings[name]=value <NEW_LINE> <DEDENT> def getNameBinding(self,name): <NEW_LINE> <INDENT> a = self.name_bindings[name] <NEW_LINE> return a <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def isOperator(ch...
Scheme interpeter ideally in form of post fix operation not prefix
62598ee6ac7a0e7691f70ba9
class POSTag(): <NEW_LINE> <INDENT> def __init__(self, language: str): <NEW_LINE> <INDENT> self.language = language <NEW_LINE> self.available_taggers = self._setup_language_variables(self.language) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _setup_language_variables(lang: str): <NEW_LINE> <INDENT> assert lang in ...
Tag words' parts-of-speech.
62598ee6aad79263cf42ce9d
class Requires(object): <NEW_LINE> <INDENT> HANDLER_ID = constants.HANDLER_REQUIRES <NEW_LINE> def __init__( self, field, specification, aggregate=False, optional=False, spec_filter=None, immediate_rebind=False, ): <NEW_LINE> <INDENT> if not field: <NEW_LINE> <INDENT> raise ValueError("Empty field name.") <NEW_LINE> <D...
The ``@Requires`` decorator defines the requirement of a service. :Handler ID: :py:const:`pelix.ipopo.constants.HANDLER_REQUIRES` :Example: .. code-block:: python @ComponentFactory() @Requires('_hello', 'hello.world') class Foo(object): pass @ComponentFactory() @Requires('_hello', 'hell...
62598ee601c39578d7f1143c
class Ondragend(HtmlTagAttribute): <NEW_LINE> <INDENT> pass
Script to be run at the end of a drag operation
62598ee630dc7b766599df1b
class RunData: <NEW_LINE> <INDENT> def __init__(self, fileName): <NEW_LINE> <INDENT> fileName = os.path.join(DATA_FOLDER, FILE_NAME_FORMAT.format(fileName)) <NEW_LINE> with open(fileName, 'rb') as file: <NEW_LINE> <INDENT> self.raw = pickle.load(file) <NEW_LINE> <DEDENT> self.parseData() <NEW_LINE> <DEDENT> def parseDa...
Used to load data from CompliantSnake.py
62598ee6e64d504609df8708
class IEmbedScreenSettings(Interface): <NEW_LINE> <INDENT> lifetime_days = Int(title=u"Cookie lifetime, in days", required=True, default=10) <NEW_LINE> cookie_domain = TextLine( title=u"Cookie domain", description=u"User preferences will be saved in a cookie for this " u"domain", default=u".eea.europa.eu" )
Generic settings for the embed screen Used for configuration form in control panel
62598ee64e4d562566370aac
class MapTests(TestCase): <NEW_LINE> <INDENT> def test_rendering(self): <NEW_LINE> <INDENT> group = MarkerGroup.objects.create(title="Group 1", marker_image='') <NEW_LINE> marker = Marker.objects.create(title="Marker 1", group=group, location=Geoposition(52, 6)) <NEW_LINE> item = create_content_item(MapItem, pk=1, titl...
Testing private notes
62598ee62ae34c7f260a977b
class RoboMasterEnv(gym.Env): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.end_pos = config["corridor_length"] <NEW_LINE> self.cur_pos = 0 <NEW_LINE> self.action_space = Discrete(2) <NEW_LINE> self.observation_space = Box( 0.0, self.end_pos, shape=(1, ), dtype=np.float32) <NEW_LINE> <DEDENT>...
Example of a custom env in which you have to walk down a corridor. You can configure the length of the corridor via the env config.
62598ee667a9b606de544662
class GroupAccess(Access): <NEW_LINE> <INDENT> entity_name = 'group' <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def authorize(cls, group, perm, resource=None, save=True, skip_implicit=False, attempt_model=DummyAttempt, **kwargs): <NEW_LINE> <INDENT> group_id, ...
Group access class. To be inherited.
62598ee660cbc95b063629d1
class Coin(IntervalModule): <NEW_LINE> <INDENT> settings = ( ("format", "format string used for output."), ("coin", "cryptocurrency to fetch"), ("decimal", "round coin price down to this decimal place"), ("currency", "fiat currency to show fiscal data"), ("symbol", "coin symbol"), ("interval", "update interval in secon...
Fetches live data of all cryptocurrencies availible at coinmarketcap <https://coinmarketcap.com/>. Coin setting should be equal to the 'id' field of your coin in <https://api.coinmarketcap.com/v1/ticker/>. Example coin settings: bitcoin, bitcoin-cash, ethereum, litecoin, dash, lisk. Example currency settings: usd, eur...
62598ee699cbb53fe682f545
class NumpyHasher(Hasher): <NEW_LINE> <INDENT> def __init__(self, hash_name='md5', coerce_mmap=False): <NEW_LINE> <INDENT> self.coerce_mmap = coerce_mmap <NEW_LINE> Hasher.__init__(self, hash_name=hash_name) <NEW_LINE> import numpy as np <NEW_LINE> self.np = np <NEW_LINE> if hasattr(np, 'getbuffer'): <NEW_LINE> <INDENT...
Special case the hasher for when numpy is loaded.
62598ee6eab8aa0e5d30a40d
class ComMemberType(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(self,*args): ...
Describes the type of a COM member. enum ComMemberType,values: Method (0),PropGet (1),PropSet (2)
62598ee655399d3f05624bc6
class LedfxrmBinarySwitch(LedfxrmEntity, SwitchEntity): <NEW_LINE> <INDENT> async def async_turn_on(self, **kwargs): <NEW_LINE> <INDENT> await self.coordinator.api.async_change_something(True) <NEW_LINE> await self.coordinator.async_request_refresh() <NEW_LINE> <DEDENT> async def async_turn_off(self, **kwargs): <NEW_LI...
ledfxrm switch class.
62598ee6dd821e528d6d75d9
class PyKeyboardMeta(object): <NEW_LINE> <INDENT> def press_key(self, character=''): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def release_key(self, character=''): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def tap_key(self, character='', n=1, interval=0): <NEW_LINE> <INDE...
The base class for PyKeyboard. Represents basic operational model.
62598ee6e5267d203ee69f9a
class CocoConfig(Config): <NEW_LINE> <INDENT> NAME = "coco" <NEW_LINE> IMAGES_PER_GPU = 2 <NEW_LINE> NUM_CLASSES = 1 + 2
Configuration for training on MS COCO. Derives from the base Config class and overrides values specific to the COCO dataset.
62598ee63539df3088eca946
class SSHClient(paramiko.SSHClient): <NEW_LINE> <INDENT> def exec_command(self, command, bufsize=-1, timeout=None): <NEW_LINE> <INDENT> chan = self._transport.open_session() <NEW_LINE> chan.settimeout(timeout) <NEW_LINE> chan.exec_command(command) <NEW_LINE> stdout = chan.makefile('rb', bufsize) <NEW_LINE> stderr = cha...
Override exec_command to add a timeout.
62598ee62c8b7c6e89bd1e55
class TestClearXlsxRowResponse(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 testClearXlsxRowResponse(self): <NEW_LINE> <INDENT> pass
ClearXlsxRowResponse unit test stubs
62598ee6d486a94d0ba2a661
class Maze(): <NEW_LINE> <INDENT> FLOOR = ' ' <NEW_LINE> WALL = 'X' <NEW_LINE> AGENT = '*' <NEW_LINE> NORTH = 'N' <NEW_LINE> SOUTH = 'S' <NEW_LINE> EAST = 'E' <NEW_LINE> WEST = 'W' <NEW_LINE> CARDINALS = [NORTH, SOUTH, EAST, WEST] <NEW_LINE> def __init__(self, grid, location): <NEW_LINE> <INDENT> self.grid = grid <NEW_...
A pathfinding problem.
62598ee6009cb60464cffbe4
class ProjectDirectory: <NEW_LINE> <INDENT> def __init__(self, title, number, directory): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.number = number <NEW_LINE> self._directory = directory <NEW_LINE> self.samples = [] <NEW_LINE> <DEDENT> def set_date(self, date): <NEW_LINE> <INDENT> generate_project_layer( s...
Root class for project model
62598ee63539df3088eca947
class PythonPlugin(core.SerializableObject): <NEW_LINE> <INDENT> _serializable_label = "PythonPlugin.1" <NEW_LINE> def __init__( self, name=None, execution_scope=None, filepath=None, ): <NEW_LINE> <INDENT> core.SerializableObject.__init__(self) <NEW_LINE> self.name = name <NEW_LINE> self.execution_scope = execution_sco...
A class of plugin that is encoded in a python module, exposed via a manifest.
62598ee6435de62698e9a46b
class CreatePortAclConfigRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.AclConfig = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.InstanceId = params.get("InstanceId") <NEW_LINE> if params.get("AclConfig") is...
CreatePortAclConfig请求参数结构体
62598ee630dc7b766599df1d
class SqlSensor(BaseSensorOperator): <NEW_LINE> <INDENT> template_fields = ('sql',) <NEW_LINE> template_ext = ('.hql', '.sql',) <NEW_LINE> @apply_defaults <NEW_LINE> def __init__(self, conn_id, sql, *args, **kwargs): <NEW_LINE> <INDENT> self.sql = sql <NEW_LINE> self.conn_id = conn_id <NEW_LINE> super(SqlSensor, self)....
Runs a sql statement until a criteria is met. It will keep trying until sql returns no row, or if the first cell in (0, '0', ''). :param conn_id: The connection to run the sensor against :type conn_id: string :param sql: The sql to run. To pass, it needs to return at least one cell that contains a non-zero / empty...
62598ee6a79ad161977686ae
class TaskCheckIntegrity(object): <NEW_LINE> <INDENT> def __init__(self, tar_file, fid, kg_hash): <NEW_LINE> <INDENT> self.tarf = tar_file <NEW_LINE> self.fid = fid <NEW_LINE> self.hash_good = kg_hash <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> hasher = hashlib.sha256() <NEW_LINE> with tarfile.open(self...
A task, to be completed by ChildProcess, which contains the information and operations needed to check the integrity of a file in the archive against it's known-good composition, based on the MD5 hash.
62598ee67d847024c075aa63
class SymValueWrapper(object): <NEW_LINE> <INDENT> def __init__(self, symbol, value): <NEW_LINE> <INDENT> self.sym = symbol <NEW_LINE> self.val = value <NEW_LINE> <DEDENT> def value(self): <NEW_LINE> <INDENT> return self.val <NEW_LINE> <DEDENT> def symbol(self): <NEW_LINE> <INDENT> return self.sym
A container class conforming to the Symbol/Value interface which holds frame locals or frame arguments.
62598ee6dd821e528d6d75da
class Parameters(CaselessDict): <NEW_LINE> <INDENT> def params(self): <NEW_LINE> <INDENT> return self.keys() <NEW_LINE> <DEDENT> def to_ical(self, sorted=True): <NEW_LINE> <INDENT> result = [] <NEW_LINE> items = list(self.items()) <NEW_LINE> if sorted: <NEW_LINE> <INDENT> items.sort() <NEW_LINE> <DEDENT> for key, value...
Parser and generator of Property parameter strings. It knows nothing of datatypes. Its main concern is textual structure.
62598ee6b7558d5895461cda
class Error(Exception): <NEW_LINE> <INDENT> pass
Basic excetion type for be extended for specific module exceptions.
62598ee64428ac0f6e656be7
class RowFormat(object): <NEW_LINE> <INDENT> def __init__(self, prefix=None): <NEW_LINE> <INDENT> self.columns = [] <NEW_LINE> self.prefix = prefix or "" <NEW_LINE> <DEDENT> def addColumn(self, *args, **kwargs): <NEW_LINE> <INDENT> self.append(ColumnFormat(*args, **kwargs)) <NEW_LINE> <DEDENT> def append(self, column, ...
Describes an ordered collection of ColumnFormats for dispay data from rows, such that calling rowFmt.format(rowData) will return the result of formatting each column against rowData. Member Functions append(col, [after]) Adds a ColumnFormatter to the end of the row If 'after' is specified, tries...
62598ee6462c4b4f79dba090
class ScaleTransformProperty(TransformProperty): <NEW_LINE> <INDENT> deserialized_types = { 'scale': 'float', 'scale_x': 'float', 'scale_y': 'float' } <NEW_LINE> attribute_map = { 'scale': 'scale', 'scale_x': 'scaleX', 'scale_y': 'scaleY' } <NEW_LINE> def __init__(self, scale=1.0, scale_x=1.0, scale_y=1.0): <NEW_LINE> ...
:param scale: Uniform scaling in both X and Y. :type scale: float :param scale_x: Scaling in the X direction (overrides “scale” if in same group). :type scale_x: float :param scale_y: Scaling in the Y direction (overrides “scale” if in same group). :type scale_y: float
62598ee6d268445f26638ed9
class SetField(RelatedField): <NEW_LINE> <INDENT> is_m2m = True <NEW_LINE> help_text = 'Many related resources. Can be either a list of URIs or list of individually nested resource data.' <NEW_LINE> def __init__(self, to, attribute, related_name=None, default=NOT_PROVIDED, null=False, blank=False, readonly=False, full=...
Provides access to related data via a join table (Pony ORM) This subclass requires Pony ORM layer to work properly.
62598ee68da39b475be01840
class ValueRef(object): <NEW_LINE> <INDENT> def __init__(self, name, ns=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.namespace = ns
变量名引用
62598ee6fff4ab517ebcbe6e
class FeedApp(BaseFeedImage, ModelBase): <NEW_LINE> <INDENT> app = models.ForeignKey(Webapp) <NEW_LINE> description = PurifiedField() <NEW_LINE> slug = models.CharField(max_length=30, unique=True) <NEW_LINE> background_color = ColorField(null=True) <NEW_LINE> type = models.CharField(choices=FEEDAPP_TYPE_CHOICES, max_le...
Model for "Custom Featured Apps", a feed item highlighting a single app and some additional metadata (e.g. a review or a screenshot).
62598ee6f9cc0f698b1c4619
class TestOperatorPreAssign(AttrCalcTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> AttrCalcTestCase.setUp(self) <NEW_LINE> self.tgtAttr = self.ch.attribute(attributeId=1) <NEW_LINE> srcAttr = self.ch.attribute(attributeId=2) <NEW_LINE> modifier = Modifier() <NEW_LINE> modifier.state = State.offline...
Test pre-assignment operator
62598ee6379a373c97d9768a
class NetworkManager(metaclass=Singleton): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__networks = [] <NEW_LINE> <DEDENT> def get_networks(self): <NEW_LINE> <INDENT> return self.__networks <NEW_LINE> <DEDENT> def set_networks(self, net): <NEW_LINE> <INDENT> self.__networks=net <NEW_LINE> <DEDENT> ...
List<Network> networks
62598ee6a8370b77170eea79
class StreamSocket(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if not hasattr(self, "_sock"): <NEW_LINE> <INDENT> self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> <DEDENT> self.write_queue = [] <NEW_LINE> self.packet_queue = [] <NEW_LINE> self.buffer = "" <NEW_LINE> <DE...
Base class for conversational protocols If you don't want a socket allocated (ie, you already have one) set it to ._sock before calling __init__
62598ee68a43f66fc4bf0808
class UpdateDeviceToken(UpdateAPIView): <NEW_LINE> <INDENT> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> serializer_class = ProfileDeviceTokenSerializer <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return Profile.objects.get(user=self.request.user)
An endpoint for setting the device token
62598ee632920d7e50bc46c3
class FailureRateRestartStrategyConfiguration(RestartStrategyConfiguration): <NEW_LINE> <INDENT> def __init__(self, max_failure_rate=None, failure_interval=None, delay_between_attempts_interval=None, j_restart_strategy=None): <NEW_LINE> <INDENT> if j_restart_strategy is None: <NEW_LINE> <INDENT> if not isinstance(failu...
Configuration representing a failure rate restart strategy.
62598ee64f88993c371ef831
class FirmwareType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> BIOS = "bios" <NEW_LINE> EFI = "efi"
Firmware type
62598ee60a50d4780f703a41
@registry.register_generic_modality <NEW_LINE> class ElmoModality(modality.Modality): <NEW_LINE> <INDENT> def _get_elmo(self, x): <NEW_LINE> <INDENT> ret = [] <NEW_LINE> return ret <NEW_LINE> <DEDENT> def bottom_simple(self, x, name, reuse): <NEW_LINE> <INDENT> with tf.variable_scope(name, reuse=reuse): <NEW_LINE> <IND...
SymbolModality for inputs with ELMo as embeddings.
62598ee6498bea3a75a561cc
class TempStage(object, visa.SerialInstrument): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> visa.SerialInstrument.__init__(self, *args, **kwargs) <NEW_LINE> self.term_chars = visa.CR <NEW_LINE> self.rate = 20 <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> return self <NEW_...
Base class for Linkam temperature stages.
62598ee69c8ee8231303f4a3
class CSVFileValidator(object): <NEW_LINE> <INDENT> implements(IValidator) <NEW_LINE> def __init__(self, name, title='CSV File', description='CSV valid file or text'): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.title = title or name <NEW_LINE> self.description = description <NEW_LINE> <DEDENT> def __call__(se...
Validator
62598ee697e22403b3839586
class TestXenonntNvetoGain(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 XenonntNvetoGa...
XenonntNvetoGain unit test stubs
62598ee676e4537e8c3edc4e
class Binomial(Distribution): <NEW_LINE> <INDENT> def __init__(self, prob=.5, size=20): <NEW_LINE> <INDENT> self.p = prob <NEW_LINE> self.n = size <NEW_LINE> self.calculate_mean() <NEW_LINE> self.calculate_stdev() <NEW_LINE> Distribution.__init__(self, self.calculate_mean, self.calculate_stdev) <NEW_LINE> <DEDENT> def ...
Binomial distribution class for calculating and visualizing a Binomial distribution. Attributes: mean (float) representing the mean value of the distribution stdev (float) representing the standard deviation of the distribution data_list (list of floats) a list of floats to be extracted from the data file...
62598ee6cad5886f8bdc3997
class MixedOp(nn.Module): <NEW_LINE> <INDENT> def __init__(self, C, stride, primitives): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._ops = nn.ModuleList() <NEW_LINE> for primitive in primitives: <NEW_LINE> <INDENT> op = OPS[primitive](C, stride, affine=False) <NEW_LINE> self._ops.append(op) <NEW_LINE> <DEDE...
Mixed operation
62598ee6090684286d592a2b
class PoolingLayer(object): <NEW_LINE> <INDENT> def __init__(self, poolingFactor): <NEW_LINE> <INDENT> self.poolingFactor = poolingFactor <NEW_LINE> <DEDENT> def _setUp(self, input, inputDimensions): <NEW_LINE> <INDENT> self.inputDimensions = inputDimensions <NEW_LINE> self.output = downsample.max_pool_2d(input, self.p...
Input is again a 4D tensor just like in ConvolutionalLayer Note that if you combine the pooling and the convolutional operation then you can save a bit of time by not applying the activation function before the subsampling. You can still try and do that as an optimization even if you have 2 layers separated. poolingF...
62598ee6e5267d203ee69f9c
@unittest.skipIf(not HAS_SKLEARN, 'Missing scikit-learn. Skipping tests.') <NEW_LINE> class PipeLineRenameTests(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(self): <NEW_LINE> <INDENT> if not(HAS_SKLEARN): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> scikit_data = load_boston() <NEW_L...
Unit test class for testing scikit-learn converter.
62598ee6cc0a2c111447969a
class Deck: <NEW_LINE> <INDENT> decklist = ['1','2','3','4','5','6','7','8','9'] <NEW_LINE> player1_choices = [] <NEW_LINE> player2_choices = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass
represents a board of game and player choices
62598ee626068e7796d4aff2
class ItemAdditionError(DriverError): <NEW_LINE> <INDENT> pass
Error while adding an item.
62598ee676e4537e8c3edc4f
class AbstractPlayer: <NEW_LINE> <INDENT> def __init__(self, player_name, symbol): <NEW_LINE> <INDENT> self.player_name = player_name <NEW_LINE> self.symbol = symbol <NEW_LINE> <DEDENT> def symbol(self): <NEW_LINE> <INDENT> return self.symbol
Abstract class for players
62598ee6ac7a0e7691f70bad
class SlowThrower(ThrowerAnt): <NEW_LINE> <INDENT> name = 'Slow' <NEW_LINE> armor = 1 <NEW_LINE> implemented = True <NEW_LINE> def throw_at(self, target): <NEW_LINE> <INDENT> if target: <NEW_LINE> <INDENT> apply_effect(make_slow, target, 3)
ThrowerAnt that causes Slow on Bees.
62598ee644b2445a339b5cb3
class DatabaseReinstallVMAPI(MaintennanceBaseApi): <NEW_LINE> <INDENT> model = DatabaseReinstallVM <NEW_LINE> serializer_class = DatabaseReinstallVMSerializer <NEW_LINE> filter_fields = ( 'status', 'can_do_retry', 'database', 'instance', )
Task API
62598ee6d7e4931a7ef3a735
class NullBody(LeoBody): <NEW_LINE> <INDENT> def __init__(self, frame, parentFrame): <NEW_LINE> <INDENT> LeoBody.__init__(self, frame, parentFrame) <NEW_LINE> self.insertPoint = 0 <NEW_LINE> self.selection = 0, 0 <NEW_LINE> self.s = "" <NEW_LINE> self.widget = None <NEW_LINE> self.wrapper = wrapper = StringTextWrapper(...
A do-nothing body class.
62598ee6e1aae11d1e7cdb8a
class BaseHandler(RequestHandler): <NEW_LINE> <INDENT> def data_received(self, chunk: bytes) -> Optional[Awaitable[None]]: <NEW_LINE> <INDENT> return super(BaseHandler, self).data_received(chunk) <NEW_LINE> <DEDENT> @property <NEW_LINE> def terminal_manager(self): <NEW_LINE> <INDENT> return self.settings['terminal_mana...
Request handler where requests and responses speak JSON.
62598ee645492302aabfab43