code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class APIBypassCSRFMiddleware(object): <NEW_LINE> <INDENT> def process_view(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if get_api_request_user(request): <NEW_LINE> <INDENT> request.csrf_processing_done = True <NEW_LINE> <DEDENT> return None | This middleware turns off CSRF protection for API clients.
It must come before CsrfViewMiddleware in settings.MIDDLEWARE_CLASSES. | 62598eff7b180e01f3e4852c |
class BoardMessage(messages.Message): <NEW_LINE> <INDENT> board_state = messages.StringField(1, required=True) | Board board_state | 62598eff67a9b606de544995 |
class ScriptParameter: <NEW_LINE> <INDENT> def __init__(self, code, description): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.description = description | A parameter that can be added to the icacls
| 62598eff5166f23b2e241da9 |
class Channel: <NEW_LINE> <INDENT> def __init__(self, quality, logger): <NEW_LINE> <INDENT> self.producer_conn = None <NEW_LINE> self.producer_addr = None <NEW_LINE> self.is_producing = False <NEW_LINE> self.channel_id = quality <NEW_LINE> self.subscribers = {} <NEW_LINE> self.logger = logger <NEW_LINE> <DEDENT> def se... | A channel within SocketServer | 62598eff099cdd3c636748bc |
class TrSelector: <NEW_LINE> <INDENT> def __init__(self, tr_model, lon0, lat0, lon1=None, lat1=None): <NEW_LINE> <INDENT> self.tr_model = tr_model <NEW_LINE> if lon1 is None or lat1 is None: <NEW_LINE> <INDENT> self.shape = Point([lon0, lat0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.shape = Polygon([(lon0, l... | This object allows selection of Trt (tectonic region types
from a given tectonic regionalisation (TR) and a specified point
(or rectangle) defined on TR. The method get_trt_names will return all
Trt(s) matching the given criteria | 62598eff76e4537e8c3edf87 |
class IpamsvcListHAGroupResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'results': 'list[IpamsvcHAGroup]' } <NEW_LINE> attribute_map = { 'results': 'results' } <NEW_LINE> def __init__(self, results=None): <NEW_LINE> <INDENT> self._results = None <NEW_LINE> self.discriminator = None <NEW_LINE> if results is not ... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598eff4527f215b58e88c7 |
class WidgetsTest(ViewTestCase): <NEW_LINE> <INDENT> def test_view_widgets_root(self): <NEW_LINE> <INDENT> response = self.client.get( reverse('widgets_root') ) <NEW_LINE> self.assertContains(response, 'Test') <NEW_LINE> <DEDENT> def test_view_widgets(self): <NEW_LINE> <INDENT> response = self.client.get( reverse('widg... | Testing of widgets. | 62598eff3d592f4c4edb98ba |
class GridOutCursor(Cursor): <NEW_LINE> <INDENT> def __init__(self, collection, spec=None, skip=0, limit=0, timeout=True, sort=None, max_scan=None, read_preference=None, tag_sets=None, secondary_acceptable_latency_ms=None, compile_re=True, filter=None, no_cursor_timeout=None): <NEW_LINE> <INDENT> self.__root_collection... | A cursor / iterator for returning GridOut objects as the result
of an arbitrary query against the GridFS files collection. | 62598eff167d2b6e312b5968 |
class Tokenizer(Registrable): <NEW_LINE> <INDENT> default_implementation = "spacy" <NEW_LINE> def batch_tokenize(self, texts: List[str]) -> List[List[Token]]: <NEW_LINE> <INDENT> return [self.tokenize(text) for text in texts] <NEW_LINE> <DEDENT> def tokenize(self, text: str) -> List[Token]: <NEW_LINE> <INDENT> raise No... | A `Tokenizer` splits strings of text into tokens. Typically, this either splits text into
word tokens or character tokens, and those are the two tokenizer subclasses we have implemented
here, though you could imagine wanting to do other kinds of tokenization for structured or
other inputs.
See the parameters to, e.g.... | 62598eff31939e2706ed0f47 |
class AffineTransformer(object): <NEW_LINE> <INDENT> def __init__(self, out_size, name='SpatialAffineTransformer', interp_method='bilinear', **kwargs): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.out_size = out_size <NEW_LINE> self.param_dim = 6 <NEW_LINE> self.interp_method=interp_method <NEW_LINE> with tf.va... | Spatial Affine Transformer Layer
Implements a spatial transformer layer as described in [1]_.
Based on [2]_ and [3]_. Edited by Daniyar Turmukhambetov. | 62598eff71ff763f4b5e612e |
class VerifyUserView(APIView): <NEW_LINE> <INDENT> authentication_classes = () <NEW_LINE> permission_classes = () <NEW_LINE> def put(self, request): <NEW_LINE> <INDENT> email = request.data.get('email') <NEW_LINE> user = get_object_or_404(User, email=email) <NEW_LINE> emails.verification(user) <NEW_LINE> return Respons... | Creates new account | 62598efff9cc0f698b1c47b5 |
class TestDevelopersController(BaseTestCase): <NEW_LINE> <INDENT> def test_create_user(self): <NEW_LINE> <INDENT> response = self.client.open( '/ypardo/pokeapi2/1.0.0/user', method='POST') <NEW_LINE> self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) <NEW_LINE> <DEDENT> def test_create_user... | DevelopersController integration test stubs | 62598eff851cf427c66b6c95 |
class JupyterProgressRecorder(ProgressRecorder): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(JupyterProgressRecorder, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> from ipywidgets import FloatProgress, HBox, Label, Layout <NEW_LINE> from ... | Graphical progress bar for use in Jupyter notebooks | 62598f00796e427e5384d168 |
class DiskCache(QNetworkDiskCache): <NEW_LINE> <INDENT> def __init__(self, cache_dir, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.setCacheDirectory(os.path.join(cache_dir, 'http')) <NEW_LINE> self._set_cache_size() <NEW_LINE> config.instance.changed.connect(self._set_cache_size) <NEW_LINE... | Disk cache which sets correct cache dir and size. | 62598f00ad47b63b2c5a61e5 |
@zope.interface.implementer(zc.sourcefactory.interfaces.IContextualSource) <NEW_LINE> class FactoredContextualSource(FactoredSource): <NEW_LINE> <INDENT> context = None <NEW_LINE> def __init__(self, factory, context): <NEW_LINE> <INDENT> self.factory = factory <NEW_LINE> self.context = context <NEW_LINE> self.__parent_... | An iterable context-aware source that was created from a source factory.
| 62598f00379a373c97d979c8 |
class Treecols(Xul): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Treecols, self).__init__(element="template", kwargs=kwargs) | Description
| 62598f004f88993c371ef9d0 |
class CPUCoreList(object): <NEW_LINE> <INDENT> __slot__ = None <NEW_LINE> cpu_list = [] <NEW_LINE> sep = "," <NEW_LINE> def __init__(self, cpu_set, sep=","): <NEW_LINE> <INDENT> if isinstance(cpu_set, Iterable): <NEW_LINE> <INDENT> cpu_set = sep.join([str(core) for core in cpu_set]) <NEW_LINE> <DEDENT> cpu_set = cpu_se... | convert cpu-set strings to list
or
Simplify cpu-set strings | 62598f007d847024c075ad98 |
class Topic(models.Model): <NEW_LINE> <INDENT> text = models.CharField(max_length = 200) <NEW_LINE> date_added = models.DateTimeField(auto_now_add = True) <NEW_LINE> owner = models.ForeignKey(User) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.text | 用户学习的主题 | 62598f00442bda511e95ae2f |
class MonThresh(monasca_setup.detection.Plugin): <NEW_LINE> <INDENT> def _detect(self): <NEW_LINE> <INDENT> if monasca_setup.detection.find_process_cmdline('mon-thresh') is not None: <NEW_LINE> <INDENT> self.available = True <NEW_LINE> <DEDENT> <DEDENT> def build_config(self): <NEW_LINE> <INDENT> log.info("\tWatching t... | Detect the running mon-thresh and monitor.
| 62598f005fdd1c0f98e5c973 |
class Command(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> flush_unpublished() | handles show command | 62598f0031939e2706ed0f48 |
class Vendor(Person, DeclarativeBaseGuid): <NEW_LINE> <INDENT> __tablename__ = "vendors" <NEW_LINE> __table_args__ = {} <NEW_LINE> name = Column("name", VARCHAR(length=2048), nullable=False) <NEW_LINE> notes = Column("notes", VARCHAR(length=2048), nullable=False) <NEW_LINE> tax_override = Column("tax_override", INTEGER... | A GnuCash Vendor
Attributes:
name (str): name of the Vendor
id (str): autonumber id with 5 digits (initialised to book.counter_vendor + 1)
notes (str): notes
active (int): 1 if the vendor is active, 0 otherwise
currency (:class:`piecash.core.commodity.Commodity`): the currency of the vendor
tax... | 62598f009f288636728171c4 |
class IterationPrinters(object): <NEW_LINE> <INDENT> iteration = { "title": "#", "value": lambda M: M.iter, "width": 5, "format": "%3d" } <NEW_LINE> f = { "title": "f", "value": lambda M: M.f, "width": 10, "format": "%1.2e" } <NEW_LINE> norm_g = { "title": "|proj(x-g)-x|", "value": lambda M: norm(M.projection(M.xc - M.... | docstring for IterationPrinters | 62598f00a219f33f346c51fc |
class TagForm(FlaskForm): <NEW_LINE> <INDENT> name = StringField('标签名称', validators=[DataRequired("请输入内容")]) <NEW_LINE> submit = SubmitField('添加') <NEW_LINE> def validate_name(self, field): <NEW_LINE> <INDENT> tag = Tag.query.filter_by(name=field.data).count() <NEW_LINE> if tag != 0: <NEW_LINE> <INDENT> raise Validatio... | 标签 | 62598f00956e5f7376df4b62 |
class SSLCAKeySpec(SSLCAXMLSpec): <NEW_LINE> <INDENT> attrs = dict(bits='2048', type='rsa') <NEW_LINE> tag = 'Key' | Handle key.xml files | 62598f005fdd1c0f98e5c974 |
class IPython2ProgressBar(ProgressBar): <NEW_LINE> <INDENT> supports_fast_ipynb_updates = True <NEW_LINE> def __init__(self, task="Simulation"): <NEW_LINE> <INDENT> super(IPython2ProgressBar, self).__init__(task) <NEW_LINE> self._widget = IPythonProgressWidget() <NEW_LINE> self._initialized = False <NEW_LINE> <DEDENT> ... | IPython progress bar based on widgets. | 62598f007b180e01f3e4852e |
class TimeSpan(object): <NEW_LINE> <INDENT> def __init__(self, start=None, end=None): <NEW_LINE> <INDENT> self._start = None <NEW_LINE> self._end = None <NEW_LINE> self.start = start <NEW_LINE> if end: <NEW_LINE> <INDENT> self.end = end <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def start(self): <NEW_LINE> <INDE... | TimeSpan is a class to represent a span of time with a start and an end.
A TimeSpan object is used to store a time span with a start point of
type Date and an end point of type Date. With this you can calculate
the time difference between start and end. | 62598f00aad79263cf42d1de |
class PySTARTUPINFO(object): <NEW_LINE> <INDENT> def __new__(cls): <NEW_LINE> <INDENT> raise Exception('This class just for typing, can not be instanced!') <NEW_LINE> <DEDENT> @property <NEW_LINE> def dwX(self)->'int': <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> def dwY(self)->'int': <NEW_LINE> <I... | A Python object, representing an STARTUPINFO structure | 62598f00dc8b845886d51f96 |
class IDLRecord(Record): <NEW_LINE> <INDENT> __slots__ = ['destination', 'source', 'x1', 'y1', 'x2', 'y2'] <NEW_LINE> def __init__(self, destination, source, x1, y1, x2, y2): <NEW_LINE> <INDENT> self.destination = destination <NEW_LINE> self.source = source <NEW_LINE> self.x1 = int(x1) <NEW_LINE> self.y1 = int(y1) <NEW... | Attributes
----------
destination : str
destination file (virtual path)
source : str
source image file (path relative to content.ggpk)
x1 : int
Upper left x coordinate
y1 : int
Upper left y coordinate
x2 : int
Lower right x coordinate
y2 : int
Lower right y coordinate | 62598f00091ae356687035e9 |
class SensorData(ByteStructure): <NEW_LINE> <INDENT> byte_size = 49 <NEW_LINE> data_format = 'fhhhhhhhhhhhhhhhhhhhhhhB' <NEW_LINE> def __init__(self, data=[0] * 24): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.pressure = data[0] <NEW_LINE> self.acceleration = Acceleration(data[1], data[2], data[3]) <NEW_LINE> ... | Container for all sensor data.
This includes, in order, with respective structure:
- pressure : float
- acceleration : Acceleration
- magnetic : Magnetic
- angular_vel : AngularVelocity
- euler_angles : EulerAngles
- quaternion : Quaternion
- linear_acceleration: LinearAcceleration
- gr... | 62598f007cff6e4e811b43b3 |
class RedisMultiEventFactory(object): <NEW_LINE> <INDENT> LAST_STACK = [] <NEW_LINE> @staticmethod <NEW_LINE> def create_event(wrapped, instance, args, kwargs, start_time, response, exception): <NEW_LINE> <INDENT> event = RedisMultiExecutionEvent( wrapped, instance, args, kwargs, start_time, response, exception, RedisM... | Factory class, generates Redis multi-execution event. | 62598f0097e22403b38398b5 |
class FileBackup(object): <NEW_LINE> <INDENT> def __init__(self, src, dist): <NEW_LINE> <INDENT> self.src = src <NEW_LINE> self.dist = dist <NEW_LINE> <DEDENT> def read_files(self): <NEW_LINE> <INDENT> ls = os.listdir(self.src) <NEW_LINE> print(ls) <NEW_LINE> for l in ls: <NEW_LINE> <INDENT> self.backup_file2(l) <NEW_L... | 文本文件备份 | 62598f00379a373c97d979ca |
class OrderedListBlock(ListBlock): <NEW_LINE> <INDENT> RE = re.compile(r'(?:\A|\n{2,})' r'(?P<items>(?P<marker>^[0-9]+\. ).*?)' r'(?=\n{3,}|\n*\Z|\n{2}^[^[0-9\s])', flags=re.MULTILINE|re.DOTALL|re.UNICODE) <NEW_LINE> ITEM_RE = re.compile(r'^[0-9]+\. (?P<item>.*?)(?=\Z|^[0-9]+\. )', flags=re.MULTILINE|re.DOTALL|re.UNICO... | Ordered lists. | 62598f004f88993c371ef9d1 |
class InvalidObjectException(Exception): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'message', None, None, ), ) <NEW_LINE> def __init__(self, message=None,): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.T... | Attributes:
- message | 62598f0031939e2706ed0f49 |
class ListSlidesView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> images = [img for img in os.listdir('/app/images') if img.endswith('svs')] <NEW_LINE> return HttpResponse(json.dumps(images), content_type="application/json") | For the List Files
| 62598f0071ff763f4b5e6132 |
class Workload(object): <NEW_LINE> <INDENT> def __init__(self, task_uuid, subtask_uuid, name, description, position, runner, hooks, context, sla, args): <NEW_LINE> <INDENT> self.workload = db.workload_create( task_uuid=task_uuid, subtask_uuid=subtask_uuid, name=name, description=description, position=position, runner=r... | Represents a workload object. | 62598f003317a56b869bda4c |
class Session(object): <NEW_LINE> <INDENT> def __init__(self, request_handler_obj): <NEW_LINE> <INDENT> self._request_handler = request_handler_obj <NEW_LINE> self.session_id = request_handler_obj.get_secure_cookie("session_id") <NEW_LINE> if not self.session_id: <NEW_LINE> <INDENT> self.session_id = uuid.uuid4().hex <... | def __new__(cls,request_handler_obj):
if not hasattr(cls, 'instance'):
cls.instance = super(Session, cls).__new__(cls)
return cls.instance | 62598f00aad79263cf42d1e0 |
class RuleBaseInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.IsDefault = None <NEW_LINE> self.EffectImageCount = None <NEW_LINE> self.RuleId = None <NEW_LINE> self.UpdateTime = None <NEW_LINE> self.RuleName = None <NEW_LINE> self.EditUserName = None <NEW_LINE> self.IsEnable = None... | 运行时安全,策略基本信息
| 62598f0067a9b606de54499a |
class DrawnImage(AbstractImage): <NEW_LINE> <INDENT> def __init__(self, draw_method, *args, **kwargs): <NEW_LINE> <INDENT> self._draw_method = draw_method <NEW_LINE> self._graphic = None <NEW_LINE> self.next(*args, **kwargs) <NEW_LINE> <DEDENT> def get_image(self): <NEW_LINE> <INDENT> return self._graphic <NEW_LINE> <D... | :param drawn_image - method that draws the image and returns a pygame.Surface
:param colorkey - pygame color key
:return Surface containing drawn image
Creates a surface using a draw method for use with sprites. | 62598f007047854f4633dd98 |
@enum.unique <NEW_LINE> class E(enum.Enum): <NEW_LINE> <INDENT> unproven = CvssEnumValue("U", 0.85) <NEW_LINE> proof_of_concept = CvssEnumValue("POC", 0.9) <NEW_LINE> functional = CvssEnumValue("F", 0.95) <NEW_LINE> high = CvssEnumValue("H", 1.0) <NEW_LINE> not_defined = CvssEnumValue("ND", 1.0) | Exploitability. | 62598f00dc8b845886d51f98 |
class RaspvidCmd(object): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> self.fps = cfg.fps if cfg.fps != -1 else 30 <NEW_LINE> self.bright = cfg.brightness if cfg.brightness != -1 else 50 <NEW_LINE> self.bitrate = cfg.bitrate if cfg.bitrate != -1 else 4500000 <NEW_LINE> self.rtsp_port = cfg.rtsp_port... | opt the cmd str | 62598f00091ae356687035eb |
class MongoDB(): <NEW_LINE> <INDENT> def __init__(self, collection="results"): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> uri = self.make_uri() <NEW_LINE> database = config["app_conf"]["mongo_db"] <NEW_LINE> self.collection = pymongo.Connection(uri, safe=True)[database][collection] <NEW_LINE> self.ensure_index() <NEW... | Interface for MongoDB database | 62598f004428ac0f6e656f1f |
class ProductConfigSyncTestCase(MultiproductConfigTestCase): <NEW_LINE> <INDENT> def test_sync(self): <NEW_LINE> <INDENT> config1 = self._read() <NEW_LINE> config2 = self._read() <NEW_LINE> self.assertEqual('', config1.get('s', 'o')) <NEW_LINE> self.assertEqual('', config2.get('s', 'o')) <NEW_LINE> config1.set('s', 'o'... | Test cases for concurrent access of product configuration objects.
| 62598f00ad47b63b2c5a61e9 |
class SequenceKFold(object): <NEW_LINE> <INDENT> def __init__(self, lengths, n_folds=3, indices=True, shuffle=False, random_state=None): <NEW_LINE> <INDENT> self.indices = indices <NEW_LINE> self.lengths = lengths <NEW_LINE> self.n_folds = n_folds <NEW_LINE> self.random_state = random_state <NEW_LINE> self.shuffle = sh... | Sequence-aware k-fold CV splitter.
Uses a greedy heuristic to partition input sequences into sets with roughly
equal numbers of samples, while keeping the sequences intact.
Parameters
----------
lengths : array-like of integers, shape (n_samples,)
Lengths of sequences, in the order in which they appear in the dat... | 62598f0021bff66bcd721628 |
class MultiDictManager(models.Manager): <NEW_LINE> <INDENT> def as_dict(self): <NEW_LINE> <INDENT> return MultiDict(self.all()) | Converts a resulting list to a bidimensional mapping object that can be
accessed as a list or as a dictionary of lists grouped together by the
*group* field. | 62598f004f88993c371ef9d2 |
class TextGrid(Text): <NEW_LINE> <INDENT> file_ext = "textgrid" <NEW_LINE> header = 'File type = "ooTextFile"\nObject class = "TextGrid"\n' <NEW_LINE> blurb = "Praat TextGrid file" <NEW_LINE> MetadataElement(name="annotations", default=[], desc="Annotation types", param=ListParameter, readonly=True, visible=True, optio... | Praat Textgrid file for speech annotations
>>> from galaxy.datatypes.sniff import get_test_fname
>>> fname = get_test_fname('1_1119_2_22_001.textgrid')
>>> TextGrid().sniff(fname)
True
>>> fname = get_test_fname('drugbank_drugs.cml')
>>> TextGrid().sniff(fname)
False | 62598f00d8ef3951e32c733b |
class TestFranchise(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 testFranchise(self): <NEW_LINE> <INDENT> pass | Franchise unit test stubs | 62598f009f288636728171c7 |
class ManifestTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_basic(self): <NEW_LINE> <INDENT> vi1 = manifest.VolumeInfo() <NEW_LINE> vi1.set_info(3, ("hello",), None, (), None) <NEW_LINE> vi2 = manifest.VolumeInfo() <NEW_LINE> vi2.set_info(4, ("goodbye", "there"), None, ("aoeusht",), None) <NEW_LINE> vi3 = manif... | Test Manifest class | 62598f00d486a94d0ba2a99b |
class DonutChartWidget(NumericWidget): <NEW_LINE> <INDENT> display = models.CharField(max_length=55, verbose_name=_( "Display style"), default='full_circle', choices=DISPLAY_CHOICES) <NEW_LINE> donut_ratio = models.IntegerField( verbose_name=_('Donut ratio'), default=33) <NEW_LINE> @cached_property <NEW_LINE> def get_c... | Widget which shows donut chart. | 62598f003d592f4c4edb98c1 |
class Colored(object): <NEW_LINE> <INDENT> def __init__(self, colorize=True): <NEW_LINE> <INDENT> self.colorize = colorize <NEW_LINE> <DEDENT> def red(self, msg): <NEW_LINE> <INDENT> return self._color(msg, 'red') <NEW_LINE> <DEDENT> def green(self, msg): <NEW_LINE> <INDENT> return self._color(msg, 'green') <NEW_LINE> ... | Helper class to add ANSI colors and decorations to text. Given a string, ANSI colors are added with special prefix
and suffix characters that are specially interpreted by Terminals to display colors.
Ex: "message" -> add red color -> [31mmessage[0m
This class serves two purposes:
- Hide the underlying libra... | 62598f00283ffb24f3cf227d |
class TextPrinter(flattened_printer.FlattenedPrinter): <NEW_LINE> <INDENT> pass | An alias for FlattenedPrinter.
An alias for the *flattened* format. | 62598f00aad79263cf42d1e2 |
class ConcatJSONDecoder(json.JSONDecoder): <NEW_LINE> <INDENT> FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL <NEW_LINE> WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS) <NEW_LINE> def decode(self, s, _w=WHITESPACE.match): <NEW_LINE> <INDENT> s_len = len(s) <NEW_LINE> objs = [] <NEW_LINE> end = 0 <NEW_LINE> while end != s_... | Returns list of dicts from given string containing multiple root JSON objects | 62598f005fc7496912d4775c |
class RoleSerializer(SingleArtifactContentSerializer): <NEW_LINE> <INDENT> name = serializers.CharField() <NEW_LINE> namespace = serializers.CharField() <NEW_LINE> version = serializers.CharField() <NEW_LINE> def validate(self, data): <NEW_LINE> <INDENT> data = super().validate(data) <NEW_LINE> relative_path = "{namesp... | A serializer for Role versions. | 62598f005166f23b2e241db1 |
class Kayako(BotPlugin): <NEW_LINE> <INDENT> def _generate_signature(self): <NEW_LINE> <INDENT> salt = str(random.getrandbits(16)).encode('utf-8') <NEW_LINE> encrypted_signature = hmac.new( self.config['SECRET_KEY'].encode('utf-8'), msg=salt, digestmod=hashlib.sha256 ).digest() <NEW_LINE> return salt, base64.b64encode(... | A plugin to interface with Kayako helpdesk | 62598f003617ad0b5ee04afe |
class _GlobalMacroDef(_SetterMacroDef): <NEW_LINE> <INDENT> def get_namespace(self, spec_obj: "Spec", context: Dict[str, Any]) -> "Spec": <NEW_LINE> <INDENT> return spec_obj | Parse global macro definitions. | 62598f00cc40096d616196c3 |
class LSVExp(Experiment): <NEW_LINE> <INDENT> def __init__(self, parameters): <NEW_LINE> <INDENT> super(LSVExp, self).__init__(parameters) <NEW_LINE> self.datatype = "linearData" <NEW_LINE> self.xlabel = "Voltage (mV)" <NEW_LINE> self.ylabel = "Current (A)" <NEW_LINE> self.datalength = 2 <NEW_LINE> self.databytes = 6 <... | Linear Scan Voltammetry experiment | 62598f0026068e7796d4b32e |
class TestUtils(unittest.TestCase): <NEW_LINE> <INDENT> def test_server_ok(self): <NEW_LINE> <INDENT> url = '{}?value=10'.format(SERVER_URL) <NEW_LINE> r = request.urlopen(url) <NEW_LINE> self.assertEqual(r.code, 200) <NEW_LINE> json_data = json.loads(r.read().decode('UTF-8')) <NEW_LINE> self.assertEqual(json_data['sta... | Тестирование сервера main.py | 62598f004f88993c371ef9d3 |
class DiagnosticOrderItem(BackboneElement): <NEW_LINE> <INDENT> resource_type = Field("DiagnosticOrderItem", const=True) <NEW_LINE> code: fhirtypes.CodeableConceptType = Field( ..., alias="code", title="Type `CodeableConcept` (represented as `dict` in JSON).", description="Code to indicate the item (test or panel) bein... | The items the orderer requested.
The specific diagnostic investigations that are requested as part of this
request. Sometimes, there can only be one item per request, but in most
contexts, more than one investigation can be requested. | 62598f001f5feb6acb161628 |
class FaceMapsMaterial(bpy.types.Operator): <NEW_LINE> <INDENT> bl_label = "Face Maps from Materials" <NEW_LINE> bl_idname = "emc.facemapmaterial" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> reverse: bpy.props.BoolProperty( name = "Reverse", description = "Assign faces from face sets TO materials based on n... | Creates Face Maps of Each Material and Assigns the Respective Faces to the Face Maps | 62598f0055399d3f05624efa |
class HostHeaderConfig(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "Values": ([str], False), } | `HostHeaderConfig <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-listenerrule-hostheaderconfig.html>`__ | 62598f0031939e2706ed0f4b |
class TestSmartDict(InvenioTestCase): <NEW_LINE> <INDENT> def test_smart_dict(self): <NEW_LINE> <INDENT> d = SmartDict() <NEW_LINE> d['foo'] = {'a': 'world', 'b': 'hello'} <NEW_LINE> d['a'] = [{'b': 1}, {'b': 2}, {'b': 3}] <NEW_LINE> self.assertEqual(d.keys(), ['a', 'foo']) <NEW_LINE> self.assertTrue('foo.a' in d) <NEW... | Smart Dictionary TestSuite | 62598f0071ff763f4b5e6136 |
class EOS(Token): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> def __init__(self, lineno=-1, col_offset=-1): <NEW_LINE> <INDENT> Token.__init__(self, Token.EOS, '', lineno, col_offset) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_token(cls, token): <NEW_LINE> <INDENT> return EOS(lineno=token.lineno, col_offset... | Token representing end of statement. | 62598f005fcc89381b265614 |
class Unit13(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.unit_id = 0 <NEW_LINE> self.type = '' <NEW_LINE> self.title = '' <NEW_LINE> self.release_date = '' <NEW_LINE> self.now_available = False <NEW_LINE> self.properties = {} <NEW_LINE> self._index = None <NEW_LINE> self.href = None <NEW_L... | An object to represent a Unit, Assessment or Link (version 1.3). | 62598f00a219f33f346c5202 |
class LoginError(UserActionError): <NEW_LINE> <INDENT> message = "Login Failed" | Invalid username or password provided. | 62598f00e1aae11d1e7cdd2d |
class Context(): <NEW_LINE> <INDENT> def __init__( self, hostname=None, pid=None, started=None, ended=None, topic=None ): <NEW_LINE> <INDENT> if hostname is None: <NEW_LINE> <INDENT> hostname = socket.gethostname() <NEW_LINE> <DEDENT> self.hostname = hostname <NEW_LINE> if pid is None: <NEW_LINE> <INDENT> pid = os.getp... | Class for recording profiling information such as:
hostname - many possible nodes in cluster
pid - many similar processes on a node
topic - many kinds of services on a node
start_timestamp_utc - in seconds
end_timestamp_utc - in seconds
Also provides a way to store others. | 62598f00851cf427c66b6c9d |
class GENASubscription(StateMachine): <NEW_LINE> <INDENT> def __init__(self, event: str, res: ClientResponse): <NEW_LINE> <INDENT> super().__init__('valid') <NEW_LINE> self.event = event <NEW_LINE> self._seq = 0 <NEW_LINE> self._values = {} <NEW_LINE> self.__invalid_handle = None <NEW_LINE> self._update(res) <NEW_LINE>... | class GENASubscription:
Represent and manage a GENA subscription.
Events:
- update (values: Dict[str, str], seq: int) : each time a new value is emitted
- expired (was: str) : each time the subscription goes expired | 62598f007cff6e4e811b43ba |
class ConfidenceCombiner(Combiner): <NEW_LINE> <INDENT> def get_combined(self, solution): <NEW_LINE> <INDENT> return solution | 取Confidence最大的detector的检测结果 | 62598f00379a373c97d979d0 |
class EventTrigger(_messages.Message): <NEW_LINE> <INDENT> eventType = _messages.StringField(1) <NEW_LINE> path = _messages.StringField(2) <NEW_LINE> resource = _messages.StringField(3) | Describes EventTrigger, used to request events be sent from another
service.
Fields:
eventType: `event_type` names contain the service that is sending an event
and the kind of event that was fired. Must be of the form
`providers/*/eventTypes/*` e.g. Directly handle a Message published to
Google Cloud Pub... | 62598f0055399d3f05624efc |
class Resolver(common.ResolverBase, styles.Versioned): <NEW_LINE> <INDENT> persistenceVersion = 1 <NEW_LINE> def upgradeToVersion1(self): <NEW_LINE> <INDENT> self.typeToMethod = {} <NEW_LINE> for (k, v) in common.typeToMethod.items(): <NEW_LINE> <INDENT> self.typeToMethod[k] = getattr(self, v) <NEW_LINE> <DEDENT> <DEDE... | A resolver that services hosts(5) format files. | 62598f005fcc89381b265615 |
class CorpusSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.local_bi = BiDictionary() <NEW_LINE> self.words_count = 0 <NEW_LINE> self.V = 0 <NEW_LINE> self.artids_list = [] <NEW_LINE> self.arts_Z = [] <NEW_LINE> self.M = 0 <NEW_LINE> self.global_bi = None <NEW_LINE> self.local_2_global = {... | 定义语料集类,作为LdaBase的基类 | 62598f0060cbc95b06362d07 |
class XMLConvertible(Protocol): <NEW_LINE> <INDENT> def toXML(self) -> 'XMLContent': <NEW_LINE> <INDENT> raise NotImplementedError | Classes can define a `toXML` method to be automatically converted
to XML when used as XML content. | 62598f00283ffb24f3cf2280 |
class Comment(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey(Blogger, on_delete=models.CASCADE) <NEW_LINE> comment = models.TextField(max_length=500, help_text="Enter your comments") <NEW_LINE> post_time = models.DateTimeField("time posted", default=timezone.now) <NEW_LINE> blog = models.ForeignKey(BlogP... | This is model for comment a each specific blog post | 62598f004f6381625f1989a7 |
class Chromaticity(object): <NEW_LINE> <INDENT> def __init__(self, edid): <NEW_LINE> <INDENT> self._edid = edid <NEW_LINE> <DEDENT> @property <NEW_LINE> def red_x(self): <NEW_LINE> <INDENT> return (self._edid[0x1B] << 2) + ((self._edid[0x19] >> 6) & 0x03) <NEW_LINE> <DEDENT> @property <NEW_LINE> def red_y(self): <NEW_L... | Class for parsing chromaticity section of base EDID. | 62598f00a219f33f346c5204 |
class SystemData(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_by_type': {'key': 'createdByType', 'type': 'str'}, 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, 'last_... | Metadata pertaining to creation and last modification of the resource.
:param created_by: The identity that created the resource.
:type created_by: str
:param created_by_type: The type of identity that created the resource. Possible values
include: "User", "Application", "ManagedIdentity", "Key".
:type created_by_typ... | 62598f00956e5f7376df4b66 |
class NumpyEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, (np.integer, onp.integer)): <NEW_LINE> <INDENT> return int(obj) <NEW_LINE> <DEDENT> elif isinstance(obj, (np.floating, onp.floating)): <NEW_LINE> <INDENT> return float(obj) <NEW_LINE> <DEDENT> elif i... | Custom JSON encoder that handles numpy types. | 62598f00dc8b845886d51f9e |
class ApiException(Exception): <NEW_LINE> <INDENT> err_code = '' <NEW_LINE> err_msg = '' <NEW_LINE> def __init__(self, err_code=None, err_msg=None): <NEW_LINE> <INDENT> self.err_code = err_code if self.err_code else err_code <NEW_LINE> self.err_msg = self.err_msg if self.err_msg else err_msg <NEW_LINE> <DEDENT> def __s... | 自定义的异常 | 62598f00099cdd3c636748c2 |
class MethodNotSupported(SDKException): <NEW_LINE> <INDENT> def __init__(self, resource, method): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> name = resource.__name__ <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> name = resource.__class__.__name__ <NEW_LINE> <DEDENT> message = ('The %s method is not s... | The resource does not support this operation type. | 62598f00cc40096d616196c5 |
class _OperatorPanelSettingsRestore(_Registerable, bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = 'wm.ari_panel_settings_restore' <NEW_LINE> bl_label = 'Restore Panel Settings' <NEW_LINE> bl_description = 'Restore panel settings and clear ID properties' <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> a... | 全て初期化 | 62598f004527f215b58e88d3 |
class InstrumentCommand(BaseEnum): <NEW_LINE> <INDENT> CMD_LINE = "$" <NEW_LINE> GET_CLOCK = "get clock" <NEW_LINE> SET_CLOCK = "set clock" <NEW_LINE> UPGRADE = "upgrade" <NEW_LINE> REBOOT = "reboot" <NEW_LINE> EXIT = "exit" <NEW_LINE> GET_LAMPTIME = "get lamptime" <NEW_LINE> GET_ACTIVECALFILE = "get activecalfile" <NE... | Instrument command strings | 62598f0021bff66bcd72162e |
class DccChatFactoryTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_buildProtocol(self): <NEW_LINE> <INDENT> queryData = ('fromUser', None, None) <NEW_LINE> factory = irc.DccChatFactory(None, queryData) <NEW_LINE> protocol = factory.buildProtocol('127.0.0.1') <NEW_LINE> self.assertIsInstance(protocol, irc.DccCha... | Tests for L{DccChatFactory}. | 62598f00377c676e912f6250 |
class Var(): <NEW_LINE> <INDENT> def __init__(self, cmodel, colno): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getAttr(self, attrname): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def sameAs(self, other): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def setAttr(self, attrname, newval): <NEW_LINE> <INDENT> pass | Var(cmodel, colno)
Gurobi variable object. Variables have a number of attributes.
Some can be set (e.g., v.ub = 0.0), while others can only be queried
(e.g., print v.x). The most commonly used variable attributes are:
obj: Linear objective coefficient.
lb: Lower bound.
ub: Upper bound.
varName: Variable name.... | 62598f003d592f4c4edb98c6 |
class EvaluateListView(OrderBaseView): <NEW_LINE> <INDENT> template_name = 'wechat/order/evaluate_list.html' <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> kwargs = {} <NEW_LINE> kwargs['teacher'] = teacher = self.get_teacher(request) <NEW_LINE> parent = self.get_parent(request) <NEW_LINE> if parent is None: <N... | 测评建档服务列表 | 62598f004f88993c371ef9d5 |
class TrackerGeneCounts(RnaseqTracker): <NEW_LINE> <INDENT> pattern = "(\S+)_gene_counts$" | tracker with gene counts. | 62598f00ec188e330fdf7285 |
class Page(object): <NEW_LINE> <INDENT> def __init__(self, item_count, page_index = 1, page_size = 10): <NEW_LINE> <INDENT> self.item_count = item_count <NEW_LINE> self.page_size = page_size <NEW_LINE> self.page_count = item_count // page_size + (1 if item_count % page_size > 0 else 0) <NEW_LINE> if (item_count == 0) o... | Page object for display pages. | 62598f009f288636728171ce |
class CoverageMonitor(Monitor): <NEW_LINE> <INDENT> def __init__(self, repeat_interval, min_percent, event_name, create_time=None): <NEW_LINE> <INDENT> super(CoverageMonitor, self).__init__(event_name, create_time=create_time) <NEW_LINE> self.repeat_interval = repeat_interval <NEW_LINE> self.min_percent = min_percent <... | A coverage monitor tracks the volume of pings received since the
last reset. It has normal and warn states that are determined by
calculating the number of expected pings since the last reset. If
the actual number of pings falls below the minimum required
percent the monitor goes into warn mode. The component being
... | 62598f00aad79263cf42d1e7 |
class TestAnonymousSurvey(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> question = "What language did you first learn to speak?" <NEW_LINE> self.my_survey = AnonymousSurvey(question) <NEW_LINE> self.responses = ['English', 'Spanish', 'Chinese'] <NEW_LINE> <DEDENT> def test_store_single_re... | 针对AnonymousSurvey类的测试 | 62598f00283ffb24f3cf2282 |
class DataboxJobSecrets(JobSecrets): <NEW_LINE> <INDENT> _validation = { 'job_secrets_type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'job_secrets_type': {'key': 'jobSecretsType', 'type': 'str'}, 'pod_secrets': {'key': 'podSecrets', 'type': '[DataBoxSecret]'}, } <NEW_LINE> def __init__( self, *, pod_secrets:... | The secrets related to a DataBox job.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar job_secrets_type: Used to indicate what type of job secrets object.Constant filled by
server. Possible values include: "DataBox", "DataBoxDisk", "DataBoxHeavy".
:vartype job_secrets_ty... | 62598f00956e5f7376df4b67 |
class i(CurrentSource): <NEW_LINE> <INDENT> def __init__(self, ival): <NEW_LINE> <INDENT> self.args = (ival, ) <NEW_LINE> Ival = tExpr(ival) <NEW_LINE> self._Isc = Isuper(Ival) | Arbitrary t-domain current source | 62598f00d486a94d0ba2a9a1 |
class BoardDimension(click.ParamType): <NEW_LINE> <INDENT> name = 'dimension' <NEW_LINE> def convert(self, value, param, ctx): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> dimension = int(value) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> self.fail('provided value is not a valid integer') <NEW_LINE> <DED... | Hold validation for width/height console parameters | 62598f004f6381625f1989a8 |
class svn_ra_session_t: <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, svn_ra_session_t, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, svn_ra_session_t, name) <NEW_LINE> def __init__(s... | Proxy of C svn_ra_session_t struct | 62598f00ad47b63b2c5a61f0 |
class ExternalLibrary(object): <NEW_LINE> <INDENT> pass | A dummy object to house ExternalSymbol instances | 62598f005fc7496912d4775f |
class CustomUnpickler(object): <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> unpickler = pickle.Unpickler(file) <NEW_LINE> unpickler.persistent_load = self.persistent_load <NEW_LINE> self.load = unpickler.load <NEW_LINE> self.noload = unpickler.noload <NEW_LINE> <DEDENT> def persistent_load(self, ob... | Custom pickle object to perform correct deserializing.
This class replace filtered YAQL Engine to the real instance. | 62598f0050812a4eaa6200d7 |
class domain_name_website_info(): <NEW_LINE> <INDENT> need_check_ziduan = [u'bbd_dotime', u'approval_time', u'organizer_name' ] <NEW_LINE> def check_bbd_dotime(self, indexstr, ustr): <NEW_LINE> <INDENT> ret = None <NEW_LINE> if ustr and len(ustr): <NEW_LINE> <INDENT> if not public.bbd_dotime_date_format(ustr): <NEW_LIN... | 企业网站信息 | 62598f003617ad0b5ee04b04 |
class NewMatrix(PyoMatrixObject): <NEW_LINE> <INDENT> def __init__(self, width, height, init=None): <NEW_LINE> <INDENT> pyoArgsAssert(self, "IIL", width, height, init) <NEW_LINE> PyoMatrixObject.__init__(self) <NEW_LINE> self._size = (width, height) <NEW_LINE> if init == None: <NEW_LINE> <INDENT> self._base_objs = [New... | Create a new matrix ready for recording.
Optionally, the matrix can be filled with the contents of the
`init` parameter.
See :py:class:`MatrixRec` to write samples in the matrix.
:Parent: :py:class:`PyoMatrixObject`
:Args:
width : int
Desired matrix width in samples.
height : int
Desired ma... | 62598f00091ae356687035f3 |
class FileIndex(object) : <NEW_LINE> <INDENT> __slots__ = [ 'indexedfile', '_parser', '_positions', '_keys', '_key_dict'] <NEW_LINE> def __init__(self, indexedfile, linekey = None, parser=None) : <NEW_LINE> <INDENT> def default_parser(seekedfile) : <NEW_LINE> <INDENT> return seekedfile.readline() <NEW_LINE> <DEDENT> if... | Line based random access to a file. Quickly turn a file into a read-only
database.
Attr:
- indexfile -- The file to be indexed. Can be set to None and latter
replaced with a new file handle, for exampel, if you need to
close and latter reopen the file.
Bugs:
User must set the indexedfile ... | 62598f00be7bc26dc9251350 |
class ElexJSONOutputHandler(output.CementOutputHandler): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> label = 'json' <NEW_LINE> overridable = True <NEW_LINE> <DEDENT> def render(self, data, template=None): <NEW_LINE> <INDENT> if not isinstance(data, (list, tuple)): <NEW_LINE> <INDENT> data = [data] <NEW_LINE> <D... | A custom JSON output handler | 62598f008a349b6b43684c1d |
@instancedoc <NEW_LINE> class InterfaceFunctionElement(SageObject): <NEW_LINE> <INDENT> def __init__(self, obj, name): <NEW_LINE> <INDENT> self._obj = obj <NEW_LINE> self._name = name <NEW_LINE> <DEDENT> def _repr_(self): <NEW_LINE> <INDENT> return "%s" % self._name <NEW_LINE> <DEDENT> def __call__(self, *args, **kwds)... | Interface function element. | 62598f003346ee7daa336b53 |
class ResourceType(object): <NEW_LINE> <INDENT> def __init__(self, type_name=None, source_id=None): <NEW_LINE> <INDENT> LOGGER.info("Resource Type: {} [{}]".format(type_name, source_id)) <NEW_LINE> self.type_name = type_name <NEW_LINE> self.node = None <NEW_LINE> self.resource_url = source_id <NEW_LINE> <DEDENT> def to... | Base class for File, WebPage, Video, Audio resources | 62598f00ec188e330fdf7287 |
class PolynomialRing_commutative(PolynomialRing_general, commutative_algebra.CommutativeAlgebra): <NEW_LINE> <INDENT> def __init__(self, base_ring, name=None, sparse=False, element_class=None, category=None): <NEW_LINE> <INDENT> if base_ring not in _CommutativeRings: <NEW_LINE> <INDENT> raise TypeError("Base ring %s mu... | Univariate polynomial ring over a commutative ring. | 62598f005fcc89381b265617 |
class PhysicsEngine(object): <NEW_LINE> <INDENT> def __init__(self, physics_controller): <NEW_LINE> <INDENT> self.physics_controller = physics_controller <NEW_LINE> <DEDENT> def update_sim(self, hal_data, now, tm_diff): <NEW_LINE> <INDENT> lr_motor = hal_data['pwm'][1]['value'] <NEW_LINE> rr_motor = hal_data['pwm'][2][... | Simulates a 4-wheel robot using Tank Drive joystick control | 62598f0031939e2706ed0f4e |
class GM2MTo(Dummy): <NEW_LINE> <INDENT> pk = None | We need to define pk as we're using that attribute in the GM2MToManager
above | 62598f00aad79263cf42d1e9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.