code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Conditional(CodeGen): <NEW_LINE> <INDENT> def __init__(self, opt, indent, condition, content): <NEW_LINE> <INDENT> super(Conditional, self).__init__(opt, indent) <NEW_LINE> if condition: <NEW_LINE> <INDENT> self.content = content
A conditional block of code.
62598fb444b2445a339b69d6
class ComparisonTargetPermission(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> if view.action in ['list', 'retrieve']: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> <DEDENT> def has_object_pe...
List : anyone Create : X Retrieve : anyone Update : X Partial update : X Destroy : X
62598fb49c8ee823130401d6
class ImageType (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'ImageType') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/avs/avs.xsd', 2574, 3) <NEW_LINE> _Documentation = 'A Type of Image.'
A Type of Image.
62598fb4adb09d7d5dc0a654
class checkNamespaceIteratorConflicts_result(object): <NEW_LINE> <INDENT> def __init__(self, ouch1=None, ouch2=None, ouch3=None,): <NEW_LINE> <INDENT> self.ouch1 = ouch1 <NEW_LINE> self.ouch2 = ouch2 <NEW_LINE> self.ouch3 = ouch3 <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is no...
Attributes: - ouch1 - ouch2 - ouch3
62598fb457b8e32f52508180
class GradingSectionsTestRecipe(GradingSectionsTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.rub = baker.make_recipe("makeReports.gradedRubric",rubricVersion=self.r) <NEW_LINE> self.rInG = baker.make_recipe("makeReports.rubricItem",rubricVersion=self.r,section=1) <NEW_L...
Tests the grading sections using recipe based models
62598fb47d847024c075c485
class TestConfig(BaseTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> parser = RawConfigParser() <NEW_LINE> parser.read(TEST_CONFIG_FILE_PATH) <NEW_LINE> cls.old_fpath = parser.get("pysemantic", "specfile") <NEW_LINE> parser.set("pysemantic", "specfile", op.abspath(cls.old...
Test the configuration management utilities.
62598fb4a05bb46b3848a933
class ExceptionManagerBase: <NEW_LINE> <INDENT> RAISE = 0 <NEW_LINE> PASS = 1 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.handlers = [] <NEW_LINE> self.policy = ExceptionManagerBase.RAISE <NEW_LINE> <DEDENT> def add_handler(self, cls): <NEW_LINE> <INDENT> if not cls in self.handlers: <NEW_LINE> <INDENT> sel...
ExceptionManager manages exceptions handlers.
62598fb456b00c62f0fb2980
class TopLevel(Resource): <NEW_LINE> <INDENT> decorators = [multi_auth.login_required] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(self, *args, **kwargs) <NEW_LINE> self.debug = 0 <NEW_LINE> self.api = args[0] <NEW_LINE> if self.debug > 2: <NEW_LINE> <INDENT> mydebug(f"kwargs {k...
Simple resource to redirect to the correct entry point.
62598fb430bbd722464699dd
class Frame_order(GuiTestCase, system_tests.frame_order.Frame_order): <NEW_LINE> <INDENT> def __init__(self, methodName=None): <NEW_LINE> <INDENT> super(Frame_order, self).__init__(methodName) <NEW_LINE> whitelist = [ 'test_cam_iso_cone' ] <NEW_LINE> if methodName not in whitelist: <NEW_LINE> <INDENT> status.skipped_te...
Class for testing the frame order related functions in the GUI.
62598fb4be8e80087fbbf12f
class TestDeDe: <NEW_LINE> <INDENT> def test_city(self, faker, num_samples): <NEW_LINE> <INDENT> for _ in range(num_samples): <NEW_LINE> <INDENT> city = faker.city() <NEW_LINE> assert isinstance(city, str) <NEW_LINE> assert city in DeDeAddressProvider.cities <NEW_LINE> <DEDENT> <DEDENT> def test_state(self, faker, num_...
Test de_DE address provider methods
62598fb466656f66f7d5a4b9
class Field(AbstractField): <NEW_LINE> <INDENT> form = models.ForeignKey("Form", related_name="fields", on_delete=models.CASCADE) <NEW_LINE> order = models.IntegerField(_("Order"), null=True, blank=True) <NEW_LINE> class Meta(AbstractField.Meta): <NEW_LINE> <INDENT> ordering = ("order",) <NEW_LINE> <DEDENT> def save(se...
Implements automated field ordering.
62598fb4a8370b77170f04a5
class KuramotoIndex(metrics_base.BaseTimeseriesMetricAlgorithm): <NEW_LINE> <INDENT> def evaluate(self): <NEW_LINE> <INDENT> if self.time_series.data.shape[1] < 2: <NEW_LINE> <INDENT> msg = " The number of state variables should be at least 2." <NEW_LINE> self.log.error(msg) <NEW_LINE> raise Exception(msg) <NEW_LINE> <...
Return the Kuramoto synchronization index. Useful metric for a parameter analysis when the collective brain dynamics represent coupled oscillatory processes. The *order* parameters are :math:`r` and :math:`Psi`. .. math:: r e^{i * \psi} = \frac{1}{N}\,\sum_{k=1}^N(e^{i*\theta_k}) The first is the phase coheren...
62598fb401c39578d7f12e42
class LeaderAssignor(Service, LeaderAssignorT): <NEW_LINE> <INDENT> def __init__(self, app: AppT, **kwargs: Any) -> None: <NEW_LINE> <INDENT> Service.__init__(self, **kwargs) <NEW_LINE> self.app = app <NEW_LINE> <DEDENT> async def on_start(self) -> None: <NEW_LINE> <INDENT> leader_topic = self._leader_topic <NEW_LINE> ...
Leader assignor, ensures election of a leader.
62598fb432920d7e50bc611c
class PathHash: <NEW_LINE> <INDENT> def hash(self, items): <NEW_LINE> <INDENT> node = self <NEW_LINE> for part in items: <NEW_LINE> <INDENT> node = node[part] <NEW_LINE> <DEDENT> return node <NEW_LINE> <DEDENT> def alias(self, target, alias): <NEW_LINE> <INDENT> original = None if alias not in self else self[alias] <NE...
Implementation of a hash function for hierarchical namespaces with aliased entries. PathHash encodes the hierarchical relationships among its contents by having each node in the hierarchy store the names of the nodes that are its immediate children. Aliases are permitted and they hash to the same key as the original e...
62598fb48e7ae83300ee916d
@world.absorb <NEW_LINE> class GroupFactory(sf.GroupFactory): <NEW_LINE> <INDENT> pass
Groups for user permissions for courses
62598fb44c3428357761a383
class ApplicationSessionFactory(FutureMixin, protocol.ApplicationSessionFactory): <NEW_LINE> <INDENT> session = ApplicationSession
WAMP application session factory for Twisted-based applications.
62598fb43d592f4c4edbaf89
class ANSIFormatter(logging.Formatter): <NEW_LINE> <INDENT> BLACK = '\033[1;30m%s\033[0m' <NEW_LINE> RED = '\033[1;31m%s\033[0m' <NEW_LINE> GREEN = '\033[1;32m%s\033[0m' <NEW_LINE> YELLOW = '\033[1;33m%s\033[0m' <NEW_LINE> GREY = '\033[1;37m%s\033[0m' <NEW_LINE> RED_UNDERLINE = '\033[4;31m%s\033[0m' <NEW_LINE> def __in...
Implements basic colored output using ANSI escape codes. Currently acrylamid uses nanoc's color and information scheme: skip, create, identical, update, re-initialized, removed. If log level is greater than logging.WARN the level name is printed red underlined.
62598fb456ac1b37e63022b3
class PublishLongNew(APIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated, ) <NEW_LINE> def post(self, request, format=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> request_data = self.request.data['newData'] <NEW_LINE> user = request.user <NEW_LINE> data_to_save = dict({'new_title': request_data['...
Class dedicated to API call 'createnew/publishlongnew', authentication required. Method post - Create 'New' model object.
62598fb4097d151d1a2c10f7
class OperationsHandlerMixin: <NEW_LINE> <INDENT> csrf_exempt = False <NEW_LINE> exports = None <NEW_LINE> anonymous = None <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> op = request.GET.get("op") or request.POST.get("op") <NEW_LINE> signature = request.method.upper(), op <NEW_LINE> funct...
Handler mixin for operations dispatch. This enabled dispatch to custom functions that piggyback on HTTP methods that ordinarily, in Piston, are used for CRUD operations. This must be used in cooperation with :class:`OperationsResource` and :class:`OperationsHandlerType`.
62598fb44428ac0f6e6585e9
class BgpServiceCommunityListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[BgpServiceCommunity]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["BgpServiceCommunity"]] = None, next_link: Optiona...
Response for the ListServiceCommunity API service call. :param value: A list of service community resources. :type value: list[~azure.mgmt.network.v2018_01_01.models.BgpServiceCommunity] :param next_link: The URL to get the next set of results. :type next_link: str
62598fb4a8370b77170f04a6
class ISOExtra(object): <NEW_LINE> <INDENT> def __init__(self, element_type, source, destination): <NEW_LINE> <INDENT> self.element_type = element_type <NEW_LINE> self.source = source <NEW_LINE> self.destination = destination
Class that represents an extra element to add to an installation ISO. Objects of this type contain 3 pieces of information: element_type - "file" or "directory" source - A source URL for the element. destination - A relative destination for the element.
62598fb471ff763f4b5e783d
class HTMLResponse(Response): <NEW_LINE> <INDENT> def __init__(self, content='', printed_output=''): <NEW_LINE> <INDENT> Response.__init__(self, content) <NEW_LINE> self.printed_output = printed_output <NEW_LINE> self.headers['Content-type'] = 'text/html' <NEW_LINE> self.headers['Cache-Control'] = 'no-cache' <NEW_LINE>...
HTML response >>> import response >>> response.HTMLResponse('test123').render() == ( ... 'X-FRAME-OPTIONS: DENY\n' ... 'Content-type: text/html\n' ... 'Content-length: 7\n' ... 'Cache-Control: no-cache\n\n' ... 'test123' ... ) True >>> response.HTMLResponse('test123').render_wsgi() == ( ... '20...
62598fb47c178a314d78d566
class RandomPlanarGraph(UndirectedGraph): <NEW_LINE> <INDENT> def __init__(self, geometry, count): <NEW_LINE> <INDENT> super(RandomPlanarGraph, self).__init__() <NEW_LINE> self.geometry = geometry <NEW_LINE> configurations = numpy.array([ geometry.sample_configuration() for _ in xrange(5 * count)]) <NEW_LINE> self.conf...
Random planar graph in R^2 This is mostly useful for debugging and demonstration; because it is planar, it is easier to parse visually than an RGG. The construction employs uses a Delauanay triangulation to select edges, optionally removing any edges which intersect some geometry. Vertex labels are just indices of an...
62598fb4adb09d7d5dc0a656
class IfFeatureNode(Node): <NEW_LINE> <INDENT> child_nodelists = ('nodelist_true', 'nodelist_false') <NEW_LINE> def __init__(self, nodelist_enabled, nodelist_disabled, feature_id, extra_kwargs): <NEW_LINE> <INDENT> self.nodelist_enabled = nodelist_enabled <NEW_LINE> self.nodelist_disabled = nodelist_disabled <NEW_LINE>...
Template node for feature-based if statements. This works mostly like a standard ``{% if %}`` tag, checking whether the given feature is enabled and rendering the content between it and the else/end tags only if matching the desired state. This supports a ``{% else %}``, to allow rendering content if the feature does...
62598fb42ae34c7f260ab1a5
class MetaBeing(Being): <NEW_LINE> <INDENT> pass
complement of being
62598fb4f548e778e596b66d
class PSSM: <NEW_LINE> <INDENT> def __init__(self, description=""): <NEW_LINE> <INDENT> self.description = description <NEW_LINE> self.seqCount = 0 <NEW_LINE> self.size = None <NEW_LINE> self.aaDistribution = None <NEW_LINE> self.aaCount = None <NEW_LINE> self.gapPenalties = None <NEW_LINE> <DEDENT> def add(self, Seque...
Position Specific Score Matrix. Creates a profile for a series of aligned Sequences, and gives a score to each AA subsitution in a given column.
62598fb4fff4ab517ebcd8b0
class ClasseAction(Action): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def init_types(cls): <NEW_LINE> <INDENT> cls.ajouter_types(cls.supprimer_alarme, "Personnage", "str") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def supprimer_alarme(personnage, cle_alarme): <NEW_LINE> <INDENT> importeur.scripting.supprimer_alarm...
Supprime l'alarme indiquée.
62598fb455399d3f056265de
class Action(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.command = None <NEW_LINE> self.parameters = None <NEW_LINE> self.type = None <NEW_LINE> self.message = None <NEW_LINE> self._parameter_start_pos = 0 <NEW_LINE> <DEDENT> def setParameterStartPos(self, pos): <NEW_LINE> <INDENT> self._p...
Action class, handles actual (system) calls. set command, parameters (template) type and log message
62598fb44527f215b58e9f9f
class MailSchema(Schema): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> type_ = 'mail' <NEW_LINE> self_view = 'v1.mail_detail' <NEW_LINE> self_view_kwargs = {'id': '<id>'} <NEW_LINE> self_view_many = 'v1.mail_list' <NEW_LINE> inflect = dasherize <NEW_LINE> <DEDENT> id = fields.Str(dump_only=True) <NEW_LINE> recip...
Api schema for mail Model
62598fb45fcc89381b2661b1
class BaseModel(object): <NEW_LINE> <INDENT> def __init__(self, in_shape, output_shape): <NEW_LINE> <INDENT> self._input_shape = in_shape <NEW_LINE> self._output_shape = output_shape <NEW_LINE> <DEDENT> @property <NEW_LINE> def input_shape(self): <NEW_LINE> <INDENT> return self._input_shape <NEW_LINE> <DEDENT> @propert...
Represents a learning capable entity
62598fb4cc40096d6161a23e
class BiosVfOnboardStorage(ManagedObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ManagedObject.__init__(self, "BiosVfOnboardStorage") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def class_id(): <NEW_LINE> <INDENT> return "biosVfOnboardStorage" <NEW_LINE> <DEDENT> DN = "Dn" <NEW_LINE> RN = "Rn" <N...
This class contains the relevant properties and constant supported by this MO.
62598fb4cc0a2c111447b0dd
class CreateApp(Base): <NEW_LINE> <INDENT> def __init__(self, business_criticality, app_name, web_application=None, vendor_id=None, teams=None, tags=None, policy=None, origin=None, next_day_scheduling_enabled=None, industry=None, description=None, deployment_method=None, business_unit=None, business_owner_email=None, b...
class: veracode.SDK.upload.CreateApp params: business_criticality: required app_name: required web_application: optional vendor_id: optional teams: optional tags: optional policy: optional origin: optional next_day_scheduling_enabled: optional industry: optional description:...
62598fb456ac1b37e63022b5
class FontAwesomeFont(IconsFont): <NEW_LINE> <INDENT> name = 'font-awesome' <NEW_LINE> shortcut = 'fa' <NEW_LINE> css_url = '//cdn.jsdelivr.net/fontawesome/latest/css/font-awesome.css' <NEW_LINE> tag_classes = 'fa' <NEW_LINE> prefix = 'fa-'
http://fontawesome.io/icons/ <i class="fa fa-star"></i>
62598fb44428ac0f6e6585eb
class AzureSqlTableDataset(Dataset): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, 'linked_service_name': {'required': True}, } <NEW_LINE> _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'}, 'description': {'key': 'description', 'type': ...
The Azure SQL Server database dataset. All required parameters must be populated in order to send to Azure. :param additional_properties: Unmatched properties from the message are deserialized to this collection. :type additional_properties: dict[str, object] :param type: Required. Type of dataset.Constant filled by...
62598fb4a8370b77170f04a8
class Socket(QTcpSocket): <NEW_LINE> <INDENT> def __init__(self, parent=None,upLoadFunction=None): <NEW_LINE> <INDENT> super(Socket, self).__init__(parent) <NEW_LINE> self.connect(self, SIGNAL("readyRead()"),self.readPacket) <NEW_LINE> self.connect(self, SIGNAL("disconnected()"), self.deleteLater) <NEW_LINE> self.nextB...
Custom socket handler for our packet format
62598fb47cff6e4e811b5aea
class NodeList(set): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def deserialize(cls, stream: BitStreamReader): <NEW_LINE> <INDENT> nodeList = cls() <NEW_LINE> for i in range(28): <NEW_LINE> <INDENT> nodeByte = uint8_t.deserialize(stream) <NEW_LINE> for j in range(8): <NEW_LINE> <INDENT> if nodeByte & (1 << j): <NEW_LI...
Deserializer for nodelist returned in NODE_LIST_REPORT
62598fb456ac1b37e63022b6
class Tests(IMP.test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> IMP.test.TestCase.setUp(self) <NEW_LINE> IMP.base.set_log_level(IMP.base.TERSE) <NEW_LINE> self.data_file = self.get_input_file_name("anchors.input") <NEW_LINE> <DEDENT> def test_run(self): <NEW_LINE> <INDENT> self.anchors_data = I...
Tests for a domino run on a single mapping
62598fb47b180e01f3e490b6
class CoffeeMachine(Thing): <NEW_LINE> <INDENT> def __init__(self, w): <NEW_LINE> <INDENT> super().__init__(w, "kaffemaskin", "kaffemaskiner", "en") <NEW_LINE> self.broken = True <NEW_LINE> <DEDENT> def description(self): <NEW_LINE> <INDENT> return "En kaffemaskin som kan brygga liten kaffe, stor kaffe, frappuchino, ca...
CoffeeMachine class
62598fb43317a56b869be5b2
class Problem2D(Problem): <NEW_LINE> <INDENT> def __init__(self, random_seed=None, noise_stdev=0.0): <NEW_LINE> <INDENT> param_shapes = [(2,)] <NEW_LINE> super(Problem2D, self).__init__(param_shapes, random_seed, noise_stdev) <NEW_LINE> <DEDENT> def surface(self, n=50, xlim=5, ylim=5): <NEW_LINE> <INDENT> xm, ym = _mes...
2D problem.
62598fb44527f215b58e9fa1
class DownloadManager(Thread): <NEW_LINE> <INDENT> PUBLISHER_TOPIC = 'dlmanager' <NEW_LINE> MAX_DOWNLOAD_THREADS = 3 <NEW_LINE> def __init__(self, threads_list, update_thread=None): <NEW_LINE> <INDENT> super(DownloadManager, self).__init__() <NEW_LINE> self.threads_list = threads_list <NEW_LINE> self.update_thread = up...
Manage youtube-dlG download list. Params threads_list: Python list that contains DownloadThread objects. update_thread: UpdateThread.py thread. Accessible Methods close() Params: None Return: None add_thread() Params: DownloadThread object Return: None aliv...
62598fb410dbd63aa1c70c81
class LedMatrix(object): <NEW_LINE> <INDENT> def __init__(self, columns, rows, colors): <NEW_LINE> <INDENT> self.rows = rows <NEW_LINE> self.columns = columns <NEW_LINE> self.mat = [LedColumn(colors[row]) for row in range(columns)] <NEW_LINE> self.act_column = it.cycle(range(columns)) <NEW_LINE> <DEDENT> def __getitem_...
Coluns and Rows.
62598fb4ff9c53063f51a719
class DHT22Sensor(DHTSensor): <NEW_LINE> <INDENT> def __init__(self, pin): <NEW_LINE> <INDENT> DHTSensor.__init__(self, 22, pin)
DHT22 sensor class Take as args : - Sensor Pin
62598fb4379a373c97d990e1
class CrossRef(models.Model): <NEW_LINE> <INDENT> startverse = models.ForeignKey(Verse, related_name="startverse") <NEW_LINE> endverse = models.ForeignKey(Verse, related_name="endverse") <NEW_LINE> objects = CrossRefManager() <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> if self.startverse.id == self.endverse.i...
Encapsulates a "passage" or "cross reference." startverse should be before endverse. If there is only one verse, then startverse = endverse (neither should be null). In addition, should restrict that both verses be contained in the same book.
62598fb4851cf427c66b8383
class RegisterServer2Parameters(FrozenClass): <NEW_LINE> <INDENT> ua_types = { 'Server': 'RegisteredServer', 'DiscoveryConfiguration': 'ExtensionObject', } <NEW_LINE> def __init__(self, binary=None): <NEW_LINE> <INDENT> if binary is not None: <NEW_LINE> <INDENT> self._binary_init(binary) <NEW_LINE> self._freeze = True ...
:ivar Server: :vartype Server: RegisteredServer :ivar DiscoveryConfiguration: :vartype DiscoveryConfiguration: ExtensionObject
62598fb591f36d47f2230f0e
class Organization(_messages.Message): <NEW_LINE> <INDENT> class LifecycleStateValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> LIFECYCLE_STATE_UNSPECIFIED = 0 <NEW_LINE> ACTIVE = 1 <NEW_LINE> DELETE_REQUESTED = 2 <NEW_LINE> <DEDENT> creationTime = _messages.StringField(1) <NEW_LINE> displayName = _messages.StringF...
The root node in the resource hierarchy to which a particular entity's (e.g., company) resources belong. Enums: LifecycleStateValueValuesEnum: The organization's current lifecycle state. Assigned by the server. @OutputOnly Fields: creationTime: Timestamp when the Organization was created. Assigned by the ...
62598fb55fc7496912d482e2
class TestMapCTP(object): <NEW_LINE> <INDENT> def tearDown(self): <NEW_LINE> <INDENT> shutil.rmtree(RESULTS, True) <NEW_LINE> <DEDENT> def test_map_ctp(self): <NEW_LINE> <INDENT> logger(__name__).debug("Testing Map CTP on %s..." % SUBJECTS) <NEW_LINE> map_ctp = MapCTP(collection=COLLECTION, subjects=SUBJECTS, dest=RESU...
Map CTP unit tests.
62598fb5236d856c2adc94a5
class MockBinarySensor(MockEntity, BinarySensorDevice): <NEW_LINE> <INDENT> @property <NEW_LINE> def is_on(self): <NEW_LINE> <INDENT> return self._handle("is_on") <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_class(self): <NEW_LINE> <INDENT> return self._handle("device_class")
Mock Binary Sensor class.
62598fb5a8370b77170f04a9
class ResultProxy(object): <NEW_LINE> <INDENT> def __init__(self, result): <NEW_LINE> <INDENT> self._result = result <NEW_LINE> self._object = None <NEW_LINE> <DEDENT> def deserialize(self, request): <NEW_LINE> <INDENT> if self._object is None: <NEW_LINE> <INDENT> obj, id_, *args = self._result.get() <NEW_LINE> if obj ...
A proxy class for :class:`celery.result.AsyncResult` that provide results serialization using :func:`fanboi2.errors.deserialize_error` and :func:`fanboi2.models.deserialize_model`. :param result: A result of :class:`celery.AsyncResult`.
62598fb5097d151d1a2c10fb
class InMageRcmReprotectInput(ReverseReplicationProviderSpecificInput): <NEW_LINE> <INDENT> _validation = { 'instance_type': {'required': True}, 'reprotect_agent_id': {'required': True}, 'datastore_name': {'required': True}, 'log_storage_account_id': {'required': True}, } <NEW_LINE> _attribute_map = { 'instance_type': ...
InMageRcm specific provider input. All required parameters must be populated in order to send to Azure. :param instance_type: Required. The class type.Constant filled by server. :type instance_type: str :param reprotect_agent_id: Required. The reprotect agent Id. :type reprotect_agent_id: str :param datastore_name: R...
62598fb55fdd1c0f98e5e05b
class InstanceDNSTestCase(test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(InstanceDNSTestCase, self).setUp() <NEW_LINE> self.tempdir = tempfile.mkdtemp() <NEW_LINE> self.flags(logdir=self.tempdir) <NEW_LINE> self.network = TestFloatingIPManager() <NEW_LINE> self.network.db = db <NEW_LINE>...
Tests nova.network.manager instance DNS
62598fb544b2445a339b69d9
class ModifyDBInstanceVipVportResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.AsyncRequestId = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.AsyncRequestId = params.get("AsyncRequestId") <NEW_LINE> self.Reques...
ModifyDBInstanceVipVport返回参数结构体
62598fb5460517430c4320c3
class CommandSpecification(Specification): <NEW_LINE> <INDENT> _prefix = "core.command"
CommandSpecifications are used to define commands that may be executed thought the API's command mechanism. Not all Hosts or Managers may support a particular command. \see python.implementation.ManagerInterfaceBase.ManagerInterfaceBase.commandSupported \see python.implementation.ManagerInterfaceBase.ManagerInterfaceB...
62598fb599cbb53fe6830fa2
class ACSZoneViewset(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = ACSZone.objects.all() <NEW_LINE> serializer_class = ACSZoneSerializer <NEW_LINE> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.serializer_class = ListACSZoneSerializer <NEW_LINE> return super(ACSZoneViewset, self).list(requ...
ACS zone API viewset
62598fb5f548e778e596b671
class OperationDefinition(dict): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> assert "name" in kwargs <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def __to_myia__(self): <NEW_LINE> <INDENT> return self["mapping"] <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <...
Definition of an operation.
62598fb5d486a94d0ba2c09f
class MatplotlibWidget(FigureCanvas): <NEW_LINE> <INDENT> def __init__(self, parent=None, title='', xlabel='', ylabel='', xlim=None, ylim=None, xscale='linear', yscale='linear', width=4, height=3, dpi=100, hold=True, X = None, Y = None, Z = None): <NEW_LINE> <INDENT> self.figure = Figure(figsize=(width, height), dpi=dp...
MatplotlibWidget inherits PySide.QtGui.QWidget and matplotlib.backend_bases.FigureCanvasBase Options: option_name (default_value) ------- parent (None): parent widget title (''): figure title xlabel (''): X-axis label ylabel (''): Y-axis label xlim (None): X-axis limits ([min, max]) ylim (None): Y-axis limits ([mi...
62598fb57047854f4633f4a8
class TestScriptPubKey(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 testScriptPubKey(self): <NEW_LINE> <INDENT> pass
ScriptPubKey unit test stubs
62598fb53346ee7daa3376ae
class TexteLibre(Masque): <NEW_LINE> <INDENT> nom = "texte_libre" <NEW_LINE> nom_complet = "texte libre" <NEW_LINE> def init(self): <NEW_LINE> <INDENT> self.texte = "" <NEW_LINE> <DEDENT> def repartir(self, personnage, masques, commande): <NEW_LINE> <INDENT> message = liste_vers_chaine(commande).lstrip() <NEW_LINE> sel...
Masque <texte_libre>. On attend un n'importe quoi en paramètre.
62598fb54527f215b58e9fa3
class TeamMember(object): <NEW_LINE> <INDENT> def __init__(self, first_name=None, last_name=None, username=None, version=None, verified=None, self_url=None): <NEW_LINE> <INDENT> self.swagger_types = { 'first_name': 'str', 'last_name': 'str', 'username': 'str', 'version': 'float', 'verified': 'str', 'self_url': 'str' } ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fb51f5feb6acb162cec
class Op(namedtuple('Op', 'entity, action')): <NEW_LINE> <INDENT> pass
Op holds an entity and action to be authorized on that entity. entity string holds the name of the entity to be authorized. @param entity should not contain spaces and should not start with the prefix "login" or "multi-" (conventionally, entity names will be prefixed with the entity type followed by a hyphen. @param a...
62598fb5be7bc26dc9251ec3
class QMax(sequencetools.AideSequence): <NEW_LINE> <INDENT> NDIM, NUMERIC, SPAN = 0, False, (0., None)
Obere Abflussgrenze (upper discharge boundary) [m³/s].
62598fb5f548e778e596b672
class FakeCreatTargetResponse(object): <NEW_LINE> <INDENT> status = 'fackStatus' <NEW_LINE> def read(self): <NEW_LINE> <INDENT> return FAKE_RES_DETAIL_DATA_CREATE_TARGET
Fake create target response.
62598fb5627d3e7fe0e06f7e
class MonthEnd(CacheableOffset, DateOffset): <NEW_LINE> <INDENT> def apply(self, other): <NEW_LINE> <INDENT> other = datetime(other.year, other.month, other.day, tzinfo=other.tzinfo) <NEW_LINE> n = self.n <NEW_LINE> _, days_in_month = tslib.monthrange(other.year, other.month) <NEW_LINE> if other.day != days_in_month: <...
DateOffset of one month end
62598fb5cc40096d6161a240
class Connection(_http.JSONConnection): <NEW_LINE> <INDENT> API_BASE_URL = 'https://' + PUBSUB_API_HOST <NEW_LINE> API_VERSION = 'v1' <NEW_LINE> API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}' <NEW_LINE> _EXTRA_HEADERS = { _http.CLIENT_INFO_HEADER: _CLIENT_INFO, } <NEW_LINE> def __init__(self, client): <NEW_LIN...
A connection to Google Cloud Pub/Sub via the JSON REST API. :type client: :class:`~google.cloud.pubsub.client.Client` :param client: The client that owns the current connection.
62598fb5a05bb46b3848a939
class script_list(object): <NEW_LINE> <INDENT> def __init__(self, directory_name): <NEW_LINE> <INDENT> self.scripts = [] <NEW_LINE> if not directory_name: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> script_directory = os.path.expanduser(directory_name) <NEW_LINE> if os.path.isdir(script_directory): <NEW_LINE> <INDEN...
Manages a list of user scripts for the Google AIY voice project. The specified directory is scanned for scripts, expected to provide actions for voice commands. Each script can offer to handle multiple keywords. Each script can provide a handler called before and after recognition.
62598fb566656f66f7d5a4bf
class ELU(Module): <NEW_LINE> <INDENT> def __init__(self, alpha=1., inplace=False): <NEW_LINE> <INDENT> super(ELU, self).__init__() <NEW_LINE> self.alpha = alpha <NEW_LINE> self.inplace = inplace <NEW_LINE> <DEDENT> def forward(self, input): <NEW_LINE> <INDENT> return F.elu(input, self.alpha, self.inplace) <NEW_LINE> <...
Applies element-wise, :math:`f(x) = max(0,x) + min(0, alpha * (exp(x) - 1))` Args: alpha: the alpha value for the ELU formulation. Default: 1.0 inplace: can optionally do the operation in-place. Default: False Shape: - Input: :math:`(N, *)` where `*` means, any number of additional dimensions - ...
62598fb53d592f4c4edbaf8f
class CartSerializer(serializers.Serializer): <NEW_LINE> <INDENT> sku_id = serializers.IntegerField(label='商品 SKU ID', min_value=1) <NEW_LINE> count = serializers.IntegerField(label='商品数量', min_value=1) <NEW_LINE> selected = serializers.BooleanField(label='是否勾选', default=True) <NEW_LINE> def validate_sku_id(self, value...
购物车序列化器:校验数据使用
62598fb58a43f66fc4bf2248
@nest.check_stack <NEW_LINE> class RateInstantaneousAndDelayedTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_rate_instantaneous_and_delayed(self): <NEW_LINE> <INDENT> neuron_params = {'tau': 5., 'std': 0.} <NEW_LINE> drive = 1.5 <NEW_LINE> delay = 2. <NEW_LINE> weight = 0.5 <NEW_LINE> simtime = 100. <NEW_LIN...
Test whether delayed rate connections have same properties as instantaneous connections but with the correct delay
62598fb5167d2b6e312b7042
class DateTime(types.UInt): <NEW_LINE> <INDENT> @property <NEW_LINE> def _input_casts(self): <NEW_LINE> <INDENT> casts = super(DateTime, self)._input_casts <NEW_LINE> casts[datetime] = self._datetime_cast <NEW_LINE> return casts <NEW_LINE> <DEDENT> def _datetime_cast(self, value): <NEW_LINE> <INDENT> initial_date = dat...
Date-Time field which accepts datetime input and string time inputs
62598fb5460517430c4320c4
class excTWCC_CAPSEQERROR(Exception): <NEW_LINE> <INDENT> pass
Capability has dependencies on other capabilities and cannot be operated upon at this time.
62598fb55166f23b2e2434aa
class FieldLevelAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> def get_fieldsets(self, request, obj=None): <NEW_LINE> <INDENT> if self.declared_fieldsets: <NEW_LINE> <INDENT> fieldsets = self.declared_fieldsets <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> form = self.get_form(request, obj) <NEW_LINE> fieldsets = form.ba...
A subclass of ModelAdmin that provides hooks for setting field-level permissions based on object or request properties. Intended to be used as an abstract base class replacement for ModelAdmin, with can_change_inline() and can_change_field() customized to each use.
62598fb5283ffb24f3cf395c
class _BufferedReader(object): <NEW_LINE> <INDENT> def __init__(self, iterator): <NEW_LINE> <INDENT> self._iterator = iterator <NEW_LINE> try: <NEW_LINE> <INDENT> self._current_element = next(self._iterator) <NEW_LINE> <DEDENT> except StopIteration: <NEW_LINE> <INDENT> self._current_element = self._iterator <NEW_LINE> ...
A look-ahead reader that expedites merging. Accepts an iterator and returns element (advancing current element) if requested element equals next element in collection and None otherwise. Never returns StopIteration so cannot be used as iteration control-flow. This behavior is useful only because VcfRecord equality is...
62598fb597e22403b383afd5
class TestCloudInstall(TestDistributed): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(self): <NEW_LINE> <INDENT> super().setUpClass() <NEW_LINE> th.start_streams_cloud_instance() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(self): <NEW_LINE> <INDENT> th.stop_streams_cloud_instance() <NEW_...
Test invocations of composite operators in Streaming Analytics Service using remote toolkit
62598fb57b180e01f3e490b8
class MakeServiceTest(TestCase): <NEW_LINE> <INDENT> if not Crypto: <NEW_LINE> <INDENT> skip = "can't run w/o PyCrypto" <NEW_LINE> <DEDENT> if not pyasn1: <NEW_LINE> <INDENT> skip = "can't run w/o PyASN1" <NEW_LINE> <DEDENT> if not unix: <NEW_LINE> <INDENT> skip = "can't run on non-posix computers" <NEW_LINE> <DEDENT> ...
Tests for L{tap.makeService}.
62598fb566673b3332c3049c
class TextCallbackWidget(TextWidget): <NEW_LINE> <INDENT> def __init__( self, pos: Point, callback: Callable, style: Optional[int] = None ): <NEW_LINE> <INDENT> self._callback = callback <NEW_LINE> super(TextCallbackWidget, self).__init__(pos, callback(), style) <NEW_LINE> <DEDENT> def update(self, dt): <NEW_LINE> <IND...
Simple text widget with callback. :param pos: widget's global position :param text: contained text :param style: curses style for text
62598fb54a966d76dd5eefa7
class HelloAPIView(APIView): <NEW_LINE> <INDENT> serializer_class = HelloSerializer <NEW_LINE> def get(self, request, format=None): <NEW_LINE> <INDENT> an_apiview = [ 'Use HTTP methods as function (get, post, patch, put, delete)', 'It is similar to traditional Django view', 'gives you the most control over your logic',...
Test API View
62598fb5a79ad1619776a13b
class DepthFirstTraverser(object): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def _processing_map(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def nodes_to_be_processed(self): <NEW_LINE> <INDENT> return tuple(k for k in self._processing_map().keys()) <NEW_LINE> <DEDENT> def process(self, node): <NEW_LINE> <I...
Helper class that allows depth first traversal and to implement custom processing for certain AST nodes. The processor of a node must return the new resulting node. This node will be placed in the tree. Processing of a node using this traverser should therefore only transform child nodes. The returned node will get th...
62598fb526068e7796d4ca26
class Role(Resource): <NEW_LINE> <INDENT> PATH = 'admin/Role' <NEW_LINE> COLLECTION_NAME = 'roles' <NEW_LINE> PRIMARY_KEY = 'role_id' <NEW_LINE> def __init__(self, role_id=None, *args, **kwargs): <NEW_LINE> <INDENT> Resource.__init__(self) <NEW_LINE> self.__role_id = role_id <NEW_LINE> <DEDENT> @property <NEW_LINE> def...
A role defines a common set of permissions that govern access into a given account
62598fb57047854f4633f4ab
class UserManager(BaseUserManager): <NEW_LINE> <INDENT> use_in_migrations = True <NEW_LINE> def _create_user(self, email, password, **extra_fields): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('The given email must be set') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> us...
ユーザーマネージャー.
62598fb5379a373c97d990e5
class ProxiedInterface(object): <NEW_LINE> <INDENT> send_midi = nop <NEW_LINE> def __init__(self, outer = None, *a, **k): <NEW_LINE> <INDENT> super(ControlElement.ProxiedInterface, self).__init__(*a, **k) <NEW_LINE> self._outer = outer <NEW_LINE> <DEDENT> @property <NEW_LINE> def outer(self): <NEW_LINE> <INDENT> return...
Declaration of the interface to be used when the ControlElement is wrapped in any form of Proxy object.
62598fb50fa83653e46f4faf
class Solution: <NEW_LINE> <INDENT> def permute(self, nums): <NEW_LINE> <INDENT> results = [] <NEW_LINE> if nums is None: <NEW_LINE> <INDENT> return results <NEW_LINE> <DEDENT> visited = [False for i in range(len(nums))] <NEW_LINE> self.dfs_permute(nums, visited, [], results) <NEW_LINE> return results <NEW_LINE> <DEDEN...
@param: nums: A list of integers. @return: A list of permutations.
62598fb532920d7e50bc6124
class Closed(RuntimeError): <NEW_LINE> <INDENT> pass
Raised when sending command to closed client
62598fb55fdd1c0f98e5e05e
class Crawler(object): <NEW_LINE> <INDENT> def __init__(self, urls, threadnum): <NEW_LINE> <INDENT> super(Crawler, self).__init__() <NEW_LINE> self.threadnum = threadnum <NEW_LINE> self.urls = urls <NEW_LINE> <DEDENT> def craw(self): <NEW_LINE> <INDENT> threads = [] <NEW_LINE> for i in range(self.threadnum): <NEW_LINE>...
爬取公司名字的爬虫
62598fb5097d151d1a2c10ff
class TestTransactionUpdateView(object): <NEW_LINE> <INDENT> def test_404_when_not_exists(self, testapp): <NEW_LINE> <INDENT> testapp.get("/transactions/1/update", status=404) <NEW_LINE> <DEDENT> def test_get_update(self, testapp, example_transactions): <NEW_LINE> <INDENT> testapp.get("/transactions/1/update", status=2...
Test for the transaction detail view.
62598fb563b5f9789fe8523c
class Spawn(LaunchMode): <NEW_LINE> <INDENT> def run(self, cmdline, **kwargs): <NEW_LINE> <INDENT> if ver.islinux(): <NEW_LINE> <INDENT> self.popen = subprocess.Popen('%s %s' % (pyfile, cmdline), **kwargs) <NEW_LINE> <DEDENT> elif ver.iswin(): <NEW_LINE> <INDENT> self.popen = subprocess.Popen('%s %s' % (pyfile, cmdline...
create a new process and run python in the process; can be used both Windows and Unix
62598fb57b25080760ed7583
class SubmitSkillForCertificationRequest(object): <NEW_LINE> <INDENT> deserialized_types = { 'publication_method': 'ask_smapi_model.v1.skill.publication_method.PublicationMethod', 'version_message': 'str' } <NEW_LINE> attribute_map = { 'publication_method': 'publicationMethod', 'version_message': 'versionMessage' } <NE...
:param publication_method: :type publication_method: (optional) ask_smapi_model.v1.skill.publication_method.PublicationMethod :param version_message: Description of the version (limited to 300 characters). :type version_message: (optional) str
62598fb5baa26c4b54d4f388
class Proxmox: <NEW_LINE> <INDENT> def __init__(self, user, password, host, verify_ssl): <NEW_LINE> <INDENT> from proxmoxer import ProxmoxAPI <NEW_LINE> self.data = None <NEW_LINE> try: <NEW_LINE> <INDENT> self._api = ProxmoxAPI(host, user=user, password=password, verify_ssl=verify_ssl) <NEW_LINE> _LOGGER.error('Proxmo...
Handle all communication with the Proxmox API.
62598fb5a8370b77170f04ae
class ScanReport(object): <NEW_LINE> <INDENT> def __init__(self, adv_report): <NEW_LINE> <INDENT> self.timestamp = time.time() <NEW_LINE> self.peer_address = adv_report.peer_addr <NEW_LINE> self.packet_type: AdvertisingPacketType = adv_report.adv_type <NEW_LINE> self._current_advertise_data = adv_report.adv_data.record...
Represents a payload and associated metadata that's received during scanning
62598fb57c178a314d78d56e
class IsisAddressFamilyEnum(Enum): <NEW_LINE> <INDENT> ipv4 = 0 <NEW_LINE> ipv6 = 1 <NEW_LINE> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_clns_isis_datatypes as meta <NEW_LINE> return meta._meta_table['IsisAddressFamilyEnum']
IsisAddressFamilyEnum Isis address family .. data:: ipv4 = 0 IPv4 .. data:: ipv6 = 1 IPv6
62598fb58a43f66fc4bf224a
class DatasetSettings(BaseSettings): <NEW_LINE> <INDENT> dataset_path: str = None
Base settings for dataset
62598fb5283ffb24f3cf395e
class Threat(CSKAType): <NEW_LINE> <INDENT> @property <NEW_LINE> def _fields(self): <NEW_LINE> <INDENT> return ['time', 'threat_id', 'threat', 'count', 'has_capture', 'acknowledged', 'name', 'signer_seat_id', 'device_id', 'validator', 'validator_seat_id', 'seat_id', 'device'] <NEW_LINE> <DEDENT> @property <NEW_LINE> de...
Threat details. Threat details contain the following fields: - time (int): Seconds since epoch (UTC) when threat occurred. - threat_id (string): Unique internal id representing the threat. - threat (string): Description of the threat. - count (int): Number of threats in this record. - has_capture (bool): Is ...
62598fb5d268445f26639bec
class WinkTime(Enum): <NEW_LINE> <INDENT> STOP = 0 <NEW_LINE> BY_SECONDS = 1 <NEW_LINE> BY_MANUFACTUERER = 254 <NEW_LINE> FOREVER = 255
Enum class for Wink Time.
62598fb5fff4ab517ebcd8b7
class PtpIpCmdResponse(PtpIpPacket): <NEW_LINE> <INDENT> def __init__(self, data=None): <NEW_LINE> <INDENT> super(PtpIpCmdResponse, self).__init__() <NEW_LINE> self.cmdtype = struct.pack('I', 0x07) <NEW_LINE> if data is not None: <NEW_LINE> <INDENT> self.ptp_response_code = struct.unpack('H', data[0:2])[0] <NEW_LINE> s...
ResponseCode Description 0x2000 Undefined 0x2001 OK 0x2002 General Error 0x2003 Session Not Open 0x2004 Invalid TransactionID 0x2005 Operation Not Supported 0x2006 Parameter Not Supported 0x2007 Incomplete Transfer 0x2008 Invalid StorageID 0x2009 Invalid ObjectHandle 0x200A DeviceProp Not Supported 0x200B Invalid Objec...
62598fb54f88993c371f0574
class InvenioDB(object): <NEW_LINE> <INDENT> def __init__(self, app=None, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> if app: <NEW_LINE> <INDENT> self.init_app(app, **kwargs) <NEW_LINE> <DEDENT> <DEDENT> def init_app(self, app, **kwargs): <NEW_LINE> <INDENT> self.kwargs.update(kwargs) <NEW_LINE> self...
Invenio database extension.
62598fb560cbc95b06364416
class Median(Aggregation): <NEW_LINE> <INDENT> def __init__(self, column_name): <NEW_LINE> <INDENT> self._column_name = column_name <NEW_LINE> self._percentiles = Percentiles(column_name) <NEW_LINE> <DEDENT> def get_aggregate_data_type(self, table): <NEW_LINE> <INDENT> return Number() <NEW_LINE> <DEDENT> def validate(s...
Calculate the median value of a column containing :class:`.Number` data. This is the 50th percentile. See :class:`Percentiles` for implementation details.
62598fb599fddb7c1ca62e53
class BatchPad(base.NetworkHandlerImpl): <NEW_LINE> <INDENT> def __init__(self, batch_size, keys, axis=0): <NEW_LINE> <INDENT> self.keys = keys <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.axis = axis <NEW_LINE> <DEDENT> def _pad(self, arr): <NEW_LINE> <INDENT> rem = arr.shape[self.axis] % self.batch_size <N...
pads variables with 0's to the specified batch size
62598fb5f548e778e596b675
class Solution: <NEW_LINE> <INDENT> @timeit <NEW_LINE> def judgeCircle(self, moves: str) -> bool: <NEW_LINE> <INDENT> st = 0 <NEW_LINE> d = {"U":1, "D":-1, "L":-1j, "R":1j} <NEW_LINE> for c in moves: <NEW_LINE> <INDENT> st += d[c] <NEW_LINE> <DEDENT> return st == 0
[657. 机器人能否返回原点](https://leetcode-cn.com/problems/robot-return-to-origin/)
62598fb54e4d5625663724f3
class Meta(UserSerializer.Meta): <NEW_LINE> <INDENT> fields = UserSerializer.Meta.fields + ('roles', )
Metaclass for serializer.
62598fb53317a56b869be5b5
class PortalLanguagesVocabulary(object): <NEW_LINE> <INDENT> implements(IVocabularyFactory) <NEW_LINE> def __call__(self, context): <NEW_LINE> <INDENT> portal_languages = getToolByName(context, 'portal_languages', None) <NEW_LINE> if not portal_languages: <NEW_LINE> <INDENT> return SimpleVocabulary([]) <NEW_LINE> <DEDE...
Return portal types as vocabulary
62598fb53346ee7daa3376b0
class AbstractContextManager(abc.ABC): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def __exit__(self, exc_type, exc_value, traceback): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def __subclasshook__(cls, C):...
An abstract base class for context managers.
62598fb54f6381625f199529
class LogfileModuleLogger(ModuleLogger): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> ModuleLogger.__init__(self) <NEW_LINE> self._file = open(filename, 'w') <NEW_LINE> <DEDENT> def set_current_module(self, name): <NEW_LINE> <INDENT> self._update_file(self._file) <NEW_LINE> <DEDENT> def clear_c...
The file output logger, all the outputs go to the same log file.
62598fb567a9b606de5460a1