code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class RunningAverageMeter(object): <NEW_LINE> <INDENT> def __init__(self, momentum=0.99): <NEW_LINE> <INDENT> self.momentum = momentum <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.val = None <NEW_LINE> self.avg = 0 <NEW_LINE> <DEDENT> def update(self, val): <NEW_LINE> <INDENT> i... | Computes and stores the average and current value | 62599026d164cc6175821ebb |
class OpenPosition(CommonType): <NEW_LINE> <INDENT> def __init__(self, symbol: str, side: str, quantity: float, initial_price: float, unrealized_pl: float): <NEW_LINE> <INDENT> self.symbol = str(symbol) <NEW_LINE> self.side = str(side) <NEW_LINE> self.quantity = float(quantity) <NEW_LINE> self.initial_price = float(ini... | OpenPosition is a glorified immutable dict for easy storage and lookup.
It is based on the "OpenPosition" struct in:
https://github.com/fund3/communication-protocol/blob/master/TradeMessage.capnp | 62599026bf627c535bcb23fc |
class CommsPlan: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.session = aiohttp.ClientSession() <NEW_LINE> self.comms_plan_url ="https://docs.google.com/spreadsheets/d/1a63VD2WXmShIwpiTTfHuK-5yWKw-3AtXLbv1LBjMyCE" <NEW_LINE> self.comms_plan_export = self.comms_plan_url... | Fetches the comms plan from discord | 6259902621bff66bcd723ba9 |
class AutomaticTuningOptionModeActual(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> OFF = "Off" <NEW_LINE> ON = "On" | Automatic tuning option actual state.
| 62599026d99f1b3c44d065e9 |
class _ProfileLRPool(object): <NEW_LINE> <INDENT> def __init__(self, max_size: int): <NEW_LINE> <INDENT> self._parameter_list: List[float] = [] <NEW_LINE> self._likelihood_list: List[float] = [] <NEW_LINE> self._model_list: List[modeling.Dataset] = [] <NEW_LINE> self.max_size: int = max_size <NEW_LINE> <DEDENT> @proper... | Helper class to contain the profile likelihood values
and their corresponding models.
Attributes:
max_size: Maximal size of the pool. Limited to limit used memory.
full: True if the maximum size of the pool is reached.
parameter_list: List of parameters for the profile.
likelihood_list: List of maximum profile lik... | 6259902656b00c62f0fb3806 |
class testMultiException_result(TBase): <NEW_LINE> <INDENT> def __init__(self, success=None, err1=None, err2=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.err1 = err1 <NEW_LINE> self.err2 = err2 <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> L = ['%s=%r' % (key, value) for key, value i... | Attributes:
- success
- err1
- err2 | 62599026925a0f43d25e8f8d |
class InternalError(DatabaseError): <NEW_LINE> <INDENT> pass | The database encountered an internal error
| 62599026796e427e5384f6c3 |
class Approval(aff4.AFF4Object): <NEW_LINE> <INDENT> class SchemaCls(aff4.AFF4Object.SchemaCls): <NEW_LINE> <INDENT> REQUESTOR = aff4.Attribute("aff4:approval/requestor", rdfvalue.RDFString, "Requestor of the approval.") <NEW_LINE> APPROVER = aff4.Attribute("aff4:approval/approver", rdfvalue.RDFString, "An approver for... | An abstract approval request object.
This object normally lives within the namespace:
aff4:/ACL/...
The aff4:/ACL namespace is not writable by users, hence all manipulation of
this object must be done via dedicated flows. These flows use the server's
access credentials for manipulating this object. | 62599026d164cc6175821ebe |
class UserViewSet(ModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> filter_backends = (DjangoFilterBackend,) <NEW_LINE> filter_fields = ('name', 'discriminator') | View providing CRUD access to the users stored. | 62599026d18da76e235b78f1 |
class NohinDetail(BaseModel): <NEW_LINE> <INDENT> belong_user = models.CharField(verbose_name='所属ユーザ', max_length=50) <NEW_LINE> kataban = models.CharField(verbose_name='会社名', max_length=50) <NEW_LINE> price = models.IntegerField(verbose_name='単価') <NEW_LINE> amount = models.IntegerField(verbose_name='数量') <NEW_LINE> n... | 納品詳細 | 62599026be8e80087fbbffc0 |
class LevelAPI(_abstract_json_versioned_api.VersionedAPI): <NEW_LINE> <INDENT> api_name: str = 'level' <NEW_LINE> api_version: str <NEW_LINE> game: Game <NEW_LINE> Level: type <NEW_LINE> Area: type <NEW_LINE> Course: type <NEW_LINE> @classmethod <NEW_LINE> def build(cls, game: Game, api_version: Optional[str]) -> 'Leve... | Class representing the entire API -- a set of classes you can use to
represent a level | 6259902630c21e258be9975e |
class TestCleanContent(BaseTest): <NEW_LINE> <INDENT> def test_empty_text_must_return_empty_list(self): <NEW_LINE> <INDENT> actual = clean_content('') <NEW_LINE> self.assertEqual(actual, []) <NEW_LINE> <DEDENT> def test_one_item_in_text_must_return_list_with_item(self): <NEW_LINE> <INDENT> actual = clean_content(' it ... | This class tests the clean_content method | 62599026d164cc6175821ebf |
class Terminal(VteTerminal): <NEW_LINE> <INDENT> def __init__(self, CONF): <NEW_LINE> <INDENT> VteTerminal.__init__(self) <NEW_LINE> self.set_scrollback_lines(-1) <NEW_LINE> self.set_audible_bell(0) <NEW_LINE> self.connect("key_press_event", self.copy_or_paste) <NEW_LINE> self.host, self.port = CONF.getApiRestfulConInf... | Defines a simple terminal that will execute faraday-terminal with the
corresponding host and port as specified by the CONF.
Inherits from Compatibility.Vte, which is just Vte.Terminal with
spawn_sync overrode to function with API 2.90 and 2.91 | 625990261d351010ab8f4a5f |
class PersonDetail(TemplateView): <NEW_LINE> <INDENT> template_name = 'personDetail.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> class CardNumberAngularForm(NgModelFormMixin, NgModelForm, Bootstrap3FormMixin): <NEW_LINE> <INDENT> form_name = 'cardNumberForm' <NEW_LINE> class Meta: <NEW_LIN... | Person detail view.
Display persons detail info. Class based on TemplateView.
:return: generated personDetail.html | 62599026c432627299fa3f3c |
class ObjectKey(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def initFromObject(self, obj): <NEW_LINE> <INDENT> self._className = obj.__class__.__name__ <NEW_LINE> self._serialNum = obj.serialNum() <NEW_LINE> if self._serialNum is 0: <NEW_LINE> <INDENT> self._serialNum =... | An ObjectKey is used by ObjectStore for keeping track of objects in memory.
Currently a key is equal to the class name of the object combined
with the object's serial number, although as a user of object keys,
you don't normally need to know what's inside them. | 6259902626238365f5fada9b |
class ICC_082: <NEW_LINE> <INDENT> pass | Frozen Clone | 62599026ac7a0e7691f73433 |
class _CumulativeWorkerStatsTest(TestCase): <NEW_LINE> <INDENT> def test___init__(t): <NEW_LINE> <INDENT> cws = _CumulativeWorkerStats() <NEW_LINE> t.assertEqual(cws.numoccurrences, 0) <NEW_LINE> t.assertEqual(cws.totaltime, 0.0) <NEW_LINE> t.assertEqual(cws.lasttime, 0) <NEW_LINE> <DEDENT> @patch('{src}.time'.format(*... | Test the _CumulativeWorkerStats class. | 6259902673bcbd0ca4bcb1da |
class ParsingError(Exception): <NEW_LINE> <INDENT> pass | Base class for parsing error | 62599026a4f1c619b294f53e |
class ActiveDirectoryAccountGetIterKeyTd(NetAppObject): <NEW_LINE> <INDENT> _key_0 = None <NEW_LINE> @property <NEW_LINE> def key_0(self): <NEW_LINE> <INDENT> return self._key_0 <NEW_LINE> <DEDENT> @key_0.setter <NEW_LINE> def key_0(self, val): <NEW_LINE> <INDENT> if val != None: <NEW_LINE> <INDENT> self.validate('key_... | Key typedef for table active_directory | 62599026bf627c535bcb2400 |
class AltManager(Manager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> conf = config.TempestConfig() <NEW_LINE> super(AltManager, self).__init__(conf.identity.alt_username, conf.identity.alt_password, conf.identity.alt_tenant_name) | Manager object that uses the alt_XXX credentials for its
managed client objects | 62599026a8ecb03325872168 |
class LoggingContext(object): <NEW_LINE> <INDENT> __slots__ = ["parent_context", "name", "__dict__"] <NEW_LINE> thread_local = threading.local() <NEW_LINE> class Sentinel(object): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "sentinel" <NEW_LINE> <DEDENT> def copy_to(self,... | Additional context for log formatting. Contexts are scoped within a
"with" block. Contexts inherit the state of their parent contexts.
Args:
name (str): Name for the context for debugging. | 62599026925a0f43d25e8f91 |
class _Paragraph(Subshape): <NEW_LINE> <INDENT> def __init__(self, p, parent): <NEW_LINE> <INDENT> super(_Paragraph, self).__init__(parent) <NEW_LINE> self._element = self._p = p <NEW_LINE> <DEDENT> def add_line_break(self): <NEW_LINE> <INDENT> self._p.add_br() <NEW_LINE> <DEDENT> def add_run(self): <NEW_LINE> <INDENT>... | Paragraph object. Not intended to be constructed directly. | 625990268e05c05ec3f6f601 |
class ProductsJsonHandler(api): <NEW_LINE> <INDENT> def get(self, p=1): <NEW_LINE> <INDENT> data = self.db.product(state=1)[int(p): 10] <NEW_LINE> list = data.object_list <NEW_LINE> for item in list: <NEW_LINE> <INDENT> item['imgs'] = item['imgs'].split('|') <NEW_LINE> <DEDENT> self.write({'data': list, 'prev': data.pr... | yf: 根据页数P获取商品列表 | 625990266e29344779b0159b |
@add_metaclass(MetaInstructionCase) <NEW_LINE> class AdcImmTest(unittest.TestCase): <NEW_LINE> <INDENT> asm = 'ADC #$10' <NEW_LINE> lex = [('T_INSTRUCTION', 'ADC'), ('T_HEX_NUMBER', '#$10')] <NEW_LINE> syn = ['S_IMMEDIATE'] <NEW_LINE> code = [0x69, 0x10] | Test the arithmetic operation ADC between decimal 16
and the content of the accumulator. | 6259902626238365f5fada9d |
class DataShape(TableModule): <NEW_LINE> <INDENT> inputs = [ SlotDescriptor("table", type=Table, required=True), ] <NEW_LINE> def __init__(self, **kwds: Any) -> None: <NEW_LINE> <INDENT> super().__init__(**kwds) <NEW_LINE> pass <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @process_s... | Adds statistics on input data | 62599026ac7a0e7691f73435 |
class SubscriptionFormPlugin(CMSPlugin): <NEW_LINE> <INDENT> title = models.CharField(_('title'), max_length=100, blank=True) <NEW_LINE> show_description = models.BooleanField(_('show description'), default=True, help_text=_('Show the mailing list\'s description.')) <NEW_LINE> mailing_list = models.ForeignKey(MailingLi... | CMS Plugin for susbcribing to a mailing list | 625990268c3a8732951f74a4 |
class ProxyOnlyResource(Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, 'type': {'key': 'type'... | Azure proxy only resource. This resource is not tracked by Azure Resource
Manager.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource Name.
:vartype name: str
:param kind: Kind of resource.
:type kind: str
:ivar type: Re... | 625990263eb6a72ae038b5b1 |
class OperationList(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'required': True}, } <NEW_LINE> _attribute_map = { 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, 'value': {'key': 'value', 'type': '[Operation]'}, } <NEW_LINE> def __init__( self,... | Paged list of operation resources.
All required parameters must be populated in order to send to Azure.
:param count: Total item count.
:type count: long
:param next_link: The Url of next result page.
:type next_link: str
:param value: Required. Collection of items of type results.
:type value: list[~azure.mgmt.purvi... | 62599026ac7a0e7691f73437 |
class PhysicalMixin(models.Model): <NEW_LINE> <INDENT> UNIT_SQUAREFOOT = 1 <NEW_LINE> UNIT_SQUAREMETER = 2 <NEW_LINE> UNIT_ACRE = 3 <NEW_LINE> UNIT_HECTARE = 4 <NEW_LINE> UNIT_CHOICES = ( (UNIT_SQUAREFOOT, 'square feet'), (UNIT_SQUAREMETER, 'square meters'), (UNIT_ACRE, 'acres'), (UNIT_HECTARE, 'hectares'), ) <NEW_LINE... | Fields and methods for a
physically constructable design project. | 62599026d99f1b3c44d065f1 |
@actions.register('stop') <NEW_LINE> class Stop(BaseAction): <NEW_LINE> <INDENT> valid_origin_states = ('running',) <NEW_LINE> schema = type_schema( 'stop', **{'terminate-ephemeral': {'type': 'boolean'}, 'hibernate': {'type': 'boolean'}}) <NEW_LINE> has_hibernate = jmespath.compile('[].HibernationOptions.Configured') <... | Stops or hibernates a running EC2 instances
:Example:
.. code-block:: yaml
policies:
- name: ec2-stop-running-instances
resource: ec2
query:
- instance-state-name: running
actions:
- stop
- name: ec2-hibernate-instances
resources: ec2
query... | 625990265e10d32532ce40ab |
class Tramites(models.Model): <NEW_LINE> <INDENT> folio = models.CharField(primary_key=True, max_length=13) <NEW_LINE> distrito = models.PositiveSmallIntegerField(editable=False) <NEW_LINE> mac = models.CharField(max_length=6, editable=False) <NEW_LINE> tramo_exitoso = models.DurationField(editable=False, blank=True, n... | Modelo para evaluar al proveedor | 62599026d164cc6175821ec5 |
class CertificateOrderContact(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'email': {'key': 'email', 'type': 'str'}, 'name_first': {'key': 'nameFirst', 'type': 'str'}, 'name_last': {'key': 'nameLast', 'type': 'str'}, 'phone': {'key': 'phone', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, em... | CertificateOrderContact.
:ivar email:
:vartype email: str
:ivar name_first:
:vartype name_first: str
:ivar name_last:
:vartype name_last: str
:ivar phone:
:vartype phone: str | 625990268e05c05ec3f6f603 |
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 1200 <NEW_LINE> self.screen_height = 800 <NEW_LINE> self.bg_color = (230, 230, 230) <NEW_LINE> self.ship_speed_factor = 1.5 <NEW_LINE> self.bullet_speed_factor = 1 <NEW_LINE> self.bullet_width = 3 <NEW_LINE> self.bullet_he... | 存储配置类 | 625990263eb6a72ae038b5b3 |
class HasSourceOf(HasSourceOfBase): <NEW_LINE> <INDENT> labels = [ _('Source ID:') ] <NEW_LINE> name = _('People with the <source>') <NEW_LINE> category = _('Citation/source filters') <NEW_LINE> description = _('Matches people who have a particular source') | Rule that checks people that have a particular source. | 62599026507cdc57c63a5cf6 |
class YadisResourceDescriptor: <NEW_LINE> <INDENT> resources_list = [] <NEW_LINE> def __init__(self, resources_list): <NEW_LINE> <INDENT> self.resources_list = resources_list <NEW_LINE> <DEDENT> def get_resources_list(self): <NEW_LINE> <INDENT> return self.resources_list <NEW_LINE> <DEDENT> def set_resources_list(self,... | The yadis resource descriptor class. | 625990261f5feb6acb163b40 |
class Trait(Mapping): <NEW_LINE> <INDENT> def __init__(self, name=None, ratings: dict = None, normalize=False): <NEW_LINE> <INDENT> if name is None: <NEW_LINE> <INDENT> self.name = f"temp trait {str(random())[2:]}" <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> if normalize: <NEW_LIN... | A representation of a single trait.
A trait is a modifier for a player - they affect stats, can have additional affects, and
can be lost / gained / expire.
Note that trait values are stored from 0-20, so this normalizes them as well. | 6259902663f4b57ef008651a |
class LoginViews(Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.db = db.init_db() <NEW_LINE> self.parser = reqparse.RequestParser() <NEW_LINE> self.validator = Validator() <NEW_LINE> self.user_models = UserModels() <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> self.parser.add_argu... | Controls methods related to user login | 62599026ac7a0e7691f73439 |
class coord_trans(coord): <NEW_LINE> <INDENT> def __init__(self, x='identity', y='identity', xlim=None, ylim=None): <NEW_LINE> <INDENT> self.trans = Bunch(x=gettrans(x), y=gettrans(y)) <NEW_LINE> self.limits = Bunch(xlim=xlim, ylim=ylim) <NEW_LINE> <DEDENT> def transform(self, data, panel_params, munch=False): <NEW_LIN... | Transformed cartesian coordinate system
Parameters
----------
x : str | trans
Name of transform or `trans` class to
transform the x axis
y : str | trans
Name of transform or `trans` class to
transform the y axis
xlim : None | (float, float)
Limits for x axis. If None, then they are
automaticall... | 6259902656b00c62f0fb3810 |
class StandardWriter(Writer): <NEW_LINE> <INDENT> _started = False <NEW_LINE> _finalized = False <NEW_LINE> _worker = None <NEW_LINE> def __init__(self, savefun=npz.save_npz, **kwds): <NEW_LINE> <INDENT> super(StandardWriter, self).__init__() <NEW_LINE> self._savefun = savefun <NEW_LINE> self._kwds = kwds <NEW_LINE> se... | Base class of snapshot writers which use thread or process.
This class creates a new thread or a process every time when ``__call__``
is invoked.
Args:
savefun: Callable object. It takes three arguments: the output file
path, the serialized dictionary object, and the optional keyword
arguments.
... | 62599026796e427e5384f6cd |
class ImportFinder(ast.NodeVisitor): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.imports = set() <NEW_LINE> <DEDENT> def visit_Import(self, node: ast.AST) -> None: <NEW_LINE> <INDENT> for alias in node.names: <NEW_LINE> <INDENT> self.imports.add(alias.name.split(".")[0]) <NEW_LINE> <DEDENT>... | An AST walker for collecting imported modules. | 6259902666673b3332c3133f |
class HashGetSchema(ma.Schema): <NEW_LINE> <INDENT> id = ma.Integer(required=False) <NEW_LINE> password = ma.String(required=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> strict = True | Schema for fetching a hash, it can use any one of the three shown below | 625990266fece00bbaccc90a |
class SideEffect(Dao): <NEW_LINE> <INDENT> def __init__(self, dao): <NEW_LINE> <INDENT> self.dao = dao <NEW_LINE> self.redis = redis.Redis(**app.config.get('REDIS_CLIENT')) <NEW_LINE> self.rds_monitor_finish = 'lll_monitor_finish' <NEW_LINE> self.rds_monitor_start = 'lll_monitor_start' <NEW_LINE> <DEDENT> def insert(se... | Side effect wrapper, implementing test.dao interface.
| 625990266e29344779b015a1 |
class Lart(plugins.ChannelIdDatabasePlugin): <NEW_LINE> <INDENT> _meRe = re.compile(r'\bme\b', re.I) <NEW_LINE> _myRe = re.compile(r'\bmy\b', re.I) <NEW_LINE> def _replaceFirstPerson(self, s, nick): <NEW_LINE> <INDENT> s = self._meRe.sub(nick, s) <NEW_LINE> s = self._myRe.sub('%s\'s' % nick, s) <NEW_LINE> return s <NEW... | Provides an implementation of the Luser Attitude Readjustment Tool
for users.
Example:
* If you add ``slaps $who``.
* And Someone says ``@lart ChanServ``.
* ``* bot slaps ChanServ``. | 6259902673bcbd0ca4bcb1e2 |
class BXIError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg, cause=None): <NEW_LINE> <INDENT> super(BXIError, self).__init__(msg) <NEW_LINE> self.msg = msg <NEW_LINE> self._cause = cause <NEW_LINE> tb = sys.exc_info() <NEW_LINE> if tb == (None, None, None): <NEW_LINE> <INDENT> self.traceback_str = "" <NEW_LIN... | The root class of all BXI exceptions | 625990265166f23b2e244327 |
class KeywordsTagField(with_metaclass(models.SubfieldBase, BaseTagField)): <NEW_LINE> <INDENT> description = "Field for Storing <meta name='keywords' /> tag" <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs['db_index'] = False <NEW_LINE> kwargs['max_length'] = 255 <NEW_LINE> self.name = 'keywo... | Creates a field for Keywords Meta Tag
* Max-length 255 | 62599026d99f1b3c44d065f5 |
class NotImplemented(web.webapi.HTTPError): <NEW_LINE> <INDENT> def __init__(self, message="not implemented"): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> status = "501 Not Implemented" <NEW_LINE> headers = {"Content-Type": "text/html"} <NEW_LINE> web.webapi.HTTPError.__init__(self, status, headers, message) | `501 Not Implemented` error. | 62599026bf627c535bcb2408 |
class TestResponseContainerEvent(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 testResponseContainerEvent(self): <NEW_LINE> <INDENT> pass | ResponseContainerEvent unit test stubs | 6259902656b00c62f0fb3812 |
class Command(BaseCommand): <NEW_LINE> <INDENT> help = ( "Update the signature information related to News items which do not" " have any related signatures yet." ) <NEW_LINE> def write(self, text): <NEW_LINE> <INDENT> if self.verbose: <NEW_LINE> <INDENT> self.stdout.write(text) <NEW_LINE> <DEDENT> <DEDENT> def handle(... | A Django management command which tries to update the signature information
for :class:`News <pts.core.models.News>` instances which do not have
any associated signatures. | 625990265e10d32532ce40ad |
class TestPack(PackTests): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> require_git_version((1, 5, 0)) <NEW_LINE> super(TestPack, self).setUp() <NEW_LINE> self._tempdir = tempfile.mkdtemp() <NEW_LINE> self.addCleanup(shutil.rmtree, self._tempdir) <NEW_LINE> <DEDENT> def test_copy(self): <NEW_LINE> <INDENT> ... | Compatibility tests for reading and writing pack files. | 6259902621a7993f00c66ecf |
class any_obj: <NEW_LINE> <INDENT> pass | Used to create objects for spawning arbitrary attributes by assignment | 625990263eb6a72ae038b5b7 |
class MacroRecorder(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "wm.record_macro" <NEW_LINE> bl_label = "Toggle macro recording" <NEW_LINE> v3d = None <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.space_data.type in {'TEXT_EDITOR', 'VIEW_3D'} <NEW_LINE> <DEDENT> ... | Record operators to a text block | 6259902691af0d3eaad3ad7b |
class InstructionDesc: <NEW_LINE> <INDENT> def __init__(self, func, n_args): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> self.n_args = n_args <NEW_LINE> <DEDENT> def execute(self, args): <NEW_LINE> <INDENT> self.func(args) | data structure for storing instruction function and number of arguments needed. | 62599026a4f1c619b294f548 |
class infrange(): <NEW_LINE> <INDENT> def __init__(self, min, max, step=0): <NEW_LINE> <INDENT> self.min = min <NEW_LINE> self.max = max <NEW_LINE> self.step = step <NEW_LINE> <DEDENT> @property <NEW_LINE> def range(self): <NEW_LINE> <INDENT> return abs(self.max-self.min) <NEW_LINE> <DEDENT> def __lt__(self, other): <N... | Similar to base Python `range`, but allowing the step to be a float or even
0, useful for specifying ranges for logical comparisons. | 625990268c3a8732951f74ac |
class ClassResult: <NEW_LINE> <INDENT> def __init__(self, benchclass): <NEW_LINE> <INDENT> self.benchclass = benchclass <NEW_LINE> self.instresults = [] <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for instresult in self.instresults: <NEW_LINE> <INDENT> yield instresult | Represents the results of all instances of a benchmark class. | 62599026d99f1b3c44d065f7 |
class Session(object): <NEW_LINE> <INDENT> engine = create_engine("mysql+pymysql://{user}:{password}@{host}:{port}/{database}".format(**settings.mysql_config), encoding='utf8', connect_args=dict(connect_timeout=2), max_overflow=10, poolclass=sqlalchemy.pool.QueuePool, pool_size=32, pool_recycle=60*10, pool_timeout=1, e... | with Session() as session:
session.query() | 62599026d164cc6175821ecb |
class Metric(Component): <NEW_LINE> <INDENT> meta_type = portal_type = 'ZentrospectMetric' <NEW_LINE> metric_name = None <NEW_LINE> _properties = Component._properties + ( {'id': 'metric_name', 'type': 'string', 'mode': 'w'}, ) <NEW_LINE> _relations = Component._relations + ( ('process', ToOne(ToManyCont, MODULE_NAME['... | Model class for Metric. | 62599026796e427e5384f6d1 |
@implementer(IIntervalTicksDailyEvent) <NEW_LINE> class IntervalTicksDailyEvent(IntervalTicksGenericEvent): <NEW_LINE> <INDENT> pass | An Event that will be fired daily from a cronjob | 625990268e05c05ec3f6f606 |
class ProfessionalForm(forms.ModelForm): <NEW_LINE> <INDENT> phone2 = forms.CharField(label="Phone 2") <NEW_LINE> email2 = forms.EmailField(label="E-mail 2") <NEW_LINE> website2 = forms.URLField(label="Website 2") <NEW_LINE> goals = forms.CharField(label="What are this professionals goals or needs? What opportunities ... | renames a variety of model columns for user interaction | 62599026c432627299fa3f47 |
class OperatorSymbol(QuantumSymbol, Operator): <NEW_LINE> <INDENT> def _pseudo_inverse(self): <NEW_LINE> <INDENT> return PseudoInverse(self) | Symbolic operator
See :class:`.QuantumSymbol`. | 625990266fece00bbaccc90e |
class VocabularyDetail(RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> serializer_class = VocabularySerializer <NEW_LINE> lookup_field = 'slug' <NEW_LINE> lookup_url_kwarg = 'vocab_slug' <NEW_LINE> permission_classes = ( ViewVocabularyPermission, ManageTaxonomyPermission, IsAuthenticated, ) <NEW_LINE> def get_querys... | REST detail view for Vocabulary. | 6259902691af0d3eaad3ad7d |
class FakeResponse(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.deferred = defer.fail(err) | Fake Response. | 6259902621a7993f00c66ed3 |
class APITemplateView(HomeAssistantView): <NEW_LINE> <INDENT> url = URL_API_TEMPLATE <NEW_LINE> name = "api:template" <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return template.render(self.hass, request.json['template'], request.json.get('variables')) <NEW_LINE> <DEDENT> except Tem... | View to handle requests. | 625990266e29344779b015a7 |
class Comment(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> name = models.CharField(max_length=100, help_text='Nom et Prénom') <NEW_LINE> email = models.EmailField(blank=True, null=True, help_text='Adresse email (yyyyyy@monfai.fr)') <NEW_LINE> comment = models.TextField(help_text... | A very simple comment system for Event details | 625990266fece00bbaccc910 |
class PrefixKeyFunc: <NEW_LINE> <INDENT> def __init__(self, prefix): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> <DEDENT> def __call__(self, *a, **kw): <NEW_LINE> <INDENT> return self.prefix + "-" + self.encode_args(a, kw) <NEW_LINE> <DEDENT> def encode_args(self, args, kw={}): <NEW_LINE> <INDENT> a = self.json... | A function to generate cache keys using a prefix and arguments.
| 625990268c3a8732951f74af |
class Histogram(object): <NEW_LINE> <INDENT> __slots__ = ["_nanosecond_timestamp", "_binStart", "_binSize", "_bins"] <NEW_LINE> def __init__(self, timestamp, binStart, binSize, bins): <NEW_LINE> <INDENT> self._binStart = binStart <NEW_LINE> self._binSize = binSize <NEW_LINE> self._bins = bins <NEW_LINE> if isinstance(t... | Point represents a datapoint as a timestamp and value in a timeseries dataset. | 6259902630c21e258be9976d |
class ChannelList(QListView): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(ChannelList, self).__init__(parent) <NEW_LINE> self.slider = None <NEW_LINE> self._nxt = 0.0 <NEW_LINE> self.start = False <NEW_LINE> self.residual = 0.0 <NEW_LINE> <DEDENT> def slideStart(self): <NEW_LINE> <IND... | A list to display the chosen channels | 62599026a8ecb03325872176 |
class OnstarDeviceTracker: <NEW_LINE> <INDENT> def __init__(self, see, data): <NEW_LINE> <INDENT> self._see = see <NEW_LINE> self._data = data <NEW_LINE> <DEDENT> def setup(self, hass): <NEW_LINE> <INDENT> self.update() <NEW_LINE> track_utc_time_change( hass, lambda now: self.update(), second=range(0, 60, 30) ) <NEW_LI... | BMW Connected Drive device tracker. | 62599026796e427e5384f6d5 |
class FargateTaskDefinitionBase(Base): <NEW_LINE> <INDENT> fargate_task_definition: FargateTaskDefinition <NEW_LINE> fargate_container = FargateContainer | Fargate基底class | 625990263eb6a72ae038b5bd |
@orientation_helper(axis_forward='Y', axis_up='Z') <NEW_LINE> class ExportB3D(bpy.types.Operator, ExportHelper): <NEW_LINE> <INDENT> bl_idname = "export_scene.blitz3d_b3d" <NEW_LINE> bl_label = 'Export B3D' <NEW_LINE> filename_ext = ".b3d" <NEW_LINE> filter_glob: StringProperty( default="*.b3d", options={'HIDDEN'}, ) <... | Export to B3D file format (.b3d) | 62599026d18da76e235b78fa |
class Sip(TwiML): <NEW_LINE> <INDENT> def __init__(self, uri, **kwargs): <NEW_LINE> <INDENT> super(Sip, self).__init__(**kwargs) <NEW_LINE> self.value = uri | <Sip> element | 625990266e29344779b015a9 |
class ForestParam(TimestampedModel): <NEW_LINE> <INDENT> default = models.NullBooleanField(unique=True) <NEW_LINE> notes = models.TextField(blank=True) <NEW_LINE> name = models.TextField(blank=True) <NEW_LINE> jasmine_json_string = models.TextField() <NEW_LINE> willow_json_string = models.TextField() <NEW_LINE> def par... | Model for tracking params used in Forest analyses. There is one object for all trees.
When adding support for a new tree, make sure to add a migration to populate existing
ForestMetadata objects with the default metadata for the new tree. This way, all existing
ForestTasks are still associated to the same ForestMetada... | 625990266fece00bbaccc912 |
class Param(Element): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Element.__init__(self) <NEW_LINE> <DEDENT> def get_input(self, *args, **kwargs): <NEW_LINE> <INDENT> if self.get_type() in ('file_open', 'file_save'): <NEW_LINE> <INDENT> input_widget = FileParam(self, *args, **kwargs) <NEW_LINE> <DEDENT>... | The graphical parameter. | 625990265166f23b2e24432f |
class TestMLen(TestCase): <NEW_LINE> <INDENT> def test_non_mxp_string(self): <NEW_LINE> <INDENT> self.assertEqual(utils.m_len('Test_string'), 11) <NEW_LINE> <DEDENT> def test_mxp_string(self): <NEW_LINE> <INDENT> self.assertEqual(utils.m_len('|lclook|ltat|le'), 2) <NEW_LINE> <DEDENT> def test_mxp_ansi_string(self): <NE... | Verifies that m_len behaves like len in all situations except those
where MXP may be involved. | 62599026287bf620b6272b49 |
class L1Regularizer(Regularizer): <NEW_LINE> <INDENT> def __init__(self, reg): <NEW_LINE> <INDENT> super().__init__(reg) <NEW_LINE> <DEDENT> def loss(self, w): <NEW_LINE> <INDENT> return self._lambda * np.linalg.norm(w[:-1], 1) <NEW_LINE> <DEDENT> def gradient(self, w): <NEW_LINE> <INDENT> gradient = np.zeros_like(w) <... | docstring for L2Regularizer | 62599026a4f1c619b294f54e |
class INT(GPIDefaultType): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(INT, self).__init__() <NEW_LINE> self._type = int <NEW_LINE> self._range = None <NEW_LINE> <DEDENT> def edgeTip(self, data): <NEW_LINE> <INDENT> if data is None: <NEW_LINE> <INDENT> return "" <NEW_LINE> <DEDENT> return str(data... | Enforcement for the standard python-int. | 62599026925a0f43d25e8fa1 |
class DeltaHVMetric(Metric): <NEW_LINE> <INDENT> def __init__(self, pf: np.ndarray): <NEW_LINE> <INDENT> super(DeltaHVMetric, self).__init__() <NEW_LINE> self._hv = hv = Hypervolume(pf=pf, normalize=True) <NEW_LINE> self.hv_true = hv.calc(pf) <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <I... | Metric measuring the difference to the pre-known hypervolume. It has a value between 1 and 0, where 0 means the
hypervolume is exactly the same, meaning the true Pareto front has been found.
Implementation based on:
Palar, P.S., "On Multi-Objective Efficient Global Optimization Via Universal Kriging Surrogate Model", ... | 62599026d164cc6175821ed2 |
class FTPServer: <NEW_LINE> <INDENT> def __init__(self, src, sport): <NEW_LINE> <INDENT> self.src = src <NEW_LINE> self.sport = sport <NEW_LINE> self.verbose = False <NEW_LINE> self.tcp_flags = { 'TCP_FIN': 0x01, 'TCP_SYN': 0x02, 'TCP_RST': 0x04, 'TCP_PSH': 0x08, 'TCP_ACK': 0x10, 'TCP_URG': 0x20, 'TCP_ECE': 0x40, 'TCP_... | Wrapper class on the FTPServerConnection. Listens and creates new connection
for each for new SYN. | 625990261d351010ab8f4a71 |
class CacheWrapper(BaseCache): <NEW_LINE> <INDENT> def __init__(self, server, params: dict): <NEW_LINE> <INDENT> super().__init__(server, params) <NEW_LINE> self._cache = {} <NEW_LINE> self._threshold = self._options.get("THRESHOLD", 0) <NEW_LINE> <DEDENT> def _prune(self): <NEW_LINE> <INDENT> if self._threshold == 0: ... | 简单的内存缓存;
适用于单个进程环境,主要用于开发服务器;
非线程安全的 | 62599026c432627299fa3f4d |
class XmlMeasure(): <NEW_LINE> <INDENT> def __init__(self, number, time): <NEW_LINE> <INDENT> self.number = number <NEW_LINE> self.composition = [] <NEW_LINE> self.currentTime = 0 <NEW_LINE> self.timelast = time <NEW_LINE> <DEDENT> def appendNote(self, note): <NEW_LINE> <INDENT> if isinstance(note, ... | Define what a measure is in MusicXML format | 625990261f5feb6acb163b4c |
class GSFMeta(ABCMeta): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return '{0}.{1}'.format(__package__, self.__name__) | GSF Metaclass for overriding string representations. | 6259902773bcbd0ca4bcb1ec |
class LineItemViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = models.LineItem.objects.all() <NEW_LINE> serializer_class = serializers.LineItemSerializer | API endpoint that allows Line Items to be viewed or edited.
@samphillips1879 | 62599027d99f1b3c44d065fe |
class AS3Element(object): <NEW_LINE> <INDENT> folderPattern = re.compile('.*/$') <NEW_LINE> def __init__(self, key, etag, cont_type, metadata): <NEW_LINE> <INDENT> self.key = key.encode('utf-8') <NEW_LINE> self.etag = etag.encode('utf-8') <NEW_LINE> self.content_type = cont_type.encode('utf-8') <NEW_LINE> self.metadata... | Encapsulates the attributes of an Amazon S3 Storage element.
These are analagous to files and folders on a regular file system. | 62599027ac7a0e7691f73445 |
class Cluster: <NEW_LINE> <INDENT> cluster_id = int() <NEW_LINE> oids = [] <NEW_LINE> def __init__(self, cluster_id): <NEW_LINE> <INDENT> self.cluster_id = cluster_id <NEW_LINE> self.oids = [] <NEW_LINE> <DEDENT> def getCluster_id(self): <NEW_LINE> <INDENT> return self.cluster_id | generated source for class Cluster | 625990278c3a8732951f74b4 |
class Mount(mount.Mount): <NEW_LINE> <INDENT> mode = 'nbd' <NEW_LINE> device_id_string = mode <NEW_LINE> _DEVICES = ['/dev/nbd%s' % i for i in range(FLAGS.max_nbd_devices)] <NEW_LINE> def _allocate_nbd(self): <NEW_LINE> <INDENT> if not os.path.exists("/sys/block/nbd0"): <NEW_LINE> <INDENT> self.error = _('nbd unavailab... | qemu-nbd support disk images. | 62599027925a0f43d25e8fa3 |
class MarkovChain: <NEW_LINE> <INDENT> def __init__(self, proposal, constraints, accept, initial_state, total_steps=1000): <NEW_LINE> <INDENT> if callable(constraints): <NEW_LINE> <INDENT> is_valid = constraints <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> is_valid = Validator(constraints) <NEW_LINE> <DEDENT> if not i... | MarkovChain is an iterator that allows the user to iterate over the states
of a Markov chain run.
Example usage:
.. code-block:: python
chain = MarkovChain(proposal, is_valid, accept, initial_state)
for state in chain:
# Do whatever you want - print output, compute scores, ... | 62599027a8ecb0332587217a |
class EmptyTileFilter: <NEW_LINE> <INDENT> def filter(self, tiles): <NEW_LINE> <INDENT> return [tile for tile in tiles if tile.piece is None] | Filter that only returns Empty Tiles | 625990273eb6a72ae038b5c1 |
class TestSplitJobActionDto(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 testSplitJobActionDto(self): <NEW_LINE> <INDENT> pass | SplitJobActionDto unit test stubs | 62599027d99f1b3c44d06600 |
class UnitLengthScaler(BaseScaler): <NEW_LINE> <INDENT> def _calculate_constant_reduction(self, column): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def _calculate_factor_divisor(self, column): <NEW_LINE> <INDENT> return np.linalg.norm(column) | Will normalize all provided columns to be unit length.
Or, ||x|| = 1
Calculation is:
x' = x / ||x|| | 62599027287bf620b6272b4d |
class DeleteResult(object): <NEW_LINE> <INDENT> def __init__(self, deleted_count): <NEW_LINE> <INDENT> self.deleted_count = deleted_count | The return type for delete methods. | 62599027925a0f43d25e8fa5 |
class Qgroup(models.Model): <NEW_LINE> <INDENT> uuid = models.CharField(max_length=4096, unique=True) | uuid of the qgroup | 625990275e10d32532ce40b3 |
class Resource(Model): <NEW_LINE> <INDENT> def __init__(self, resource_id, project_id, first_sample_timestamp, last_sample_timestamp, source, user_id, metadata): <NEW_LINE> <INDENT> Model.__init__(self, resource_id=resource_id, first_sample_timestamp=first_sample_timestamp, last_sample_timestamp=last_sample_timestamp, ... | Something for which sample data has been collected.
| 62599027a8ecb0332587217c |
class BaseStaffDashboardView(UserDataMixin, TemplateView): <NEW_LINE> <INDENT> def get_filter_args(self): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(BaseStaffDashboardView, self).get_context_data(**kwargs) <NEW_LINE> project_dict = Ordered... | Base view for the administrator and ambassador dashboard views. The
specific views in administrator/views.py and ambassador/views.py
will inherit from this view. | 625990271d351010ab8f4a76 |
class system_usermanager(j.code.classGetBase()): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> self._te={} <NEW_LINE> self.actorname="usermanager" <NEW_LINE> self.appname="system" <NEW_LINE> <DEDENT> def authenticate(self, name, secret, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedEr... | get a user | 6259902721bff66bcd723bc3 |
class CachedHistoryIterator(HistoryIterator): <NEW_LINE> <INDENT> def __init__(self, messageable, limit, before=None, after=None, around=None, oldest_first=None): <NEW_LINE> <INDENT> super().__init__(messageable, limit, before, after, around, oldest_first) <NEW_LINE> self.prefill = self.reverse is False and around is N... | HistoryIterator, but we hit the cache first. | 62599027bf627c535bcb2417 |
class MessageType(object): <NEW_LINE> <INDENT> X224_TPDU_CONNECTION_REQUEST = 0xE0 <NEW_LINE> X224_TPDU_CONNECTION_CONFIRM = 0xD0 <NEW_LINE> X224_TPDU_DISCONNECT_REQUEST = 0x80 <NEW_LINE> X224_TPDU_DATA = 0xF0 <NEW_LINE> X224_TPDU_ERROR = 0x70 | @summary: Message type | 6259902766673b3332c3134f |
class LogisticNormal(TransformedDistribution): <NEW_LINE> <INDENT> arg_constraints = {'loc': constraints.real, 'scale': constraints.positive} <NEW_LINE> support = constraints.simplex <NEW_LINE> has_rsample = True <NEW_LINE> def __init__(self, loc, scale, validate_args=None): <NEW_LINE> <INDENT> base_dist = Normal(loc, ... | Creates a logistic-normal distribution parameterized by :attr:`loc` and :attr:`scale`
that define the base `Normal` distribution transformed with the
`StickBreakingTransform` such that::
X ~ LogisticNormal(loc, scale)
Y = log(X / (1 - X.cumsum(-1)))[..., :-1] ~ Normal(loc, scale)
Args:
loc (float or Tenso... | 62599027d18da76e235b78fe |
class Episode(object): <NEW_LINE> <INDENT> REQUIRED_KEYS = ('title', 'url', 'podcast_title', 'podcast_url', 'description', 'website', 'released', 'mygpo_link') <NEW_LINE> def __init__(self, title, url, podcast_title, podcast_url, description, website, released, mygpo_link): <NEW_LINE> <INDENT> self.title = title <NEW_L... | Container Class for Episodes
Attributes:
title -
url -
podcast_title -
podcast_url -
description -
website -
released -
mygpo_link - | 6259902721a7993f00c66ede |
class CyclicEF(LinFixedEF): <NEW_LINE> <INDENT> def __init__(self, fid: str, sfid: str = None, name: str = None, desc: str = None, parent: CardDF = None, rec_len={1, None}, **kwargs): <NEW_LINE> <INDENT> super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, parent=parent, rec_len=rec_len, **kwargs) | Cyclic EF (Entry File) in the smart card filesystem | 62599027d99f1b3c44d06604 |
class PasswordUpdateForm(forms.Form): <NEW_LINE> <INDENT> your_password = forms.CharField(widget=forms.PasswordInput()) <NEW_LINE> new_password = forms.CharField(widget=forms.PasswordInput()) <NEW_LINE> confirm_new_password = forms.CharField(widget=forms.PasswordInput()) <NEW_LINE> def clean(self): <NEW_LINE> <INDENT> ... | Form to update an user password | 6259902763f4b57ef0086523 |
@permission_classes((permissions.IsAuthenticated,)) <NEW_LINE> @authentication_classes((authentication.TokenAuthentication,authentication.SessionAuthentication,)) <NEW_LINE> class NERView(APIView): <NEW_LINE> <INDENT> @permission_classes((permissions.AllowAny,)) <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> da... | View for Named Entity Recognition | 62599027ac7a0e7691f7344b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.