code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class MediaWikiAPI(object): <NEW_LINE> <INDENT> def __init__(self, session): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> <DEDENT> def get_content(self, title): <NEW_LINE> <INDENT> return self.session.index_call({"action": "raw", "title": title}) <NEW_LINE> <DEDENT> def revisions(self, title, start="", end="X"...
Implements an API for content stored on a MediaWiki.
62598f9382261d6c5272fd22
class LocalNRL(NRL): <NEW_LINE> <INDENT> def __init__(self, root): <NEW_LINE> <INDENT> self.root = root <NEW_LINE> self._join = os.path.join <NEW_LINE> super(self.__class__, self).__init__() <NEW_LINE> <DEDENT> def _get_cp_from_ini(self, path): <NEW_LINE> <INDENT> cp = ConfigParser() <NEW_LINE> with codecs.open(path, m...
Subclass of NRL for accessing local copy NRL.
62598f937047854f4633f077
class BootstrapVerifyPassword(PasswordInput): <NEW_LINE> <INDENT> def __init__(self, error_class=u"is-invalid"): <NEW_LINE> <INDENT> super(BootstrapVerifyPassword, self).__init__() <NEW_LINE> self.error_class = error_class <NEW_LINE> <DEDENT> def __call__(self, field, **kwargs): <NEW_LINE> <INDENT> if field.errors: <NE...
Bootstrap Validator for password
62598f9345492302aabfc16f
class HHApiError(Exception): <NEW_LINE> <INDENT> pass
Hypnohub API Error.
62598f9330dc7b766599f4ea
class Create_DB_Project(Base): <NEW_LINE> <INDENT> __tablename__ = 'SPProjects' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> date = Column(DateTime(timezone=False), default=func.now()) <NEW_LINE> project = Column(String(50), nullable=False) <NEW_LINE> description = Column(String(50), nullable=False)
class create project table for Spare Parts
62598f93d7e4931a7ef3bd3b
class Blips(object): <NEW_LINE> <INDENT> def __init__(self, blips): <NEW_LINE> <INDENT> self._blips = blips <NEW_LINE> <DEDENT> def __getitem__(self, blip_id): <NEW_LINE> <INDENT> return self._blips[blip_id] <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self._blips.__iter__() <NEW_LINE> <DEDENT> de...
Class modeling an immutable dictionary of blips.
62598f9385dfad0860cbf8bf
class RollbackException(Exception): <NEW_LINE> <INDENT> pass
Raised to cause a clean rollback of the transaction
62598f9323e79379d538c19e
class TagMixin: <NEW_LINE> <INDENT> def tags(self, user_tags=None, custom_fields=None): <NEW_LINE> <INDENT> if custom_fields: <NEW_LINE> <INDENT> self.setdefault('tags', dict()) <NEW_LINE> self['tags']['customFields'] = custom_fields <NEW_LINE> <DEDENT> if user_tags: <NEW_LINE> <INDENT> self.setdefault('tags', dict()) ...
Field used to build the *tags* parameter in the payload data
62598f93498bea3a75a577c2
class MySQLClient(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def __init_client(db_config): <NEW_LINE> <INDENT> client = pymysql.connect( host=db_config['host'], port=db_config['port'], user=db_config['user'], passwd=db_config['passwd'], db=db_config['db'], charset=db_config['charset'] ) <NEW_LINE> if client....
MySQL相关方法 所有的连接均为短连接,用完就关闭
62598f931f037a2d8b9e3d7a
class Meta: <NEW_LINE> <INDENT> model = Process <NEW_LINE> read_only_fields = ( "created", "id", "modified", "is_active", ) <NEW_LINE> update_protected_fields = ( "category", "contributor", "data_name", "description", "entity_always_create", "entity_descriptor_schema", "entity_input", "entity_type", "input_schema", "na...
ProcessSerializer Meta options.
62598f9307d97122c4216948
class CinderManager(object): <NEW_LINE> <INDENT> def __init__(self, username, password, project, auth_url): <NEW_LINE> <INDENT> self.client = cinder_client.Client(username, password, project, auth_url) <NEW_LINE> <DEDENT> def volume_list(self): <NEW_LINE> <INDENT> return self.client.volumes.list() <NEW_LINE> <DEDENT> d...
Manage Cinder resources
62598f9360cbc95b06363fdf
class UserProfileManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, name, password=None): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('User must have email address') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email, name=...
Manaer for user profiles
62598f93bde94217f37074b5
class Shape(Symbolizer): <NEW_LINE> <INDENT> def __init__(self, color=None, size=6, type='circle'): <NEW_LINE> <INDENT> Symbolizer.__init__(self) <NEW_LINE> self.color = Color(color) if color else None <NEW_LINE> self.size = Expression(size) <NEW_LINE> self.type = type <NEW_LINE> <DEDENT> def _prepare(self, rule): <NEW...
Symbolizer for point geometries that consists of a ``color`` and ``size``. >>> Shape('#ff0000', 5) Shape(color=(255,0,0),size=5,type=circle) The ``type`` argument is a well known name describing the shape type: >>> shp = Shape(type='triangle') The default shape is "circle". Allowable values include "square", "tria...
62598f93a17c0f6771d5bed4
class Portfolio(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=150, unique=True) <NEW_LINE> user = models.ForeignKey(User, related_name='portfolios', on_delete=models.CASCADE, null=False) <NEW_LINE> items = models.ManyToManyField(Item)
Portfolio model
62598f930fa83653e46f4b83
class Weather: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.temperature = 70.0 <NEW_LINE> self.status = "sunny" <NEW_LINE> <DEDENT> def process_message(self, message): <NEW_LINE> <INDENT> logger.info("weather process_message is incomplete - skipping") <NEW_LINE> value = message.value() <NEW_LINE> lo...
Defines the Weather model
62598f933c8af77a43b67d87
class UnexpectedInputError(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.value
Exception raised for errors in the input.
62598f93a79ad16197769cfa
class CommandFailedError(CommandError): <NEW_LINE> <INDENT> def __init__(self, command: str, text: str, error_id: int): <NEW_LINE> <INDENT> self._command = command <NEW_LINE> self._error_text = text <NEW_LINE> self._error_id = error_id <NEW_LINE> super().__init__(command, "{} ({})".format(text, error_id)) <NEW_LINE> <D...
Define an error when a HEOS command fails.
62598f934e4d5625663720ba
class ContrastMatrix(object): <NEW_LINE> <INDENT> def __init__(self, matrix, column_suffixes): <NEW_LINE> <INDENT> self.matrix = np.asarray(matrix) <NEW_LINE> self.column_suffixes = column_suffixes <NEW_LINE> if self.matrix.shape[1] != len(column_suffixes): <NEW_LINE> <INDENT> raise PatsyError("matrix and column_suffix...
A simple container for a matrix used for coding categorical factors. Attributes: .. attribute:: matrix A 2d ndarray, where each column corresponds to one column of the resulting design matrix, and each row contains the entries for a single categorical variable level. Usually n-by-n for a full rank coding or...
62598f9363b5f9789fe84e0f
class MgmtDatastoreVersions(base.ManagerWithFind): <NEW_LINE> <INDENT> resource_class = datastores.DatastoreVersion <NEW_LINE> def list(self, limit=None, marker=None): <NEW_LINE> <INDENT> return self._paginated("/mgmt/datastore-versions", "versions", limit, marker) <NEW_LINE> <DEDENT> def get(self, datastore_version_id...
Manage :class:`DatastoreVersion` resources.
62598f9391af0d3eaad39aa0
class UnsupportedVendorError(Error): <NEW_LINE> <INDENT> pass
If vendor is not supported by framework.
62598f93379a373c97d98cac
class LiveVideoConverter(Converter): <NEW_LINE> <INDENT> def __init__(self, source: typing.Union[str, int], scale: float, width_stretch: float, gradient: str): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> self.scale = scale <NEW_LINE> self.width_stretch = width_stretch <NEW_LINE> self.gradient = list(gradient) <...
A converter class which handles converting live video from a camera to ASCII.
62598f9338b623060ffa8d26
class AttributeEnclosingMethod(AttributeInfoEntry): <NEW_LINE> <INDENT> class_index = 0 <NEW_LINE> method_index = 0 <NEW_LINE> def __init__(self, constant_pool): <NEW_LINE> <INDENT> super().__init__(constant_pool) <NEW_LINE> self.class_index = 0 <NEW_LINE> self.method_index = 0 <NEW_LINE> <DEDENT> def populate(self, f...
class_index - should be an index into the constant pool pointing to a ClassInfo structure method_index - should be an index into the constant pool pointing to a NameAndTypeInfo structure
62598f93f8510a7c17d7dfc4
class ReconciliationUnmatchTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> create_user() <NEW_LINE> group = ReconciliationGroup.objects.create() <NEW_LINE> bank_transactions = create_bank_transactions() <NEW_LINE> bank_transaction = bank_transactions[0] <NEW_LINE> bank_transaction.reconciled = ...
Tests the unmatch transaction view
62598f9394891a1f408b953d
class AdaptiveInstanceNorm2d(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_features, eps=1e-5, momentum=0.1): <NEW_LINE> <INDENT> super(AdaptiveInstanceNorm2d, self).__init__() <NEW_LINE> self.num_features = num_features <NEW_LINE> self.eps = eps <NEW_LINE> self.momentum = momentum <NEW_LINE> self.weight = Non...
Reference: https://github.com/NVlabs/MUNIT/blob/master/networks.py
62598f93090684286d593525
class QueryAliyunVideoAuthTest(SteamTestCase): <NEW_LINE> <INDENT> __interfaceName__ = "/steam-course/course/queryAliyunVideoAuth" <NEW_LINE> @initInputService( services = [ WeixinSearchService , UserViewCourseService ], curser = QueryAliyunVideoAuthService ) <NEW_LINE> def __init__(self, methodName = 'runTest', para...
用户获取观看权限字符串
62598f93f7d966606f747c7e
class StringNotFound(Exception): <NEW_LINE> <INDENT> pass
Raised when language string not found for the given key inside english locale.
62598f9330dc7b766599f4ec
class PicasaField(FileField): <NEW_LINE> <INDENT> attr_class = PicasaFieldFile <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('upload_to', 'default') <NEW_LINE> super(PicasaField, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def south_field_triple(self): <NEW_LINE> <INDENT...
Field that is used in the model.
62598f9324f1403a926856fe
class Logger: <NEW_LINE> <INDENT> VERBOSITY = ['DEBUG', 'INFO'] <NEW_LINE> def __init__(self, path: str, comment: str = None, verbosity: str = 'DEBUG', experiment_name: str = None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.full_path = os.path.join( self.path, 'logs' ) <NEW_LINE> os.makedirs(self.full_path, ...
Logger class to save events to TensorBoard.
62598f938e71fb1e983bb74f
class CollectionAggregate(UnaryExpression): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _create_any(cls, expr): <NEW_LINE> <INDENT> expr = _literal_as_binds(expr) <NEW_LINE> if expr.is_selectable and hasattr(expr, "as_scalar"): <NEW_LINE> <INDENT> expr = expr.as_scalar() <NEW_LINE> <DEDENT> expr = expr.self_group()...
Forms the basis for right-hand collection operator modifiers ANY and ALL. The ANY and ALL keywords are available in different ways on different backends. On PostgreSQL, they only work for an ARRAY type. On MySQL, they only work for subqueries.
62598f93498bea3a75a577c4
class PID: <NEW_LINE> <INDENT> def __init__(self, P=0.2, I=0.0, D=0.0): <NEW_LINE> <INDENT> self.Kp = P <NEW_LINE> self.Ki = I <NEW_LINE> self.Kd = D <NEW_LINE> self.SetPoint=None <NEW_LINE> self.sample_time = 0.00 <NEW_LINE> self.current_time = time.time() <NEW_LINE> self.last_time = self.current_time <NEW_LINE> self....
PID Controller
62598f93dd821e528d6d8bcf
class DisplayArticle(DetailView): <NEW_LINE> <INDENT> model = Article <NEW_LINE> template_name = 'news/article_detail.html' <NEW_LINE> context_object_name = 'news_article'
Display a single article, identified by a unique slug.
62598f93b57a9660fecd1715
class Viewer: <NEW_LINE> <INDENT> def register(self, sub: Subject): <NEW_LINE> <INDENT> sub.register_viewer(self) <NEW_LINE> <DEDENT> def unregister(self, sub: Subject): <NEW_LINE> <INDENT> sub.unregister_viewer(self) <NEW_LINE> <DEDENT> def update(self, *args): <NEW_LINE> <INDENT> pass
观察者
62598f93004d5f362081ee49
class Rbac(MiddlewareMixin): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> current_url = request.path_info <NEW_LINE> for valid_url in settings.VAILD_URL_LIST: <NEW_LINE> <INDENT> if re.match(valid_url, current_url): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> <DEDENT> permissions_...
用户URL进入URL路由控制器之前经过的中间件
62598f9307f4c71912baf0e6
class Bucket(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update(kwargs) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> strs = ["%s=%r" % kv for kv in self.__dict__.items()] <NEW_LINE> return "Bucket(" + ", ".join(strs) + ")"
General purpose, hold-all data object
62598f9396565a6dacd2cdc7
class Context(object): <NEW_LINE> <INDENT> default_ctx = None <NEW_LINE> devtype2str = {1: 'cpu', 2: 'gpu', 3: 'cpu_pinned'} <NEW_LINE> devstr2type = {'cpu': 1, 'gpu': 2, 'cpu_pinned': 3} <NEW_LINE> def __init__(self, device_type, device_id=0): <NEW_LINE> <INDENT> if isinstance(device_type, Context): <NEW_LINE> <INDENT...
Constructs a context. MXNet can run operations on CPU and different GPUs. A context describes the device type and ID on which computation should be carried on. One can use mx.cpu and mx.gpu for short. See also ---------- `How to run MXNet on multiple CPU/GPUs <http://mxnet.io/how_to/multi_devices.html>` for more det...
62598f93bde94217f37074b6
class AdjacencyList(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.adjacency_list = {} <NEW_LINE> self.nodes = [] <NEW_LINE> <DEDENT> def adjacent(self, node_1, node_2): <NEW_LINE> <INDENT> if node_2 in [x.to_node for x in self.adjacency_list[node_1]]: <NEW_LINE> <INDENT> return True <NEW_LIN...
AdjacencyList is one of the graph representation which uses adjacency list to store nodes and edges
62598f936fb2d068a7693c80
class StringRecordPackage(TwincatTypeRecordPackage): <NEW_LINE> <INDENT> input_rtyp = 'waveform' <NEW_LINE> output_rtyp = 'waveform' <NEW_LINE> dtyp = 'asynInt8' <NEW_LINE> field_defaults = { 'FTVL': 'CHAR', 'APST': 'On Change', 'MPST': 'On Change', } <NEW_LINE> link_requires_record = True <NEW_LINE> link_suffix = "LSO...
RecordPackage for broadcasting string values
62598f9363b5f9789fe84e11
class MultiHeadAttention_raw(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d_q, d_k, d_model=768, dropout=0.1, h=1): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> assert d_model % h == 0 <NEW_LINE> self.d_model_h = d_model // h <NEW_LINE> self.h = h <NEW_LINE> self.d_qkv = [d_q, d_k, d_k] <NEW_LINE> self.linea...
Take in model size and number of heads.
62598f93b830903b9686e2c1
class LostRemote(Exception): <NEW_LINE> <INDENT> pass
失去心跳之后
62598f93baa26c4b54d4ef4a
class NombreFemmesEnceintesCPN1NombreMILDFemmesEnceintes(IndicatorTable): <NEW_LINE> <INDENT> name = "Figure 31" <NEW_LINE> title = " " <NEW_LINE> caption = ("Nombre de femmes enceintes reçues en CPN1 et Nombre " "de MILD distribuées aux femmes enceintes") <NEW_LINE> rendering_type = 'graph' <NEW_LINE> INDICATORS = [ g...
Graphe: Nombre de femmes enceintes reçues en CPN1 et Nombre de MILD distribuées aux femmes enceintes
62598f930a50d4780f705071
class NamedTree: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def extract_spec(cls, *T_list): <NEW_LINE> <INDENT> for T in T_list: <NEW_LINE> <INDENT> if T.spec: <NEW_LINE> <INDENT> return T.spec <NEW_LINE> <DEDENT> <DEDENT> t_list = list(map(lambda T:T.get_tree(), T_list)) <NEW_LINE> t_spec = named_tree_get_common(t_li...
Could be used as a info for a named tree
62598f93379a373c97d98cae
class ImagefapImageExtractor(Extractor): <NEW_LINE> <INDENT> category = "imagefap" <NEW_LINE> subcategory = "image" <NEW_LINE> directory_fmt = ["{category}", "{gallery_id} {title}"] <NEW_LINE> filename_fmt = "{category}_{gallery_id}_{name}.{extension}" <NEW_LINE> pattern = [r"(?:https?://)?(?:www\.)?imagefap\.com/photo...
Extractor for single images from imagefap.com
62598f9310dbd63aa1c7085b
class SmartDevices: <NEW_LINE> <INDENT> def __init__( self, lights: List[SmartDevice] = None, switches: List[SmartDevice] = None ): <NEW_LINE> <INDENT> self._lights = lights or [] <NEW_LINE> self._switches = switches or [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def lights(self): <NEW_LINE> <INDENT> return self._light...
Hold different kinds of devices.
62598f938da39b475be02e7d
class QtDialog(QtWindow, ProxyDialog): <NEW_LINE> <INDENT> widget = Typed(QWindowDialog) <NEW_LINE> def create_widget(self): <NEW_LINE> <INDENT> flags = self.creation_flags() <NEW_LINE> self.widget = QWindowDialog(self, self.parent_widget(), flags) <NEW_LINE> <DEDENT> def init_widget(self): <NEW_LINE> <INDENT> super(Qt...
A Qt implementation of an Enaml ProxyDialog.
62598f93dd821e528d6d8bd0
class GCalendarToggleEnabled(generics.GenericAPIView): <NEW_LINE> <INDENT> serializer_class = GCalendarSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return GCalendar.objects.filter(user=self.request.user) <NEW_LINE> <DEDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE...
API endpoint primarily used for toggling calendar defaults
62598f93b7558d58954632c9
class Bachangfshj(ORMBase): <NEW_LINE> <INDENT> implements(IBachangfshj) <NEW_LINE> __tablename__ = 'envi_bachangfshj' <NEW_LINE> id = sqlalchemy.schema.Column(sqlalchemy.types.Integer(),Sequence('bachangfshj_id_seq'), primary_key=True, autoincrement=True, ) <NEW_LINE> bcdm = sqlalchemy.schema.Column(sqlalchemy.types.S...
Database-backed implementation of IBachangfshj
62598f93009cb60464d011cb
class PPSingleSelOption( PPSingleValOption ): <NEW_LINE> <INDENT> def inselectable( self, value ): <NEW_LINE> <INDENT> return ( value in self.selectable() ) <NEW_LINE> <DEDENT> def selectable( self ): <NEW_LINE> <INDENT> raise NotImplementedError()
Basic Single Value Selection Option
62598f93442bda511e95c100
@implementer(IMailbox) <NEW_LINE> class Mailbox: <NEW_LINE> <INDENT> def listMessages(self, i=None): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> def getMessage(self, i): <NEW_LINE> <INDENT> raise ValueError <NEW_LINE> <DEDENT> def getUidl(self, i): <NEW_LINE> <INDENT> raise ValueError <NEW_LINE> <DEDENT> def dele...
A base class for mailboxes.
62598f9332920d7e50bc5cfc
class PluginLoadingFlake8(Flake8): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> ext_dir = pkg_resources.normalize_path('build_ext') <NEW_LINE> dist = pkg_resources.Distribution( ext_dir, project_name='build_ext', metadata=pkg_resources.PathMetadata(ext_dir, ext_dir) ) <NEW_LINE> pkg_reso...
A Flake8 runner that will load our custom plugins. It's important to note that this has to be invoked via `./setup.py flake8`. Just running `flake8` won't cut it. Flake8 normally wants to load plugins via entry_points, but as far as I can tell that would require packaging our checkers separately. Instead, we create...
62598f936e29344779b002f6
class _MinimalResult(object): <NEW_LINE> <INDENT> __slots__ = ( 'failures', 'errors', 'skipped', 'expectedFailures', 'unexpectedSuccesses', 'stream', 'shouldStop', 'testsRun') <NEW_LINE> def fixup_case(self, case): <NEW_LINE> <INDENT> case._outcomeForDoCleanups = None <NEW_LINE> <DEDENT> def __init__(self, original_res...
A minimal, picklable TestResult-alike object.
62598f9307d97122c421694d
class State(local): <NEW_LINE> <INDENT> request_id: Optional[str] = None <NEW_LINE> request: Optional[HttpRequest] = None
Storage for request state
62598f930c0af96317c56021
class StudentDiscussionList(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = get_all_students_count() <NEW_LINE> serializer_class = StudentDiscussionSerializer <NEW_LINE> permission_classes = (IsAdminUser,) <NEW_LINE> authentication_classes = (SessionAuthentication, BasicAuthentication, OAuth2Authentication)
**Use Case** *Get a paginated list of students with their count of discussions and questions in the edX Platform. Each page in the list can contain up to 10 students. **Example Requests** GET /api/courses/v2/discussions/students/ **Response Values** On success with Response Code <200> *...
62598f93d486a94d0ba2bc70
class MetricsIntegrationTest(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.cw_client = boto3.client("cloudwatch") <NEW_LINE> cls.cw_metric_publisher = CWMetricsPublisher(cls.cw_client) <NEW_LINE> <DEDENT> def test_publish_single_metric(self): <NEW_LINE> <INDENT> now...
This class will use a unique metric namespace to create metrics. There is no cleanup done here because if a particular namespace is unsed for 2 weeks it'll be cleanedup by cloudwatch.
62598f933c8af77a43b67d89
class Candidate(object): <NEW_LINE> <INDENT> KIND_HOST = 0 <NEW_LINE> KIND_RELAYED = 1 <NEW_LINE> KIND_SERVER_REFLEXIVE = 2 <NEW_LINE> KIND_PEER_REFLEXIVE = 3 <NEW_LINE> def __init__(self, kind, address, priority=0): <NEW_LINE> <INDENT> self._kind = kind <NEW_LINE> self._address = address <NEW_LINE> self._priority = pr...
Candidate transport address
62598f936fb2d068a7693c81
class Sha1Hash(object): <NEW_LINE> <INDENT> name = 'python-sha1' <NEW_LINE> digest_size = 20 <NEW_LINE> block_size = 64 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._h = ( 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0, ) <NEW_LINE> self._unprocessed = b'' <NEW_LINE> self._message_byte_length = 0...
A class that mimics that hashlib api and implements the SHA-1 algorithm.
62598f93b830903b9686e2c2
class ModelExistsWarning(UserWarning): <NEW_LINE> <INDENT> pass
Issued by Model constructor when a second model is defined.
62598f93ac7a0e7691f721aa
class CRoom(Model): <NEW_LINE> <INDENT> cclient_path = os.path.join(get_cclient_path(), ("cclient.exe" if platform.system() == "Windows" else "cclient")) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Model.__init__(self, "{0} 60".format(self.cclient_path)) <NEW_LINE> self.data = ([], [], [], []) <NEW_LINE> self.Kp...
c-room model
62598f9345492302aabfc175
class RandomFlatWalk(Behaviour): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> Behaviour.__init__(self, *args, **kwargs) <NEW_LINE> self.behaviours.append(self.random_walk) <NEW_LINE> self.wallCheckDisabled = False <NEW_LINE> self.my_direction = random_xy_vector() <NEW_LINE> self.time_tra...
Generic Wandering Behaviour on a plane travels for about a 5th of the size of the environment before turning
62598f93fbf16365ca793d52
class QuantizeHandler(ABC): <NEW_LINE> <INDENT> def __init__(self, node: Node, modules: Dict[str, torch.nn.Module]): <NEW_LINE> <INDENT> self.num_tensor_args = len(node.args) <NEW_LINE> self.all_node_args_are_tensors = True <NEW_LINE> self.last_node = node <NEW_LINE> <DEDENT> def _maybe_get_last_node_only_observer( sel...
Base handler class for the quantizer patterns
62598f93baa26c4b54d4ef4c
class Table: <NEW_LINE> <INDENT> def __init__(self, database, name): <NEW_LINE> <INDENT> self.__database = database <NEW_LINE> self.__name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def columns(self): <NEW_LINE> <INDENT> if not hasattr(self, "_columns"): <NEW_LINE> <INDENT> fields = ( "COLUMN_NAME AS name", "IS_NU...
Table or view information.
62598f9310dbd63aa1c7085d
class TestInheritance(unittest.TestCase): <NEW_LINE> <INDENT> def test_chart_quantity_actions(self): <NEW_LINE> <INDENT> self.assertTrue( issubclass(Quantity_of_actions, Chart) ) <NEW_LINE> <DEDENT> def test_chart_quantity_actions_with_source(self): <NEW_LINE> <INDENT> self.assertTrue( issubclass(Quantity_of_actions_wi...
Good inheritance = Exception if functions arent definined
62598f934428ac0f6e6581c7
class UpdatePwdView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> login_url = '/login/' <NEW_LINE> redirect_field_name = 'next' <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> modifyPwd_form = ModifyPwdForm(request.POST) <NEW_LINE> if modifyPwd_form.is_valid(): <NEW_LINE> <INDENT> pwd1 = request.POST.get("pass...
在个人中心修改用户密码
62598f93090684286d593527
class TestPaginationWithCountResponseCustomerResponseModel(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 testPaginationWithCountResponseCustomerResponseModel(self): <NEW_LINE> <INDENT> pass
PaginationWithCountResponseCustomerResponseModel unit test stubs
62598f93d7e4931a7ef3bd41
class Book(DynamicDocument): <NEW_LINE> <INDENT> meta = { "collection": "bibliodb_books", } <NEW_LINE> document_id = ReferenceField(LBDocument) <NEW_LINE> provenance = PROVENANCE_FIELD <NEW_LINE> digitization_provenance = StringField(required=True) <NEW_LINE> bid = StringField(required=True) <NEW_LINE> title = StringFi...
The schema of documents in the `bibliodb_books` collection in MongoDB.
62598f93cc0a2c111447acb2
class WorkerPools(base.Group): <NEW_LINE> <INDENT> pass
Manage Remote Build Execution Worker Pools. Create, delete, list, view, and update worker pool configurations for Remote Build Execution instances.
62598f93b7558d58954632cc
class Home(View): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get(request): <NEW_LINE> <INDENT> if request.user.is_anonymous: <NEW_LINE> <INDENT> return render(request, 'core/login.html') <NEW_LINE> <DEDENT> return render(request, 'core/home.html')
Login view
62598f933539df3088ecbf5e
class TaskWorktype(ModelObject): <NEW_LINE> <INDENT> def Delete(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Insert(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Modify(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Select(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> Name = property...
TaskWorktype()
62598f938e71fb1e983bb752
class SurnameColorOption(Option): <NEW_LINE> <INDENT> def __init__(self, label): <NEW_LINE> <INDENT> Option.__init__(self, label, "")
This class describes a widget that allows multiple surnames to be selected from the database, and to assign a color (not necessarily unique) to each one.
62598f9355399d3f056261bd
class ProductChannel(enum.IntEnum): <NEW_LINE> <INDENT> UNSPECIFIED = 0 <NEW_LINE> UNKNOWN = 1 <NEW_LINE> ONLINE = 2 <NEW_LINE> LOCAL = 3
Enum describing the locality of a product offer. Attributes: UNSPECIFIED (int): Not specified. UNKNOWN (int): Used for return value only. Represents value unknown in this version. ONLINE (int): The item is sold online. LOCAL (int): The item is sold in local stores.
62598f9376e4537e8c3ef250
class NetworkInterfaceTranslator(translators.base_translator.BaseTranslator): <NEW_LINE> <INDENT> FIELDS = [ 'name', 'ip_address', 'notes' ] <NEW_LINE> def _name(self): <NEW_LINE> <INDENT> return self.data.id <NEW_LINE> <DEDENT> def _ip_address(self): <NEW_LINE> <INDENT> return self.data.private_ip_address <NEW_LINE> <...
Translates a Network Interface from an EC2 Instance to IT Glue Configuration Interface
62598f9307d97122c421694e
class NotPredictiveModelError(Exception): <NEW_LINE> <INDENT> pass
Raised when the loaded model is not a predictive model.
62598f93d58c6744b42dc11e
class TestCaseAssertInline(admin.StackedInline): <NEW_LINE> <INDENT> model = TestCaseAssert
Test case assertions administration.
62598f93eab8aa0e5d30ba20
class Quantity(Parameter): <NEW_LINE> <INDENT> def __init__(self, unit, fget=None, fset=None, fget_target=None, lower=None, upper=None, data=None, check=None, external_lower_getter=None, external_upper_getter=None, user_lower_getter=None, user_lower_setter=None, user_upper_getter=None, user_upper_setter=None, help=None...
A :class:`.Parameter` associated with a unit.
62598f93596a89723612791c
class SubComputeViewModelIEnumerablePaginatedViewModel(object): <NEW_LINE> <INDENT> swagger_types = { 'total_count': 'int', 'payload': 'list[SubComputeViewModel]' } <NEW_LINE> attribute_map = { 'total_count': 'totalCount', 'payload': 'payload' } <NEW_LINE> def __init__(self, total_count=None, payload=None): <NEW_LINE> ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f93d486a94d0ba2bc72
class Demeaner(object): <NEW_LINE> <INDENT> def __init__(self, arr, to_file): <NEW_LINE> <INDENT> self.arr = arr <NEW_LINE> self.to_file = to_file <NEW_LINE> self.arr_shape = arr.shape <NEW_LINE> <DEDENT> def demean(self, standardize=True): <NEW_LINE> <INDENT> arr_out = demean(self.arr, to_file=False) <NEW_LINE> if sta...
Docstrins can be put right below the class definition, but also within the __init__ method if desired (in this case, set `napoleon_include_init_with_doc` to `True` in conf.py. Also, set `napoleon_use_ivar` to `True` in conf.py, which enables the documentation of attributes. Parameters ---------- arr : array-like ...
62598f93be8e80087fbbecfc
class UpgradeOrchestrationServiceStateSummary(Model): <NEW_LINE> <INDENT> _attribute_map = { 'current_code_version': {'key': 'CurrentCodeVersion', 'type': 'str'}, 'current_manifest_version': {'key': 'CurrentManifestVersion', 'type': 'str'}, 'target_code_version': {'key': 'TargetCodeVersion', 'type': 'str'}, 'target_man...
Service state summary of Service Fabric Upgrade Orchestration Service. :param current_code_version: The current code version of the cluster. :type current_code_version: str :param current_manifest_version: The current manifest version of the cluster. :type current_manifest_version: str :param target_code_version: The...
62598f9491af0d3eaad39aa5
class AddBookmark(Request): <NEW_LINE> <INDENT> def __init__(self, user_id, item_id, timestamp=DEFAULT, cascade_create=DEFAULT, recomm_id=DEFAULT, additional_data=DEFAULT): <NEW_LINE> <INDENT> self.user_id = user_id <NEW_LINE> self.item_id = item_id <NEW_LINE> self.timestamp = timestamp <NEW_LINE> self.cascade_create =...
Adds a bookmark of a given item made by a given user. Required parameters: :param user_id: User who bookmarked the item :param item_id: Bookmarked item Optional parameters: :param timestamp: UTC timestamp of the bookmark as ISO8601-1 pattern or UTC epoch time. The default value is the current time. :param cascad...
62598f94bde94217f37074b8
class MysqlPipeline(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.conn = pymysql.connect('192.168.99.19', 'medicalmap1', 'medicalmap#1', 'test', charset="utf8", use_unicode=True) <NEW_LINE> self.cursor = self.conn.cursor() <NEW_LINE> <DEDENT> def process_item(self, item, spider): <NEW_LINE> ...
采用同步的机制写入mysql
62598f94462c4b4f79dbb6a6
class EnsembleInconsistency(SolrCloudHealthError): <NEW_LINE> <INDENT> pass
Top level exception for inconsistency that spans 2 or more zkhosts (the entire ensemble is inconsistent)
62598f94f7d966606f747c83
class CommandManager(object): <NEW_LINE> <INDENT> MaxListSize = 2000 <NEW_LINE> def __init__(self, max_items): <NEW_LINE> <INDENT> self._list = [] <NEW_LINE> self._max_items = max_items <NEW_LINE> if self._max_items > CommandManager.MaxListSize: <NEW_LINE> <INDENT> self._max_items = CommandManager.MaxListSize <NEW_LINE...
manages the queue
62598f94435de62698e9ba92
class TestLeverage(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 testLeverage(self): <NEW_LINE> <INDENT> pass
Leverage unit test stubs
62598f94090684286d593528
class WebhookUrl(ModelNormal): <NEW_LINE> <INDENT> allowed_values = { } <NEW_LINE> validations = { } <NEW_LINE> additional_properties_type = None <NEW_LINE> @staticmethod <NEW_LINE> def openapi_types(): <NEW_LINE> <INDENT> return { 'webhook_url': (str,), } <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def discriminator(...
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...
62598f94be383301e02534a5
class PackageNotFound(Exception): <NEW_LINE> <INDENT> def __init__(self, package_name): <NEW_LINE> <INDENT> super(PackageNotFound, self).__init__(package_name) <NEW_LINE> self.package_name = package_name
Package Not Found exception.
62598f9445492302aabfc178
class ExecutionError(EmployError): <NEW_LINE> <INDENT> pass
Error when executing a command
62598f940a50d4780f705076
class Affine(A.ImageOnlyTransform): <NEW_LINE> <INDENT> def __init__(self, shear_x_mag=0, shear_y_mag=0, translate_x_mag=0, translate_y_mag=0, always_apply=False, p=.5): <NEW_LINE> <INDENT> super().__init__(always_apply, p) <NEW_LINE> self.shear_x_mag = shear_x_mag <NEW_LINE> self.shear_y_mag = shear_y_mag <NEW_LINE> s...
Affine変換。
62598f9471ff763f4b5e7417
class Terrestre: <NEW_LINE> <INDENT> se_move_em_terra = True <NEW_LINE> def __init__(self, velocidade=100): <NEW_LINE> <INDENT> self.velocidade_em_terra = velocidade
Classe de veículos terrestres
62598f946e29344779b002fa
class Dataset(models.Model): <NEW_LINE> <INDENT> TYPE = (('CI', 'Core Infrastructure'), ('NI', 'Non-Core Infrastructure'), ('RN', 'Recurring'), ('A', 'Adhoc'), ('O', 'Other')) <NEW_LINE> UPDATES = (('W', 'Weekly'), ('M', 'Monthly'), ('Q', 'Quarterly'), ('B', 'Bi-Annual'), ('Y', 'Yearly'), ('O', 'One off'), ('U', 'Unkno...
Stores data about each dataset
62598f943cc13d1c6d46540d
class FlashButton(Button): <NEW_LINE> <INDENT> die = ObjectProperty(dt.Die(1)) <NEW_LINE> lst = ListProperty([]) <NEW_LINE> def __init__(self, delay_time=0.25, **kwargs): <NEW_LINE> <INDENT> super(FlashButton, self).__init__(**kwargs) <NEW_LINE> self.delay_time = delay_time <NEW_LINE> self._original_color = self.color ...
a button that flashes for delay_time=0.25 sec after pressed, so you know you done taht press real clear-like. assign on_press using self.delay OR make the function it calls use self.delay or you won't see the flash. can hold info about a die or list for keeping track of stuff.
62598f9460cbc95b06363fe7
class PlotHorizontalBarPitchClassOffset(PlotHorizontalBar): <NEW_LINE> <INDENT> values = ['pitchClass', 'offset', 'pianoroll'] <NEW_LINE> def __init__(self, streamObj, *args, **keywords): <NEW_LINE> <INDENT> PlotHorizontalBar.__init__(self, streamObj, *args, **keywords) <NEW_LINE> self.fy = lambda n:n.pitchClass <NEW_L...
A graph of events, sorted by pitch class, over time >>> from music21 import * >>> s = corpus.parse('bach/bwv324.xml') #_DOCS_HIDE >>> p = graph.PlotHorizontalBarPitchClassOffset(s, doneAction=None) #_DOCS_HIDE >>> #_DOCS_SHOW s = corpus.parse('bach/bwv57.8') >>> #_DOCS_SHOW p = graph.PlotHorizontalBarPitchClassOffset(...
62598f940c0af96317c56025
class ApplicationGatewayUrlPathMap(SubResource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'S...
UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. :param id: Resource ID. :type id: str :param default_backend_address_pool: Default backend address pool resource of URL path map. :type default_backend_address_pool: ~azure.mgmt.network.v2018_08_01.models.SubResource :param default_...
62598f942c8b7c6e89bd346f
class RepeatedWordCompleter(QCompleter): <NEW_LINE> <INDENT> def init(self, parent=None): <NEW_LINE> <INDENT> QCompleter.init(self, parent) <NEW_LINE> <DEDENT> def pathFromIndex(self, index): <NEW_LINE> <INDENT> path = QCompleter.pathFromIndex(self, index) <NEW_LINE> lst = unicode(self.widget().text()).split(',') <NEW_...
A completer that completes multiple times from a list
62598f94507cdc57c63a4a34
class Identity(Layer): <NEW_LINE> <INDENT> def __call__(self, inp): <NEW_LINE> <INDENT> return inp <NEW_LINE> <DEDENT> def params(self): <NEW_LINE> <INDENT> return []
Return the input unmodified.
62598f9496565a6dacd2cdca
class UILoggingHandler(logging.Handler): <NEW_LINE> <INDENT> log_level_attr = { 'CRITICAL': 'log critical', 'ERROR': 'log error', 'WARN': 'log warning', 'WARNING': 'log warning', 'INFO': 'log info', 'DEBUG': 'log debug', 'NOTSET': 'log notset', } <NEW_LINE> def __init__(self, max_history=100, disable_stderr=False): <NE...
UI integrated logging handler for standard Python logging library. The handler can be 'connected' and 'disconnected' to the UI and initialized before hand. While in the disconnected state the handler can also output logging lines to stderr using the building StreamHandler.
62598f94462c4b4f79dbb6a8
class SingleSwitchTopo(Topo): <NEW_LINE> <INDENT> def build(self): <NEW_LINE> <INDENT> s1 = self.addSwitch('s1') <NEW_LINE> s2 = self.addSwitch('s2') <NEW_LINE> h1 = self.addHost('h1', mac="00:00:00:00:11:11", ip="192.168.1.1/24") <NEW_LINE> h2 = self.addHost('h2', mac="00:00:00:00:11:12", ip="192.168.1.2/24") <NEW_LIN...
Single switch connected to n hosts.
62598f94a219f33f346c64bb
class NIMSGEPhysio(nimsdata.NIMSReader): <NEW_LINE> <INDENT> domain = u'mr' <NEW_LINE> filetype = u'gephysio' <NEW_LINE> state = ['orig'] <NEW_LINE> def __init__(self, path, load_data=False): <NEW_LINE> <INDENT> super(NIMSGEPhysio, self).__init__(path, load_data) <NEW_LINE> with tarfile.open(path) as archive: <NEW_LINE...
Parse and identify GE Physio data.
62598f9482261d6c5272fd27
class BowPressure(AbjadValueObject): <NEW_LINE> <INDENT> __slots__ = ( '_default_scope', '_pressure', ) <NEW_LINE> def __init__( self, pressure=None, ): <NEW_LINE> <INDENT> self._default_scope = None <NEW_LINE> self._pressure = pressure <NEW_LINE> <DEDENT> @property <NEW_LINE> def default_scope(self): <NEW_LINE> <INDEN...
A bow pressure indicator. .. container:: example **Example 1.** Overpressure indicator: .. container:: example :: >>> bow_pressure = indicatortools.BowPressure('overpressure') >>> print(format(bow_pressure)) indicatortools.BowPressure( pressure=...
62598f9476d4e153a661c8bc
class MongoWireMessage: <NEW_LINE> <INDENT> __slots__ = ['header', 'operation'] <NEW_LINE> def __init__(self, operation: BaseOp, header: MessageHeader = None): <NEW_LINE> <INDENT> if header: <NEW_LINE> <INDENT> self.header = header <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.header = MessageHeader() <NEW_LINE> <...
Base class for the mongodb wire protocol message
62598f94a4f1c619b294e28c
class Library: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def first_day_of_liturgical_year(year): <NEW_LINE> <INDENT> christmas = date(year - 1, 12, 25) <NEW_LINE> days_since_sunday = timedelta(christmas.weekday() + 1) <NEW_LINE> sunday_before_christmas = christmas - days_since_sunday <NEW_LINE> three_weeks = timedel...
contains functions for resolving daterules and coordinaterules and auxiliary functions
62598f94baa26c4b54d4ef50
class SyncbackService(gevent.Greenlet): <NEW_LINE> <INDENT> def __init__(self, poll_interval=1, chunk_size=100, retry_interval=30): <NEW_LINE> <INDENT> semaphore_factory = lambda: BoundedSemaphore(CONCURRENCY_LIMIT) <NEW_LINE> self.semaphore_map = defaultdict(semaphore_factory) <NEW_LINE> self.keep_running = True <NEW_...
Asynchronously consumes the action log and executes syncback actions.
62598f94ac7a0e7691f721ad
class RollBook: <NEW_LINE> <INDENT> DEF_MODEL_NAME = 'ModelName' <NEW_LINE> DEF_CONF_FILE = os.path.expanduser('~/bin/storgan.conf') <NEW_LINE> def __init__(self, model: str = DEF_MODEL_NAME, conf_file: str = DEF_CONF_FILE, debug=False): <NEW_LINE> <INDENT> self._dbg = debug <NEW_LINE> self._log = get_logger(self.__cla...
RollBook class
62598f94460517430c431eab