code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class SvSvgCircleNode(bpy.types.Node, SverchCustomTreeNode): <NEW_LINE> <INDENT> bl_idname = 'SvSvgCircleNode' <NEW_LINE> bl_label = 'Circle SVG' <NEW_LINE> bl_icon = 'MESH_CIRCLE' <NEW_LINE> sv_icon = 'SV_CIRCLE_SVG' <NEW_LINE> rad_x: FloatProperty(name='Radius X', description='Horizontal Radius', default=1.0, update=... | Triggers: Ellipse SVG
Tooltip: Svg circle/ellipse shape, the shapes will be wrapped in SVG Groups | 62598f7bc432627299fa2962 |
class ChannelAttn(nn.Module): <NEW_LINE> <INDENT> def __init__(self, channels, reduction=16, act_layer=nn.ReLU): <NEW_LINE> <INDENT> super(ChannelAttn, self).__init__() <NEW_LINE> self.avg_pool = nn.AdaptiveAvgPool2d(1) <NEW_LINE> self.max_pool = nn.AdaptiveMaxPool2d(1) <NEW_LINE> self.fc1 = nn.Conv2d(channels, channel... | Original CBAM channel attention module, currently avg + max pool variant only.
| 62598f7b15baa72349461909 |
@dataclass <NEW_LINE> class Target(NamedItemBaseType): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> name = "target" <NEW_LINE> namespace = OCIL_2_NAMESPACE | A target element describes the user, system, or role that applies to all
questionnaires in scope.
For instance, specifying that user Joe Smith should complete this
document; applies to system with ip address of 123.45.67.89; applies
to all systems functioning as (role) web servers; or all (role)
administrators should ... | 62598f7b07d97122c421662c |
class X: <NEW_LINE> <INDENT> x = filter(lambda f, p = '' : fnmatch.fnmatch(f, p), []) | doc | 62598f7b66673b3332c2fd4e |
class ResidualBlock(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_filters, kernel_size, padding, nonlinearity=Mish, dropout=0.2, dilation=1,batchNormObject=nn.BatchNorm2d): <NEW_LINE> <INDENT> super(ResidualBlock, self).__init__() <NEW_LINE> num_hidden_filters = num_filters <NEW_LINE> self.conv1 = nn.Conv2d(nu... | Residual Block | 62598f7b1f5feb6acb1625c0 |
class Neuron: <NEW_LINE> <INDENT> def __init__(self, layer, index): <NEW_LINE> <INDENT> self.layer = layer <NEW_LINE> self.index = index <NEW_LINE> self.bias = gauss(0,1) <NEW_LINE> self.weightList = [] <NEW_LINE> self.inputNeuron = 0.0 <NEW_LINE> self.outputNeuron = 0.0 <NEW_LINE> <DEDENT> def getLayer(self): <NEW_LIN... | Class which defines a neuron in a neural network. It is composed of
- the layer in which is this neuron
- the index of the neuron in this layer
- its bias
- the list of its weights between this neuron and neurons in the next layer called weightList | 62598f7b507cdc57c63a4715 |
class ConfigurationError(Exception): <NEW_LINE> <INDENT> pass | Configuration Error
| 62598f7b26238365f5fac4fb |
class EndpointProxy(object): <NEW_LINE> <INDENT> def __init__(self, api, endpoint_url, schema_url): <NEW_LINE> <INDENT> self._api = api <NEW_LINE> self._endpoint_url = endpoint_url <NEW_LINE> self._schema_url = schema_url <NEW_LINE> self._resource = filter(bool, endpoint_url.split('/'))[-1] <NEW_LINE> <DEDENT> def __re... | Proxy object to a service endpoint | 62598f7b3eb6a72ae0389fcc |
class PerceptronClassifier(ClassifierNode): <NEW_LINE> <INDENT> def __init__(self, execute_method=None, input_dim=None, output_dim=None, dtype=None): <NEW_LINE> <INDENT> super(PerceptronClassifier, self).__init__( execute_method=execute_method, input_dim=input_dim, output_dim=output_dim, dtype=dtype) <NEW_LINE> self.we... | A simple perceptron with input_dim input nodes. | 62598f7b50485f2cf55da8fb |
class Capability(object): <NEW_LINE> <INDENT> def __init__(self, name, properties, definition): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self._properties = properties <NEW_LINE> self.definition = definition <NEW_LINE> <DEDENT> def get_properties_objects(self): <NEW_LINE> <INDENT> properties = [] <NEW_LINE> props... | TOSCA built-in capabilities type. | 62598f7ba4f1c619b294df77 |
class Rosetta(object): <NEW_LINE> <INDENT> def __init__(self, keys): <NEW_LINE> <INDENT> self._localized_strings = {} <NEW_LINE> self._localized_keys = keys <NEW_LINE> <DEDENT> def acquire_storm_object(self, obj): <NEW_LINE> <INDENT> self._localized_strings = { key: getattr(obj, key) for key in self._localized_keys } <... | This Class can manage all the localized strings inside
one Storm object. AKA: manage three language on a single
stone. Hell fucking yeah, History! | 62598f7b94891a1f408b93b4 |
class RBiostrings(RPackage): <NEW_LINE> <INDENT> homepage = "https://bioconductor.org/packages/Biostrings/" <NEW_LINE> git = "https://git.bioconductor.org/packages/Biostrings.git" <NEW_LINE> version('2.44.2', commit='e4a2b320fb21c5cab3ece7b3c6fecaedfb1e5200') <NEW_LINE> depends_on('r-biocgenerics', type=('build', ... | Memory efficient string containers, string matching algorithms, and
other utilities, for fast manipulation of large biological sequences
or sets of sequences. | 62598f7bbe8e80087fbbe9ec |
class OutOfDateMessage(Exception): <NEW_LINE> <INDENT> pass | The value of the incoming message is out of date - the local node holds
a later version of the value. | 62598f7b63f4b57ef0085a33 |
@pytest.mark.skipif(not HAVE_NP, reason='Numpy is not available') <NEW_LINE> class TestNumpy_RLEDecodeSegment: <NEW_LINE> <INDENT> def test_noop(self): <NEW_LINE> <INDENT> data = b'\x80\x80\x80' <NEW_LINE> assert bytes(_rle_decode_segment(data)) == b'' <NEW_LINE> data = ( b'\x80\x80' b'\x05\x01\x02\x03\x04\x05\x06' b'\... | Tests for rle_handler._rle_decode_segment.
Using int8
----------
if n >= 0 and n < 127:
read next (n + 1) bytes literally
elif n <= -1 and n >= -127:
copy the next byte (-n + 1) times
elif n = -128:
do nothing
Using uint8 (as in handler)
---------------------------
if n < 128
read next (n + 1) bytes l... | 62598f7bd53ae8145f917e21 |
class ColorViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Color.objects.all() <NEW_LINE> serializer_class = ColorSerializer <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save(created_by=self.request.user, updated_by=self.request.user) <NEW_LINE> <DEDENT> def perform_upd... | This viewset automatically provides `list` and `detail` actions. | 62598f7b6aa9bd52df0d4863 |
class NameExpansionIteratorQueue(object): <NEW_LINE> <INDENT> def __init__(self, name_expansion_iterator, final_value): <NEW_LINE> <INDENT> self.name_expansion_iterator = name_expansion_iterator <NEW_LINE> self.final_value = final_value <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> <DEDENT> def qsize(self): <NEW_L... | Wrapper around NameExpansionIterator that provides a Multiprocessing.Queue
facade.
Only a blocking get() function can be called, and the block and timeout
params on that function are ignored. All other class functions raise
NotImplementedError.
This class is thread safe. | 62598f7b50485f2cf55da8fc |
class TR(HTMLElement): <NEW_LINE> <INDENT> pass | Element corresponding to the ``<tr>`` tag | 62598f7b07d97122c421662d |
class SuperdeskJSONEncoder(MongoJSONEncoder, ElasticJSONSerializer): <NEW_LINE> <INDENT> pass | Custom JSON encoder for elastic that can handle `bson.ObjectId`s. | 62598f7b8e71fb1e983bb441 |
class PCA(AlgorithmBase): <NEW_LINE> <INDENT> def __init__(self, dims, scale=True, solver="eig"): <NEW_LINE> <INDENT> self.dims = dims <NEW_LINE> self.scale = scale <NEW_LINE> self.solver = solver <NEW_LINE> <DEDENT> def fit(self, X: np.array, y=None): <NEW_LINE> <INDENT> if self.scale: <NEW_LINE> <INDENT> X, self.X_of... | PCA Algorithm
References:
Deep Learning, Ian Goodfellow, Section 5.8.1, Page 146
Pattern Recognition and Machine Learning, Section 12.1, Page 561 | 62598f7b26068e7796d4c2e6 |
class EnvironmentContext(InstanceContext): <NEW_LINE> <INDENT> def __init__(self, version, service_sid, sid): <NEW_LINE> <INDENT> super(EnvironmentContext, self).__init__(version) <NEW_LINE> self._solution = {'service_sid': service_sid, 'sid': sid, } <NEW_LINE> self._uri = '/Services/{service_sid}/Environments/{sid}'.f... | PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. | 62598f7bfb3f5b602db47e76 |
class File: <NEW_LINE> <INDENT> file_path: str <NEW_LINE> check_extension: bool <NEW_LINE> EXTENSION: str <NEW_LINE> def __init__(self, file_path: str, check_extension: bool=False): <NEW_LINE> <INDENT> self.file_path = file_path <NEW_LINE> self.check_extension = check_extension <NEW_LINE> <DEDENT> @property <NEW_LINE> ... | Represents a file. | 62598f7b15baa7234946190c |
class ContinueNextToken(WorkflowTransition): <NEW_LINE> <INDENT> pass | Jump up to next token (it can be called many levels deep). | 62598f7b4e696a045264dac6 |
class ITransaction(form.Schema): <NEW_LINE> <INDENT> amount = Int( title=_(u"The amount of the transaction"), required=True ) <NEW_LINE> balance = Int( title=_(u"The total amount of credits after the transaction"), required=True ) | A transaction, a user either bought credits, or spent credits on a
service. | 62598f7b3eb6a72ae0389fce |
class Spare(object): <NEW_LINE> <INDENT> pass | This class will preserve the most fundamental works of
python codementality | 62598f7b50485f2cf55da8fd |
class OBJECT_MT_OpenCVPanel(bpy.types.WorkSpaceTool): <NEW_LINE> <INDENT> bl_label = "OpenCV Animation" <NEW_LINE> bl_space_type = 'VIEW_3D' <NEW_LINE> bl_context_mode = 'OBJECT' <NEW_LINE> bl_idname = "ui_plus.opencv" <NEW_LINE> bl_options = {'REGISTER'} <NEW_LINE> bl_icon = "ops.generic.select_circle" <NEW_LINE> def ... | Creates a Panel in the Object properties window | 62598f7bf7d966606f747973 |
class LazyTypedChoiceField(widgets.LazyChoicesMixin, forms.TypedChoiceField): <NEW_LINE> <INDENT> widget = widgets.LazySelect <NEW_LINE> def _set_choices(self, value): <NEW_LINE> <INDENT> super(LazyTypedChoiceField, self)._set_choices(value) <NEW_LINE> self.widget.choices = value | A form TypedChoiceField that respects choices being a lazy object. | 62598f7bd4950a0f3b110afb |
class Game: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getInitBoard(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getBoardSize(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getActionSize(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getNextStat... | Класс, описывающий базовый класс для игры. Для описания своей собственной игры,
унаследуйте этот класс и опишите функции, данные ниже. Игра должна быть
антогонистической и пошаговой.
Для идентификации игроков используйте 1 для первого игрока (player1) и
-1 для второго игрока (player2).
Примеры:
othello/OthelloGame.... | 62598f7b29b78933be269da2 |
class AutoCreatedField(models.DateTimeField): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault("editable", False) <NEW_LINE> kwargs.setdefault("default", now) <NEW_LINE> super(AutoCreatedField, self).__init__(*args, **kwargs) | A DateTimeField that automatically populates itself at
object creation.
By default, sets editable=False, default=timezone.now. | 62598f7b6e29344779afffef |
class DBGCALLSTACKENTRY(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> addr = _swig_property(_x64dbgapi64.DBGCALLSTACKENTRY_addr_get, _x64dbgapi64.DBGCALLSTACKENTRY_addr_set) <NEW_LINE> _fro... | Proxy of C++ DBGCALLSTACKENTRY class | 62598f7bac7a0e7691f71ea6 |
class Xearths(point.KeyedPoints): <NEW_LINE> <INDENT> def __init__(self, marker_file=None): <NEW_LINE> <INDENT> super(Xearths, self).__init__() <NEW_LINE> self._marker_file = marker_file <NEW_LINE> if marker_file: <NEW_LINE> <INDENT> self.import_locations(marker_file) <NEW_LINE> <DEDENT> <DEDENT> def __str__(self): <NE... | Class for representing a group of :class:`Xearth` objects
.. versionadded:: 0.5.1 | 62598f7b07d97122c4216630 |
class CompanySerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> fields = ["id", "name"] <NEW_LINE> model = models.Company | Company Serializer | 62598f7bfb3f5b602db47e77 |
class InitPredictNetExporter(ModelExporter): <NEW_LINE> <INDENT> def prepend_operators(self, init_net, predict_net, input_names: List[str]): <NEW_LINE> <INDENT> return mobile_onnx.add_feats_numericalize_ops( init_net, predict_net, self.vocab_map, input_names ) <NEW_LINE> <DEDENT> def postprocess_output( self, init_net,... | Exporter for converting models to their caffe2 init and predict nets.
Does not rely on c2_prepared, but rather splits the ONNX model into
the init and predict nets directly. | 62598f7bd6c5a102081e1ad5 |
class Favorite(Base): <NEW_LINE> <INDENT> __tablename__ = 'favorite' <NEW_LINE> __table_args__ = (sa.UniqueConstraint('user_id', 'spot_id', name='favorite_user_spot_idx'),) <NEW_LINE> id = sa.Column(sa.Integer, primary_key=True) <NEW_LINE> user = sa.orm.relationship('User', back_populates='favorites') <NEW_LINE> spot =... | User spot bookmarks.
| 62598f7b82261d6c5272fb9a |
class PronounSubject(Pronoun): <NEW_LINE> <INDENT> def __init__(self, base): <NEW_LINE> <INDENT> super().__init__(base) <NEW_LINE> self.items['tag'] = 'PS' <NEW_LINE> self.items['plural'] = ('we' if self.base == "i" else 'they') <NEW_LINE> self.items['possess_plural'] = ('our' if self.base == 'i' else 'their') | Subject Pronouns | 62598f7ba79ad161977699ed |
class TestMathFunc(unittest.TestCase): <NEW_LINE> <INDENT> def test_add(self): <NEW_LINE> <INDENT> self.assertEqual(3, Calcu.add(1, 2)) <NEW_LINE> self.assertNotEqual(3, Calcu.add(2, 2)) <NEW_LINE> <DEDENT> def test_multi(self): <NEW_LINE> <INDENT> self.assertEqual(6, Calcu.multi(2, 3)) | Test Calcu.py | 62598f7bf7d966606f747975 |
class HypothesisTest(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.MakeModel() <NEW_LINE> self.actual = self.TestStatistic(data) <NEW_LINE> self.test_stats = None <NEW_LINE> self.test_cdf = None <NEW_LINE> <DEDENT> def PValue(self, iters=1000): <NEW_LINE> <I... | Represents a hypothesis test. | 62598f7bbe8e80087fbbe9f0 |
class ProblematicTermsLinter(Linter): <NEW_LINE> <INDENT> def __init__(self, options: Optional[Options] = None) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.__terms: List[ProblematicTerm] = [] <NEW_LINE> for term in (options or {}).get('terms', []): <NEW_LINE> <INDENT> if not isinstance(term, dict): ... | Warns if there are problematic terms in the codebase. | 62598f7bd53ae8145f917e25 |
class LoftType(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,*args): <NEW_... | Specifies enumerated constants for all supported loft types.
enum LoftType,values: Developable (4),Loose (1),Normal (0),Straight (3),Tight (2),Uniform (5) | 62598f7b07d97122c4216631 |
class ExpressionToken: <NEW_LINE> <INDENT> def __init__(self, type: ExpressionTokenType, value: Variant, line: int, column: int): <NEW_LINE> <INDENT> self.__type = type <NEW_LINE> self.__value = value <NEW_LINE> self.__line = line <NEW_LINE> self.__column = column <NEW_LINE> <DEDENT> @property <NEW_LINE> def type(self)... | Defines an expression token holder. | 62598f7b96565a6dacd2cc41 |
class ServerConfiguration(ConfigParser): <NEW_LINE> <INDENT> _EPILOG = ( "[server name]\n" "url = string\n" "start_command = string\n" "\n" "The EMSM comes with tested default settings for each server.\n" "so you should only overwrite these values, if you have to.\n" ) | Handles the *server.conf* configuration file, which allows the user
to overwrite the default EMSM settings for a server wrapper like
the *url* or the *start command*.
.. seealso::
* :meth:`emsm.core.server.BaseServerWrapper.conf` | 62598f7b23e79379d538be88 |
class AtomAccessibility(Atom): <NEW_LINE> <INDENT> _setup = _mdt.mdt_feature_atom_accessibility | Atom solvent accessibility. This is calculated by the PSA algorithm,
and controlled by the surftyp and accessibility_type arguments to
:meth:`mdt.Table.add_alignment`.
The feature is considered undefined if the atom's Cartesian
coordinates are equal to the Modeller 'undefined' value (-999.0). | 62598f7bb57a9660fecd140d |
class xep_0004(base_plugin): <NEW_LINE> <INDENT> def plugin_init(self): <NEW_LINE> <INDENT> self.xep = '0004' <NEW_LINE> self.description = 'Data Forms' <NEW_LINE> self.stanza = stanza <NEW_LINE> self.xmpp.registerHandler( Callback('Data Form', StanzaPath('message/form'), self.handle_form)) <NEW_LINE> register_stanza_p... | XEP-0004: Data Forms | 62598f7b287bf620b6271548 |
class ContactForm(forms.Form): <NEW_LINE> <INDENT> message = forms.CharField( label = u'Message', required = True, widget = forms.Textarea(), ) <NEW_LINE> name = forms.CharField( label = u'Name', max_length=100, required = True, ) <NEW_LINE> email = forms.EmailField( label = u'Email', max_length=100, required = True, ) | Default ContactForm. | 62598f7b15fb5d323ce7e6ba |
class MemoryErrorHandler(ErrorHandler): <NEW_LINE> <INDENT> event_class = MemoryError <NEW_LINE> can_change_physics = False <NEW_LINE> def handle_task_event(self, task, event): <NEW_LINE> <INDENT> task.manager.increase_resources() <NEW_LINE> return self.FIXED <NEW_LINE> <DEDENT> def handle_input_event(self, abiinput, o... | Handle MemoryError. Increase the resources requirements | 62598f7b26068e7796d4c2ea |
class SuspiciousTitForTat(Player): <NEW_LINE> <INDENT> name = "Suspicious Tit For Tat" <NEW_LINE> classifier = { 'memory_depth': 1, 'stochastic': False, 'inspects_source': False, 'manipulates_source': False, 'manipulates_state': False } <NEW_LINE> @staticmethod <NEW_LINE> def strategy(opponent): <NEW_LINE> <INDENT> ret... | A TFT that initially defects. | 62598f7b15baa72349461910 |
class NunjaHTTPRequestHandlerFactory(object): <NEW_LINE> <INDENT> def __init__( self, provider, nunja_prefix='/nunja', registry_names=(ENTRY_POINT_NAME,), handler_cls=NunjaHTTPRequestHandler, ): <NEW_LINE> <INDENT> self.nunja_prefix = nunja_prefix <NEW_LINE> self.provider = provider <NEW_LINE> self.handler_cls = handle... | Produces a handler constructor that will assign attributes that the
handler implementation will need. | 62598f7b30dc7b766599f1e9 |
class AddExperienceView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> if not request.user.is_authenticated: <NEW_LINE> <INDENT> return redirect(reverse('login') + services.get_next_path(request)) <NEW_LINE> <DEDENT> if not request.user.is_applicant: <NEW_LINE> <INDENT> return redirect('profile'... | View for adding applicant's work experience | 62598f7b9b70327d1c57e735 |
class FindDaysUntilEvent(Link): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> Link.__init__(self, kwargs.pop('name', 'FindDaysUntilEvent')) <NEW_LINE> self._process_kwargs(kwargs, read_key=None, store_key=None, datetime_col=None, event_col=None, countdown_col_name='days_until_event', partitionby... | Find the number of days until an event in a spark dataframe.
Will create a new column (name given by `countdown_col_name`) containing
the number of days between the current row and the next date on which
`event_col` is greater than 0. The dataframe must include a column that has
a date or datetime. | 62598f7b16aa5153ce3ffe8f |
class TransformerModel(nn.Module): <NEW_LINE> <INDENT> def __init__(self, ntoken: int, ninp: int, nhead: int, nhid: int, nlayers: int, dropout: float = 0.5): <NEW_LINE> <INDENT> super(TransformerModel, self).__init__() <NEW_LINE> self.model_type = "Transformer" <NEW_LINE> self.ninp = ninp <NEW_LINE> self.encoder = nn.E... | Container module with an encoder, a transformer module, and a
decoder. | 62598f7b7b25080760ed6e32 |
class RouterRaw(_RouterWithForwarders): <NEW_LINE> <INDENT> alias = 'rawrouter' <NEW_LINE> plugin = alias <NEW_LINE> def set_connections_params( self, harakiri=None, timeout_socket=None, retry_delay=None, retry_max=None, use_xclient=None): <NEW_LINE> <INDENT> super().set_connections_params(**filter_locals(locals(), dro... | A pure-TCP load balancer.
Can be used to load balance between the various HTTPS routers. | 62598f7b94891a1f408b93b7 |
class account_curve(pd.core.series.Series): <NEW_LINE> <INDENT> def new_freq(self, freq): <NEW_LINE> <INDENT> if freq=="Daily": <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> if freq=="Weekly": <NEW_LINE> <INDENT> return self.cumsum().ffill().resample("W").diff() <NEW_LINE> <DEDENT> if freq=="Monthly": <NEW_LINE> ... | Inherits from pandas time series to give useful information
Could be in % or GBP terms
Downsamples to daily before doing anything else
Can | 62598f7b6aa9bd52df0d4869 |
class ActiveModelManager(models.Manager): <NEW_LINE> <INDENT> def get_query_set(self): <NEW_LINE> <INDENT> return ActiveQuerySet(self.model) <NEW_LINE> <DEDENT> def __getattr__(self, attr, *args): <NEW_LINE> <INDENT> if attr.startswith("_"): <NEW_LINE> <INDENT> raise AttributeError <NEW_LINE> <DEDENT> return getattr(se... | Exclude inactive ("deleted") objects from the query set. | 62598f7bcad5886f8bdc4cb4 |
class MetricPlotView(APIView): <NEW_LINE> <INDENT> renderer_classes = (JSONRenderer, BrowsableAPIRenderer) <NEW_LINE> def get(self, request, name): <NEW_LINE> <INDENT> started = rest_util.parse_timestamp(request, u'started', required=False) <NEW_LINE> ended = rest_util.parse_timestamp(request, u'ended', required=False)... | This view is the endpoint for retrieving plot values of metrics. | 62598f7b66656f66f7d59d83 |
class StubCapture(Capture): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def save(self, *args, **kwargs) -> None: <NEW_LINE> <INDENT> pass | This class is used to create a stub object to ensure we DON'T
save images when the stream capture is disabled. | 62598f7b1d351010ab8f34d0 |
class BooleanBinaryOperation(BinaryOperation): <NEW_LINE> <INDENT> def __init__(self, op, left, right, **kwargs): <NEW_LINE> <INDENT> super().__init__(check_type(op, BooleanBinaryOperator), left, right, **kwargs) | A binary boolean operation. | 62598f7b96565a6dacd2cc42 |
class Output(NamedObject): <NEW_LINE> <INDENT> TF_TYPE = "output" | Represents a Terraform output | 62598f7bbaa26c4b54d4ec44 |
class Query(models.Model): <NEW_LINE> <INDENT> total_results = models.PositiveIntegerField(_('number of results'), default=0) <NEW_LINE> items_per_page = models.PositiveIntegerField(_('fetched items'), default=50) <NEW_LINE> timestamp = models.DateTimeField(_('datetime of query'), auto_now_add=True) <NEW_LINE> taxon = ... | Search term (=taxon name) sent to Mendeley API. | 62598f7b23e79379d538be8b |
class GetIndustryFacilitiesInternalServerError(object): <NEW_LINE> <INDENT> def __init__(self, error=None): <NEW_LINE> <INDENT> self.swagger_types = { 'error': 'str' } <NEW_LINE> self.attribute_map = { 'error': 'error' } <NEW_LINE> self._error = error <NEW_LINE> <DEDENT> @property <NEW_LINE> def error(self): <NEW_LINE>... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f7b15fb5d323ce7e6bc |
class Announcement(models.Model): <NEW_LINE> <INDENT> ANNOUN_TYPE = ( (0, '福利'), (1, '假期安排'), (2, '活动'), ) <NEW_LINE> title = models.CharField(verbose_name=u'公告标题', max_length=150, help_text=u"公告标题") <NEW_LINE> content = UEditorField(verbose_name=u"公告内容",imagePath='announ/images/', filePath="announ/files/",help_text=u"... | 公司信息公告 | 62598f7bb830903b9686e13a |
class RPCCoverage(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dir = tempfile.mkdtemp(prefix="coverage") <NEW_LINE> self.flag = '--coveragedir=%s' % self.dir <NEW_LINE> <DEDENT> def report_rpc_coverage(self): <NEW_LINE> <INDENT> uncovered = self._get_uncovered_rpc_commands() <NEW_LINE> if uncover... | Coverage reporting utilities for test_runner.
Coverage calculation works by having each test script subprocess write
coverage files into a particular directory. These files contain the RPC
commands invoked during testing, as well as a complete listing of RPC
commands per `neom-cli help` (`rpc_interface.txt`).
After a... | 62598f7b9b70327d1c57e737 |
class ApplicationInsightsManagementClient: <NEW_LINE> <INDENT> def __init__( self, credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: <NEW_LINE> <INDENT> self._config = ApplicationInsightsManagementClientConfiguration(credential=credential, subs... | Composite Swagger for Application Insights Management Client.
:ivar workbooks: WorkbooksOperations operations
:vartype workbooks:
azure.mgmt.applicationinsights.v2018_06_17_preview.operations.WorkbooksOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.applicationinsights.v2018_06_17_pr... | 62598f7bd10714528d69d860 |
class CnnTest(object): <NEW_LINE> <INDENT> def __init__(self, result_dir): <NEW_LINE> <INDENT> self.graph = tf.Graph() <NEW_LINE> with self.graph.as_default(): <NEW_LINE> <INDENT> self.x = tf.placeholder(tf.float32, [None, CAPTCHA_HEIGHT, CAPTCHA_WIDTH, 1]) <NEW_LINE> self.y_pred = cnn_graph(self.x) <NEW_LINE> self.sav... | 模型测试对象
其他函数通过新建此对象调用模型识别功能
先进行模型的初始化,在调用测试函数,此测试适用于单个样本的输入 | 62598f7b3eb6a72ae0389fd4 |
class ShardedIterator(BaseSampler): <NEW_LINE> <INDENT> def __init__(self, sampler: BaseSampler, num_parts: int = 1, part_index: int = 0, even_size: bool = False, seed: Optional[int] = None): <NEW_LINE> <INDENT> assert part_index < num_parts, 'part_index should be less than num_parts' <NEW_LINE> self._sampler = sampler... | A sharded wrapper around an iterable (padded to length).
Parameters
----------
sampler
num_parts
Number of partitions which the data is split into (default: 1)
part_index
The index of the part to read from
even_size
If the number of batches is not even across all partitions, sample a few extra batches
... | 62598f7ba4f1c619b294df7f |
class SafeResource(Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SafeResource, self).__init__() <NEW_LINE> self.method_decorators.append(exception_guard) | Resource that is wrapped in exception_guard automatically. That means, that any exception thrown when executing
the API call will be formatted to JSON. | 62598f7b21bff66bcd7225f8 |
class SmaStrategy(Base): <NEW_LINE> <INDENT> params = (("maperiod", 15),) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(SmaStrategy, self).__init__() <NEW_LINE> print("maperiod:", self.params.maperiod) <NEW_LINE> self.sma = bt.indicators.SimpleMovingAverage( self.dataclose, period=self.params.maperiod ) <NEW... | Implementing the SMA_sta strategy from zwPython.
Rule:
If close price > SMA: buy
If close price < SMA: sell
Args:
maperiod (int): The time period for moving average. | 62598f7bd164cc6175820908 |
class DataSiftApiException(DataSiftException): <NEW_LINE> <INDENT> def __init__(self, response): <NEW_LINE> <INDENT> Exception.__init__(self, str(response["error"])) <NEW_LINE> self.response = response | Indicates that the DataSift REST API has returned an error.
The text of the error can be found in .message, while the specifics can be found in the response object stored in .response
eg.::
try:
hash = client.compile("this csdl is not going to work")
except DataSiftApiException as e:
print "E... | 62598f7b50485f2cf55da903 |
class UserFav(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="用户") <NEW_LINE> goods = models.ForeignKey(Goods, on_delete=models.CASCADE, verbose_name="商品") <NEW_LINE> add_time = models.DateTimeField(default=datetime.now, verbose_name="添加时间") <NEW_LINE> class Met... | 用户收藏 | 62598f7bd53ae8145f917e29 |
class AbstractDeclarator(Declarator): <NEW_LINE> <INDENT> def pyxstr(self,toks=None,indent=0,**kw): <NEW_LINE> <INDENT> if self.name in python_kws: <NEW_LINE> <INDENT> self.name = '_' + self.name <NEW_LINE> <DEDENT> return Node.pyxstr(self,toks,indent, **kw).strip() | used in Function; may lack an identifier | 62598f7b9b70327d1c57e738 |
class Params: <NEW_LINE> <INDENT> measure = {'impressions': 'impressionsTotalUnique', 'views':'pageViewUnique', 'downloads':'units', 'installs':'installs', 'sessions':'sessions', 'ad':'activeDevices', 'crash':'crashes', 'purchases':'iap', 'bookings':'sales', 'pu':'payingUsers'} <NEW_LINE> interval = {'day':'d', 'week':... | Class with the inputs for the Itunes Analytics App | 62598f7b6aa9bd52df0d486b |
class Contact(models.Model): <NEW_LINE> <INDENT> first_name = models.CharField(max_length=50) <NEW_LINE> last_name = models.CharField(max_length=50, blank=True) <NEW_LINE> telephone = models.CharField(max_length=25, blank=True) <NEW_LINE> email = models.EmailField(blank=True) <NEW_LINE> def __str__(self): <NEW_LINE> <I... | A person's contact info. | 62598f7b7c178a314d78ce3b |
class MenuScreen(Screen): <NEW_LINE> <INDENT> menu_sm = ObjectProperty(None) <NEW_LINE> prev_exercise_bt = ObjectProperty(None) <NEW_LINE> next_exercise_bt = ObjectProperty(None) <NEW_LINE> goto_exercise_bt = ObjectProperty(None) <NEW_LINE> prev_transition = SlideTransition(direction="right") <NEW_LINE> next_transition... | Główny ekran aplikacji - menu wyboru ćwiczeń | 62598f7b76d4e153a661c5a4 |
class Choice(list): <NEW_LINE> <INDENT> pass | Used to represent multiple possibilities at this point in a pattern string.
We use a distinguished type, rather than a list, so that the usage in the
code is clear. | 62598f7b8e05c05ec3f6eb10 |
class DefaultTitleTile(BaseMetadataTile): <NEW_LINE> <INDENT> def get_value(self): <NEW_LINE> <INDENT> return u"Insert the content title here" | A default tile for title
| 62598f7b0383005118f6d095 |
class TopicRulePayload(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Sql = None <NEW_LINE> self.Actions = None <NEW_LINE> self.Description = None <NEW_LINE> self.RuleDisabled = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Sql = params.get("Sql") <N... | TopicRulePayload结构
| 62598f7bbde94217f3707330 |
class SizeNotMatchingException(Exception): <NEW_LINE> <INDENT> pass | The size of the values submitted array does not match the Range coordinates. Make sure sizes are matching | 62598f7b73bcbd0ca4bc9be3 |
class Attachment(MTModel): <NEW_LINE> <INDENT> attachment = models.FileField(upload_to="attachments/%Y/%m/%d/") <NEW_LINE> name = models.CharField(max_length=250) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT... | Abstract base class for an attachment. | 62598f7bec188e330fdf8233 |
class DestroyDirectMessageResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | A ResultSet with methods tailored to the values returned by the DestroyDirectMessage Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598f7b71ff763f4b5e7100 |
class PolyhedralConvexAabbCachingTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.tolerance = bullet.btVector3(0.04, 0.04, 0.04) <NEW_LINE> self.points = [ bullet.btVector3(-1, -1, -1), bullet.btVector3(-1, 1, -1), bullet.btVector3(-1, -1, 1), bullet.btVector3(-1, 1, 1), bullet... | We use btConvexHullShape to implicitly test abstract base classes
that it inherits and implements | 62598f7bac7a0e7691f71eac |
class TransformerSublayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, sublayer, sublayer_shape, dropout_p=0.1): <NEW_LINE> <INDENT> super(TransformerSublayer, self).__init__() <NEW_LINE> self.sublayer = sublayer <NEW_LINE> self.norm = nn.LayerNorm(sublayer_shape) <NEW_LINE> self.dropout = nn.Dropout(dropout_p, i... | Implements a sub layer of the transformer model, which consists of:
1) A sub layer module
2) Followed by dropout
3) Plus a residual connection
4) With layer normalization | 62598f7b1d351010ab8f34d3 |
class TestCompareXLSXFiles(base_test_class.XLSXBaseTest): <NEW_LINE> <INDENT> def test_chart_doughnut01(self): <NEW_LINE> <INDENT> self.run_exe_test('test_chart_doughnut01') <NEW_LINE> <DEDENT> def test_chart_doughnut02(self): <NEW_LINE> <INDENT> self.run_exe_test('test_chart_doughnut02') <NEW_LINE> <DEDENT> def test_c... | Test file created with libxlsxwriter against a file created by Excel. | 62598f7b1f5feb6acb1625ca |
class Cancel(BaseModel): <NEW_LINE> <INDENT> action: str = 'cancel' <NEW_LINE> oid: str <NEW_LINE> symbol: str | Cancel msg for removing a dark (ems triggered) or
broker-submitted (live) trigger/order. | 62598f7b26238365f5fac505 |
class BotInfo(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["user_id", "description", "commands"] <NEW_LINE> ID = 0x98e81d3a <NEW_LINE> QUALNAME = "types.BotInfo" <NEW_LINE> def __init__(self, *, user_id: int, description: str, commands: List["raw.base.BotCommand"]) -> None: <NEW_LINE> <INDENT> self.user_id = ... | This object is a constructor of the base type :obj:`~pyrogram.raw.base.BotInfo`.
Details:
- Layer: ``122``
- ID: ``0x98e81d3a``
Parameters:
user_id: ``int`` ``32-bit``
description: ``str``
commands: List of :obj:`BotCommand <pyrogram.raw.base.BotCommand>` | 62598f7b30c21e258be9819c |
class TestStateItalicsWrapping(unittest.TestCase): <NEW_LINE> <INDENT> def test_hanging_closed_by_bold_token(self): <NEW_LINE> <INDENT> state = lib.state.State() <NEW_LINE> self.assertFalse(state.is_italics) <NEW_LINE> state.update('*test') <NEW_LINE> state.update('more proze') <NEW_LINE> self.assertTrue(state.is_itali... | Tests for tracking state of iatlics blocks over multiple lines. | 62598f7bdc8b845886d52f49 |
class PenetrationTestData(ProjectDataDocument): <NEW_LINE> <INDENT> __collection__ = "penetration_test_data" <NEW_LINE> start_time = StringField() <NEW_LINE> use_time = FloatField() <NEW_LINE> note = StringField() | 渗透测试详情 | 62598f7b6aa9bd52df0d486d |
class GrainFM(MultiOutUGen): <NEW_LINE> <INDENT> __documentation_section__ = None <NEW_LINE> __slots__ = () <NEW_LINE> _ordered_input_names = ( 'channel_count', 'trigger', 'duration', 'carfrequency', 'modfrequency', 'index', 'pan', 'envbufnum', 'max_grains', ) <NEW_LINE> _valid_calculation_rates = None <NEW_LINE> def _... | ::
>>> grain_fm = ugentools.GrainFM.ar(
... carfrequency=440,
... channel_count=1,
... duration=1,
... envbufnum=-1,
... index=1,
... max_grains=512,
... modfrequency=200,
... pan=0,
... trigger=0,
... )
>>> grain_fm
GrainFM.ar... | 62598f7bd99f1b3c44d05041 |
class Tree: <NEW_LINE> <INDENT> class Position: <NEW_LINE> <INDENT> def element(self): <NEW_LINE> <INDENT> raise NotImplementedError("must be implemented by subclass") <NEW_LINE> <DEDENT> def eq (self, other): <NEW_LINE> <INDENT> raise NotImplementedError("must be implemented by subclass") <NEW_LINE> <DEDENT> def ne (s... | Abstract base class representing a tree structure. | 62598f7b7c178a314d78ce3d |
class QuteSchemeOSError(Exception): <NEW_LINE> <INDENT> pass | Called when there was an OSError inside a handler. | 62598f7bf7d966606f74797c |
class Oper(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> db_table = 'ircd_opers' <NEW_LINE> <DEDENT> username = models.CharField(max_length = 31, unique = True, editable = False) <NEW_LINE> password = models.CharField(max_length = 32, editable = False) <NEW_LINE> hostname = models.CharField(max_len... | Sets up the schema used by the sqloper module from inspIRCd.
See: http://wiki.inspircd.org/Modules/sqloper | 62598f7b8a349b6b43685bd7 |
class close_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'handle', (QueryHandle, QueryHandle.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, handle=None,): <NEW_LINE> <INDENT> self.handle = handle <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TB... | Attributes:
- handle | 62598f7b63f4b57ef0085a38 |
class IncludeDef: <NEW_LINE> <INDENT> def __init__(self, ast_call: ast.Call) -> None: <NEW_LINE> <INDENT> self.ast_call = ast_call <NEW_LINE> <DEDENT> def get_location(self) -> str: <NEW_LINE> <INDENT> return self.ast_call.args[0].s <NEW_LINE> <DEDENT> def get_label(self) -> label.Label: <NEW_LINE> <INDENT> return labe... | Represents build file include definition like
include_defs("//include/path"). | 62598f7b96565a6dacd2cc44 |
class Column(Div): <NEW_LINE> <INDENT> template = "%s/layout/column.html" | Layout object. It wraps fields in a ``<div>`` and the template adds the
appropriate class to render the contents in a column. e.g. ``col-md`` when
using the Bootstrap4 template pack.
Attributes
----------
template : str
The default template which this Layout Object will be rendered
with.
css_class : str, optio... | 62598f7b8e71fb1e983bb44b |
class PipedViewerPQProcess(Process): <NEW_LINE> <INDENT> def __init__(self, cmndpipe, rspdpipe): <NEW_LINE> <INDENT> super(PipedViewerPQProcess,self).__init__(group=None, target=None, name='PipedViewerPQ') <NEW_LINE> self.__cmndpipe = cmndpipe <NEW_LINE> self.__rspdpipe = rspdpipe <NEW_LINE> self.__app = None <NEW_LINE... | A Process specifically tailored for creating a PipedViewerPQ. | 62598f7ba4f1c619b294df82 |
class ActionInfoLine(object): <NEW_LINE> <INDENT> def __init__(self, parent, row, command_number, label_color, value_color): <NEW_LINE> <INDENT> self.command_label = tk.Label(parent, text=" " + str(command_number) + " ", background=label_color, relief=tk.GROOVE, anchor=tk.N, width=3) <NEW_LINE> self.command_label.grid(... | Line containing info about actions assigned to a command number | 62598f7b07d97122c4216637 |
class AugmentedCIFAR10Data(object): <NEW_LINE> <INDENT> def __init__(self, raw_cifar10data, sess, model): <NEW_LINE> <INDENT> assert isinstance(raw_cifar10data, CIFAR10Data) <NEW_LINE> self.image_size = 32 <NEW_LINE> self.x_input_placeholder = tf.placeholder(tf.float32, shape=[None, 32, 32, 3]) <NEW_LINE> padded = tf.m... | Data augmentation wrapper over a loaded dataset.
Inputs to constructor
=====================
- raw_cifar10data: the loaded CIFAR10 dataset, via the CIFAR10Data class
- sess: current tensorflow session
- model: current model (needed for input tensor) | 62598f7bbe383301e025318e |
class MarriedTo(Relation): <NEW_LINE> <INDENT> relation_name = 'married_to' | married_to relation. | 62598f7b0a366e3fb87dc360 |
class MidiCcFx(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def map_float_to_int(float_val): <NEW_LINE> <INDENT> assert 0.00 <= float_val <= 1.00 <NEW_LINE> int_val = int(round(float_val * MidiCcMsg.CC_VAL_MAX, 0)) <NEW_LINE> return int_val <NEW_LINE> <DEDENT> def __init__(self, midi_out, channel_num=0, controller_n... | An effect that implemented with MIDI Control Change messages.
I.e. each change of the FX emits a corresponding MIDI CC message. | 62598f7b1d351010ab8f34d5 |
class AdminEmployee(Employee, FullTime, AccessCard, AdaAccess): <NEW_LINE> <INDENT> def __init__(self, first_name, last_name): <NEW_LINE> <INDENT> super().__init__(first_name, last_name) <NEW_LINE> FullTime.__init__(self) <NEW_LINE> AccessCard.__init__(self) <NEW_LINE> AdaAccess.__init__(self) | Class representing Human Resources Employee | 62598f7b4e696a045264dacb |
class QtQml(PyQtBindings): <NEW_LINE> <INDENT> def __init__(self, project): <NEW_LINE> <INDENT> super().__init__(project, 'QtQml', qmake_QT=['qml'], test_headers=['qjsengine.h'], test_statement='new QJSEngine()') | The QtQml bindings. | 62598f7c26238365f5fac507 |
class Message(object): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.text = (' '.join(message.split())).split('\n') <NEW_LINE> self._lines = [] <NEW_LINE> self._last_width = 0 <NEW_LINE> <DEDENT> def should_update(self, surface_width): <NEW_LINE> <INDENT> return len(self._lines) == 0 or surf... | Message object provides normalization process in order
to avoid text overflow in a standard surface rendering. | 62598f7ca4f1c619b294df83 |
class Primary(models.Model): <NEW_LINE> <INDENT> questionaire = models.ForeignKey(Questionaire, on_delete=models.CASCADE, null=True, blank=True, related_name="q_in_primary") <NEW_LINE> name = models.CharField(max_length=256, blank=False, null=True, verbose_name="Information exchanged") <NEW_LINE> reading_frequency = mo... | The Primary class defines the main storage point for Primary Assets.
Each Primary has these fields:
- **questionaire** - defines a ManytoOne-Relationship of a primary asset to a Questionnaire.
- **name** - stores the name of the primary asset.
- **reading_frequency** - stores the reading frequency of the primary asset.... | 62598f7c21bff66bcd7225fc |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.