code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class UploadPart(object): <NEW_LINE> <INDENT> def __init__(self, mpu, fp, partnum, chunks): <NEW_LINE> <INDENT> self.mpu = mpu <NEW_LINE> self.partnum = partnum <NEW_LINE> self.fp = fp <NEW_LINE> self.size = 0 <NEW_LINE> self.chunks = chunks <NEW_LINE> self.etag = {} <NEW_LINE> self.success = True
The class for the upload part
62598fb0a219f33f346c684f
class UtilsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_define_mass_bins(self): <NEW_LINE> <INDENT> mbins = utils.define_mass_bins(low=1, high=100, dm_low=1, dm_high=1.) <NEW_LINE> tmp = np.arange(1, 101) <NEW_LINE> np.testing.assert_array_almost_equal(mbins, tmp)
Tests from 'utils.py'.
62598fb07d847024c075c3fd
class Operations: <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer) -> None: <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <NEW_LINE> <DEDENT> def l...
Operations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~storage_pool_management.models :param client: Client...
62598fb091f36d47f2230ec4
class StopWordFilter(TransformBase): <NEW_LINE> <INDENT> def __init__(self, stopwords, flgset=set()): <NEW_LINE> <INDENT> super(StopWordFilter, self).__init__(flgset, filt_run) <NEW_LINE> self.stopwords = set(stopwords) <NEW_LINE> <DEDENT> def tkn_processor(self, tkn, tag=None): <NEW_LINE> <INDENT> rtkn, flg = self.flg...
Usage: Remove stopwords
62598fb099cbb53fe6830f13
class ResNeXt(ResNet, nn.Module): <NEW_LINE> <INDENT> def __init__(self, depth: int, pretrained: bool = False): <NEW_LINE> <INDENT> if depth not in (50, 101): <NEW_LINE> <INDENT> raise ValueError(f"invalid depth specified. depth must be one of 50, 101 got {depth}") <NEW_LINE> <DEDENT> super(ResNet, self).__init__() <NE...
Implements ResNeXt backbone for retinanet. Args: depth (int): depth for resnet, either 50 or 101 pretrained (bool): whether to load pretrained ImageNet weights
62598fb05fcc89381b266169
class IThemeSpecific(IDefaultPloneLayer): <NEW_LINE> <INDENT> pass
Marker interface that defines a Zope 3 browser layer. If you need to register a viewlet only for the "ploneorgbr.portal.theme" theme, this interface must be its layer.
62598fb038b623060ffa90d6
class Config(object): <NEW_LINE> <INDENT> def __init__(self,file): <NEW_LINE> <INDENT> super(Config, self).__init__() <NEW_LINE> config_path = os.path.abspath(__file__) <NEW_LINE> config_file = config_path.replace("config_setup.py", file) <NEW_LINE> with open(config_file) as json_data: <NEW_LINE> <INDENT> self.__dict__...
docstring for Config.
62598fb03539df3088ecc2ed
class AddTag(TagCommand): <NEW_LINE> <INDENT> SYNOPSIS = (None, 'tags/add', 'tags/add', '<tag>') <NEW_LINE> ORDER = ('Tagging', 0) <NEW_LINE> HTTP_CALLABLE = ('GET', 'POST') <NEW_LINE> HTTP_POST_VARS = { 'name': 'tag name', 'slug': 'tag slug', 'icon': 'icon-tag', 'label': 'display as label in search results, or not', '...
Create a new tag
62598fb05fc7496912d4829e
class Lines: <NEW_LINE> <INDENT> def __init__(self, lines_start, lines_end, colors_start, colors_end, visible): <NEW_LINE> <INDENT> self.num_lines = lines_start.shape[0] <NEW_LINE> self.positions = np.empty((self.num_lines * 2, 3), dtype=lines_start.dtype) <NEW_LINE> self.positions[0::2] = lines_start <NEW_LINE> self.p...
Set of line segments defined by startint points and ending points.
62598fb0627d3e7fe0e06ee9
class ZeroPad2d(ConstantPad2d): <NEW_LINE> <INDENT> def __init__(self, padding): <NEW_LINE> <INDENT> super(ZeroPad2d, self).__init__(padding, 0)
用零填充输入张量边界. 参数: padding (int, tuple): 填充的大小. 如果是int,则在所有边界使用相同的填充. . 如果是四个元组, 则使用 (paddingLeft, paddingRight, paddingTop, paddingBottom) 形态: - Input: :math:`(N, C, H_{in}, W_{in})` - Output: :math:`(N, C, H_{out}, W_{out})` where :math:`H_{out} = H_{in} + paddingTop + paddingBottom` :math:...
62598fb063b5f9789fe851a3
class Quintly(Product): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> ordering = Product.Meta.ordering <NEW_LINE> <DEDENT> quintly_profile_id = models.IntegerField(verbose_name="Quintly Profil-ID")
Base model for Quintly data.
62598fb0097d151d1a2c1066
class Span(object): <NEW_LINE> <INDENT> template_name = 'layout/field.html' <NEW_LINE> def __init__(self, span_columns, field_name): <NEW_LINE> <INDENT> self.span_columns = span_columns <NEW_LINE> self.field_name = field_name <NEW_LINE> <DEDENT> def render(self, context, **options): <NEW_LINE> <INDENT> template_pack = ...
Wrapper for a field reference. There are ``Span2``, ``Span3``, .., ``Span12`` shortcut classes. ``Layout`` autowraps string field references into Span(1, field_name) :param span_columns: relative field width :param field_name: field name in the form
62598fb0a79ad1619776a0a3
@MetaborgReleng.subcommand("changed") <NEW_LINE> class MetaborgRelengChanged(cli.Application): <NEW_LINE> <INDENT> destination = cli.SwitchAttr(names=['-d', '--destination'], argtype=str, mandatory=False, default='.qualifier', help='Path to read/write the last qualifier to') <NEW_LINE> forceChange = cli.Flag(names=['-f...
Returns 0 and prints the qualifer if repository has changed since last invocation of this command, based on the current branch and latest commit date in all submodules. Returns 1 otherwise.
62598fb04c3428357761a2f5
class BasePeople(object): <NEW_LINE> <INDENT> def __init__(self, name="no_name", play_id=0): <NEW_LINE> <INDENT> self.__name = name <NEW_LINE> self.__play_id = play_id <NEW_LINE> <DEDENT> def set_name(self, name): <NEW_LINE> <INDENT> self.__name = name <NEW_LINE> <DEDENT> def set_play_id(self, play_id): <NEW_LINE> <IND...
classdocs
62598fb03346ee7daa337665
class Item(Base): <NEW_LINE> <INDENT> __tablename__ = 'item' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(80), nullable=False) <NEW_LINE> description = Column(String(250)) <NEW_LINE> category_id = Column(Integer, ForeignKey('category.id')) <NEW_LINE> category = relationship(Category...
Item information stored in the database
62598fb02ae34c7f260ab11d
class NumpyHistogramMetric(Metric): <NEW_LINE> <INDENT> def __init__(self, max_value=10, **kwargs): <NEW_LINE> <INDENT> Metric.__init__(self, **kwargs) <NEW_LINE> self.counts = np.zeros(2+max_value, dtype=np.int_) <NEW_LINE> self.max_value = max_value <NEW_LINE> <DEDENT> def add(self, elem): <NEW_LINE> <INDENT> assert ...
A histogram with bins of size 1 and a final bin containing elements > max_value
62598fb056ac1b37e6302226
class TestingConfig(BaseConfig): <NEW_LINE> <INDENT> pass
Configuracion de prueba
62598fb057b8e32f52508139
class AfatConfig(AppConfig): <NEW_LINE> <INDENT> name = "afat" <NEW_LINE> label = "afat" <NEW_LINE> verbose_name = f"AFAT - Another Fleet Activity Tracker v{__version__}"
General config
62598fb08a43f66fc4bf21b7
class GitInstall(object): <NEW_LINE> <INDENT> def __init__(self, repo, git=None): <NEW_LINE> <INDENT> self.repo = repo <NEW_LINE> self._temp_dir = Tempdir() <NEW_LINE> self._opened = False <NEW_LINE> self._git = git or Git() <NEW_LINE> <DEDENT> def open(self): <NEW_LINE> <INDENT> if not self._opened: <NEW_LINE> <INDENT...
Tool to install a Python package by cloning its git repo and if necessary modifying files inside. Used as a context manager, it allows to run python code (for instance the :class:`LineReplacer` on setup.py or installing patches, etc) after the repo has been cloned and before the install. The value retu...
62598fb04e4d562566372462
class Truck(Vehicle): <NEW_LINE> <INDENT> wheels_number = 6 <NEW_LINE> def vehicle_type(self): <NEW_LINE> <INDENT> return ' '.join(['Truck', self.trademark, self.model])
Heavy Truck. So brutal. Much wow.
62598fb0a05bb46b3848a8a7
class FBTimeReferential (object): <NEW_LINE> <INDENT> kFBTimeReferentialAction=property(doc="Action. ") <NEW_LINE> kFBTimeReferentialShot=property(doc="Shot. ") <NEW_LINE> kFBTimeReferentialEdit=property(doc="Edit. ") <NEW_LINE> pass
FBCommandState.
62598fb0a219f33f346c6851
class NumberValidator(object): <NEW_LINE> <INDENT> def validate(self, password, user=None): <NEW_LINE> <INDENT> if not re.findall('\d', password): <NEW_LINE> <INDENT> raise ValidationError( _("The password must contain at least 1 digit, 0-9."), code='password_no_number', ) <NEW_LINE> <DEDENT> <DEDENT> def get_help_text...
Custom Password Validator: Checks if password contains atleast 1 Digit
62598fb066656f66f7d5a42c
class TransistionInline(admin.StackedInline): <NEW_LINE> <INDENT> model = models.Transition <NEW_LINE> extra = 0
Allow adding a transistion when adding an answer.
62598fb032920d7e50bc6090
class readme_exampleLanguageServerProtocol: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> from DHParser.lsp import gen_lsp_table <NEW_LINE> self.lsp_data = { 'processId': 0, 'rootUri': '', 'clientCapabilities': {}, 'serverInfo': { "name": "readme_example-Server", "version": "0.1" }, 'serverCapabilities': ...
For the specification and implementation of the language server protocol, see: https://code.visualstudio.com/api/language-extensions/language-server-extension-guide https://microsoft.github.io/language-server-protocol/ https://langserver.org/
62598fb023849d37ff8510f0
class Normalize(nn.Module): <NEW_LINE> <INDENT> def __init__(self, norm_type='none', n_hidden=0): <NEW_LINE> <INDENT> super(Normalize, self).__init__() <NEW_LINE> self.norm_type = norm_type <NEW_LINE> if self.norm_type == 'layer_norm': <NEW_LINE> <INDENT> assert n_hidden > 0, '`n_hidden` cannot be zero for `layer_norm`...
Various normalization schemes.
62598fb0f7d966606f748022
class KaizenConfigError(Exception): <NEW_LINE> <INDENT> pass
Used when a configuration error occurs.
62598fb060cbc95b0636438c
class RawFieldValueError(RuntimeError): <NEW_LINE> <INDENT> pass
A raw field value is invalid. Raw field value filters raise this exception if necessary.
62598fb05fc7496912d4829f
class DistanceMatrix(_Matrix): <NEW_LINE> <INDENT> def __init__(self, names, matrix=None): <NEW_LINE> <INDENT> _Matrix.__init__(self, names, matrix) <NEW_LINE> self._set_zero_diagonal() <NEW_LINE> <DEDENT> def __setitem__(self, item, value): <NEW_LINE> <INDENT> _Matrix.__setitem__(self, item, value) <NEW_LINE> self._se...
Distance matrix class that can be used for distance based tree algorithms. All diagonal elements will be zero no matter what the users provide.
62598fb0236d856c2adc945c
@implementer(IVocabularyFactory) <NEW_LINE> class AllowableContentTypesVocabulary(object): <NEW_LINE> <INDENT> def __call__(self, context): <NEW_LINE> <INDENT> site = getSite() <NEW_LINE> items = list(getAllowableContentTypes(site)) <NEW_LINE> if 'text/x-plone-outputfilters-html' in items: <NEW_LINE> <INDENT> items.rem...
Vocabulary factory for allowable content types. A list of mime-types that can be used as input for textfields. >>> from zope.component import queryUtility >>> from plone.app.vocabularies.tests.base import create_context >>> from plone.app.vocabularies.tests.base import DummyTool >>> name = 'plone.app.vocabul...
62598fb0167d2b6e312b6fae
class PrivateEndpointConnectionListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'readonly': True}, 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <N...
A list of private endpoint connections. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Array of results. :vartype value: list[~azure.mgmt.rdbms.postgresql.models.PrivateEndpointConnection] :ivar next_link: Link to retrieve next page of results. :vartype next_link:...
62598fb056ac1b37e6302227
class DeleteGraphRuleView(DeleteView): <NEW_LINE> <INDENT> template_name = 'coverage/coverage_rule_delete.html' <NEW_LINE> model = GraphRule <NEW_LINE> slug_field = 'rule_name' <NEW_LINE> success_url = reverse_lazy('settings-graph-rules') <NEW_LINE> def get_object(self, queryset=None): <NEW_LINE> <INDENT> obj = super(D...
Delete Graph Rule View
62598fb030bbd72246469997
class LongbowmanBlueprint(Blueprint): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("longbowman", 7, 80) <NEW_LINE> self.add_component(Health, 5) <NEW_LINE> self.add_component(Attack, 3, 4) <NEW_LINE> self.add_component(Movable, 3)
Used to create a copy of a Longbowman (Loyalist combat unit)
62598fb04c3428357761a2f7
class TagDetail(TagMixin, RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> pass
Return a specific Tag, update it, or delete it.
62598fb08e7ae83300ee90e0
class IProfile(Interface): <NEW_LINE> <INDENT> title = schema.TextLine( title=_(u"Title"), required=False, ) <NEW_LINE> customCategories = schema.Text( title=_(u"Custom Categories."), required=False, )
Profile Type
62598fb097e22403b383af4b
class GFKQuerySet(QuerySet): <NEW_LINE> <INDENT> def fetch_generic_relations(self, *args): <NEW_LINE> <INDENT> from actstream import settings as actstream_settings <NEW_LINE> qs = self._clone() <NEW_LINE> if not actstream_settings.FETCH_RELATIONS: <NEW_LINE> <INDENT> return qs <NEW_LINE> <DEDENT> gfk_fields = [g for g ...
A QuerySet with a fetch_generic_relations() method to bulk fetch all generic related items. Similar to select_related(), but for generic foreign keys. Based on http://www.djangosnippets.org/snippets/984/ Firstly improved at http://www.djangosnippets.org/snippets/1079/ Extended in django-activity-stream to allow for ...
62598fb0f548e778e596b5e1
class OtherWord(DataElementValue): <NEW_LINE> <INDENT> value = ArrayField(models.IntegerField(), blank=True, null=True) <NEW_LINE> raw = models.BinaryField(blank=True, null=True)
A :class:`~django.db.models.Model` representing a single *OtherWord* data element value.
62598fb0851cf427c66b82f9
class OBJECT_OT_ApplyRestoffset(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "mixamo.apply_restoffset" <NEW_LINE> bl_label = "Apply Restoffset" <NEW_LINE> bl_description = "Applies Restoffset to restpose and corrects animation" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> mixamo = context.scene.mi...
Button/Operator for converting single Rig
62598fb010dbd63aa1c70bf1
class cs_buffer(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__rx_buffer = [] <NEW_LINE> <DEDENT> def get_num_rx(self): <NEW_LINE> <INDENT> return(len(self.__rx_buffer)) <NEW_LINE> <DEDENT> def add(self, packet): <NEW_LINE> <INDENT> if len(packet): <NEW_LINE> <INDENT> self.__rx_buffer.append(pack...
Buffering for the packets received during downloading.
62598fb085dfad0860cbfa92
class Blobs(Game): <NEW_LINE> <INDENT> moves = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.initial = GameState(to_move='R', utility=0, board=BlobsBoard(), moves=['L','R','U','D']) <NEW_LINE> self.currentState = self.initial <NEW_LINE> self.moves = self.initial.moves <NEW_LINE> <DEDENT> def actions(self...
Play Blobs on an 6 x 6 board, with Max (first player) playing the red Blobs with marker 'R'. A state has the player to move, a cached utility, a list of moves in the form of the four directions (left 'L', right 'R', up 'U', and down 'D'), and a board, in the form of a BlobsBoard object. Marker is 'R' for the Red Player...
62598fb076e4537e8c3ef5e5
class F(object): <NEW_LINE> <INDENT> def __init__(self, **filters): <NEW_LINE> <INDENT> filters = filters.items() <NEW_LINE> if len(filters) > 1: <NEW_LINE> <INDENT> self.filters = [{'and': filters}] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.filters = filters <NEW_LINE> <DEDENT> <DEDENT> def __repr__(self): <N...
Filter objects. Makes it easier to create filters cumulatively using ``&`` (and), ``|`` (or) and ``~`` (not) operations. For example:: f = F() f &= F(price='Free') f |= F(style='Mexican') creates a filter "price = 'Free' or style = 'Mexican'".
62598fb06e29344779b0069a
class Code(NameDescriptionMixin): <NEW_LINE> <INDENT> code_group = models.ForeignKey(CodeGroup, related_name="codes") <NEW_LINE> order = models.PositiveIntegerField()
Defines a single code
62598fb01b99ca400228f54f
class ColabAuthenticatedFileHandler(testing.AsyncHTTPTestCase): <NEW_LINE> <INDENT> def get_app(self): <NEW_LINE> <INDENT> self.temp_dir = tempfile.mkdtemp() <NEW_LINE> settings = { 'base_url': '/', 'local_hostnames': ['127.0.0.1'], } <NEW_LINE> app = web.Application([], **settings) <NEW_LINE> app.add_handlers('.*$', [...
Tests for ColabAuthenticatedFileHandler.
62598fb04527f215b58e9f13
class CourseDetailView(View): <NEW_LINE> <INDENT> def get(self, request, course_id): <NEW_LINE> <INDENT> course = Courses.objects.get(id=course_id) <NEW_LINE> course.click_nums += 1 <NEW_LINE> course.save() <NEW_LINE> has_fav_course = False <NEW_LINE> has_fav_org = False <NEW_LINE> if request.user.is_authenticated(): <...
课程详情页
62598fb0cc40096d6161a1f8
class TreeNode(object): <NEW_LINE> <INDENT> tag = None <NEW_LINE> children = ( ) <NEW_LINE> def __init__(self, tag, children=( )): <NEW_LINE> <INDENT> self.tag = tag <NEW_LINE> self.children = children
An example tree node to play with.
62598fb063d6d428bbee27ea
class ColorPrint(object): <NEW_LINE> <INDENT> def __init__(self, silent=False): <NEW_LINE> <INDENT> self.silent = silent <NEW_LINE> <DEDENT> def R(self, *args, sep=' ', end='\n', file=None): <NEW_LINE> <INDENT> if not self.silent: <NEW_LINE> <INDENT> co_name = sys._getframe().f_code.co_name <NEW_LINE> term(*args, color...
if ``silent is true`` will print nothing. - R: Red - G: Green - B: Blue - C: Cyan - Y: Yellow - F: fuchsia - W: White
62598fb07d847024c075c401
class fakedQuantity: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.unit = Unit() <NEW_LINE> self.__class__ = Quantity
Faked Quantity class of TestQuantity2powers unittest.
62598fb04428ac0f6e658564
class Solution1: <NEW_LINE> <INDENT> def sortedArrayToBST(self, nums: List[int]) -> TreeNode: <NEW_LINE> <INDENT> if not nums: return None <NEW_LINE> midIndex = len(nums) // 2 <NEW_LINE> root = TreeNode(nums[midIndex]) <NEW_LINE> if nums[:midIndex]: <NEW_LINE> <INDENT> root.left = self.sortedArrayToBST(nums[:midIndex])...
将有序数组,通过中序遍历的划分方法,划分数组,数组左边的作为节点的左边节点,数组右边的作为节点的右边节点
62598fb0bf627c535bcb14dd
class AutoExtensibleForm(AutoFields, ExtensibleForm): <NEW_LINE> <INDENT> implements(IAutoExtensibleForm) <NEW_LINE> @property <NEW_LINE> def schema(self): <NEW_LINE> <INDENT> raise NotImplementedError("The class deriving from AutoExtensibleForm must have a 'schema' property") <NEW_LINE> <DEDENT> @property <NEW_LINE> d...
Mixin class for z3c.form forms that support fields extracted from a schema
62598fb016aa5153ce400541
class AllPages(): <NEW_LINE> <INDENT> def __init__(self,url): <NEW_LINE> <INDENT> self.url=url
This is a class for collecting data from a webpage.
62598fb060cbc95b0636438e
class ConfigIntegrationTest(TestCase): <NEW_LINE> <INDENT> def test_showconfig(self): <NEW_LINE> <INDENT> config_path = pathjoin(root(), "config.yml") <NEW_LINE> move(config_path, "/tmp/webagmes_webapi_config.yml") <NEW_LINE> old_stdout = sys.stdout <NEW_LINE> with open(config_path, "w") as tmpconfig: <NEW_LINE> <INDEN...
Test the entire module
62598fb0167d2b6e312b6fb0
class DavosTestingError(Exception): <NEW_LINE> <INDENT> pass
Base class for Davos testing-related errors
62598fb04a966d76dd5eef16
class UpgradeOperationHistoricalStatusInfo(Model): <NEW_LINE> <INDENT> _validation = { 'properties': {'readonly': True}, 'type': {'readonly': True}, 'location': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'properties': {'key': 'properties', 'type': 'UpgradeOperationHistoricalStatusInfoProperties'}, 'type': {'ke...
Virtual Machine Scale Set OS Upgrade History operation response. Variables are only populated by the server, and will be ignored when sending a request. :ivar properties: Information about the properties of the upgrade operation. :vartype properties: ~azure.mgmt.compute.v2017_12_01.models.UpgradeOperationHistorical...
62598fb04f88993c371f052a
class RandomPlanner(Planner): <NEW_LINE> <INDENT> def policy(self, state): <NEW_LINE> <INDENT> return random.choice(self.possible_actions)
A planner that takes actions at random.
62598fb0dd821e528d6d8f74
class ESMTPRelayer(RelayerMixin, smtp.ESMTPClient): <NEW_LINE> <INDENT> def __init__(self, messagePaths, *args, **kw): <NEW_LINE> <INDENT> smtp.ESMTPClient.__init__(self, *args, **kw) <NEW_LINE> self.loadMessages(messagePaths)
A base class for ESMTP relayers.
62598fb08da39b475be03225
class InactiveUsersView(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = User.objects.filter(is_active=True) & ( User.objects.filter( last_login__lte=timezone.now() - timezone.timedelta(days=THREE_YEARS_IN_DAYS) ) | User.objects.filter( last_login__isnull=True, date_joined__lte=timezone.now() - timezone.timedelta(...
This API view endpoint allows us to see our inactive users. An inactive user is one that hasn't logged in for three years. If the user has never logged in, we look at the date they registered with us instead.
62598fb099cbb53fe6830f18
class PizzaMenuItemSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> ingredients = serializers.PrimaryKeyRelatedField(many=True, queryset=PizzaIngredient.objects.all()) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = PizzaMenuItem <NEW_LINE> fields = ('id', 'name', 'ingredients')
This class is used to get the pizza menu items. But it does not show ingredients. TODO: add ingredients
62598fb0009cb60464d01560
class GaussTubuleSelfLabeling_ne(NonEnsembleBase): <NEW_LINE> <INDENT> _model = models.gauss_convolved_coated_tubule_selflabeling_ne
This is for use with SNAP-tag and Halo tag labels, which result in an annulus of roughly 5 nm thickness
62598fb0b7558d589546366a
class ProdConfig(Config): <NEW_LINE> <INDENT> SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://moringa:Muthoni.12@localhost/pitches'
Production configuration child class Args: Config: The parent configuration class with General configuration settings
62598fb010dbd63aa1c70bf3
class BadKeyError(Error): <NEW_LINE> <INDENT> pass
Raised by Key.__str__ when the key_bk is invalid.
62598fb07d847024c075c402
class Common(object): <NEW_LINE> <INDENT> def __init__(self, verbose, version): <NEW_LINE> <INDENT> self.verbose = verbose <NEW_LINE> logger = logging.getLogger("Common.__init__") <NEW_LINE> logger.debug("") <NEW_LINE> self.version = version <NEW_LINE> self.appdata_path = appdirs.user_config_dir("FlockAgent") <NEW_LINE...
The Common class is a singleton of shared functionality throughout the app
62598fb02c8b7c6e89bd3805
class Component(component.Component): <NEW_LINE> <INDENT> log = txaio.make_logger() <NEW_LINE> session = ApplicationSession <NEW_LINE> def _connect_transport(self, reactor, transport_config, session_factory): <NEW_LINE> <INDENT> transport_factory = _create_transport_factory(reactor, transport_config, session_factory) <...
A component establishes a transport and attached a session to a realm using the transport for communication. The transports a component tries to use can be configured, as well as the auto-reconnect strategy.
62598fb071ff763f4b5e77b1
class Transaction: <NEW_LINE> <INDENT> deep = False <NEW_LINE> def __init__(self, *targets): <NEW_LINE> <INDENT> self.targets = targets <NEW_LINE> self.Commit() <NEW_LINE> <DEDENT> def Commit(self): <NEW_LINE> <INDENT> self.states = [Memento(target, self.deep) for target in self.targets] <NEW_LINE> <DEDENT> def Rollbac...
A transaction guard. This is really just syntactic suggar arount a memento closure.
62598fb02ae34c7f260ab122
class TestResponse(ThamosTestCase): <NEW_LINE> <INDENT> def test_serialization(self, tmp_path: Path): <NEW_LINE> <INDENT> response = json.loads((Path(self.data_dir) / "response_1.json").read_text()) <NEW_LINE> with cwd(str(tmp_path)): <NEW_LINE> <INDENT> pipfile = response["result"]["report"]["products"][0]["project"][...
Test response serialization.
62598fb04a966d76dd5eef17
class DiffEntry(object): <NEW_LINE> <INDENT> def __init__(self, path=list(), old=None, new=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.old = old <NEW_LINE> self.new = new <NEW_LINE> self.undef_str = '<undefined>' <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> old = self.undef_str if self.ol...
DiffEntry is a representation of a difference. It describes the attribute's key (path) and its values on both sides of the structure.
62598fb044b2445a339b6991
class IterativeModel(): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def params(self, symbolic=False): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> def evaluate(self, x, mnb_size): <NEW_LINE> <INDENT> evaluate_f = getattr(self, "_evaluate", None) <NEW_LINE> if evaluate_f is None: <NEW_LINE> <INDENT> evaluate_f ...
Base class for language models that are trained iteratively using gradient descent.
62598fb0f9cc0f698b1c52ea
class TypeOfAddress: <NEW_LINE> <INDENT> TON = { 0b000: 'unknown', 0b001: 'international', 0b010: 'national', 0b011: 'specific', 0b100: 'subscriber', 0b101: 'alphanumeric', 0b110: 'abbreviated', 0b111: 'extended', } <NEW_LINE> TON_INV = dict([(v[1], v[0]) for v in TON.items()]) <NEW_LINE> NPI = { 0b0000: 'unknown', 0b0...
Type Of Address representation.
62598fb0fff4ab517ebcd826
class RRData_MX(Record): <NEW_LINE> <INDENT> RRDATA_FIELDS = ['exchange'] <NEW_LINE> RECORD_TYPE = 15
MX Resource Record Type Defined in: RFC1035
62598fb04527f215b58e9f16
class BIDSRunVariableCollection(BIDSVariableCollection): <NEW_LINE> <INDENT> def __init__(self, variables, sampling_rate=None): <NEW_LINE> <INDENT> self.sampling_rate = sampling_rate or 10 <NEW_LINE> super(BIDSRunVariableCollection, self).__init__(variables) <NEW_LINE> <DEDENT> def _none_dense(self): <NEW_LINE> <INDENT...
A container for one or more RunVariables--i.e., Variables that have a temporal dimension. Args: variables (list): A list of SparseRunVariable and/or DenseRunVariable. sampling_rate (float): Sampling rate (in Hz) to use when working with dense representations of variables. If None, defaults to 10. Note...
62598fb0167d2b6e312b6fb2
class LookupModule(LookupBase): <NEW_LINE> <INDENT> def run(self, terms, variables=None, **kwargs): <NEW_LINE> <INDENT> display.vvvv("%s" % terms) <NEW_LINE> if isinstance(terms, list): <NEW_LINE> <INDENT> return_values = [] <NEW_LINE> for term in terms: <NEW_LINE> <INDENT> display.vvvv("Term: %s" % term) <NEW_LINE> cy...
USAGE:
62598fb030bbd72246469999
class TestFile(common.TestCore): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestFile, self).setUp() <NEW_LINE> utils_lib.write_file(TRACKED_FP, contents=TRACKED_FP_CONTENTS_1) <NEW_LINE> utils_lib.write_file(TRACKED_FP_WITH_SPACE, contents=TRACKED_FP_CONTENTS_1) <NEW_LINE> utils_lib.write_file(TRACK...
Base class for file tests.
62598fb0a79ad1619776a0a9
class Link(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='links') <NEW_LINE> url = models.URLField() <NEW_LINE> icon = models.CharField(max_length=128) <NEW_LINE> title = models.CharField(max_length=128, null=True, blank=True)
Generic links for users.
62598fb021bff66bcd722ca8
class ConsoleObjectMenu(TemplateMenu): <NEW_LINE> <INDENT> obj = None <NEW_LINE> def object_menu(self): <NEW_LINE> <INDENT> self.print_help( "Do you want to 'add', 'list' {name}s, 'delete' them, or 'back' to main?".format(name=self.obj.name) ) <NEW_LINE> while True: <NEW_LINE> <INDENT> self.print_info("***{name} Menu**...
This is a template for other model menus
62598fb03d592f4c4edbaf02
class Ship(Entity): <NEW_LINE> <INDENT> def __init__(self, owner, id, position, halite_amount): <NEW_LINE> <INDENT> super().__init__(owner, id, position) <NEW_LINE> self.halite_amount = halite_amount <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_full(self): <NEW_LINE> <INDENT> return self.halite_amount >= constants.M...
Ship class to house ship entities
62598fb0e1aae11d1e7ce844
class FixtureDef: <NEW_LINE> <INDENT> def __init__(self, fixturemanager, baseid, argname, func, scope, params, unittest=False, ids=None): <NEW_LINE> <INDENT> self._fixturemanager = fixturemanager <NEW_LINE> self.baseid = baseid or '' <NEW_LINE> self.has_location = baseid is not None <NEW_LINE> self.func = func <NEW_LIN...
A container for a factory definition.
62598fb02ae34c7f260ab123
class MultiGetFile(MultiGetFileMixin, flow.GRRFlow): <NEW_LINE> <INDENT> args_type = MultiGetFileArgs <NEW_LINE> @flow.StateHandler() <NEW_LINE> def Start(self): <NEW_LINE> <INDENT> super(MultiGetFile, self).Start( file_size=self.args.file_size, maximum_pending_files=self.args.maximum_pending_files, use_external_stores...
A flow to effectively retrieve a number of files.
62598fb0bd1bec0571e150e3
class CustomLanguageCodeRemoveView(LaunchpadFormView): <NEW_LINE> <INDENT> schema = ICustomLanguageCode <NEW_LINE> field_names = [] <NEW_LINE> page_title = "Remove" <NEW_LINE> @property <NEW_LINE> def code(self): <NEW_LINE> <INDENT> return self.context.language_code <NEW_LINE> <DEDENT> @property <NEW_LINE> def label(se...
View for removing a `CustomLanguageCode`.
62598fb08a43f66fc4bf21bc
class WorkAmendmentDetailView(WorkDependentView, UpdateView): <NEW_LINE> <INDENT> http_method_names = ['post'] <NEW_LINE> model = Amendment <NEW_LINE> pk_url_kwarg = 'amendment_id' <NEW_LINE> fields = ['date'] <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return self.work.amendments <NEW_LINE> <DEDENT> def get...
View to update or delete amendment.
62598fb0a05bb46b3848a8ad
class TransferProductRequestProperties(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'destination_invoice_section_id': {'key': 'destinationInvoiceSectionId', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, destination_invoice_section_id: Optional[str] = None, **kwargs ): <NEW_LINE> <INDENT> su...
The properties of the product to initiate a transfer. :param destination_invoice_section_id: The destination invoice section id. :type destination_invoice_section_id: str
62598fb0a219f33f346c6857
class ChannelClosedError(PaymentServerError): <NEW_LINE> <INDENT> pass
Raised when attempting to access a channel that has been closed.
62598fb04428ac0f6e658568
class EntryPingbacks(EntryDiscussions): <NEW_LINE> <INDENT> title_template = 'feeds/pingback_title.html' <NEW_LINE> description_template = 'feeds/pingback_description.html' <NEW_LINE> def items(self, obj): <NEW_LINE> <INDENT> return obj.pingbacks[:FEEDS_MAX_ITEMS] <NEW_LINE> <DEDENT> def item_link(self, item): <NEW_LIN...
Feed for pingbacks in an entry
62598fb099cbb53fe6830f1b
class TimeZoneFieldBase(models.Field): <NEW_LINE> <INDENT> description = _('A pytz timezone object') <NEW_LINE> MAX_LENGTH = 63 <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> parent_kwargs = { 'max_length': self.MAX_LENGTH, 'choices': COMMON_TIMEZONE_CHOICES, 'null': True, } <NEW_LINE> parent_kwarg...
Provides database store for pytz timezone objects. Valid inputs are: - any instance of ``pytz.tzinfo.DstTzInfo`` or ``pytz.tzinfo.StaticTzInfo`` - the ``pytz.UTC`` singleton - any string that validates against pytz.common_timezones. - None and the empty string both represent 'no timezone' Valid outputs: - None - instan...
62598fb091f36d47f2230ec8
class IfExp(NodeNG): <NEW_LINE> <INDENT> _astroid_fields = ('test', 'body', 'orelse') <NEW_LINE> test = None <NEW_LINE> body = None <NEW_LINE> orelse = None
class representing an IfExp node
62598fb05fcc89381b26616d
class EnumValueType(FrozenClass): <NEW_LINE> <INDENT> ua_types = [ ('Value', 'Int64'), ('DisplayName', 'LocalizedText'), ('Description', 'LocalizedText'), ] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.Value = 0 <NEW_LINE> self.DisplayName = LocalizedText() <NEW_LINE> self.Description = LocalizedText() <NEW_...
A mapping between a value of an enumerated type and a name and description. :ivar Value: :vartype Value: Int64 :ivar DisplayName: :vartype DisplayName: LocalizedText :ivar Description: :vartype Description: LocalizedText
62598fb032920d7e50bc6096
class TestAppCommon: <NEW_LINE> <INDENT> def test_app_root_get(self, test_client: FlaskClient) -> None: <NEW_LINE> <INDENT> response = test_client.get("/") <NEW_LINE> assert response.status_code == HTTPStatus.FOUND <NEW_LINE> <DEDENT> def test_app_get_favicon(self, test_app: OverhaveAdminApp, test_client: FlaskClient) ...
Integration tests for OverhaveApp.
62598fb0ff9c53063f51a68f
class ToolTip(Toplevel): <NEW_LINE> <INDENT> def __init__(self, wdgt, msg=None, msgFunc=None, delay=1, follow=True): <NEW_LINE> <INDENT> self.wdgt = wdgt <NEW_LINE> self.parent = self.wdgt.master <NEW_LINE> Toplevel.__init__(self, self.parent, bg='black', padx=1, pady=1) <NEW_LINE> self.withdraw() <NEW_LINE> self.overr...
Provides a ToolTip widget for Tkinter. To apply a ToolTip to any Tkinter widget, simply pass the widget to the ToolTip constructor
62598fb03317a56b869be56c
class IndexPartition(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._partition = _IndexPartition() <NEW_LINE> <DEDENT> def size(self): <NEW_LINE> <INDENT> return self._partition.size() <NEW_LINE> <DEDENT> def starting_token(self): <NEW_LINE> <INDENT> return self._partition.starting_token() <N...
This class wraps the _IndexPartition class to provide serialization. It stores and loads an _IndexPartition object internally.
62598fb060cbc95b06364392
class AnsibleJ2Template(NativeTemplate): <NEW_LINE> <INDENT> def new_context(self, vars=None, shared=False, locals=None): <NEW_LINE> <INDENT> if vars is None: <NEW_LINE> <INDENT> vars = dict(self.globals or ()) <NEW_LINE> <DEDENT> if isinstance(vars, dict): <NEW_LINE> <INDENT> vars = vars.copy() <NEW_LINE> if locals is...
A helper class, which prevents Jinja2 from running AnsibleJ2Vars through dict(). Without this, {% include %} and similar will create new contexts unlike the special one created in Templar.template. This ensures they are all alike, except for potential locals.
62598fb0f7d966606f748028
class SimpleGPGStrategy(gpg.GPGStrategy): <NEW_LINE> <INDENT> def _command_line(self): <NEW_LINE> <INDENT> return ['gpg', '--detach-sign']
A simple signing strategy that does not need configuration. :seealso bzrlib.gpg.GPGStrategy: The base class in bzrlib that needs configuration. This also does plain signs, rather than clearsigned signatures.
62598fb05fdd1c0f98e5dfcf
class AvailabilityRuleOnceManager(django_models.Manager): <NEW_LINE> <INDENT> def create(self, groundstation, operation, periodicity, dates): <NEW_LINE> <INDENT> localtime = pytz_ref.LocalTimezone() <NEW_LINE> starting_tz = localtime.tzname(dates[0]) <NEW_LINE> ending_tz = localtime.tzname(dates[1]) <NEW_LINE> if start...
Manager with static methods for easing the handling of this kind of objects in the database.
62598fb001c39578d7f12dc2
class command(object): <NEW_LINE> <INDENT> registry = OrderedDict() <NEW_LINE> short_docs = [] <NEW_LINE> def __init__(self, doc=None): <NEW_LINE> <INDENT> self.short_docs.append(doc) <NEW_LINE> <DEDENT> def __call__(self, fn): <NEW_LINE> <INDENT> command.registry[fn.func_name.replace("_", "-")] = fn <NEW_LINE> return ...
411, a tool to create dns entries in AWS, dnsmasq from your published containers and external files. This will create the files that need to be commited in different repos. Usage: 411.py [COMMAND] Commands:
62598fb0090684286d5936fe
class FlatternTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_no_need_flat(self): <NEW_LINE> <INDENT> temp = [] <NEW_LINE> inp = [1,2,3,4,5] <NEW_LINE> output = [1,2,3,4,5] <NEW_LINE> flattern(inp, temp) <NEW_LINE> print('Given input {}, output {} '.format(inp, temp)) <NEW_LINE> self.assertEqual(temp, output)...
Tests for `flattern.py`.
62598fb056ac1b37e630222d
class STD_ANON_ (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = None <NEW_LINE> _Documentation = None
An atomic simple type.
62598fb0097d151d1a2c106e
class BehaviorParams(paramtools.Parameters): <NEW_LINE> <INDENT> array_first = True <NEW_LINE> with open(os.path.join(CUR_PATH, "behavior_params.json"), "r") as f: <NEW_LINE> <INDENT> behavior_params = json.load(f) <NEW_LINE> <DEDENT> defaults = behavior_params
Class for creating behavioral parameters
62598fb067a9b606de546010
class DesktopographySiteExtractor(DesktopographyExtractor): <NEW_LINE> <INDENT> subcategory = "site" <NEW_LINE> pattern = BASE_PATTERN + r"/$" <NEW_LINE> test = ("https://desktopography.net/",) <NEW_LINE> def items(self): <NEW_LINE> <INDENT> page = self.request(self.root).text <NEW_LINE> data = {"_extractor": Desktopog...
Extractor for all desktopography exhibitions
62598fb04f88993c371f052c
class SimpleParameterList(list): <NEW_LINE> <INDENT> pass
By convention, holds a list of holders and parameter, value to be formatted in a simple (fqdn-only) manner.
62598fb0dd821e528d6d8f78
class LinearSVCModel(JavaClassificationModel, _LinearSVCParams, JavaMLWritable, JavaMLReadable): <NEW_LINE> <INDENT> @since("3.0.0") <NEW_LINE> def setThreshold(self, value): <NEW_LINE> <INDENT> return self._set(threshold=value) <NEW_LINE> <DEDENT> @property <NEW_LINE> @since("2.2.0") <NEW_LINE> def coefficients(self):...
Model fitted by LinearSVC. .. versionadded:: 2.2.0
62598fb0a79ad1619776a0ab
class WuiElementText(WuiRawHtml): <NEW_LINE> <INDENT> def __init__(self, sText): <NEW_LINE> <INDENT> WuiRawHtml.__init__(self, webutils.escapeElem(sText));
Outputs the given element text.
62598fb099cbb53fe6830f1c
class MacroProcedure(LambdaProcedure): <NEW_LINE> <INDENT> def eval_call(self, operands, env): <NEW_LINE> <INDENT> eval_operands = complete_eval(self.apply(operands, env)) <NEW_LINE> return scheme_eval(eval_operands, env)
A macro: a special form that operates on its unevaluated operands to create an expression that is evaluated in place of a call.
62598fb067a9b606de546011
class SpinnakerSecurityGroupError(SpinnakerError): <NEW_LINE> <INDENT> pass
Could not create Security Group.
62598fb097e22403b383af51
class NotebookFinder(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.loaders = {} <NEW_LINE> <DEDENT> def find_module(self, fullname, path=None): <NEW_LINE> <INDENT> nb_path = find_notebook(fullname, path) <NEW_LINE> if not nb_path: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> key = path <NE...
Module finder that locates Jupyter Notebooks
62598fb0009cb60464d01564