code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ExceptionAction(object): <NEW_LINE> <INDENT> def __init__(self, raise_=True, omitted_exceptions=(), disable_var=""): <NEW_LINE> <INDENT> self.omitted_exceptions = omitted_exceptions <NEW_LINE> self.raise_ = raise_ <NEW_LINE> self.disable_var = disable_var <NEW_LINE> <DEDENT> def __call__(self, function): <NEW_LIN...
This is a base class to be used for constructing decorators that take a specific action when the decorated method/function raises an exception. For example, it can send a message or record data to a database before the exception is raised, and then (optionally) raise the exception. Optionally specify particular excepti...
62598f83d53ae8145f917f22
class APIResult(str, Enum): <NEW_LINE> <INDENT> SUCCESS = "success" <NEW_LINE> ERROR = "error"
ApiResult.
62598f83fb3f5b602db47efa
class SensorType(db.Model, CRUDMixin): <NEW_LINE> <INDENT> __tablename__ = "sensor_type" <NEW_LINE> id = db.Column(db.Integer, primary_key=True, nullable=False) <NEW_LINE> type_name = db.Column(db.String(140), nullable=False) <NEW_LINE> units_id = db.Column(db.Integer, nullable=False) <NEW_LINE> minimum_refresh = db.Co...
Determines the SensorType Example, DHT22, TMP32, TestCounter
62598f83f7d966606f747a7c
class TestHasID(unittest.TestCase): <NEW_LINE> <INDENT> def test_id_read_only(self): <NEW_LINE> <INDENT> _id = mixin.HasID() <NEW_LINE> with self.assertRaises(AttributeError): <NEW_LINE> <INDENT> _id.id = 'ID'
Test case for :class:`kado.store.mixin.HasID`.
62598f8323849d37ff850b51
class TestAssetErrors(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 testAssetErrors(self): <NEW_LINE> <INDENT> pass
AssetErrors unit test stubs
62598f83d6c5a102081e1bdd
class TotallyOrderedFiniteSetElement(Element): <NEW_LINE> <INDENT> def __init__(self, parent, data): <NEW_LINE> <INDENT> Element.__init__(self, parent) <NEW_LINE> self.value = data <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> same_parent = self.parent() is other.parent() <NE...
Element of a finite totally ordered set. EXAMPLES:: sage: S = TotallyOrderedFiniteSet([2,7], facade=False) sage: x = S(2) sage: print(x) 2 sage: x.parent() {2, 7}
62598f83498bea3a75a575b8
class AndroidModel(_messages.Message): <NEW_LINE> <INDENT> class FormFactorValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> DEVICE_FORM_FACTOR_UNSPECIFIED = 0 <NEW_LINE> PHONE = 1 <NEW_LINE> TABLET = 2 <NEW_LINE> WEARABLE = 3 <NEW_LINE> <DEDENT> class FormValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> DEVICE_...
A description of an Android device tests may be run on. Enums: FormValueValuesEnum: Whether this device is virtual or physical. @OutputOnly FormFactorValueValuesEnum: Whther this device is a phone, tablet, wearable, etc. @OutputOnly Fields: brand: The company that this device is branded with. Example: "...
62598f8321a7993f00c65a06
class Command: <NEW_LINE> <INDENT> def run(self, *argv, **kwargs): <NEW_LINE> <INDENT> assert(hasattr(self, "bin")) <NEW_LINE> invocation = [find_exec(self.bin)] <NEW_LINE> invocation.extend(argv) <NEW_LINE> for key in ["stdout", "stderr"]: <NEW_LINE> <INDENT> if key not in kwargs and ctx.quiet: <NEW_LINE> <INDENT> kwa...
A runnable command. Class inheriting from the Command class must provide the bin property/attribute.
62598f83d7e4931a7ef3bb30
class odict(dict): <NEW_LINE> <INDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[name] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise AttributeError
Dictionary that allows attribute access, e.g. if `foo` is instance of `odict` then foo.x == foo['x'].
62598f8396565a6dacd2ccc2
class HostSubProcess: <NEW_LINE> <INDENT> def __init__(self, ip_address, dev_id, hass, config, privileged): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.ip_address = ip_address <NEW_LINE> self.dev_id = dev_id <NEW_LINE> self._count = config[CONF_PING_COUNT] <NEW_LINE> if sys.platform == "win32": <NEW_LINE> <IND...
Host object with ping detection.
62598f83507cdc57c63a4821
class Message(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'messages' <NEW_LINE> id = db.Column( db.Integer, primary_key=True, autoincrement=True ) <NEW_LINE> text = db.Column( db.String(140), nullable=False ) <NEW_LINE> timestamp = db.Column( db.DateTime, nullable=False, default=datetime.utcnow() ) <NEW_LINE> user_i...
An individual message ("warble").
62598f83d164cc6175820a0d
class AutoMLContainer: <NEW_LINE> <INDENT> def __init__( self, trials: 'Trials', hyperparameter_space: HyperparameterSpace, n_iters: int, trial_number: int ): <NEW_LINE> <INDENT> self.trials = trials <NEW_LINE> self.hyperparameter_space = hyperparameter_space <NEW_LINE> self.n_iters = n_iters <NEW_LINE> self.trial_numb...
Data object for auto ml. .. seealso:: :class:`AutoMLSequentialWrapper`, :class:`RandomSearch`, :class:`HyperparamsRepository`, :class:`MetaStepMixin`, :class:`BaseStep`
62598f83097d151d1a2c0aba
class ModelTreatmentAccess(unittest.TestCase): <NEW_LINE> <INDENT> def test_access_treatments(self): <NEW_LINE> <INDENT> m = mn.model(treatments=[('As is', 'The current situation'), ('To be', 'The future')]) <NEW_LINE> self.assertEqual(m.treatment('As is').name, 'As is') <NEW_LINE> self.assertEqual( m.treatment('As is'...
Access the treatments from a model
62598f836aa9bd52df0d4971
class StyleWrapper(object): <NEW_LINE> <INDENT> def __init__(self, raw): <NEW_LINE> <INDENT> assert raw is not None <NEW_LINE> self.raw = raw <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(self.wrappedEnum) + "as int:" + str(int(self.raw)) <NEW_LINE> <DEDENT> def rawValue(self): <NEW_LINE> <INDE...
Wrap a StyleProperty that is Qt enum so that it is Pickleable. Only needed for PySide. Qt enums are already pickleable in PyQt, but not in PySide. Also isolates Qt. Instances are true instances, unlike PySide Qt enum values, which are class attributes. (That's why they are not pickleable.) StyleProperty's that are...
62598f836fece00bbaccb41d
class GameStats(): <NEW_LINE> <INDENT> def __init__(self, ai_settings): <NEW_LINE> <INDENT> self.ai_settings = ai_settings <NEW_LINE> self.reset_stats() <NEW_LINE> self.game_active = False <NEW_LINE> self.high_score = 0 <NEW_LINE> <DEDENT> def reset_stats(self): <NEW_LINE> <INDENT> self.ships_left = self.ai_settings.sh...
Track statistics for Alien Invasion.
62598f831d351010ab8f35d2
class Subject(object): <NEW_LINE> <INDENT> def __init__(self, subject, p=None): <NEW_LINE> <INDENT> self._subject = None <NEW_LINE> self._personalization = None <NEW_LINE> self.subject = subject <NEW_LINE> if p is not None: <NEW_LINE> <INDENT> self.personalization = p <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> d...
A subject for an email message.
62598f8330c21e258be9829f
class Scanner(pyre.parsing.sws): <NEW_LINE> <INDENT> pyre_token = pyre.parsing.sws.pyre_token <NEW_LINE> section = pyre_token(pattern=r'\w[-.\w]*(\s*#\s*\w[-.\w]*)?', tail='\s*:') <NEW_LINE> assignment = pyre_token(pattern=r'[^=]+', tail='\s*=') <NEW_LINE> comment = pyre_token(head=r'(?<!\\);', pattern='.*', tail='$') ...
Converts an input source into a stream of tokens.
62598f831f5feb6acb1626c8
class DomainOwnershipIdentifierCollection(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'required': True}, 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[DomainOwnershipIdentifier]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <N...
Collection of domain ownership identifiers. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar value: Required. Collection of resources. :vartype value: list[~azure.mgmt.web.v2018_02_01.models.DomainOwners...
62598f8307d97122c4216739
class DataQualityOperator(BaseOperator): <NEW_LINE> <INDENT> ui_color = '#89DA59' <NEW_LINE> @apply_defaults <NEW_LINE> def __init__(self, redshift_conn_id="", tables = [], test_sql=None, test_result=None, *args, **kwargs): <NEW_LINE> <INDENT> super(DataQualityOperator, self).__init__(*args, **kwargs) <NEW_LINE> self.r...
Airflow Operator for Data Quality check
62598f8329b78933be269e25
class qualifierEntryItemType (_ImportedBinding_xbrli.tokenItemType): <NEW_LINE> <INDENT> _TypeDefinition = STD_ANON_12 <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'qualifierEntryItemType')...
Complex type {http://www.xbrl.org/int/gl/gen/2006-10-25}qualifierEntryItemType with content type SIMPLE
62598f83d53ae8145f917f24
class KineticEnergyIntegral(BaseTwoIndexSymmetric): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def construct_array_contraction(contractions_one, contractions_two): <NEW_LINE> <INDENT> if not isinstance(contractions_one, GeneralizedContractionShell): <NEW_LINE> <INDENT> raise TypeError("`contractions_one` must be a Ge...
Class for obtaining the kinetic energy integrals. Attributes ---------- _axes_contractions : tuple of tuple of GeneralizedContractionShell Sets of contractions associated with each axis of the array. Properties ---------- contractions : tuple of GeneralizedContractionShell Contractions that are associated wit...
62598f8371ff763f4b5e7203
class PSUPrototypeV1(SerialPSU): <NEW_LINE> <INDENT> __BAUD_RATE = 1200 <NEW_LINE> @classmethod <NEW_LINE> def name(cls): <NEW_LINE> <INDENT> return 'PrototypeV1' <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def report_class(cls): <NEW_LINE> <INDENT> return PSUStatus <NEW_LINE> <DEDENT> @classmethod <NEW_L...
South Coast Science PSU v1 (prototype) via UART
62598f83287bf620b6271649
class CALURI(Property): <NEW_LINE> <INDENT> value_type = str <NEW_LINE> cardinality = '1' <NEW_LINE> parameters_allowed = ()
`§ 6.9.3 <http://tools.ietf.org/html/rfc6350#section-6.9.3>`_
62598f8391af0d3eaad39892
class MainProjectsZonesTokensService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'mainProjects_zones_tokens' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(ContainerV1.MainProjectsZonesTokensService, self).__init__(client) <NEW_LINE> self._upload_configs = { } <NEW_LINE> <DEDENT> def Create...
Service class for the mainProjects_zones_tokens resource.
62598f83c432627299fa2a65
class Sender(object): <NEW_LINE> <INDENT> def test_proxy(self, proxy): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> response = requests.get(TEST_URL, proxies={ 'http': 'http://' + proxy, 'https': 'https://' + proxy }, timeout=TEST_TIMEOUT) <NEW_LINE> if response.status_code == 200: <NEW_LINE> <INDENT> return True <NEW_...
拨号并发送到 Redis
62598f83711fe17d825e017f
class Ec2AmiState(ModelSimple): <NEW_LINE> <INDENT> allowed_values = { ('value',): { 'PENDING': "PENDING", 'AVAILABLE': "AVAILABLE", 'INVALID': "INVALID", 'DEREGISTERED': "DEREGISTERED", 'TRANSIENT': "TRANSIENT", 'FAILED': "FAILED", 'ERROR': "ERROR", }, } <NEW_LINE> validations = { } <NEW_LINE> additional_properties_ty...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Attributes: allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict with a capitalized key describing the a...
62598f83d53ae8145f917f25
class Logged(Aspect): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.logger = None <NEW_LINE> <DEDENT> def atCall(self, call_data): <NEW_LINE> <INDENT> args = call_data.args <NEW_LINE> kwargs = call_data.kwargs <NEW_LINE> function = call_data.function <NEW_LINE> if self.logger == None: <NEW_LINE> <IND...
Aspect to perform logging
62598f8315baa72349461a15
class InvalidParameter(IDESolverException): <NEW_LINE> <INDENT> pass
Invalid parameters were passed to the solver's constructor.
62598f83bde94217f37073b1
class ResponseError(Error): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message
Exception raised for errors in the request response.
62598f83d99f1b3c44d05144
class Subtask(object): <NEW_LINE> <INDENT> def __init__(self, task_uuid, title, description=None, context=None): <NEW_LINE> <INDENT> self.subtask = db.subtask_create(task_uuid, title=title, description=description, context=context) <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.subtask[...
Represents a subtask object.
62598f83d164cc6175820a0f
class PopupListBase(object): <NEW_LINE> <INDENT> def AdvanceSelection(self, next=True): <NEW_LINE> <INDENT> sel = self._list.GetSelection() <NEW_LINE> if next: <NEW_LINE> <INDENT> count = self._list.GetCount() <NEW_LINE> sel += 1 <NEW_LINE> if sel < count: <NEW_LINE> <INDENT> self._list.SetSelection(sel) <NEW_LINE> <DE...
Common functionality between Popuplist GTK and Mac
62598f836aa9bd52df0d4973
class KNearestNeighbor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, X, y): <NEW_LINE> <INDENT> self.X_train = X <NEW_LINE> self.y_train = y <NEW_LINE> <DEDENT> def predict(self, X, k=1, num_loops=0): <NEW_LINE> <INDENT> if num_loops == 0: <NEW_LINE> <INDE...
a kNN classifier with L2 distance
62598f83596a897236127709
class CheckoutReceiptView(CheckoutBaseView): <NEW_LINE> <INDENT> step_active = 'receipt' <NEW_LINE> steps_processed = [] <NEW_LINE> template_name = 'checkout_receipt.html' <NEW_LINE> def get_breadcrumbs(self): <NEW_LINE> <INDENT> return ({'name': 'Order Receipt', 'url': reverse('sales_checkout_receipt', args=[self.orde...
Display user order receipt
62598f831d351010ab8f35d4
class RAMPresenceManager: <NEW_LINE> <INDENT> def __init__(self,TimeOut): <NEW_LINE> <INDENT> self.TimeOut=TimeOut <NEW_LINE> self.Presence={} <NEW_LINE> self.PresenceLock=ThreadLock.allocate_lock() <NEW_LINE> <DEDENT> def __delitem__(self,key): <NEW_LINE> <INDENT> self.PresenceLock.acquire() <NEW_LINE> try: <NEW_LINE>...
Handles Presence Cache for one site { JID1 : PresenceDataDico1, JID2 : PresenceDataDico2, }
62598f837c178a314d78cf43
class HotkeyRecorder(QProgressDialog): <NEW_LINE> <INDENT> def __init__(self, mainWindow, hotkeyData, name): <NEW_LINE> <INDENT> super().__init__(mainWindow) <NEW_LINE> self.setWindowModality(Qt.ApplicationModal) <NEW_LINE> self.progress = 0 <NEW_LINE> self.hotkeyData = hotkeyData <NEW_LINE> self.thread = TasksThread()...
Map logo downloader dialog.
62598f838a43f66fc4bf1c18
class cached(cached_value): <NEW_LINE> <INDENT> def __get__(self, instance, owner): <NEW_LINE> <INDENT> if instance is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> id = owner.__module__ + '.' + owner.__name__ + '.' + self.retriever.__name__ <NEW_LINE> return CacheProxy(id, partial(self.retrieve...
Method decorator creating a cached attribute from a data retrieval method. In contrast with cached attributes created by the `cached_value` decorator, accessing a cached attribute created with `cached` will not directly give back the cached value. Instead, this will return a proxy object with `get` and `invalidate` m...
62598f836e29344779b000fb
class NewDBProxy(DBProxy): <NEW_LINE> <INDENT> def queryColumnSQL(self, sql, varMap = None, arraySize = 100, lowerCase = True): <NEW_LINE> <INDENT> comment = ' /* cacheSchedConfig column query */' <NEW_LINE> if self.conn == None: <NEW_LINE> <INDENT> return None, None <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> self.co...
Class extending OraDBProxy to add some column name mapping utilites
62598f83be383301e0253292
class NotePrevalenceOfUnpitchedInstrumentsFeature( featuresModule.FeatureExtractor): <NEW_LINE> <INDENT> id = 'I4' <NEW_LINE> def __init__(self, dataOrStream=None, *arguments, **keywords): <NEW_LINE> <INDENT> featuresModule.FeatureExtractor.__init__(self, dataOrStream=dataOrStream, *arguments, **keywords) <NEW_LINE> s...
>>> from music21 import *
62598f8345492302aabfbf75
class DICOMDiffusionVolumePluginClass(DICOMPlugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DICOMPlugin,self).__init__() <NEW_LINE> self.loadType = "Diffusion Volume" <NEW_LINE> self.diffusionTags = { 'GE' : [ '0043,1039', '0019,10bb', '0019,10bc', '0019,10bd', ], 'Siemens' : [ '0051,100b', '0...
DiffusionVolume specific interpretation code
62598f8307f4c71912baeedc
class Transform(): <NEW_LINE> <INDENT> _wrap = None <NEW_LINE> order = 0 <NEW_LINE> def __init__(self, func, order=None): <NEW_LINE> <INDENT> if order is not None: <NEW_LINE> <INDENT> self.order = order <NEW_LINE> <DEDENT> self.func = func <NEW_LINE> self.func.__name__ = func.__name__[1:] <NEW_LINE> functools.update_wr...
Utility class for adding probability and wrapping support to transform `func`.
62598f83287bf620b627164b
class GCN(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.conv1 = GCNConv(config['gnn_indim'], config['gcn_nhid'], cached=False) <NEW_LINE> self.conv2 = GCNConv(config['gcn_nhid'], config['gnn_outdim'], cached=False) <NEW_LINE> self.use_edge_weigh...
Model class for GCN.
62598f83a4f1c619b294e085
class DeviceStatusViewSet(CreateListRetrieveViewSet): <NEW_LINE> <INDENT> queryset = models.DeviceStatus.objects.all() <NEW_LINE> serializer_class = serializers.DeviceStatusSerializer
API endpoint that allows devices status to be viewed and added.
62598f83d10714528d69d968
class tridiagonal_jitter(_value_context): <NEW_LINE> <INDENT> _global_value = 1e-6
The (relative) amount of noise to add to the diagonal of tridiagonal matrices before eigendecomposing. root_decomposition becomes slightly more stable with this, as we need to take the square root of the eigenvalues. Any eigenvalues still negative after adding jitter will be zeroed out.
62598f83498bea3a75a575bc
class Interaction: <NEW_LINE> <INDENT> def __init_(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(self.data) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Interaction(" + repr(self.data) + ")" <NEW_LINE> <DEDENT> def __str_...
An arbitrary interaction between any number of species. This class definition is inteded solely as a minimal wrapper interface that should be implemented and extended by more specific abstractions. Attributes: data -- reference to arbitrary additional data
62598f8307d97122c421673c
class Api(object): <NEW_LINE> <INDENT> def __init__(self, url, headers=None, queryparams=None, **kwargs): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> if queryparams: <NEW_LINE> <INDENT> self.url += queryparams <NEW_LINE> <DEDENT> self.headers = headers or {} <NEW_LINE> <DEDENT> def handle_errors(self, status_code, ms...
This class is an Api instance. Examples: api = Api('http://example.com/api/list-things/') api.get() headers = {'Authorization': 'Token some_api_key'} api = Api('http://example.com/api/list-things/', headers=headers) api.get()
62598f8338b623060ffa8b2f
class MatchInteraction(BlockInteraction): <NEW_LINE> <INDENT> XMLNAME = (core.IMSQTI_NAMESPACE, 'matchInteraction') <NEW_LINE> XMLATTR_shuffle = ('shuffle', xsi.boolean_from_str, xsi.boolean_to_str) <NEW_LINE> XMLATTR_maxAssociations = ( 'maxAssociations', xsi.integer_from_str, xsi.integer_to_str) <NEW_LINE> XMLATTR_mi...
A match interaction is a blockInteraction that presents candidates with two sets of choices and allows them to create associates between pairs of choices in the two sets, but not between pairs of choices in the same set:: <xsd:attributeGroup name="matchInteraction.AttrGroup"> <xsd:attributeGrou...
62598f8315fb5d323ce7e7c4
class NewsByCategory(ListView): <NEW_LINE> <INDENT> model = News <NEW_LINE> template_name = 'news/home_news_list.html' <NEW_LINE> context_object_name = 'news' <NEW_LINE> allow_empty = False <NEW_LINE> def get_context_data(self, *, object_list=None, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwa...
Выводит категории новости Метод select_related('category'), сокращает колличество запросов к БД, объединяя множество sql запросов в 1 сложный
62598f8315baa72349461a17
class Exam(models.Model): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> verbose_name = u'Экзамен' <NEW_LINE> verbose_name_plural = u'Экзамены' <NEW_LINE> <DEDENT> object_name = models.CharField( max_length=256, blank=False, verbose_name=u'Название предмета') <NEW_LINE> date_time =models.DateTimeField( bla...
Exam Models
62598f83d99f1b3c44d05146
class unit(object): <NEW_LINE> <INDENT> def __init__(self, abbreviation, fullName, baseUnit = None, conversion = None): <NEW_LINE> <INDENT> self.abbreviation = abbreviation <NEW_LINE> self.fullName = fullName <NEW_LINE> self.baseUnit = baseUnit <NEW_LINE> self.conversion = conversion <NEW_LINE> <DEDENT> def __call__(se...
The base class for all measurement units.
62598f835f7d997b871f9124
class FiwareBackend(OAuthBackend): <NEW_LINE> <INDENT> name = 'fiware' <NEW_LINE> EXTRA_DATA = [ ('nickName', 'username'), ('actorId', 'uid'), ] <NEW_LINE> def get_user_id(self, details, response): <NEW_LINE> <INDENT> return response['actorId'] <NEW_LINE> <DEDENT> def get_user_details(self, response): <NEW_LINE> <INDEN...
FIWARE IdM OAuth authentication backend
62598f838e05c05ec3f6eb94
class _JsonRpcServlet(SimpleJSONRPCDispatcher): <NEW_LINE> <INDENT> def __init__(self, dispatch_method, encoding=None): <NEW_LINE> <INDENT> SimpleJSONRPCDispatcher.__init__(self, encoding=encoding) <NEW_LINE> self.register_introspection_functions() <NEW_LINE> self._dispatch_method = dispatch_method <NEW_LINE> <DEDENT> ...
A JSON-RPC servlet that can be registered in the Pelix HTTP service Calls the dispatch method given in the constructor
62598f8324f1403a926855fa
class Jacobi(Polynomial): <NEW_LINE> <INDENT> def __init__(self, _n, _alpha, _beta): <NEW_LINE> <INDENT> c = jacobi_coef(_n, _alpha, _beta) <NEW_LINE> super().__init__(c) <NEW_LINE> self.n = _n <NEW_LINE> self.alpha = _alpha <NEW_LINE> self.beta = _beta <NEW_LINE> if self.n > 0: <NEW_LINE> <INDENT> assert self.roots.dt...
Jacobi polynomial Its attributions are the same as the Polynomial class.
62598f830383005118f6d195
class Topic(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50) <NEW_LINE> description = models.TextField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'topic' <NEW_LINE> verbose_name_plural = 'topics' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name
Model definition for Topic.
62598f8363d6d428bbee2252
class CustomerFollowUp(models.Model): <NEW_LINE> <INDENT> customer = models.ForeignKey('Customer',on_delete=models.CASCADE) <NEW_LINE> content = models.TextField(verbose_name='跟进内容') <NEW_LINE> contsultant = models.ForeignKey('UserProfile',on_delete=models.CASCADE) <NEW_LINE> intention_choices = ( (0,'2周内报名'), (1,'1个月内...
客户记录表
62598f83d10714528d69d969
class WrappersTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_wrapProtocol(self): <NEW_LINE> <INDENT> protocol = MockProtocol() <NEW_LINE> protocol.transport = StubTransport() <NEW_LINE> protocol.connectionMade() <NEW_LINE> wrapped = session.wrapProtocol(protocol) <NEW_LINE> wrapped.dataReceived('dataReceived...
A test for the wrapProtocol and wrapProcessProtocol functions.
62598f8323e79379d538bf94
class CleanupDatasetsApplication: <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.object_store = build_object_store_from_config(config) <NEW_LINE> self.model = galaxy.config.init_models_from_config(config, object_store=self.object_store) <NEW_LINE> registry = Registry() <NEW_LINE> registry.load...
Encapsulates the state of a Universe application
62598f83c432627299fa2a69
class Endpoint(Enum): <NEW_LINE> <INDENT> ROOT = '/' <NEW_LINE> APP_NAME = f'{ROOT}getDomainAge' <NEW_LINE> DASHBOARD = f'{APP_NAME}/dashboard' <NEW_LINE> API = f'{APP_NAME}/api' <NEW_LINE> API_LOGIN = f'{API}/login' <NEW_LINE> API_LOGOUT = f'{API}/logout' <NEW_LINE> API_JOB = f'{API}/job' <NEW_LINE> API_JOB_ADD = f'{A...
Endpoint enum stores all the supported enfpoints in this application Storing all these as enums prevents typos in code and improves future maintainability Nested endpoints are created using the enum members
62598f8463b5f9789fe84c0b
class MatchConfidenceLevel(enum.IntEnum): <NEW_LINE> <INDENT> MATCH_CONFIDENCE_LEVEL_UNSPECIFIED = 0 <NEW_LINE> LOW = 1 <NEW_LINE> MEDIUM = 2 <NEW_LINE> HIGH = 3
Represents the system's confidence that this knowledge answer is a good match for this conversational query. Attributes: MATCH_CONFIDENCE_LEVEL_UNSPECIFIED (int): Not specified. LOW (int): Indicates that the confidence is low. MEDIUM (int): Indicates our confidence is medium. HIGH (int): Indicates our confiden...
62598f84d164cc6175820a13
class Hook(GitHubCore): <NEW_LINE> <INDENT> def __init__(self, hook, session=None): <NEW_LINE> <INDENT> super(Hook, self).__init__(hook, session) <NEW_LINE> self._api = hook.get('url', '') <NEW_LINE> self.updated_at = None <NEW_LINE> if hook.get('updated_at'): <NEW_LINE> <INDENT> self.updated_at = self._strptime(hook.g...
The :class:`Hook <Hook>` object. This handles the information returned by GitHub about hooks set on a repository.
62598f84596a89723612770e
class RFC3156: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.message = email.message_from_bytes(self.data) <NEW_LINE> self.parsed = self.find_payloads(self.message) <NEW_LINE> <DEDENT> def find_payloads(self, message): <NEW_LINE> <INDENT> if message.get_content_type(...
Access data inside OpenPGP MIME emails
62598f84a79ad16197769afc
class LibraryReader: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> None <NEW_LINE> <DEDENT> def load_data(self,fileName,fileFormat=None): <NEW_LINE> <INDENT> fileExtension = self._get_extension(fileName,fileFormat) <NEW_LINE> return self.__default_load(fileName,fileExtension) <NEW_LINE> <DEDENT> def _get_...
Reads various library file types
62598f848da39b475be02c81
class ZshMalformedCompareKoji(TestCompareKoji): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> TestCompareKoji.setUp(self) <NEW_LINE> self.before_rpm.add_installed_file( "/usr/share/data/invalid_zsh.sh", rpmfluff.SourceFile("invalid_zsh.sh", invalid_zsh), ) <NEW_LINE> self.after_rpm.add_installed_file( "/usr/...
Invalid /bin/zsh script is BAD for comparing Koji builds
62598f8430dc7b766599f2f3
class TestBulkhead(BaseTestCase): <NEW_LINE> <INDENT> LEFT_TOP = (10, 20) <NEW_LINE> RIGHT_BOTTOM = (110, 40) <NEW_LINE> ATTRIBS = dict(fill="#6F6") <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> from planner.frame.bulkhead import Bulkhead <NEW_LINE> cls.Bulkhead = Bulkhead <NEW_LINE> <DEDE...
Test bulkhead (inner wall) representation class
62598f841d351010ab8f35d9
class BurgersType(Equation): <NEW_LINE> <INDENT> def __init__(self, eqn_config): <NEW_LINE> <INDENT> super(BurgersType, self).__init__(eqn_config) <NEW_LINE> self.x_init = np.zeros(self.dim) <NEW_LINE> self.y_init = 1 - 1.0 / (1 + np.exp(0 + np.sum(self.x_init) / self.dim)) <NEW_LINE> self.sigma = self.dim + 0.0 <NEW_L...
Multidimensional Burgers-type PDE in Section 4.5 of Comm. Math. Stat. paper doi.org/10.1007/s40304-017-0117-6
62598f84a4f1c619b294e088
class BootcampApplicationQuerySet(models.QuerySet): <NEW_LINE> <INDENT> def prefetch_state_data(self): <NEW_LINE> <INDENT> return self.select_related("user__profile", "bootcamp_run").prefetch_related( "submissions", models.Prefetch( "orders", queryset=Order.objects.filter(status=Order.FULFILLED).select_related( "user__...
Custom queryset for BootcampApplication model
62598f84c432627299fa2a6a
class DfaTenants(Base): <NEW_LINE> <INDENT> __tablename__ = 'tenants' <NEW_LINE> id = sa.Column(sa.String(36), primary_key=True) <NEW_LINE> name = sa.Column(sa.String(255), primary_key=True) <NEW_LINE> dci_id = sa.Column(sa.Integer) <NEW_LINE> result = sa.Column(sa.String(255))
Represents DFA tenants.
62598f8416aa5153ce3fff9c
class UserProfile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User) <NEW_LINE> team = models.ForeignKey(Team, verbose_name='团队') <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.user.username
Extend of User Class
62598f8421bff66bcd722706
class PortCollection(collection.Collection): <NEW_LINE> <INDENT> ports = [Port] <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._type = 'ports' <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def convert_with_links(cls, rpc_ports, limit, url=None, expand=False, **kwargs): <NEW_LINE> <INDENT> collection = ...
API representation of a collection of Port objects.
62598f8407f4c71912baeedf
class ZooRenameCommand(command.ZooCommand): <NEW_LINE> <INDENT> id = "zoo.nodes.rename" <NEW_LINE> creator = "David Sparrow" <NEW_LINE> isUndoable = True <NEW_LINE> uiData = {"icon": "cube", "tooltip": "Batch renames nodes", "label": "Rename", "color": "", "backgroundColor": "" } <NEW_LINE> _modifier = None <NEW_LINE> ...
This command batch renames maya nodes, expects om2.MObjects
62598f846fb2d068a7693b7c
class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField('Категория', max_length=150) <NEW_LINE> description = models.TextField('Описание') <NEW_LINE> url = models.SlugField(max_length=160, unique=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> class Meta: <...
Категории фильмов
62598f84004d5f362081ed48
class BotMethodInvalid(BadRequest): <NEW_LINE> <INDENT> ID = "BOT_METHOD_INVALID" <NEW_LINE> MESSAGE = __doc__
The method can't be used by bots
62598f84d6c5a102081e1be5
class Task03TestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_bishop_movement(self): <NEW_LINE> <INDENT> bishop = chessmaster.Bishop('d4') <NEW_LINE> self.assertTrue(bishop.move('f6'), 'd4 => f6') <NEW_LINE> self.assertTrue(bishop.move('d4'), 'f6 => d4') <NEW_LINE> self.assertTrue(bishop.move('f2'), 'd4 => f2')...
Task 03 tests
62598f8466656f66f7d59e91
class Section: <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'actions.Section()' <NEW_LINE> <DEDENT> def steps(self): <NEW_LINE> <INDENT> return [steplib.SectionBreak(), ]
Marker for the beginning of a section. In the TUI you can skip to the next section marker using "S".
62598f840a366e3fb87dc469
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width: int = 0, height: int = 0) -> None: <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> print("Created a Rectangle") <NEW_LINE> <DEDENT> def area(self) -> int: <NEW_LINE> <INDENT> return self.width * self.height <NEW_LINE> <DEDE...
Abstraction for the rectangle; get the area and draw it.
62598f84b5575c28eb712a15
class TestOwnerTransfer(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 testOwnerTransfer(self): <NEW_LINE> <INDENT> pass
OwnerTransfer unit test stubs
62598f8496565a6dacd2ccc6
class MWDBError(Exception): <NEW_LINE> <INDENT> pass
Base class for all exceptions raised by mwdb
62598f8415fb5d323ce7e7c8
class CourseHomeMetadataView(RetrieveAPIView): <NEW_LINE> <INDENT> authentication_classes = ( JwtAuthentication, BearerAuthenticationAllowInactiveUser, SessionAuthenticationAllowInactiveUser, ) <NEW_LINE> serializer_class = CourseHomeMetadataSerializer <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <IND...
**Use Cases** Request Course metadata details for the Course Home MFE that every page needs. **Example Requests** GET api/course_home/v1/course_metadata/{course_key} **Response Values** Body consists of the following fields: course_id: (str) The Course's id (Course Run key) username: (str) The...
62598f84d164cc6175820a15
class pgmcmc_parameters: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dopartemp = False <NEW_LINE> self.likehoodmoddisplay = 200 <NEW_LINE> self.debugLevel = 3 <NEW_LINE> self.maxstps = 50000 <NEW_LINE> self.fracwant = 0.25 <NEW_LINE> self.initNSteps = 200 <NEW_LINE> self.coarseNSteps = 100 <NEW_LIN...
Storage class for the parameters of pcmcmc routines CONTENTS: likehoodmoddisplay - [Int] If debugLevel > =3 display likelihood call model and residual every iteration mod of this parameter debugLevel - [Int] maxstps - [Int] Maximum number of mcmc steps until stoppin...
62598f846aa9bd52df0d4979
class USSDMiddleWare: <NEW_LINE> <INDENT> def __init__(self,): <NEW_LINE> <INDENT> self._redis=R.StrictRedis(host="localhost", port=6379) <NEW_LINE> self.service_code=USSD.get('code') <NEW_LINE> self.service_sub_code=USSD.get('sub_code') <NEW_LINE> self.service_endpoint=USSD.get('endpoint') <NEW_LINE> self.service_sess...
This is the USSD middleware
62598f84a79ad16197769afe
class ComponentAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, probes: Dict[str, Callable[[], None]] = None, update_call: Callable = None, finalize_call: Callable = None, initialize_call: Callable = None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._mw_agent = MiddlewareAgent(self._dependencies, self._...
This class has to be instantiated and started (via start method) in each MANAGED component instance in order to integrate it properly with the the Avocado framework.
62598f8473bcbd0ca4bc9cee
class UnitHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> student = self.personalize_page_and_get_enrolled() <NEW_LINE> if not student: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> unit, lesson = extract_unit_and_lesson(self) <NEW_LINE> unit_id = unit.unit_id <NEW_LINE> if (not unit.now_a...
Handler for generating unit page.
62598f84d99f1b3c44d0514b
class AccountRole(Base): <NEW_LINE> <INDENT> __tablename__ = 'account_roles' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(255), nullable=False, unique=True) <NEW_LINE> accounts = relationship('Account', secondary=roles_association, back_populates='roles')
database table for Roles
62598f847b25080760ed6f43
class ExitCode(Enum): <NEW_LINE> <INDENT> OK = 0 <NEW_LINE> WARNING = 1 <NEW_LINE> CRITICAL = 2 <NEW_LINE> UNKNOWN = 3
Enum Class to better select ExitCodes
62598f84be383301e0253298
class VolumeMaker(BopAlgo): <NEW_LINE> <INDENT> def __init__(self, shapes, intersect=False, fuzzy_val=None, nondestructive=False): <NEW_LINE> <INDENT> super(VolumeMaker, self).__init__(None, None, fuzzy_val, nondestructive, BOPAlgo_MakerVolume) <NEW_LINE> self.set_args(shapes) <NEW_LINE> if intersect: <NEW_LINE> <INDEN...
Build solids from a list of shapes. :param list(OCCT.TopoDS.TopoDS_Shape) shapes: The shapes. :param bool intersect: Option to intersect the shapes before building solids. :param float fuzzy_val: Fuzzy tolerance value. :param bool nondestructive: Option to not modify the input shapes.
62598f8421bff66bcd722708
class NotificationUnreadListView(LoginRequiredMixin, ListView): <NEW_LINE> <INDENT> model = Notification <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return self.request.user.notifications.unread()
未读通知列表
62598f84a05bb46b3848a318
class NodeController(models.Model): <NEW_LINE> <INDENT> provider = models.ForeignKey(Provider) <NEW_LINE> alias = models.CharField(max_length=256) <NEW_LINE> hostname = models.CharField(max_length=256) <NEW_LINE> port = models.IntegerField(default=22) <NEW_LINE> private_ssh_key = models.TextField() <NEW_LINE> start_dat...
NodeControllers are specific to a provider They have a dedicated, static IP address and a human readable name To use the image manager they must also provide a valid private ssh key
62598f8429b78933be269e29
class Nested(fields.Nested): <NEW_LINE> <INDENT> def __init__(self, nested: type, value_selection_fn: Callable, **kwargs: Any): <NEW_LINE> <INDENT> super().__init__(nested=nested, **kwargs) <NEW_LINE> self.value_selection_fn = value_selection_fn <NEW_LINE> if value_selection_fn is not None: <NEW_LINE> <INDENT> self._CH...
An extension of the Marshmallow Nested field that allows the value to be selected via a value_selection_fn. Note that because the value_selection_fn is always called, users must return `marshmallow.missing` if they don't want this field included in the resulting serialized object. Args: - nested (type): the neste...
62598f8450485f2cf55daa10
class Connection(object): <NEW_LINE> <INDENT> def __init__(self, authurl=None, user=None, key=None, retries=4, preauthurl=None, preauthtoken=None, snet=False, starting_backoff=1, auth_version="1"): <NEW_LINE> <INDENT> self.authurl = authurl <NEW_LINE> self.user = user <NEW_LINE> self.key = key <NEW_LINE> self.retries =...
Convenience class to make requests that will also retry the request
62598f84d53ae8145f917f2d
class Builder(object): <NEW_LINE> <INDENT> def __init__(self, href, draft=drafts.LATEST, **kwargs): <NEW_LINE> <INDENT> self.o = {'_links': {'self': dict(href=href, **kwargs)}} <NEW_LINE> self.draft = draft.draft <NEW_LINE> <DEDENT> def url(self): <NEW_LINE> <INDENT> return self.o['_links']['self']['href'] <NEW_LINE> <...
Simplify creation of HAL documents. ``Builder`` provides a lightweight chainable API for creating HAL documents. Unlike ``dougrain.Document``, ``Builder`` provides no facilities for interrogating or mutating existing documents. ``Builder`` also makes fewer sanity checks than ``dougrain.Document``, which makes it cons...
62598f84d99f1b3c44d0514c
class NyCommentAddEvent(object): <NEW_LINE> <INDENT> implements(INyCommentAddEvent) <NEW_LINE> def __init__(self, context, contributor, parent_ob): <NEW_LINE> <INDENT> self.parent_ob = parent_ob <NEW_LINE> self.context = context <NEW_LINE> self.contributor = contributor
A comment was added
62598f8463b5f9789fe84c0f
class Episode(object): <NEW_LINE> <INDENT> def __init__(self, node, mirror_url): <NEW_LINE> <INDENT> self.id = node.get("id", "") <NEW_LINE> self.show_id = node.get("seriesid", "") <NEW_LINE> self.name = node.get("EpisodeName", "") <NEW_LINE> self.overview = node.get("Overview", "") <NEW_LINE> self.season_number = node...
A python object representing a thetvdb.com episode record.
62598f845f7d997b871f9127
class interp_block(gateway_block): <NEW_LINE> <INDENT> def __init__(self, name, in_sig, out_sig, interp): <NEW_LINE> <INDENT> gateway_block.__init__(self, name=name, in_sig=in_sig, out_sig=out_sig, block_type=gr.GW_BLOCK_DECIM ) <NEW_LINE> self._decim = 1 <NEW_LINE> self._interp = interp <NEW_LINE> self.gateway.set_rel...
Args: name (str): block name in_sig (gr.py_io_signature): input port signature out_sig (gr.py_io_signature): output port signature For backward compatibility, a sequence of numpy type names is also accepted as an io signature.
62598f84a17c0f6771d5bce1
class ElasticsearchDomain(AwsObject): <NEW_LINE> <INDENT> def __init__(self, dict_src, from_cache=False): <NEW_LINE> <INDENT> super().__init__(dict_src) <NEW_LINE> self.instances = [] <NEW_LINE> if from_cache: <NEW_LINE> <INDENT> self._init_object_from_cache(dict_src) <NEW_LINE> return <NEW_LINE> <DEDENT> init_options ...
Elasticsearch domain class
62598f84b57a9660fecd151b
class Group(DeclarativeBase): <NEW_LINE> <INDENT> __tablename__ = 'tg_group' <NEW_LINE> group_id = Column(Integer, autoincrement=True, primary_key=True) <NEW_LINE> group_name = Column(Unicode(16), unique=True, nullable=False) <NEW_LINE> display_name = Column(Unicode(255)) <NEW_LINE> created = Column(DateTime, default=d...
Group definition for :mod:`repoze.what`. Only the ``group_name`` column is required by :mod:`repoze.what`.
62598f84596a897236127712
class StubStorage: <NEW_LINE> <INDENT> _oid = 1 <NEW_LINE> _transaction = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._stored = [] <NEW_LINE> self._finished = [] <NEW_LINE> self._data = {} <NEW_LINE> self._transdata = {} <NEW_LINE> self._transstored = [] <NEW_LINE> <DEDENT> def new_oid(self): <NEW_LINE...
Very simple in-memory storage that does *just* enough to support tests. Only one concurrent transaction is supported. Voting is not supported. Inspect self._stored and self._finished to see how the storage has been used during a unit test. Whenever an object is stored in the store() method, its oid is appended to sel...
62598f848e71fb1e983bb559
class RedisWrapper(StorageBase): <NEW_LINE> <INDENT> def __init__( self, db_uri, *, db_name=None, collection, ttl=None, extra_options=None ): <NEW_LINE> <INDENT> if not _has_redis: <NEW_LINE> <INDENT> raise ImportError("redis module is required but it is not available") <NEW_LINE> <DEDENT> if not extra_options: <NEW_LI...
Simple wrapper for a dict-like storage in Redis. Supports JSON-serializable data types.
62598f84ec188e330fdf833d
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> if not isinstance(width, int): <NEW_LINE> <INDENT> raise TypeError("width must be an integer") <NEW_LINE> <DEDENT> if width < 0: <NEW_LINE> <INDENT> raise ValueError("width must be >= 0") <NEW_LINE> <DEDENT> if not isinstanc...
defining Rectangle class
62598f841d351010ab8f35dc
class TargetProtectionGroupPostPatch(object): <NEW_LINE> <INDENT> swagger_types = { 'protection_group': 'FixedReferenceNoId', 'target': 'FixedReferenceNoId', 'allowed': 'bool' } <NEW_LINE> attribute_map = { 'protection_group': 'protection_group', 'target': 'target', 'allowed': 'allowed' } <NEW_LINE> required_args = { }...
Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition.
62598f847b25080760ed6f45
class StandardRobot(Robot): <NEW_LINE> <INDENT> def updatePositionAndClean(self): <NEW_LINE> <INDENT> testPos = self.pos.getNewPosition(self.dir, self.speed) <NEW_LINE> if self.room.isPositionInRoom(testPos): <NEW_LINE> <INDENT> self.room.cleanTileAtPosition(testPos) <NEW_LINE> self.pos = testPos <NEW_LINE> <DEDENT> el...
A StandardRobot is a Robot with the standard movement strategy. At each time-step, a StandardRobot attempts to move in its current direction; when it would hit a wall, it *instead* chooses a new direction randomly.
62598f8476d4e153a661c6b2
class Test_rdfa1(unittest.TestCase): <NEW_LINE> <INDENT> def test_tagsoup1(self): <NEW_LINE> <INDENT> f = filesource('tagsouprdfa1.html') <NEW_LINE> doc = html.parse(f.source) <NEW_LINE> h = doc.xml_select(u'//h1')[0] <NEW_LINE> self.assertEqual(h.property, u'dc:title') <NEW_LINE> self.assertEqual(h.xml_attributes[None...
Testing RDFa 1
62598f848a43f66fc4bf1c20