code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Background(FrameMinion): <NEW_LINE> <INDENT> name = 'background' <NEW_LINE> def run(self): <NEW_LINE> <INDENT> import os <NEW_LINE> import logging <NEW_LINE> import warnings <NEW_LINE> import numpy as np <NEW_LINE> from numpy.ma.core import MaskedArrayFutureWarning <NEW_LINE> logging.getLogger('tgk.science').debu... | Estimate comet background.
Parameters
----------
config : dict
Configuration parameters.
im : Image
Frame data.
obs : Observation
Frame meta data.
geom : Geometry
Comet geometric circumstances. | 6259908d4c3428357761bf12 |
class DistrictIspInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Domain = None <NEW_LINE> self.Protocol = None <NEW_LINE> self.IpProtocol = None <NEW_LINE> self.StartTime = None <NEW_LINE> self.EndTime = None <NEW_LINE> self.Interval = None <NEW_LINE> self.Metric = None <NEW_LINE> ... | 地区运营商明细数据
| 6259908dad47b63b2c5a94a8 |
class ProductSplitter(BaseVspSplitter): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> _simuPOP_ba.ProductSplitter_swiginit(self, _simuPOP_ba.... | Details:
This splitter takes several splitters and take their intersections
as new VSPs. For example, if the first splitter defines 3 VSPs and
the second splitter defines 2, 6 VSPs will be defined by splitting
3 VSPs defined by the first splitter each to two VSPs. This
splitter is usually used to d... | 6259908d5fcc89381b266f89 |
class AbstractUniqueEmailUser(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> username = models.CharField( trans('username'), max_length=30, unique=True, help_text=trans( 'Required. 30 characters or fewer. Letters, numbers and ' '@/./+/-/_ characters'), validators=[ validators.RegexValidator( re.compile('^[\w.... | An abstract base class implementing a fully featured User model with
admin-compliant permissions.
Username, password and email are required. Other fields are optional. | 6259908d5fdd1c0f98e5fbce |
class Game(models.Model): <NEW_LINE> <INDENT> developer = models.ForeignKey(User, limit_choices_to={'groups__name': "Developers"}) <NEW_LINE> title = models.CharField(max_length=60, blank=False) <NEW_LINE> search_title = models.CharField(max_length=60, null=False, default='') <NEW_LINE> url = models.URLField(blank=Fals... | Model representing Game objects.
Attributes:
title: a string: name of the game (certain characters are not allowed)
search_title: a string: plain version of title to be used in searches (certain characters removed)
developer: a User object belonging to group Developers
url: a... | 6259908d8a349b6b43687eb6 |
class Delete(Base): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> id = self.options['<id>'] <NEW_LINE> password_record = password_service.get(id) <NEW_LINE> answer = input('Do you want to delete {name}({account_name})? (y/n): '.format(name=password_record['name'], account_name=password_record['account_name']))... | Delete passwords | 6259908d7cff6e4e811b769a |
class DeleteRawModifiedDetails(FrozenClass): <NEW_LINE> <INDENT> ua_types = [ ('NodeId', 'NodeId'), ('IsDeleteModified', 'Boolean'), ('StartTime', 'DateTime'), ('EndTime', 'DateTime'), ] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.NodeId = NodeId() <NEW_LINE> self.IsDeleteModified = True <NEW_LINE> self.Sta... | :ivar NodeId:
:vartype NodeId: NodeId
:ivar IsDeleteModified:
:vartype IsDeleteModified: Boolean
:ivar StartTime:
:vartype StartTime: DateTime
:ivar EndTime:
:vartype EndTime: DateTime | 6259908df9cc0f698b1c60f7 |
class TextValueGenerator(object): <NEW_LINE> <INDENT> def __init__(self,meanlen,stdlen): <NEW_LINE> <INDENT> self.meanlen = meanlen <NEW_LINE> self.stdlen = stdlen <NEW_LINE> <DEDENT> def generate(self): <NEW_LINE> <INDENT> length = max(0,int(random.gauss(self.meanlen, self.stdlen))) <NEW_LINE> return '"' + "".join([ra... | Generates random text. | 6259908d55399d3f0562816c |
class RegenerateCredentialParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, name: Union[str, "PasswordName"], **kwargs ): <NEW_LINE> <INDENT> super(Regenerate... | The parameters used to regenerate the login credential.
All required parameters must be populated in order to send to Azure.
:ivar name: Required. Specifies name of the password which should be regenerated -- password or
password2. Possible values include: "password", "password2".
:vartype name: str or ~azure.mgmt.c... | 6259908d26068e7796d4e59a |
class TestRowWiseThreshold(unittest.TestCase): <NEW_LINE> <INDENT> def test_3by3_matrix_percentile(self): <NEW_LINE> <INDENT> matrix = np.array([[0.5, 2.0, 3.0], [3.0, 4.0, 5.0], [4.0, 2.0, 1.0]]) <NEW_LINE> adjusted_matrix = refinement.RowWiseThreshold( p_percentile=0.5, thresholding_soft_multiplier=0.01, thresholding... | Tests for the RowWiseThreshold class. | 6259908dbf627c535bcb312b |
class PrepaidRentTestCase(DataProvider, BalanceUtils, TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.cash = self.account(type=Account.TYPES.asset) <NEW_LINE> self.rent_expense = self.account(type=Account.TYPES.expense) <NEW_LINE> self.prepaid_rent = self.account(type=Account.TYPES.asset) <NEW_... | Prepay three months rent in advance
Based on example here:
http://www.double-entry-bookkeeping.com/other-current-assets/prepaid-rent/ | 6259908d5fcc89381b266f8a |
class StatementParser: <NEW_LINE> <INDENT> def __init__(self, bankname: str): <NEW_LINE> <INDENT> self.confbank = bankparser.config.get_bank_config(bankname) <NEW_LINE> self.bankname = bankname <NEW_LINE> self.filename = None <NEW_LINE> self.content = None <NEW_LINE> <DEDENT> def parse(self, filename, is_content: bool=... | Базовый класс для разбора выписки | 6259908d3346ee7daa33848e |
@mock.patch('cinder.volume.api.API.get_snapshot', api_snapshot_get) <NEW_LINE> class SnapshotUnmanageTest(test.TestCase): <NEW_LINE> <INDENT> def _get_resp(self, snapshot_id): <NEW_LINE> <INDENT> req = webob.Request.blank('/v3/%s/snapshots/%s/action' % ( fake.PROJECT_ID, snapshot_id)) <NEW_LINE> req.method = 'POST' <NE... | Test cases for cinder/api/contrib/snapshot_unmanage.py
The API extension adds an action to snapshots, "os-unmanage", which will
effectively issue a delete operation on the snapshot, but with a flag set
that means that a different method will be invoked on the driver, so that
the snapshot is not actually deleted in the... | 6259908d283ffb24f3cf54f9 |
class MyForm(forms.Form): <NEW_LINE> <INDENT> pass | Example .
i have no Question object so comment it | 6259908d656771135c48ae5d |
class IssueStatusSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Issue <NEW_LINE> fields = ['status'] <NEW_LINE> <DEDENT> def update(self, id): <NEW_LINE> <INDENT> issue = Issue.objects.get(id=id) <NEW_LINE> issue.status = self.validated_data['status'] <NEW_LINE> iss... | Serializer of an issue's status | 6259908da05bb46b3848bf52 |
class TestingConfig(Config): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> DATABASE_URL = os.getenv("DATABASE_TEST_URL") | Configurations for Testing | 6259908d167d2b6e312b83c5 |
class G43dot1(GCodeMaker): <NEW_LINE> <INDENT> _cmd = "G43.1" <NEW_LINE> _order = ['z'] <NEW_LINE> _tmpls = {'z':"Z%s"} <NEW_LINE> def __init__(self, **data): <NEW_LINE> <INDENT> GCodeMaker.__init__(self, **data) | Dynamic Tool Length Offset | 6259908de1aae11d1e7cf642 |
class TarballContains(Matcher): <NEW_LINE> <INDENT> def __init__(self, paths): <NEW_LINE> <INDENT> super(TarballContains, self).__init__() <NEW_LINE> self.paths = paths <NEW_LINE> self.path_matcher = Equals(sorted(self.paths)) <NEW_LINE> <DEDENT> def match(self, tarball_path): <NEW_LINE> <INDENT> f = open(tarball_path,... | Matches if the given tarball contains the given paths.
Uses TarFile.getnames() to get the paths out of the tarball. | 6259908dad47b63b2c5a94ac |
class Solution: <NEW_LINE> <INDENT> def isPalindrome(self, s: str) -> bool: <NEW_LINE> <INDENT> if not s: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> s = ''.join([x.lower() for x in s if x.isalnum()]) <NEW_LINE> return s[::-1] == s | 判断字符串是否是回文字符串
正读反读都一样的字符串 忽略大小写及特殊标点 | 6259908d60cbc95b06365b95 |
class ObjectDict(dict): <NEW_LINE> <INDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[name] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise AttributeError(name) <NEW_LINE> <DEDENT> <DEDENT> def __setattr__(self, name, value): <NEW_LINE> <INDENT> self[name] = va... | Makes a dictionary behave like an object, with attribute-style access. | 6259908d3346ee7daa33848f |
class TestStartpage(BaseCherryPyTestCase, ResponseAssertions): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls) -> None: <NEW_LINE> <INDENT> helpers.start_server(apps.startpage.main.Controller) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(cls) -> None: <NEW_LINE> <INDENT> helpers.stop_se... | Unit tests for the template app | 6259908d97e22403b383cb52 |
class TestEzsigndocumentlogResponse(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 testEzsigndocumentlogResponse(self): <NEW_LINE> <INDENT> pass | EzsigndocumentlogResponse unit test stubs | 6259908dfff4ab517ebcf472 |
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('Users must have an email address.') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email, ... | Helps Django work with our custom user model. | 6259908d26068e7796d4e59e |
class ResultTracker(object): <NEW_LINE> <INDENT> MISSING = object() <NEW_LINE> SKIPPED = object() <NEW_LINE> def __init__(self, request, parent_object, placeholder, items, all_cacheable=True): <NEW_LINE> <INDENT> self.request = request <NEW_LINE> self.parent_object = parent_object <NEW_LINE> self.placeholder = placehol... | A tracking of intermediate results during rendering.
This object is completely agnostic to what is's rendering,
it just stores "output" for a "contentitem". | 6259908dec188e330fdfa50b |
class MathExtension(Extension): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(MathExtension, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def extendMarkdown(self, md, md_globals): <NEW_LINE> <INDENT> def handle_match_inline(m): <NEW_LINE> <INDENT> node = etree.Element('script... | ## Math extension for Python-Markdown
Adds support for displaying math formulas using [MathJax](http://www.mathjax.org/).
Author: 2015, Dmitry Shachnev <mitya57@gmail.com>.
Slightly customized by cryptonomicon314 | 6259908d5fc7496912d49099 |
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('email', 'password', 'name') <NEW_LINE> extra_kwargs = {'password': {'write_only': True, 'min_length': 5}} <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE>... | Serializer for user object | 6259908daad79263cf43040f |
class KeyView(BaseView): <NEW_LINE> <INDENT> route_base = '/api/1/auth/key' <NEW_LINE> def get(self): <NEW_LINE> <INDENT> resp = {} <NEW_LINE> resp['format'] = const.AUTH_TOKEN_KEY_FORMAT <NEW_LINE> resp['key'] = const.AUTH_TOKEN_PUB_KEY <NEW_LINE> resp['algorithm'] = const.AUTH_TOKEN_ALGORITHM <NEW_LINE> return ujson.... | API end point for obtaining the public key, used to decode the JWT tokens | 6259908d8a349b6b43687ebc |
class LastModifiedCleaner(Feeder): <NEW_LINE> <INDENT> def __init__(self, feeder_dir, linger_time): <NEW_LINE> <INDENT> self.feeder_dir = str(feeder_dir) <NEW_LINE> self.linger_time = float(linger_time) <NEW_LINE> if not os.path.isdir(feeder_dir): <NEW_LINE> <INDENT> raise ValueError("Feeder directory must be an existi... | Abstract subclass of Feeder that provides a "delete after delay" clean() method.
| 6259908ddc8b845886d55217 |
class UsageError(Exception): <NEW_LINE> <INDENT> pass | Exception used to detect an invalid usage error. | 6259908d167d2b6e312b83c7 |
class RequestContext(context.RequestContext): <NEW_LINE> <INDENT> def __init__(self, auth_token=None, auth_url=None, domain_id=None, domain_name=None, user=None, user_id=None, project=None, project_id=None, is_admin=False, is_public_api=False, read_only=False, show_deleted=False, request_id=None, trust_id=None, auth_to... | Extends security contexts from the OpenStack common library. | 6259908d091ae356687068a3 |
class LocalVar(Assignment): <NEW_LINE> <INDENT> subparts = [('names', NameList), ('values', ExpressionList)] <NEW_LINE> template = 'local {names} = {values}' <NEW_LINE> def render(self, wrapper=empty_wrapper): <NEW_LINE> <INDENT> if len(self) == 1: <NEW_LINE> <INDENT> self.template = LocalVar.template.replace('= {value... | Variable declaration with "local" modifier. | 6259908d5fcc89381b266f8d |
class CustomUser(User,models.Model): <NEW_LINE> <INDENT> core_num=models.IntegerField(default=1) <NEW_LINE> mem_limit=models.IntegerField(default=256) <NEW_LINE> vms=models.ManyToManyField(VM) <NEW_LINE> objects = UserManager() | User with app settings. | 6259908d656771135c48ae60 |
class ApiEndpoints(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> return {'paths': sorted(_resource_paths)} | Implementation of / REST API call. | 6259908dadb09d7d5dc0c1b9 |
class RecursivePermDirFixture(fixtures.Fixture): <NEW_LINE> <INDENT> def __init__(self, directory, perms): <NEW_LINE> <INDENT> super(RecursivePermDirFixture, self).__init__() <NEW_LINE> self.directory = directory <NEW_LINE> self.least_perms = perms <NEW_LINE> <DEDENT> def _setUp(self): <NEW_LINE> <INDENT> previous_dire... | Ensure at least perms permissions on directory and ancestors. | 6259908d7cff6e4e811b76a2 |
@attr.s <NEW_LINE> class GitTreeStructure(GitHubBase): <NEW_LINE> <INDENT> _SCHEMA: typing.ClassVar[Schema] = schemas.GIT_TREE_STRUCTURE_SCHEMA <NEW_LINE> mode = attr.ib(type=int) <NEW_LINE> path = attr.ib(type=str) <NEW_LINE> sha = attr.ib(type=str) <NEW_LINE> type = attr.ib(type=str) <NEW_LINE> size = attr.ib(type=in... | "Git tree structure. | 6259908d5fcc89381b266f8e |
class FormSpider(CrawlSpider): <NEW_LINE> <INDENT> name = 'form' <NEW_LINE> def __init__(self, urls, crawl, auth, *args, **kwargs): <NEW_LINE> <INDENT> if crawl: <NEW_LINE> <INDENT> link_extractor = LinkExtractor() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> link_extractor = LinkExtractor(deny=('.*')) <NEW_LINE> <DED... | Form spider | 6259908d60cbc95b06365b98 |
class PointSelOperator: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.delta = [] <NEW_LINE> return <NEW_LINE> <DEDENT> def operate(self, draw=True, override=False): <NEW_LINE> <INDENT> self.delta = [] <NEW_LINE> if not draw: <NEW_LINE> <INDENT> return self.delta <NEW_LINE> <DEDENT> return self.delta ... | Operator to select a point in the map | 6259908d3346ee7daa338492 |
class PushUrlCacheRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Urls = None <NEW_LINE> self.SubAppId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Urls = params.get("Urls") <NEW_LINE> self.SubAppId = params.get("SubAppId") | PushUrlCache request structure.
| 6259908d656771135c48ae61 |
class WebsocketClient(BaseClient): <NEW_LINE> <INDENT> def __init__(self, currency, secret, config): <NEW_LINE> <INDENT> BaseClient.__init__(self, currency, secret, config) <NEW_LINE> <DEDENT> def _recv_thread_func(self): <NEW_LINE> <INDENT> reconnect_time = 5 <NEW_LINE> use_ssl = self.config.get_bool("gox", "use_ssl")... | this implements a connection to MtGox through the older (but faster)
websocket protocol. Unfortuntely its just as unreliable as the socket.io. | 6259908d3617ad0b5ee07db2 |
class Compiler(object): <NEW_LINE> <INDENT> backend_extension = '.stoneg' <NEW_LINE> def __init__(self, api, backend_module, backend_args, build_path, clean_build=False): <NEW_LINE> <INDENT> self._logger = logging.getLogger('stone.compiler') <NEW_LINE> self.api = api <NEW_LINE> self.backend_module = backend_module <NEW... | Applies a collection of backends found in a single backend module to an
API specification. | 6259908d283ffb24f3cf5502 |
class FieldQuery(Query): <NEW_LINE> <INDENT> def __init__(self, field, pattern): <NEW_LINE> <INDENT> self.field = field <NEW_LINE> self.pattern = pattern | An abstract query that searches in a specific field for a
pattern. | 6259908d26068e7796d4e5a4 |
class SimpleTypeError(ValidationError, TypeError): <NEW_LINE> <INDENT> def __init__( self, value, target_type, from_err=None, msg=None, ): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.target_type = target_type <NEW_LINE> self.from_err = from_err <NEW_LINE> self._msg = msg <NEW_LINE> if msg is None: <NEW_LINE>... | Encountered a value with an incorrect simple type. | 6259908de1aae11d1e7cf646 |
class DispatcherMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.lock = Lock() <NEW_LINE> self.config = app.config <NEW_LINE> self.wsgi_app = app.wsgi_app <NEW_LINE> self.realm = self.config.get('AUTH_REALM', 'Basic realm="Login Required"') <NEW_LINE> self.git_root = os.path.abs... | Dispatch http request to flask app or git app | 6259908d5fcc89381b266f8f |
class MatchTimeBase(models.Model): <NEW_LINE> <INDENT> start = TimeField() <NEW_LINE> interval = models.IntegerField() <NEW_LINE> count = models.IntegerField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> def rrule_dtstart(self): <NEW_LINE> <INDENT> return timezone.now().replace( hour=... | Abstract base class that stores enough information to create a recurring
rule set. | 6259908daad79263cf430415 |
class pyIndIterator(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, begin: 'vector< simuPOP::Individual,std::allocator< simuPOP::Individual > >::iterator const', end: 'vect... | Details:
this class implements a Python itertor class that can be used to
iterate through individuals in a (sub)population. If allInds are
true, visiblility of individuals will not be checked. Otherwise, a
functor will be used to check if indiviudals belong to a specified
virtual subpopulation. An... | 6259908d7cff6e4e811b76a6 |
class ApplicationGesture(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(self,*ar... | Specifies the available application-specific gesture.
enum ApplicationGesture,values: AllGestures (0),ArrowDown (61497),ArrowLeft (61498),ArrowRight (61499),ArrowUp (61496),Check (61445),ChevronDown (61489),ChevronLeft (61490),ChevronRight (61491),ChevronUp (61488),Circle (61472),Curlicue (61456),DoubleCircle (61473... | 6259908d4c3428357761bf20 |
class classproperty(object): <NEW_LINE> <INDENT> def __init__(self, fget): <NEW_LINE> <INDENT> self.fget = fget <NEW_LINE> <DEDENT> def __get__(self, owner_self, owner_cls): <NEW_LINE> <INDENT> return self.fget(owner_cls) | Decorator which allows read only class properties | 6259908dd8ef3951e32c8c8f |
class PlayerPaddle(Entity): <NEW_LINE> <INDENT> CTYPE = 50 <NEW_LINE> def __init__(self, uuid, host=None, port=None, number=None, foe=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(uuid, mass=spot_get('sv_paddle_mass'), size=spot_get('paddle_size'), **kwargs) <NEW_LINE> self.box.elasticity = 1.0 <NEW_LINE> self.... | Paddle as an entity | 6259908d5fdd1c0f98e5fbdc |
class Config(FlaskConfig): <NEW_LINE> <INDENT> def from_mapping(self, *mapping, **kwargs): <NEW_LINE> <INDENT> mappings = [] <NEW_LINE> if len(mapping) == 1: <NEW_LINE> <INDENT> if hasattr(mapping[0], 'items'): <NEW_LINE> <INDENT> mappings.append(list(mapping[0].items())) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> m... | Subclass of Flask's Config class to add support to load from YAML file
| 6259908d60cbc95b06365b9a |
class CPU(models.Model): <NEW_LINE> <INDENT> asset = models.OneToOneField('Asset', on_delete=models.SET_NULL, null=True) <NEW_LINE> cpu_model = models.CharField(u'CPU型号', max_length=128, blank=True) <NEW_LINE> cpu_count = models.SmallIntegerField(u'物理cpu个数') <NEW_LINE> cpu_core_count = models.SmallIntegerField(u'cpu核数'... | CPU组件 | 6259908df9cc0f698b1c60fe |
class CompareResponse: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'result': 'CompareResult', 'status': 'str', 'error_message': 'str' } <NEW_LINE> self.result = None <NEW_LINE> self.status = None <NEW_LINE> self.error_message = None | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259908d7cff6e4e811b76a8 |
@mark.django_db <NEW_LINE> class TestEnterpriseConfig(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestEnterpriseConfig, self).setUp() <NEW_LINE> self.post_save_mock = mock.Mock() <NEW_LINE> patcher = mock.patch('enterprise.signals.handle_user_post_save', self.post_save_mock) <NEW_... | Test edx-enterprise app config. | 6259908da05bb46b3848bf58 |
class internal_open: <NEW_LINE> <INDENT> def openers(self, filename, names, extensions, mode): <NEW_LINE> <INDENT> result = [] <NEW_LINE> for extension in extensions: <NEW_LINE> <INDENT> full_filename = filename+extension <NEW_LINE> dir = os.path.splitext(full_filename)[1][1:] <NEW_LINE> result.append(lambda: builtinop... | locates files within the PyX data tree (via an open relative to the path of this file) | 6259908d63b5f9789fe86dd0 |
class UpdateTutorial(webapp2.RequestHandler): <NEW_LINE> <INDENT> def put(self): <NEW_LINE> <INDENT> data = json.loads(self.request.body) <NEW_LINE> if_view = data['ifView'] <NEW_LINE> uid = users.get_current_user().nickname() <NEW_LINE> user_query = db.GqlQuery(r"SELECT * FROM UsersHistory WHERE name = :1", str(uid)) ... | update if view tutorial to user DB | 6259908d60cbc95b06365b9b |
class IPAddress(Base): <NEW_LINE> <INDENT> def __init__(self, ipv4=True, ipv6=False, message=None): <NEW_LINE> <INDENT> kwargs = { 'ipv4': ipv4, 'ipv6': ipv6, 'message': message } <NEW_LINE> super(IPAddress, self).__init__(wtf_ip_address, **kwargs) | Validates an IP address.
:param ipv4:
If True, accept IPv4 addresses as valid (default True)
:param ipv6:
If True, accept IPv6 addresses as valid (default False)
:param message:
Error message to raise in case of a validation error. | 6259908d3346ee7daa338495 |
class rule_009(blank_line_above_line_starting_with_token): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> blank_line_above_line_starting_with_token.__init__(self, 'case', '009', [token.end_keyword]) | This rule checks for blank lines or comments above the **end** keyword.
|configuring_blank_lines_link|
**Violation**
.. code-block:: vhdl
when others =>
null;
end case;
**Fix**
.. code-block:: vhdl
when others =>
null;
end case; | 6259908d656771135c48ae64 |
class PhoneNumber(object): <NEW_LINE> <INDENT> deserialized_types = { 'country_code': 'str', 'phone_number': 'str' } <NEW_LINE> attribute_map = { 'country_code': 'countryCode', 'phone_number': 'phoneNumber' } <NEW_LINE> def __init__(self, country_code=None, phone_number=None): <NEW_LINE> <INDENT> self.__discriminator_v... | :param country_code:
:type country_code: (optional) str
:param phone_number:
:type phone_number: (optional) str | 6259908ddc8b845886d55221 |
class Event: <NEW_LINE> <INDENT> def __init__(self, eventClass): <NEW_LINE> <INDENT> self.timestamp = time.time() <NEW_LINE> self.type = eventClass <NEW_LINE> <DEDENT> def id(self): <NEW_LINE> <INDENT> return "%d" % self.timestamp <NEW_LINE> <DEDENT> def getTimestamp(self): <NEW_LINE> <INDENT> return str(self.timestamp... | Base event class | 6259908d4c3428357761bf24 |
class ExtractableI18NDirective(I18NDirective): <NEW_LINE> <INDENT> def extract(self, stream, comment_stack): <NEW_LINE> <INDENT> raise NotImplementedError | Simple interface for directives to support messages extraction. | 6259908d5fcc89381b266f92 |
class SpecificationHandler(MPlaneHandler): <NEW_LINE> <INDENT> def initialize(self, supervisor): <NEW_LINE> <INDENT> self._supervisor = supervisor <NEW_LINE> self.dn = get_dn(self._supervisor, self.request) <NEW_LINE> self._supervisor._dn_to_ip[self.dn] = self.request.remote_ip <NEW_LINE> <DEDENT> def get(self): <NEW_L... | Exposes the specifications, that will be periodically pulled by the
components | 6259908d60cbc95b06365b9c |
class ForumEntry(db.Model, SerializableObject, TextRendererMixin): <NEW_LINE> <INDENT> __tablename__ = 'forum_entry' <NEW_LINE> query = db.session.query_property(ForumEntryQuery) <NEW_LINE> object_type = 'forum.entry' <NEW_LINE> public_fields = ('entry_id', 'discriminator', 'author', 'date_created', 'date_active', 'sco... | The base class of a :class:`Question` or :class:`Answer`, which contains
some general information about the author and the creation date, as well as
the actual text and the votings. | 6259908df9cc0f698b1c6100 |
class MapsetDialog(SimpleDialog): <NEW_LINE> <INDENT> def __init__(self, parent, title=_("Select mapset in GRASS location"), location=None): <NEW_LINE> <INDENT> SimpleDialog.__init__(self, parent, title) <NEW_LINE> if location: <NEW_LINE> <INDENT> self.SetTitle(self.GetTitle() + ' <%s>' % location) <NEW_LINE> <DEDENT> ... | Dialog used to select mapset | 6259908d55399d3f0562817e |
class TryField(BaseReviewRequestField): <NEW_LINE> <INDENT> field_id = 'p2rb.autoland_try' <NEW_LINE> label = _('Try') <NEW_LINE> can_record_change_entry = True <NEW_LINE> _retrieve_error_txt = _('There was an error retrieving the try push.') <NEW_LINE> _waiting_txt = _('Waiting for the autoland to try request to execu... | The field for kicking off Try builds and showing Try state.
This field allows a user to kick off a Try build for each unique
revision. Once kicked off, it shows the state of the most recent
Try build. | 6259908ddc8b845886d55223 |
@dataclass <NEW_LINE> class AppConfig: <NEW_LINE> <INDENT> application_name: str <NEW_LINE> repository_name: str <NEW_LINE> branch: str <NEW_LINE> build_environment: Environment <NEW_LINE> @classmethod <NEW_LINE> def from_raw_config(cls: Type[AppConfigClass], raw_config: Dict[str, Any]) -> AppConfigClass: <NEW_LINE> <I... | Configuration of the application. | 6259908d5fdd1c0f98e5fbe2 |
class QueryProvider(IterProvider): <NEW_LINE> <INDENT> def __init__(self, db_path, query, params, queue_length=16): <NEW_LINE> <INDENT> def generator(): <NEW_LINE> <INDENT> for row in sqlite3.Connection(db_path).execute(query, params): <NEW_LINE> <INDENT> yield row <NEW_LINE> <DEDENT> <DEDENT> super().__init__(generato... | Provides a database query selection to multiple threads | 6259908d7cff6e4e811b76ae |
class PostgreConnector(HostConnector): <NEW_LINE> <INDENT> name = "postgres" | Postgre Engine connector | 6259908d167d2b6e312b83ce |
class TermPathFollowEnv(path_follow_env.PathFollowEnv): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TermPathFollowEnv, self).__init__() <NEW_LINE> <DEDENT> def term_reward(self, state): <NEW_LINE> <INDENT> xyz, _, _, _, _ = state <NEW_LINE> u = sum([(x-g)**2 for x, g in zip(xyz, self.goal_xyz)])**... | Environment wrapper for training low-level flying skills. The aim is to sequentially fly to
two consecutive waypoints that are each uniformly sampled from the volume of a sphere. The
first sphere is centered on the starting point (0,0,0), and the second sphere is centered on
the point (xg,yg,zg). The agent is able to s... | 6259908dbf627c535bcb313f |
class MLP(object): <NEW_LINE> <INDENT> def __init__(self, rng, input, n_in, n_hidden, n_out): <NEW_LINE> <INDENT> self.hiddenLayer = HiddenLayer( rng=rng, input=input, n_in=n_in, n_out=n_hidden, activation=T.tanh ) <NEW_LINE> self.logRegressionLayer = LogisticRegression( input=self.hiddenLayer.output, n_in=n_hidden, n_... | Multi-Layer Perceptron Class
A multilayer perceptron is a feedforward artificial neural network model
that has one layer or more of hidden units and nonlinear activations.
Intermediate layers usually have as activation function tanh or the
sigmoid function (defined here by a ``HiddenLayer`` class) while the
top layer... | 6259908d63b5f9789fe86dd6 |
class X11(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): <NEW_LINE> <INDENT> plugin_name = 'x11' <NEW_LINE> profiles = ('hardware', 'desktop') <NEW_LINE> files = ('/etc/X11',) <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> self.add_copy_spec([ "/etc/X11", "/var/log/Xorg.*.log", "/var/log/XFree86.*.log", ]) <NEW_LI... | X windowing system
| 6259908ddc8b845886d55227 |
class HashCommand(Command): <NEW_LINE> <INDENT> usage = '%prog [options] <file> ...' <NEW_LINE> ignore_require_venv = True <NEW_LINE> def add_options(self): <NEW_LINE> <INDENT> self.cmd_opts.add_option( '-a', '--algorithmStudy', dest='algorithmStudy', choices=STRONG_HASHES, action='store', default=FAVORITE_HASH, help='... | Compute a hash of a local package archive.
These can be used with --hash in a requirements file to do repeatable
installs. | 6259908da05bb46b3848bf5c |
class InvenioSequenceGenerator(object): <NEW_LINE> <INDENT> def __init__(self, app=None): <NEW_LINE> <INDENT> if app: <NEW_LINE> <INDENT> self.init_app(app) <NEW_LINE> <DEDENT> <DEDENT> def init_app(self, app): <NEW_LINE> <INDENT> app.extensions['invenio-sequencegenerator'] = self <NEW_LINE> app.register_blueprint(Blue... | Invenio-SequenceGenerator extension. | 6259908dadb09d7d5dc0c1c9 |
class VideoUploadUrlFactory(factory.DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.VideoUploadUrl <NEW_LINE> <DEDENT> owner = factory.SubFactory(UserFactory) | This fatory creates random video upload URL instances for testing purposes | 6259908d656771135c48ae68 |
class Ripoff(FSMPlayer): <NEW_LINE> <INDENT> name = "Ripoff" <NEW_LINE> classifier = { "memory_depth": 3, "stochastic": False, "long_run_time": False, "inspects_source": False, "manipulates_source": False, "manipulates_state": False, } <NEW_LINE> def __init__(self) -> None: <NEW_LINE> <INDENT> transitions = ( (1, C, 2,... | FSM player described in http://DOI.org/10.1109/TEVC.2008.920675.
Names
- Ripoff: [Ashlock2008]_ | 6259908d3617ad0b5ee07dc0 |
class TaxaJurosContaListaResponse(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'plano': 'int', 'taxa': 'float' } <NEW_LINE> self.attribute_map = { 'plano': 'plano', 'taxa': 'taxa' } <NEW_LINE> self._plano = None <NEW_LINE> self._taxa = None <NEW_LINE> <DEDENT> @property <N... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259908d8a349b6b43687ece |
class Alg(graphene.Enum): <NEW_LINE> <INDENT> HS256 = "HS256" <NEW_LINE> RS256 = "RS256" <NEW_LINE> RSA = "RSA" <NEW_LINE> ED25519 = "ED25519" | Supported signature algorithms | 6259908d167d2b6e312b83d0 |
class TestUnsupportedMediaTypeError(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return Unsup... | UnsupportedMediaTypeError unit test stubs | 6259908d091ae356687068b5 |
class CombinedDetail(base.APIView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> namespace = request.GET.get('namespace', None) <NEW_LINE> name = request.GET.get('name', None) <NEW_LINE> if not name or not namespace: <NEW_LINE> <INDENT> raise exceptions.ValidationError( detail='namespace and name par... | This is intendended to provide all of the information for the content
detail pages. For repos, it returns the repository, namespace and list of
content items.
For collections it returns a collection object | 6259908dad47b63b2c5a94c2 |
class TestV1Filesystem(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 testV1Filesystem(self): <NEW_LINE> <INDENT> pass | V1Filesystem unit test stubs | 6259908e3617ad0b5ee07dc4 |
class FrakmLog(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._urllist=list() <NEW_LINE> <DEDENT> def gen(self, hostname, logfiles, proto='https://'): <NEW_LINE> <INDENT> for logfile in logfiles: <NEW_LINE> <INDENT> with open(logfile) as f: <NEW_LINE> <INDENT> is_in_url_part=False <NEW_LINE> ... | URL List generatetor from logs akamai provides | 6259908ef9cc0f698b1c6105 |
class Recorder(object): <NEW_LINE> <INDENT> def __init__(self, serial, model, producer, description = None, id=None, parent_inventory=None, author_uri = None, agency_uri = None, creation_time = None): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.serial = str(serial) <NEW_LINE> self.model = model <NEW_LINE> self.pro... | A seismic data recorder.
| 6259908eec188e330fdfa524 |
class Role(object): <NEW_LINE> <INDENT> def __init__(self, roleName=None, createTime=None, ownerName=None,): <NEW_LINE> <INDENT> self.roleName = roleName <NEW_LINE> self.createTime = createTime <NEW_LINE> self.ownerName = ownerName <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is ... | Attributes:
- roleName
- createTime
- ownerName | 6259908e5fdd1c0f98e5fbec |
class Notice (models.Model): <NEW_LINE> <INDENT> notice_title = models.TextField() <NEW_LINE> notice_context = RichTextField() <NEW_LINE> timestamp = models.DateField() <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.notice_title + " " + self.notice_context | Model class for Notice | 6259908e3617ad0b5ee07dc6 |
class tracker_GUI(object): <NEW_LINE> <INDENT> pass | Abstract base class | 6259908ea05bb46b3848bf60 |
class GrrStatus(rdfvalue.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = jobs_pb2.GrrStatus <NEW_LINE> rdf_map = dict(cpu_used=rdfvalue.CpuSeconds) | The client status message.
When the client responds to a request, it sends a series of response messages,
followed by a single status message. The GrrStatus message contains error and
traceback information for any failures on the client. | 6259908e091ae356687068bb |
class F12(BBOBNfreeFunction): <NEW_LINE> <INDENT> funId = 12 <NEW_LINE> condition = 1e6 <NEW_LINE> beta = .5 <NEW_LINE> def initwithsize(self, curshape, dim): <NEW_LINE> <INDENT> if self.dim != dim: <NEW_LINE> <INDENT> if self.zerox: <NEW_LINE> <INDENT> self.xopt = zeros(dim) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDEN... | Bent cigar with asymmetric space distortion, condition 1e6 | 6259908e5fc7496912d490a6 |
class Worker(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=255) <NEW_LINE> description = models.TextField(blank=True) <NEW_LINE> api_key = models.CharField(max_length=255, db_index=True, unique=True) <NEW_LINE> secret = models.CharField(max_length=255, db_index=True) <NEW_LINE> enqueue_is_enabl... | Workers | 6259908e099cdd3c63676235 |
class DateParserIs(DateParser): <NEW_LINE> <INDENT> modifier_to_int = { 'fyrir' : Date.MOD_BEFORE, 'á undan' : Date.MOD_BEFORE, 'eftir' : Date.MOD_AFTER, 'í kringum' : Date.MOD_ABOUT, 'uþb' : Date.MOD_ABOUT } <NEW_LINE> bce = ["f Kr"] <NEW_LINE> calendar_to_int = { 'gregoríanskt ' : Date.CAL_GREGORIAN... | Convert a text string into a Date object, expecting a date
notation in the Icelandic language. If the date cannot be converted,
the text string is assigned. | 6259908e5fdd1c0f98e5fbf0 |
class DialectManager(object): <NEW_LINE> <INDENT> __dialects_mapping = None <NEW_LINE> __chemical_dialect_instances = {} <NEW_LINE> @staticmethod <NEW_LINE> def __initialize_dialects(): <NEW_LINE> <INDENT> from razi.postgresql_rdkit import PostgresRDKitDialect <NEW_LINE> from razi.chemicalite import ChemicaLiteDialect ... | This class is responsible for finding a chemical dialect (e.g.
PGRDKitDialect or ChemicaLiteDialect) for a SQLAlchemy database dialect.
It can be used by calling "DialectManager.get_chemical_dialect(dialect)",
which returns the corresponding chemical dialect.
The chemical dialect has to be listed in __initialize_dia... | 6259908e3346ee7daa33849e |
class Qos(api_extensions.APIExtensionDescriptor): <NEW_LINE> <INDENT> api_definition = apidef <NEW_LINE> @classmethod <NEW_LINE> def get_plugin_interface(cls): <NEW_LINE> <INDENT> return QoSPluginBase <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_resources(cls): <NEW_LINE> <INDENT> special_mappings = {'policies':... | Quality of Service API extension. | 6259908e656771135c48ae6d |
class MySqlConnect(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.conn = MySQLdb.connect(host='127.0.0.1',user='root',passwd='x5xuan',db='network_info') <NEW_LINE> self.cur = self.conn.cursor() <NEW_LINE> <DEDENT> def Select(self,sql): <NEW_LINE> <INDENT> self.cur.execute(sql) <NEW_LINE> data... | for connect mysql | 6259908e8a349b6b43687ed8 |
class RSky(Observation): <NEW_LINE> <INDENT> ObservationType = "R-SKY" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def run(self, integ_time): <NEW_LINE> <INDENT> print("Start R SKY observation") <NEW_LINE> print(f"Integration time {integ_time}") <NEW_LINE> self.con.move_cho... | An observing module for R-SKY observation, which provides Tsys
measurement toward an elevation of 80 deg.) | 6259908e7cff6e4e811b76bc |
class ElectricCar(Car): <NEW_LINE> <INDENT> def __init__(self, make, model, year): <NEW_LINE> <INDENT> super().__init__(make,model,year) <NEW_LINE> self.battery = Battery() | 电动汽车的独特之处 | 6259908edc8b845886d55233 |
class ResourceTypeMissing(ApiError): <NEW_LINE> <INDENT> pass | Resource type is missing | 6259908e26068e7796d4e5bc |
class FSKeyService(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.opts = kwargs <NEW_LINE> <DEDENT> def minions(self): <NEW_LINE> <INDENT> ret = {} <NEW_LINE> for root, dirnames, fnames in os.walk('/etc/salt/pki/master'): <NEW_LINE> <INDENT> for dirn in dirnames: <NEW_LINE> <INDENT>... | Keyservice in the Filesystem. Would implement the logic currently
present in salt.transports.mixins.auth.AESReqServerMixin._auth() | 6259908ed8ef3951e32c8c9a |
class SpellTable(tables.Table): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> model = models.Spell <NEW_LINE> sequence = ('name', 'difficulty', '...',) <NEW_LINE> exclude = ('campaign', 'id',) <NEW_LINE> <DEDENT> def render_difficulty(self, record): <NEW_LINE> <INDENT> return record.get_difficulty_display | An HTML table displaying ``Spell`` objects. | 6259908eadb09d7d5dc0c1d5 |
class UpdateEmailView( View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> email = request.POST.get("email", "") <NEW_LINE> code = request.POST.get("code", "") <NEW_LINE> existed_codes = EmailVertifyRecord.objects.filter(email=email, code=code, send_type="update_email") <NEW_LINE> if existed_codes: ... | 修改个人邮箱 | 6259908e97e22403b383cb72 |
class SimpleReadOnlyGlanceClientTest(base.ClientTestBase): <NEW_LINE> <INDENT> def test_list(self): <NEW_LINE> <INDENT> self.glance('image-list') | read only functional python-glanceclient tests.
This only exercises client commands that are read only. | 6259908e283ffb24f3cf551b |
class PuntajeRiesgo(UltimaModificacionMixin): <NEW_LINE> <INDENT> prueba = models.OneToOneField(Prueba, related_name='puntaje_riesgo', on_delete=models.CASCADE) <NEW_LINE> puntaje = models.FloatField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Puntaje Riesgo' <NEW_LINE> verbose_name_plural = 'Puntajes ... | Modelo para guardar los puntajes de riesgo de cada prueba, siempre y cuando esta sea de aguas,
para calcular el IRCA. | 6259908ead47b63b2c5a94ce |
class ProgramsConfigMixin(object): <NEW_LINE> <INDENT> def set_programs_api_configuration(self, is_enabled=False, api_version=1, api_url=PROGRAMS_STUB_URL, js_path='/js', css_path='/css'): <NEW_LINE> <INDENT> ConfigModelFixture('/config/programs', { 'enabled': is_enabled, 'api_version_number': api_version, 'internal_se... | Mixin providing a method used to configure the programs feature. | 6259908e283ffb24f3cf551d |
class NystromformerClassificationHead(nn.Module): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.dense = nn.Linear(config.hidden_size, config.hidden_size) <NEW_LINE> self.dropout = nn.Dropout(config.hidden_dropout_prob) <NEW_LINE> self.out_proj = nn.Linear(config.... | Head for sentence-level classification tasks. | 6259908e60cbc95b06365ba7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.