code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Bot: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.conversation = {} <NEW_LINE> self.conversation["incompréhension"] = [ "Ton jargon m'est inconnu, tu peux reformuler ?" ] <NEW_LINE> self.conversation["introduce_wiki"] = ["Hmm... Je me rappel de ceci."] <NEW_LINE> <DEDENT> def is_it_a_place(sel...
Contain methods to bot response.
62598f9a07f4c71912baf1b9
class TextResultsReport(ResultsReport): <NEW_LINE> <INDENT> H1_STR = '===========================================' <NEW_LINE> H2_STR = '-------------------------------------------' <NEW_LINE> def __init__(self, results, email=False, experiment=None): <NEW_LINE> <INDENT> super(TextResultsReport, self).__init__(results) ...
Class to generate text result report.
62598f9ad268445f26639a3b
class SimpleTextFilter(BaseFilter): <NEW_LINE> <INDENT> def __init__(self, text): <NEW_LINE> <INDENT> BaseFilter.__init__(self, text) <NEW_LINE> self.re = SimpleTextFilter.compile(text) <NEW_LINE> <DEDENT> _splitter = re.compile(r'\s*(\|)\s*|[,\s]+()', re.U) <NEW_LINE> _escaper = re.compile(r'(\\\Z|[^\w\\])', re.U) <NE...
Task list filter allowing only tasks whose string matches a filter string. This filter allows for basic and/or/not conditions in the filter string. For the syntax see SimpleTextFilter.isMatch. User documentation: This filter can handle basic and/or/not conditions. The syntax is as follows: :AND : ',' or whitesp...
62598f9a379a373c97d98d82
class trunc(MathFunction): <NEW_LINE> <INDENT> pass
Truncate the value.
62598f9a32920d7e50bc5dc5
class CreateActivity(graphene.Mutation): <NEW_LINE> <INDENT> class Arguments: <NEW_LINE> <INDENT> name = graphene.String(required=True) <NEW_LINE> emoticon = Upload(required=False) <NEW_LINE> <DEDENT> activity = graphene.Field(PostActivityType) <NEW_LINE> @superuser_required <NEW_LINE> def mutate(self, info, name, emot...
Creates Activity for the Post Interface, can only be accessed by superuser
62598f9a498bea3a75a5788e
class RepositoryFileNotFoundError(RepositoryError): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return _("No file could be found for the specified " "hash name: '{0}'.").format(self.data)
Used to indicate that the hash name provided for the requested file does not exist.
62598f9acb5e8a47e493c02b
class AbstractStorage (metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def insert(self,cell:int)->Callable[[Any],int]: <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def lookup(self,cell:int,wait:bool)->Callable[[],Any]: <NEW_LINE> <INDENT> ...
An instance of this class stores cached values on a persistent support.
62598f9ad58c6744b42dc188
class GroupPauseTestCase(RestAPITestMixin, TestCase): <NEW_LINE> <INDENT> endpoint = "/v1.0/11111/groups/one/pause/" <NEW_LINE> invalid_methods = ("DELETE", "GET", "PUT") <NEW_LINE> def test_pause(self): <NEW_LINE> <INDENT> mock_pause = patch( self, 'otter.rest.groups.controller.pause_scaling_group', return_value=defer...
Tests for ``/{tenantId}/groups/{groupId}/pause/`` endpoint
62598f9a097d151d1a2c0d93
class CourseView(ViewSetMixin, APIView): <NEW_LINE> <INDENT> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> res = {"code": 1000, "data": None, "error": ""} <NEW_LINE> try: <NEW_LINE> <INDENT> course = models.Course.objects.all() <NEW_LINE> ser = CourseListSerializer(instance=course, many=True) <NEW_LINE>...
课程
62598f9acc0a2c111447ad7b
class VeteranKill(ExistenceCondition): <NEW_LINE> <INDENT> def __init__(self, amnesiacRemembered: FrozenSet[Role] = None): <NEW_LINE> <INDENT> super().__init__(frozenset({Role.VETERAN}), amnesiacRemembered)
The Veteran Kill condition is used if some player was killed by a Veteran.
62598f9a8e71fb1e983bb824
class Triple(tuple): <NEW_LINE> <INDENT> def __new__(cls, *args): <NEW_LINE> <INDENT> if len(args) == 3: <NEW_LINE> <INDENT> s, p, o = tuple(args) <NEW_LINE> <DEDENT> elif len(args) == 1: <NEW_LINE> <INDENT> s, p, o = tuple(args[0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise KPError("Not a triple") <NEW_LINE> ...
Class to represent a triple
62598f9ae64d504609df926f
class CBarometerWidget(wplt.CChartModelWidget): <NEW_LINE> <INDENT> C_SGN_DATA_BAR = QtCore.pyqtSignal(list) <NEW_LINE> def __init__(self, f_sensor_feed, f_parent=None): <NEW_LINE> <INDENT> assert f_sensor_feed <NEW_LINE> super(CBarometerWidget, self).__init__(f_sensor_feed, f_parent) <NEW_LINE> self.__sensor_feed = f_...
widget for barometer
62598f9a442bda511e95c1d5
class PostcodeMalformedError(PostcodeError): <NEW_LINE> <INDENT> pass
The postcode is not valid.
62598f9a8c0ade5d55dc3546
class Solution: <NEW_LINE> <INDENT> def singleNonDuplicate(self, nums): <NEW_LINE> <INDENT> n = len(nums) <NEW_LINE> l = 0 <NEW_LINE> r = n - 1 <NEW_LINE> while l < r: <NEW_LINE> <INDENT> mid = l + (r - l) // 2 <NEW_LINE> if mid % 2 == 1: <NEW_LINE> <INDENT> mid -= 1 <NEW_LINE> <DEDENT> if nums[mid] != nums[mid + 1]: <...
@param nums: a list of integers @return: return a integer
62598f9ad6c5a102081e1eb3
class WindowUpdateLocker: <NEW_LINE> <INDENT> def __init__(self, window): <NEW_LINE> <INDENT> self.window = window <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> if self.window is not None: <NEW_LINE> <INDENT> self.window.Freeze() <NEW_LINE> <DEDENT> return self.window <NEW_LINE> <DEDENT> def __exit__(sel...
Python translation of wxWindowUpdateLocker. Usage: with WindowUpdateLocker(window): do this, do that... thawn again
62598f9a60cbc95b063640b9
class UTF8CSVRecoder: <NEW_LINE> <INDENT> def __init__(self, f, encoding): <NEW_LINE> <INDENT> self.reader = codecs.getreader(encoding)(f) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> return self.reader.next().encode("utf-8")
Iterator that reads an encoded stream and reencodes the input to UTF-8
62598f9a925a0f43d25e7dab
class SyntaxDict(dict): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.mnemonics = [] <NEW_LINE> self.conditions = [] <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> if isinstance(value, case_table): <NEW_LINE> <INDENT> self.conditions.append(value) <NEW_LINE> <DEDENT> if is...
シンタックスを記述する辞書クラス 責務: 1: 宣言された順番に記述子を格納するリストを提供する 2: ビット列表記クラスに開始位置と変数名を与える 3: ifセクション解決用のリストを提供する
62598f9a7d847024c075c141
class PCDCPWriter(object): <NEW_LINE> <INDENT> def __init__(self, empty_value=PCDCPParser.NINES): <NEW_LINE> <INDENT> self.empty_value = empty_value <NEW_LINE> <DEDENT> def write(self, out, timeseries, channels): <NEW_LINE> <INDENT> stats = timeseries[0].stats <NEW_LINE> out.write(self._format_header(stats)) <NEW_LINE>...
PCDCP writer.
62598f9a1b99ca400228f3e4
class AbstractManager(object): <NEW_LINE> <INDENT> id = None <NEW_LINE> _instance_lock = InstanceLock() <NEW_LINE> _weakref_instance = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._lock = ThreadLock() <NEW_LINE> self.log_handler = NamedLoader.get_singleton("dNG.data.logging.LogHandler", False) <NEW_LINE...
"AbstractManager" defines abstract methods to implement a PVR manager. :author: direct Netware Group et al. :copyright: direct Netware Group - All rights reserved :package: mp :subpackage: pvr :since: v0.1.00 :license: https://www.direct-netware.de/redirect?licenses;gpl GNU General Public ...
62598f9a009cb60464d01293
class TestFlightViews(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.auth_user = baker.make('app.User', is_staff=True) <NEW_LINE> self.client.force_login(self.auth_user) <NEW_LINE> <DEDENT> def test_flight_list_view(self): <NEW_LINE> <INDENT> baker.make('Flight', _quantity=8) <NEW_LINE> res...
Test class for Flight views
62598f9a3539df3088ecc025
class ToTensor(object): <NEW_LINE> <INDENT> def __call__(self, sample): <NEW_LINE> <INDENT> for idx, i in enumerate(sample): <NEW_LINE> <INDENT> sample[idx] = transforms.functional.to_tensor(i) * 255. <NEW_LINE> <DEDENT> return sample
Convert image to tensor, and normalize the value to [0, 255]
62598f9a009cb60464d01294
class RRsamtools(RPackage): <NEW_LINE> <INDENT> homepage = "https://bioconductor.org/packages/Rsamtools/" <NEW_LINE> git = "https://git.bioconductor.org/packages/Rsamtools.git" <NEW_LINE> version('1.32.2', commit='2b3254ccdeb24dc6ad95a93c2eb527021631797e') <NEW_LINE> version('1.28.0', commit='dfa5b6abef68175586f21...
This package provides an interface to the 'samtools', 'bcftools', and 'tabix' utilities (see 'LICENCE') for manipulating SAM (Sequence Alignment / Map), FASTA, binary variant call (BCF) and compressed indexed tab-delimited (tabix) files.
62598f9a3617ad0b5ee05ebe
class JsonWriter(DarterReaderWriter): <NEW_LINE> <INDENT> def write(self, file, name, items): <NEW_LINE> <INDENT> self.logger.debug("Writer '%s' in file '%s'" % (name, file)) <NEW_LINE> data = { 'totals': len(items), name: items } <NEW_LINE> with open("%s/%s.json" % (self.datafiles, file), 'w') as file: <NEW_LINE> <IND...
JsonWrite is to create json structs files
62598f9a15baa72349461cf2
class LinearBaseEstimator(BaseEstimator): <NEW_LINE> <INDENT> def __init__(self, bias_multiplier=1., optimize=False, **kwargs): <NEW_LINE> <INDENT> self.bias_multiplier = bias_multiplier <NEW_LINE> self.optimize = optimize <NEW_LINE> self.grid_parameters = kwargs <NEW_LINE> self.coef_ = None <NEW_LINE> self.intercept_ ...
Base class for all linear estimators
62598f9abaa26c4b54d4f021
class Genre(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255)
A music genre name.
62598f9a627d3e7fe0e06c1a
class BlackCartridgesAutocomplete(autocomplete.Select2QuerySetView): <NEW_LINE> <INDENT> queryset = Cartridge.objects.get_black_cartridges() <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = self.queryset.filter( Q(black_cartridge=None) & ~Q(status="onrefill") & Q(serialNumber__icontains=self.q) ) <NEW_...
API-представление, возращающее черные картриджи по запросу.
62598f9a01c39578d7f12aed
class AuthenticatedUser(User): <NEW_LINE> <INDENT> class_name = 'AuthenticatedUser' <NEW_LINE> def _update_attributes(self, user): <NEW_LINE> <INDENT> super(AuthenticatedUser, self)._update_attributes(user) <NEW_LINE> self.disk_usage = user['disk_usage'] <NEW_LINE> self.owned_private_repos = user['owned_private_repos']...
Object to represent the currently authenticated user. This is returned by :meth:`~github3.github.GitHub.me`. It contains the extra informtation that is not returned for other users such as the currently authenticated user's plan and private email information. .. versionadded:: 1.0.0 .. versionchanged:: 1.0.0 Th...
62598f9aa05bb46b3848a5ef
@register_node <NEW_LINE> class ExternOp(Operation): <NEW_LINE> <INDENT> pass
External operation.
62598f9a44b2445a339b6824
class WhenCanIExpectToGetMyMedicine2(Template): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sequence = [lx.When(), lx.Modals(), lx.PossessedNouns(), lx.Expect(), lx.To(), lx.ReceiveGet(), lx.PossessivesThird(), ex.ProductsExpander(), ex.OptionalObliquesThird()]
When can my son expect to get his medicine in the mail
62598f9a8e71fb1e983bb825
class Daemon(object): <NEW_LINE> <INDENT> __whitelisted = set(['getinfo', 'getblockcount', 'getblockhash', 'getblock', 'gettransaction']) <NEW_LINE> def __init__(self, url, whitelist=set(), auto_connect=True): <NEW_LINE> <INDENT> self.__url = url <NEW_LINE> self.__whitelisted = self.__whitelisted.union(whitelist) <NEW_...
Just a simple wrapper for bitcoinrpc.authproxy.AuthServicesProxy. Calls `whitelist`ed daemon commands to provide some protection Reconnects on JSON RPC error.
62598f9a9b70327d1c57eb11
class OWLPropertyExpression(OWLObject): <NEW_LINE> <INDENT> pass
TODO: implement
62598f9aeab8aa0e5d30baf4
class TestFunctions(DRYTest): <NEW_LINE> <INDENT> def test_load_file(self): <NEW_LINE> <INDENT> with open("testfile.txt", 'w') as f: <NEW_LINE> <INDENT> f.write("42") <NEW_LINE> <DEDENT> def load_file(filename): <NEW_LINE> <INDENT> with open(filename) as f2: <NEW_LINE> <INDENT> return f2.read() <NEW_LINE> <DEDENT> <DED...
Functions for expressions to play with
62598f9abaa26c4b54d4f022
class RunEnd(object): <NEW_LINE> <INDENT> def __init__(self, subblock): <NEW_LINE> <INDENT> self.id = subblock[0] <NEW_LINE> self.run_number = subblock[1] <NEW_LINE> self.n_events_processed = subblock[2] <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s((%r, %r, %r))' % (self.__class__.__name__, se...
The run end sub-block As specified in the CORSIKA user manual, Table 14.
62598f9a379a373c97d98d84
class IVote(Interface): <NEW_LINE> <INDENT> id = Int( title=_('The unique ID'), required=True, readonly=True) <NEW_LINE> person = Int( title=_('The Person that voted.'), required=False, readonly=True) <NEW_LINE> poll = Int( title=_('The Poll in which the person voted.'), required=True, readonly=True) <NEW_LINE> option ...
Here we store the vote itself, linked to a special token. This token is given to the user when he votes, so he can change his vote later.
62598f9a097d151d1a2c0d95
class AcrobotLegacy(Acrobot): <NEW_LINE> <INDENT> book_or_nips = "nips" <NEW_LINE> def step(self, s, a): <NEW_LINE> <INDENT> torque = self.AVAIL_TORQUE[a] <NEW_LINE> if self.torque_noise_max > 0: <NEW_LINE> <INDENT> torque += random.uniform(-self.torque_noise_max, self.torque_noise_max) <NEW_LINE> <DEDENT> s_augmented ...
Legacy version of the Acrobot domain which uses Euler integration for updating the state instead of the more precise Runge-Kutta 4 method. This approach is consistent with the experiments in
62598f9ad7e4931a7ef3be09
class Hit(): <NEW_LINE> <INDENT> def __init__(self, root, normal, thing): <NEW_LINE> <INDENT> self.root = root <NEW_LINE> self.normal = normal <NEW_LINE> self.thing = thing
Cada impacto se almacena como una instancia de Hit. Los datos a guardar son: root El valor de 't' (distancia del origen del rayo) normal La normal en el punto de impacto thing Referencia al elemento en el cual se impactó
62598f9a94891a1f408b95a9
class DescribeSecurityGroupAssociationStatisticsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.SecurityGroupIds = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.SecurityGroupIds = params.get("SecurityGroupIds")
DescribeSecurityGroupAssociationStatistics请求参数结构体
62598f9a99cbb53fe6830c43
class AirportDatabase(object): <NEW_LINE> <INDENT> def __init__(self, airports=None): <NEW_LINE> <INDENT> self._airports = airports or [] <NEW_LINE> self._mapping = {} <NEW_LINE> for airport in self._airports: <NEW_LINE> <INDENT> if airport.code in self._mapping: <NEW_LINE> <INDENT> raise ValueError("Multiple airports ...
Database for available airports
62598f9a6fb2d068a7693cec
class GenerateDummyExplorationsTest(test_utils.GenericTestBase): <NEW_LINE> <INDENT> def test_generate_count_greater_than_publish_count(self): <NEW_LINE> <INDENT> self.signup(self.ADMIN_EMAIL, self.ADMIN_USERNAME) <NEW_LINE> self.login(self.ADMIN_EMAIL, is_super_admin=True) <NEW_LINE> response = self.testapp.get('/admi...
Test the conditions for generation of dummy explorations.
62598f9a498bea3a75a57891
class SpeechCommand(object): <NEW_LINE> <INDENT> pass
The base class for objects that can be inserted between strings of text to perform actions, change voice parameters, etc. Note: Some of these commands are processed by NVDA and are not directly passed to synth drivers. synth drivers will only receive commands derived from L{SynthCommand}.
62598f9a4428ac0f6e65829c
class MOG2BackgroundSubtractor(BackgroundSubtractor): <NEW_LINE> <INDENT> def __init__( self, history=500, threshold=16.0, learning_rate=-1, detect_shadows=False): <NEW_LINE> <INDENT> self.history = history <NEW_LINE> self.threshold = threshold <NEW_LINE> self.learning_rate = learning_rate <NEW_LINE> self.detect_shadow...
Performs background subtraction on a video using Gaussian mixture-based foreground-background segmentation. This class is a wrapper around the OpenCV `BackgroundSubtractorMOG2` class. This model is only supported when using OpenCV 3.
62598f9a3cc13d1c6d4654dd
class QueueUsingList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__list = List() <NEW_LINE> self.__length = 0 <NEW_LINE> <DEDENT> def enqueue(self, item): <NEW_LINE> <INDENT> self.__list.insert(item) <NEW_LINE> self.__length += 1 <NEW_LINE> <DEDENT> def dequeue(self): <NEW_LINE> <INDENT> x = self....
使用链表构造的队列
62598f9aac7a0e7691f7227d
class BaseTestOutput: <NEW_LINE> <INDENT> @pytest.mark.parametrize( 'output_format', [ of for of in BUILTIN_OUTPUT_FORMATS ] ) <NEW_LINE> def test_output_format(self, output_format, setup): <NEW_LINE> <INDENT> tup = BUILTIN_OUTPUT_FORMATS[output_format] <NEW_LINE> mod, cls, name = tup <NEW_LINE> outputclass = getattr(i...
This base class is inherited by all output test modules. pytest will not run the test here because the class name does not start with "test". Child classes must implement a setup fixture, marked as @pytest.fixture.
62598f9a009cb60464d01296
class ExtractionConfiguration: <NEW_LINE> <INDENT> def __init__( self, configuration_file_path: str, ) -> None: <NEW_LINE> <INDENT> self._yaml_configuration: Any = ( self._read_yaml(configuration_file_path) ) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _read_yaml( yaml_file: str ) -> Any: <NEW_LINE> <INDENT> with ...
Class to load and return the configuration of a playlist extraction.
62598f9a4527f215b58e9c55
class LocationsValidator(_BaseValidator): <NEW_LINE> <INDENT> err_invalid_coordinates = "invalid_coords" <NEW_LINE> arg_color = 'color' <NEW_LINE> def __init__(self, image, enabled=True, position=None, default_valid=False): <NEW_LINE> <INDENT> super(LocationsValidator, self).__init__(enabled=enabled) <NEW_LINE> self._l...
This validator gets an image, and validates that the mouse/finger would be placed only on pixels of certain color(s). You can define either the valid colors or the invalid colors.
62598f9a67a9b606de545d46
class AlwaysProbingPolicy( PolicyBase ): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _evaluate( commandResult ): <NEW_LINE> <INDENT> policyResult = { 'Status' : 'Probing', 'Reason' : 'AlwaysProbing' } <NEW_LINE> return S_OK( policyResult )
The AlwaysProbingPolicy is a dummy module that can be used as example, it always returns Probing status.
62598f9a7047854f4633f153
class UserFavSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user = serializers.HiddenField(default=serializers.CurrentUserDefault()) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = UserFav <NEW_LINE> fields = ('user', 'goods', 'id') <NEW_LINE> validators = [ UniqueTogetherValidator( queryset=UserFav.ob...
用户收藏操作
62598f9a627d3e7fe0e06c1c
class Empty(Entity): <NEW_LINE> <INDENT> def __init__(self, cord): <NEW_LINE> <INDENT> super().__init__(cord) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "⊡"
A class that represents empty squares on a chess board.
62598f9a435de62698e9bb66
class Counts(Projection): <NEW_LINE> <INDENT> ATTRIBUTE = 'vrts' <NEW_LINE> def __iter__(self): <NEW_LINE> <INDENT> attrib_stream = Attribute(self.incoming, self.ATTRIBUTE) <NEW_LINE> return iter(Values(attrib_stream, s=True))
Base class for queries which get the size of array attributes. This uses the same bulk attribute queires as Valuess() so it is much faster that running multiple pokyEvaluates() or similar calls
62598f9a10dbd63aa1c70927
class TenPercentDiscountPriceHandler(PricingHandler): <NEW_LINE> <INDENT> def _discount(self, price): <NEW_LINE> <INDENT> return Price(currency=price.currency, net=price.net*decimal.Decimal('0.9'), gross=price.gross*decimal.Decimal('0.9')) <NEW_LINE> <DEDENT> def get_variant_price(self, *args, **kwargs): <NEW_LINE> <IN...
Discount all handler
62598f9aa79ad16197769dd5
class Agent(): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.seed = random.seed(seed) <NEW_LINE> self.qnetwork_local = QNetwork(state_size, action_size, seed).to(device) <NEW_LINE> self.qn...
Interacts with and learns from the environment.
62598f9a76e4537e8c3ef327
class DS1_185: <NEW_LINE> <INDENT> play = Hit(TARGET, 2)
Arcane Shot
62598f9a56b00c62f0fb2622
class LineSplitter: <NEW_LINE> <INDENT> def __init__ (self, resultHandler): <NEW_LINE> <INDENT> self.buf = b"" <NEW_LINE> self.cancelled = False <NEW_LINE> self.resultHandler = resultHandler <NEW_LINE> <DEDENT> def cancel (self): <NEW_LINE> <INDENT> self.cancelled = True <NEW_LINE> <DEDENT> def parseFragment (self, tex...
Split incoming text into lines which are passed to the resultHandler object
62598f9a07f4c71912baf1bc
class Variant(Subtyped, Item): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<Variant #%r>' % (self.id,)
Django binding for a single product or variant
62598f9a07f4c71912baf1bd
class TxFrame_1519Plus(Packet): <NEW_LINE> <INDENT> name = "TxFrame_1519_Plus" <NEW_LINE> fields_desc = [ByteEnumField("branch", 0xD7, OamBranchEnum), XShortField("leaf", 0x0211), ]
Variable Descriptor: TxFrame_1024_1518
62598f9a32920d7e50bc5dc8
class BoardError(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super().__init__(message)
Base class for board specific errors
62598f9a090684286d593592
class Workbooks(resource.Resource): <NEW_LINE> <INDENT> workbooks = [Workbook]
A collection of Workbooks.
62598f9a379a373c97d98d87
@dataclass(frozen=True) <NEW_LINE> class SightWordDatum: <NEW_LINE> <INDENT> grade: int <NEW_LINE> log: List[Event] <NEW_LINE> @property <NEW_LINE> def successes(self) -> float: <NEW_LINE> <INDENT> return sum(event.success for event in self.log[-EVENT_WINDOW:]) <NEW_LINE> <DEDENT> @property <NEW_LINE> def failures(self...
The data associated to a sight word: the grade, and practice events
62598f9aa79ad16197769dd6
class OZwaveException(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.msg = "OZwave generic exception:" <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.msg+' '+self.value)
"Zwave generic exception class.
62598f9a8e71fb1e983bb828
class RegisterActualValueEntity(BaseEntity): <NEW_LINE> <INDENT> __device_id: uuid.UUID <NEW_LINE> __id: uuid.UUID <NEW_LINE> __value: Union[str, int, float, bool, ButtonPayload, SwitchPayload, None] <NEW_LINE> def __init__( self, device_id: uuid.UUID, register_id: uuid.UUID, register_value: Union[str, int, float, bool...
Device register actual value entity @package FastyBird:ModbusConnectorPlugin! @module consumers @author Adam Kadlec <adam.kadlec@fastybird.com>
62598f9a8a43f66fc4bf1eee
class RFIDReader(reader.Reader): <NEW_LINE> <INDENT> pass
This class supports common black RFID Readers for 125 kHz read only tokens http://www.dx.com/p/intelligent-id-card-usb-reader-174455
62598f9a8e7ae83300ee8e10
class getUser_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.I32, 'uid', None, None, ), ) <NEW_LINE> def __init__(self, uid=None,): <NEW_LINE> <INDENT> self.uid = uid <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance...
Attributes: - uid
62598f9a498bea3a75a57893
class AbstractParkingPlacesProvider(six.with_metaclass(ABCMeta, object)): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def support_poi(self, poi): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def get_informations(self, poi): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_...
abstract class managing calls to external service providing real-time next passages
62598f9a7d847024c075c145
class IfNode(DirectiveNode): <NEW_LINE> <INDENT> def __init__(self, tokens): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.kind = "if" <NEW_LINE> self.tokens = tokens <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def is_start_node(): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def __repr__(self): <NEW_L...
Represents an #if, #ifdef or #ifndef directive.
62598f9a009cb60464d01297
class ProjectTestMixin(object): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(ProjectTestMixin, self).setUp() <NEW_LINE> self.user, self.project = create_base_project() <NEW_LINE> self.client.login(username=self.user.username, password=TEST_PASSWORD)
Mixin to use in tests that require a minimal structure for project. Most functional tests that go through object ownership checks will benefit from this.
62598f9a1b99ca400228f3e6
class AutoGroupWord(AbstractGroupWord): <NEW_LINE> <INDENT> def __init__(self, *generators, **kwds): <NEW_LINE> <INDENT> super(AutoGroupWord, self).__init__(*generators, **kwds) <NEW_LINE> self.seq = [] <NEW_LINE> self.reduced = 0 <NEW_LINE> for generator in generators: <NEW_LINE> <INDENT> g = self.group.reduce_gener...
TODO: Yet to be documented
62598f9a3cc13d1c6d4654df
class CommunicationTestCase(MailTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(CommunicationTestCase, self).setUp() <NEW_LINE> self.alice = User.objects.get(username='alice') <NEW_LINE> self.bob = User.objects.get(username='bob') <NEW_LINE> self.thread = self.create_thread('test subject', 'te...
Dereived from MailTestCase; Alice did create a new Communication.Thread with a test message "test subject", "test message" additions: self.alice, self.bob, self.thread, self.last_message
62598f9aac7a0e7691f7227f
class ExportMapChild(MapChild): <NEW_LINE> <INDENT> def _child_mapper(self): <NEW_LINE> <INDENT> return self.get_connector_unit_for_model(ExportMapper, self.model._name)
:py:class:`MapChild` for the Exports
62598f9a4527f215b58e9c57
class CheckConstraint(Constraint): <NEW_LINE> <INDENT> def __init__(self, sqltext, name=None, deferrable=None, initially=None, table=None, _create_rule=None, _autoattach=True): <NEW_LINE> <INDENT> super(CheckConstraint, self). __init__(name, deferrable, initially, _create_rule) <NEW_LINE> self.sq...
A table- or column-level CHECK constraint. Can be included in the definition of a Table or Column.
62598f9a8e7ae83300ee8e11
class SimplexLSQFitter(Fitter): <NEW_LINE> <INDENT> supported_constraints = Simplex.supported_constraints <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__(optimizer=Simplex, statistic=leastsquare) <NEW_LINE> self.fit_info = {} <NEW_LINE> <DEDENT> @fitter_unit_support <NEW_LINE> def __call__(self, mod...
Simplex algorithm and least squares statistic. Raises ------ ModelLinearityError A linear model is passed to a nonlinear fitter
62598f9a596a8972361279f4
class TestError(Exception): <NEW_LINE> <INDENT> pass
An error for unittests.
62598f9a55399d3f05626294
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$', help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."), error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/...
Form to change User Data
62598f9ad486a94d0ba2bd49
class ApplicationForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Application <NEW_LINE> fields = ('award', 'student', 'is_submitted', 'application_file') <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ApplicationForm, self).__init__(*args, **kwargs)
Unrestricted Application form with all fields included
62598f9a56b00c62f0fb2624
class Operand(object): <NEW_LINE> <INDENT> def __init__(self, sWhere, sType): <NEW_LINE> <INDENT> assert sWhere in g_kdOpLocations, sWhere; <NEW_LINE> assert sType in g_kdOpTypes, sType; <NEW_LINE> self.sWhere = sWhere; <NEW_LINE> self.sType = sType; <NEW_LINE> <DEDENT> def usesModRM(self): <NEW_LINE> <INDENT> return...
Instruction operand.
62598f9a76e4537e8c3ef329
class XinSheYang01(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=2): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self._bounds = list(zip([-5.0] * self.N, [5.0] * self.N)) <NEW_LINE> self.custom_bounds = ([-2, 2], [-2, 2]) <NEW_LINE> self.global_optimum = [[0 for _ in range(self.N...
Xin-She Yang 1 objective function. This class defines the Xin-She Yang 1 [1]_ global optimization problem. This is a multimodal minimization problem defined as follows: .. math:: f_{\text{XinSheYang01}}(x) = \sum_{i=1}^{n} \epsilon_i \lvert x_i \rvert^i The variable :math:`\ep...
62598f9ab7558d58954633a3
class BaseDestroyAPIView(DestroyAPIView): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BaseDestroyAPIView, self).__init__(*args, **kwargs)
BaseDestroyAPIView for the project
62598f9abaa26c4b54d4f026
class Upgrade(object): <NEW_LINE> <INDENT> def __init__(self, update_path, working_dir, upgrade_engine, disable_rollback=False): <NEW_LINE> <INDENT> logger.debug( u'Create Upgrade object with update path "{0}", ' 'working directory "{1}", ' 'upgrade engine "{2}", ' 'disable rollback is "{3}"'.format( update_path, worki...
Upgrade logic
62598f9a498bea3a75a57894
class ActivityUploader(object): <NEW_LINE> <INDENT> def __init__(self, client, response): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.update_from_repsonse(response) <NEW_LINE> <DEDENT> def update_from_repsonse(self, response, raise_exc=True): <NEW_LINE> <INDENT> self.upload_id = response['id'] <NEW_LINE> s...
The "future" object that holds information about an activity file upload and can wait for upload to finish, etc.
62598f9a8e71fb1e983bb82a
class OuterParty(Party): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "Outer party"
Outer party class, which extends the Party class.
62598f9a8c0ade5d55dc3549
class TestCorrectVersion (object): <NEW_LINE> <INDENT> processors = ['objectify'] <NEW_LINE> def test_correct_version(self, api): <NEW_LINE> <INDENT> root = api.item_lookup('0747532745') <NEW_LINE> nspace = root.nsmap.get(None, '') <NEW_LINE> assert api.VERSION in nspace
Check that each requested API version is also really used.
62598f9ae64d504609df9272
class _Space(object): <NEW_LINE> <INDENT> def emit(self): <NEW_LINE> <INDENT> return ' ' <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return 1
Represent a space in the atom stream.
62598f9a63d6d428bbee2528
class DiagnosticCollection(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[DiagnosticContract]'}, 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["DiagnosticContra...
Paged Diagnostic list representation. :ivar value: Page values. :vartype value: list[~api_management_client.models.DiagnosticContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. :vartype next_link: str
62598f9a6e29344779b003d0
class ClusterCollectionHandler(JSONHandler): <NEW_LINE> <INDENT> validator = ClusterValidator <NEW_LINE> @content_json <NEW_LINE> def GET(self): <NEW_LINE> <INDENT> return map( ClusterHandler.render, db().query(Cluster).all() ) <NEW_LINE> <DEDENT> @content_json <NEW_LINE> def POST(self): <NEW_LINE> <INDENT> data = self...
Cluster collection handler
62598f9af7d966606f747d5c
class AcrylClientResponse: <NEW_LINE> <INDENT> def __init__(self, successful, endpoint, response_data=None, error_code=None, error_message=None): <NEW_LINE> <INDENT> self.successful = successful <NEW_LINE> self.endpoint = endpoint <NEW_LINE> self.response_data = response_data <NEW_LINE> self.error_code = error_code <NE...
API client response. Any API method of `AcrylClient` returns `AcrylClientResponse` with response data or error (if raise_exception is False) :param successful: is request was successful :param response_data: data, returned in response :param error_code: error code in response (key "code") :param error_message: error m...
62598f9a8da39b475be02f59
class PasswordChangeTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self, data={}): <NEW_LINE> <INDENT> self.user = User.objects.create_user(username='john', email='john@doe.com', password='old_password') <NEW_LINE> self.url = reverse('accounts:password_change') <NEW_LINE> self.client.login(username='john', password=...
Base test case for form processing accepts a `data` dict to POST to the view.
62598f9a1f037a2d8b9e3e5a
class COSECRV(int, Enum): <NEW_LINE> <INDENT> P256 = 1 <NEW_LINE> P384 = 2 <NEW_LINE> P521 = 3 <NEW_LINE> ED25519 = 6
Possible values for COSEKey.CRV representing an EC2 public key's curve https://tools.ietf.org/html/rfc8152#section-13.1 https://www.iana.org/assignments/cose/cose.xhtml#table-elliptic-curves
62598f9a56ac1b37e6301f5f
class TailDoubleEasyScheduler(EasyBackfillScheduler): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> super(TailDoubleEasyScheduler, self).__init__(options) <NEW_LINE> self.cpu_snapshot = CpuSnapshot(self.num_processors, options["stats"]) <NEW_LINE> <DEDENT> def _backfill_jobs(self, current_time):...
This algorithm implements the algorithm in the paper of Tsafrir, Etzion, Feitelson, june 2007?
62598f9a7047854f4633f157
class ApacheInfo: <NEW_LINE> <INDENT> def __init__(self, host=None, port=None, user=None, password=None, statuspath = None, ssl=False, autoInit=True): <NEW_LINE> <INDENT> if host is not None: <NEW_LINE> <INDENT> self._host = host <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._host = '127.0.0.1' <NEW_LINE> <DEDENT>...
Class to retrieve stats for Apache Web Server.
62598f9a596a8972361279f6
class RelationLocatedAtError(NMLException): <NEW_LINE> <INDENT> pass
A locatedAt relation must relate with objects of type Location.
62598f9a4e4d562566372199
class DataCollections: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.clip = TextData("clips", [""]) <NEW_LINE> self.texts = DataCollection("text groups") <NEW_LINE> self.texts.add_content(self.clip) <NEW_LINE> self.actions = DataCollection("action groups")
Collections contain 2 collection elements, altogether representing the 4 levels of data self.clip is a special data, it will store clipboard texts
62598f9a435de62698e9bb6a
class TestDestinyHistoricalStatsDestinyActivityHistoryResults(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 testDestinyHistoricalStatsDestinyActivityHistoryResults(self): <NEW_LINE> <INDENT> pass
DestinyHistoricalStatsDestinyActivityHistoryResults unit test stubs
62598f9a596a8972361279f7
class Qlearning: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def choose_action(self, Q, new_observation, E_GREEDY_RATIO): <NEW_LINE> <INDENT> if policySelect == 1: <NEW_LINE> <INDENT> if E_GREEDY_RATIO < np.random.uniform(): <NEW_LINE> <INDENT> return np.argmax(Q[new_observation,:]) <NEW_LINE> <DEDENT> else: <NEW_LINE>...
class for Q Learning
62598f9aa17c0f6771d5bfb0
class TestV1DaemonSet(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 testV1DaemonSet(self): <NEW_LINE> <INDENT> pass
V1DaemonSet unit test stubs
62598f9a44b2445a339b6827
class ImmutableString(str, Immutable): <NEW_LINE> <INDENT> pass
ImmutableString class.
62598f9a8da39b475be02f5a
class Column(object): <NEW_LINE> <INDENT> def __init__(self, name, type='text', size=None, key_size=None, auto_increment=False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type = type <NEW_LINE> self.size = size <NEW_LINE> self.key_size = key_size <NEW_LINE> self.auto_increment = auto_increment
Declare a table column in a database schema.
62598f9ad58c6744b42dc18c
class LocalExpsListbox(ExpManagerListBox): <NEW_LINE> <INDENT> def getTupleList(self): <NEW_LINE> <INDENT> logger.debug("self.ExperimentManager.ExperimentsById: %s", self.ExperimentManager.ExperimentsById) <NEW_LINE> expids, experiments = zip(*self.ExperimentManager.ExperimentsById.items()) <NEW_LINE> display = (getatt...
Listbox class for displaying experimentmanager's local experiments list
62598f9ae76e3b2f99fd87ac
class Service(service.Service): <NEW_LINE> <INDENT> def __init__(self, executable_path, port=0, quiet=False): <NEW_LINE> <INDENT> if not os.path.exists(executable_path): <NEW_LINE> <INDENT> if "Safari Technology Preview" in executable_path: <NEW_LINE> <INDENT> message = "Safari Technology Preview does not seem to be in...
Object that manages the starting and stopping of the SafariDriver
62598f9ad7e4931a7ef3be0e
class ConstraintsUnion(AbstractConstraintSet): <NEW_LINE> <INDENT> def _testValue(self, value, idx): <NEW_LINE> <INDENT> for v in self._values: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> v(value, idx) <NEW_LINE> <DEDENT> except error.ValueConstraintError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> else: <NEW_LINE> ...
Value must satisfy at least one constraint
62598f9abde94217f3707525
class MeetupEvent(TrackableModel): <NEW_LINE> <INDENT> id = models.CharField(primary_key=True, max_length=255) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> description = models.TextField(null=True, blank=True) <NEW_LINE> venue_name = models.CharField(max_length=255, null=True, blank=True) <NEW_LINE> gr...
Model for Meetup Events.
62598f9a236d856c2adc92f4
class envBase(BaseEnvironment): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.currentState = [1,0,0] <NEW_LINE> self.actions = [-1, 1] <NEW_LINE> self.num_arms = None <NEW_LINE> self.max_steps = None <NEW_LINE> self.armRewardChance = None <NEW_LINE> <DEDENT> def env_init(self): <NEW_LINE> <INDENT> pa...
Example 1-Dimensional environment
62598f9a30bbd72246469831