code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class renew_delegation_token_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.I64, 'success', None, None, ), (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, o1=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.o1 = o1 <NEW_... | Attributes:
- success
- o1 | 62598f9896565a6dacd2ce14 |
class AccountInformation(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sku_name = None <NEW_LINE> self.account_kind = None | Holds information related to the storage account.
:ivar str sku_name:
Name of the storage SKU, also known as account type.
Example: Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS, Premium_ZRS
:ivar str account_kind:
Describes the flavour of the storage account, also known as account ... | 62598f982ae34c7f260aae16 |
class BottleneckTransform(nn.Module): <NEW_LINE> <INDENT> def __init__( self, dim_in, dim_out, temp_kernel_size, stride, dim_inner, num_groups, stride_1x1=False, inplace_relu=True, eps=1e-5, bn_mmt=0.1, ): <NEW_LINE> <INDENT> super(BottleneckTransform, self).__init__() <NEW_LINE> self.temp_kernel_size = temp_kernel_siz... | Bottleneck transformation: Tx1x1, 1x3x3, 1x1x1, where T is the size of
temporal kernel. | 62598f986aa9bd52df0d4c02 |
@dataclass <NEW_LINE> class OrderData(BaseData): <NEW_LINE> <INDENT> symbol: str <NEW_LINE> exchange: Exchange <NEW_LINE> orderid: str <NEW_LINE> type: OrderType = OrderType.LIMIT <NEW_LINE> direction: Direction = "" <NEW_LINE> offset: Offset = Offset.NONE <NEW_LINE> price: float = 0 <NEW_LINE> volume: float = 0 <NEW_L... | Order data contains information for tracking lastest status
of a specific order. | 62598f98d58c6744b42dc16b |
class VarRequest(Var): <NEW_LINE> <INDENT> tpl = '${%s}' | Returns request variable. Examples: PATH_INFO, SCRIPT_NAME, REQUEST_METHOD. | 62598f98e76e3b2f99fd876a |
class TestSortedAssetList(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestSortedAssetList, self).setUp() <NEW_LINE> asset_list = [dict(list(zip(AssetStoreTestData.asset_fields, asset))) for asset in AssetStoreTestData.all_asset_data] <NEW_LINE> self.sorted_asset_list_by_filename =... | Tests the SortedAssetList class. | 62598f98925a0f43d25e7d71 |
class NamedDataConverter(BaseDataConverter): <NEW_LINE> <INDENT> adapts(INamedField, INamedFileWidget) <NEW_LINE> def toWidgetValue(self, value): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> def toFieldValue(self, value): <NEW_LINE> <INDENT> if value is None or value == '': <NEW_LINE> <INDENT> return self.field... | Converts from a file-upload to a NamedFile variant.
| 62598f98d7e4931a7ef3bdcd |
class LightStatistic(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.LightDistribution = None <NEW_LINE> self.LightLevelRatio = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("LightDistribution") is not None: <NEW_LINE> <INDENT> self.LightDist... | 光照统计结果
| 62598f9867a9b606de545d0a |
class Connection(_ConnectionBase): <NEW_LINE> <INDENT> if _winapi: <NEW_LINE> <INDENT> def _close(self, _close=_multiprocessing.closesocket): <NEW_LINE> <INDENT> _close(self._handle) <NEW_LINE> <DEDENT> _write = _multiprocessing.send <NEW_LINE> _read = _multiprocessing.recv <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>... | Connection class based on an arbitrary file descriptor (Unix only), or
a socket handle (Windows). | 62598f988e71fb1e983bb7eb |
class Critter(MazeSprite): <NEW_LINE> <INDENT> tiles: Surface <NEW_LINE> dir_rects: Tuple[Rect, Rect, Rect, Rect] <NEW_LINE> _direction: int <NEW_LINE> in_transit: bool <NEW_LINE> speed: int <NEW_LINE> speeds = [(-1, 0), (0, -1), (1, 0), (0, 1)] <NEW_LINE> def __init__(self, maze_map: MazeMap, critter_tiles: Tuple[Surf... | A sub class of MazeSprite add functionality that is common to the dog and cat | 62598f98a17c0f6771d5bf71 |
class OpticalFlowFeatures: <NEW_LINE> <INDENT> def __init__(self, flow): <NEW_LINE> <INDENT> self.flow = flow <NEW_LINE> <DEDENT> def _hoof(self, x, y, bins, density=False): <NEW_LINE> <INDENT> orientations = np.arctan2(x, y) <NEW_LINE> magnitudes = np.sqrt(np.square(x) + np.square(y)) <NEW_LINE> hist, bin_edges = np.h... | Extracts features from an optical flow.
This code is optimized for understanding rather than performance.
As a result there is much recalculation across the different
feature extractors. | 62598f98627d3e7fe0e06be0 |
class PolyLineOffset(PolyLine): <NEW_LINE> <INDENT> def __init__(self, locations, popup=None, tooltip=None, offset=0, **kwargs): <NEW_LINE> <INDENT> super(PolyLineOffset, self).__init__( locations=locations, popup=popup, tooltip=tooltip, **kwargs ) <NEW_LINE> self._name = "PolyLineOffset" <NEW_LINE> self.options.update... | Add offset capabilities to the PolyLine class.
This plugin adds to folium Polylines the ability to be drawn with a
relative pixel offset, without modifying their actual coordinates. The offset
value can be either negative or positive, for left- or right-side offset,
and remains constant across zoom levels.
See :func:... | 62598f980fa83653e46f4c20 |
class CodonUsageTable(): <NEW_LINE> <INDENT> def __init__(self, url, use_frequency=False): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.usage_table = {} <NEW_LINE> self.use_frequency = use_frequency <NEW_LINE> self.fetch_codon_usage_table() <NEW_LINE> <DEDENT> def add_to_table(self, codon, aa, frequency): <NEW_LI... | Provides a representation of a specific codon usage table
url - String; URL from which the usage table can be obtained.
Usually http://www.kazusa.or.jp/codon/cgi-bin/showcodon.cgi?species=<id>&aa=<num>&style=N
use_frequency - Boolean; Defines whether usage frequencies/1000 are used inste... | 62598f989b70327d1c57ead8 |
class BaseGeometry: <NEW_LINE> <INDENT> def area(self): <NEW_LINE> <INDENT> raise Exception("area() is not implemented") | defining class BaseGeometry | 62598f98d53ae8145f9181c3 |
class IsUniqueCheck(AbstractCheck): <NEW_LINE> <INDENT> def __init__(self, description, rule, available_field_names, location=None): <NEW_LINE> <INDENT> super().__init__(description, rule, available_field_names, location) <NEW_LINE> self._field_names_to_check = [] <NEW_LINE> self._row_key_to_location_map = None <NEW_LI... | Check to ensure that all rows are unique concerning certain key fields. | 62598f9832920d7e50bc5d8d |
class DTLZ5(Problem): <NEW_LINE> <INDENT> k = 10 <NEW_LINE> def __init__(self, m, n=None): <NEW_LINE> <INDENT> Problem.__init__(self) <NEW_LINE> self.name = DTLZ5.__name__ <NEW_LINE> if n is None: <NEW_LINE> <INDENT> n = DTLZ5.default_decision_count(m) <NEW_LINE> <DEDENT> self.decisions = [Decision("x"+str(index+1),0,1... | Hypothetical test problem with
"m" objectives and "n" decisions | 62598f9823e79379d538c239 |
class BadgeApplicationRejectionReason(object): <NEW_LINE> <INDENT> openapi_types = { 'code': 'str', 'messages': 'list[BadgeApplicationRejectionReasonMessage]' } <NEW_LINE> attribute_map = { 'code': 'code', 'messages': 'messages' } <NEW_LINE> def __init__(self, code=None, messages=None, local_vars_configuration=None): <... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f98b5575c28eb712b68 |
class Repo(BaseModel): <NEW_LINE> <INDENT> id = PrimaryKeyField() <NEW_LINE> repo_id = IntegerField(unique=True) <NEW_LINE> owner = ForeignKeyField(User, related_name='repos') <NEW_LINE> url = CharField() <NEW_LINE> def get_oauth_token(self) -> str: <NEW_LINE> <INDENT> return self.owner.get_oauth_token() | A repo, with URL and id. | 62598f98656771135c4893b8 |
class EncodingProfile(object): <NEW_LINE> <INDENT> def __init__(self, width, height, bitrate_default, bitrate_min, bitrate_max, required): <NEW_LINE> <INDENT> if width is None: <NEW_LINE> <INDENT> raise ValueError('The EncodingProfile.width value is required') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.width = ... | This class defines an encoding profile | 62598f98507cdc57c63a4acc |
class GIL_534: <NEW_LINE> <INDENT> pass | Hench-Clan Thug | 62598f9845492302aabfc210 |
class FilterManager(PluginManager): <NEW_LINE> <INDENT> _default_registry = filters <NEW_LINE> @classmethod <NEW_LINE> def _init_plugins(cls, filters, fmt_mgr=None, **kwargs): <NEW_LINE> <INDENT> log.debug("Filters before resolving: {0}".format(filters)) <NEW_LINE> if fmt_mgr is None: <NEW_LINE> <INDENT> fmts = set() <... | Class responsible to manage filters and filtering itself | 62598f9807f4c71912baf183 |
class Performance(models.Model): <NEW_LINE> <INDENT> number = models.IntegerField(_("Nombre")) <NEW_LINE> instrument = models.ForeignKey(Instrument, blank=True, null=True, verbose_name=_('instrument'), on_delete=models.SET_NULL) <NEW_LINE> emit = models.ForeignKey(EmitVox, blank=True, null=True, verbose_name=_(u'Nature... | Performance made by some musicians | 62598f981b99ca400228f3c8 |
class BiosVfUmaBasedClustering(ManagedObject): <NEW_LINE> <INDENT> consts = BiosVfUmaBasedClusteringConsts() <NEW_LINE> naming_props = set([]) <NEW_LINE> mo_meta = { "classic": MoMeta("BiosVfUmaBasedClustering", "biosVfUmaBasedClustering", "Uma-based-clustering", VersionMeta.Version421a, "InputOutput", 0x1f, [], ["admi... | This is BiosVfUmaBasedClustering class. | 62598f98c432627299fa2d0d |
@unique <NEW_LINE> class Lexeme(Enum): <NEW_LINE> <INDENT> @DynamicClassAttribute <NEW_LINE> def token(self) -> str: <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> @DynamicClassAttribute <NEW_LINE> def lexeme(self) -> str: <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def t... | Supports the definition of lexemes.
This class make it possible to map a token onto the related lexeme,
by ensuring the uniqueness of both the tokens and the lexemes. | 62598f988a43f66fc4bf1eb4 |
class SynthesizeFLASH(FSCommand): <NEW_LINE> <INDENT> _cmd = "mri_synthesize" <NEW_LINE> input_spec = SynthesizeFLASHInputSpec <NEW_LINE> output_spec = SynthesizeFLASHOutputSpec <NEW_LINE> def _list_outputs(self): <NEW_LINE> <INDENT> outputs = self.output_spec().get() <NEW_LINE> if isdefined(self.inputs.out_file): <NEW... | Synthesize a FLASH acquisition from T1 and proton density maps.
Examples
--------
>>> from nipype.interfaces.freesurfer import SynthesizeFLASH
>>> syn = SynthesizeFLASH(tr=20, te=3, flip_angle=30)
>>> syn.inputs.t1_image = 'T1.mgz'
>>> syn.inputs.pd_image = 'PD.mgz'
>>> syn.inputs.out_file = 'flash_30syn.mgz'
>>> syn.... | 62598f98b7558d5895463367 |
class NewsHeading(models.Model): <NEW_LINE> <INDENT> title = models.TextField() <NEW_LINE> subtitle = models.TextField() <NEW_LINE> read_more = models.TextField(primary_key=True) <NEW_LINE> banner = models.TextField() | This model is mirrored by it's equivalent 'scrapy.Item' descendant in the
Scrapy application. | 62598f98bd1bec0571e14f60 |
class ConfigMissingError(Exception): <NEW_LINE> <INDENT> pass | Raised if configuration file is missing
| 62598f98d486a94d0ba2bd0d |
class Word: <NEW_LINE> <INDENT> def __init__(self,id,value,points): <NEW_LINE> <INDENT> self.__id = id <NEW_LINE> self.__value = value <NEW_LINE> self.__points = points <NEW_LINE> <DEDENT> def getId(self): return self.__id <NEW_LINE> def setId(self,id): self.__id = id <NEW_LINE> def getValue(self): return self.__value ... | Reprezinta o entitate cuvant, cu proprietatile id, value, points | 62598f9832920d7e50bc5d8e |
class AgriculturalClimatic(models.Model): <NEW_LINE> <INDENT> production_agricultural = models.ForeignKey( "producer.ProductionAgricultural", related_name="agricultural_climatic", on_delete=models.CASCADE ) <NEW_LINE> factor = models.CharField(max_length=100) <NEW_LINE> risk = models.CharField(max_length=50) <NEW_LINE>... | Modelo de factores climicticos y daños
que afectan a la produccion | 62598f980fa83653e46f4c22 |
class ModelInput: <NEW_LINE> <INDENT> def __init__( self, state=None, hidden=None, target_class_embedding=None, action_probs=None ): <NEW_LINE> <INDENT> self.state = state <NEW_LINE> self.hidden = hidden <NEW_LINE> self.target_class_embedding = target_class_embedding <NEW_LINE> self.action_probs = action_probs | Input to the model. | 62598f98d53ae8145f9181c5 |
class ServerError(EupsException): <NEW_LINE> <INDENT> def __init__(self, message, exc=None): <NEW_LINE> <INDENT> EupsException.__init__(self, message) <NEW_LINE> self.exc = exc <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> out = self.msg <NEW_LINE> if self.exc is not None: <NEW_LINE> <INDENT> out += " (%s)... | an exception representing a problem communicating with a server | 62598f980c0af96317c560bb |
class itkLevelSetMotionRegistrationFilterIUC3IUC3IVF33(itkPDEDeformableRegistrationFilterPython.itkPDEDeformableRegistrationFilterIUC3IUC3IVF33): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): ra... | Proxy of C++ itkLevelSetMotionRegistrationFilterIUC3IUC3IVF33 class | 62598f9816aa5153ce400235 |
@duplication(label='annotator-definition', comment='This is almost an exact copy of the "duplication" annotator.') <NEW_LINE> class inconsistency: <NEW_LINE> <INDENT> def __init__(self, *, comment=None): <NEW_LINE> <INDENT> if label == "": <NEW_LINE> <INDENT> raise MissingLabelError("Label must not be empty.") <NEW_LIN... | Annotator to mark code inconsistencies between classes/functions with a similar purpose. | 62598f98eab8aa0e5d30babc |
class CreateBackground(BasePrimitive): <NEW_LINE> <INDENT> def __init__(self, action, context): <NEW_LINE> <INDENT> BasePrimitive.__init__(self, action, context) <NEW_LINE> self.log = context.pipeline_logger <NEW_LINE> self.cfg = self.context.config.instrument <NEW_LINE> <DEDENT> def _pre_condition(self): <NEW_LINE> <I... | This is a template for primitives, which is usually an action.
The methods in the base class can be overloaded:
- _pre_condition
- _post_condition
- _perform
- apply
- __call__ | 62598f987b25080760ed71db |
class Quantile(ind.Quantile): <NEW_LINE> <INDENT> def __init__(self, attribs): <NEW_LINE> <INDENT> super(Quantile, self).__init__() <NEW_LINE> self.quantileLimit = None <NEW_LINE> self.quantileValue = None <NEW_LINE> for key, value in attribs.items(): <NEW_LINE> <INDENT> setattr(self, key, value) <NEW_LINE> <DEDENT> se... | Represents a <Quantile> tag in v4.0 and provides methods to convert to PFA. | 62598f98097d151d1a2c0d5c |
class Org(models.Model): <NEW_LINE> <INDENT> created_by = models.ForeignKey( "User", null=True, on_delete=models.SET_NULL, related_name="created_orgs", ) <NEW_LINE> name = models.TextField(unique=True) <NEW_LINE> slug = models.SlugField(max_length=255, unique=True) <NEW_LINE> description = models.TextField(default="", ... | An Organisation using the platform | 62598f9876e4537e8c3ef2ed |
class Link(Element): <NEW_LINE> <INDENT> def __init__(self, driver: webdriver, div_id=None, xpath=None, div_name=None): <NEW_LINE> <INDENT> super().__init__(driver, div_id, xpath, div_name) <NEW_LINE> <DEDENT> def click(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.element.click() <NEW_LINE> <DEDENT> except ... | Class that implements a link object | 62598f984e4d56256637215b |
class FunnelDataResultSet(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 FunnelData Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598f98596a8972361279b8 |
class RoofExteriorSolarAbsorptance(BSElement): <NEW_LINE> <INDENT> element_type = "xs:decimal" | The fraction of incident radiation in the solar spectrum that is absorbed by the material or surface. (0-1) (fraction) | 62598f98379a373c97d98d4c |
@dataclass(frozen=True) <NEW_LINE> class ScryRelatedCard(ScryObject): <NEW_LINE> <INDENT> object: ClassVar[str] = "related_card" <NEW_LINE> id: UUID <NEW_LINE> component: str <NEW_LINE> name: str <NEW_LINE> type_line: str <NEW_LINE> uri: URI | Model for https://scryfall.com/docs/api/cards#related-card-objects | 62598f9801c39578d7f12ab8 |
class Plugin: <NEW_LINE> <INDENT> def __init__(self, p_name="Standaard", p_source_plugin=None, p_logo=None, p_view_plugin=None): <NEW_LINE> <INDENT> if p_source_plugin is None: <NEW_LINE> <INDENT> p_source_plugin = SourcePlugin() <NEW_LINE> <DEDENT> if p_view_plugin is None: <NEW_LINE> <INDENT> p_view_plugin = ViewPlug... | This class has all the subplugins and will use the default subplugin if there isn a subplugin inheritted for a specific pluign
This class controls all the subplugins and has the grouped up together | 62598f9824f1403a9268574e |
class MessageAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ("__str__", "created") | Message Admin Definition | 62598f98bde94217f3707506 |
class Image(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Dimensions(image): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def FromPixels(colors, width=None, height=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def Pixels(image, xSamples, ySamples): <NE... | Methods for operating on Image Bitmaps. | 62598f9899cbb53fe6830c0a |
class RemoveComment(Protected, DeleteView): <NEW_LINE> <INDENT> model = Comment <NEW_LINE> template_name = 'main/post_edit.html' <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> comment = get_object_or_404(Comment, pk=kwargs['pk']) <NEW_LINE> post_pk = comment.post.pk <NEW_LINE> comment.delete()... | Remove comment. | 62598f98d58c6744b42dc16d |
class Glyph(Bitcoin): <NEW_LINE> <INDENT> name = 'glyph' <NEW_LINE> symbols = ('GLYPH', ) <NEW_LINE> seeds = ("node.glyphcoin.com", ) <NEW_LINE> port = 47714 <NEW_LINE> message_start = b'\xa1\xa0\xa2\xa3' <NEW_LINE> base58_prefixes = { 'PUBKEY_ADDR': 15, 'SCRIPT_ADDR': 28, 'SECRET_KEY': 143 } | Class with all the necessary Glyph network information based on
https://github.com/glyphcoin/glyphcoin/blob/master/src/net.cpp
(date of access: 02/15/2018) | 62598f98cc0a2c111447ad45 |
class TestUserController(BaseTestCase): <NEW_LINE> <INDENT> def test_user_info_put(self): <NEW_LINE> <INDENT> body = UserInfoWithoutId() <NEW_LINE> response = self.client.open( '//user/info', method='PUT', data=json.dumps(body), content_type='application/json') <NEW_LINE> self.assert200(response, 'Response body is : ' ... | UserController integration test stubs | 62598f98925a0f43d25e7d75 |
class DataHandlerMeta(type): <NEW_LINE> <INDENT> def __init__(cls, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> cls.directory = None <NEW_LINE> <DEDENT> except PermissionError: <NEW_LINE> <INDENT> cls._directory = None <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def directory(cls): <NEW_LINE> <I... | A metaclass is needed until Python supports @classproperty. | 62598f98d7e4931a7ef3bdd1 |
class APIDeletedDocumentView(generics.RetrieveDestroyAPIView): <NEW_LINE> <INDENT> mayan_object_permissions = { 'DELETE': (permission_document_delete,), 'GET': (permission_document_view,) } <NEW_LINE> queryset = DeletedDocument.objects.all() <NEW_LINE> serializer_class = DeletedDocumentSerializer | Returns the selected trashed document details.
delete: Delete the trashed document.
get: Retreive the details of the trashed document. | 62598f98379a373c97d98d4d |
class PgNode(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.parents = set() <NEW_LINE> self.children = set() <NEW_LINE> self.mutex = set() <NEW_LINE> <DEDENT> def is_mutex(self, other) -> bool: <NEW_LINE> <INDENT> if other in self.mutex: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return Fa... | Base class for planning graph nodes.
includes instance sets common to both types of nodes used in a planning graph
parents: the set of nodes in the previous level
children: the set of nodes in the subsequent level
mutex: the set of sibling nodes that are mutually exclusive with this node | 62598f9867a9b606de545d0e |
class Downscaler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def generate(self, values): <NEW_LINE> <INDENT> raise NotImplementedError() | Downscale large-scale trajectories | 62598f98b7558d5895463368 |
class StyleLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(StyleLoss, self).__init__() <NEW_LINE> self.add_module('vgg', VGG19()) <NEW_LINE> self.criterion = torch.nn.L1Loss() <NEW_LINE> <DEDENT> def compute_gram(self, x): <NEW_LINE> <INDENT> b, ch, h, w = x.size() <NEW_LINE> f = x.vi... | Perceptual loss, VGG-based
https://arxiv.org/abs/1603.08155
https://github.com/dxyang/StyleTransfer/blob/master/utils.py | 62598f980a50d4780f705112 |
class IContentTypeTerm(zope.schema.interfaces.ITitledTokenizedTerm): <NEW_LINE> <INDENT> mimeTypes = schema.List( title=_("MIME types"), description=_("List of MIME types represented by this interface;" " the first should be considered the preferred" " MIME type."), required=True, min_length=1, value_type=schema.ASCIIL... | Extended term that describes a content type interface. | 62598f9829b78933be269f7a |
class GSheetsBoolean(GSheetsField[str, bool]): <NEW_LINE> <INDENT> type = "BOOLEAN" <NEW_LINE> db_api_type = "NUMBER" <NEW_LINE> def parse(self, value: Optional[str]) -> Optional[bool]: <NEW_LINE> <INDENT> if value is None or value == "": <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return StringBoolean.strtoboo... | A GSheets boolean.
Booleans in the Google Chart API are return as a string, either "TRUE"
of "FALSE". | 62598f980fa83653e46f4c24 |
class EvaluationTaskAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('task_name', 'task_type', 'task_id') <NEW_LINE> list_filter = ('task_type', 'active') <NEW_LINE> search_fields = ('task_name', 'description') <NEW_LINE> readonly_fields = ('task_id',) <NEW_LINE> actions = (export_task_xml, export_feature_v... | ModelAdmin class for EvaluationTask objects. | 62598f988e7ae83300ee8dd8 |
class TestNodeCLI(): <NEW_LINE> <INDENT> def __init__(self, binary, datadir): <NEW_LINE> <INDENT> self.options = [] <NEW_LINE> self.binary = binary <NEW_LINE> self.datadir = datadir <NEW_LINE> self.input = None <NEW_LINE> self.log = logging.getLogger('TestFramework.deimoscli') <NEW_LINE> <DEDENT> def __call__(self, *op... | Interface to deimos-cli for an individual node | 62598f98596a8972361279ba |
class PosInteger(Typed, NonNegative, Integer2Bytes): <NEW_LINE> <INDENT> ty = int | Positive integer field | 62598f9885dfad0860cbf911 |
class MustacheRendererFactory(object): <NEW_LINE> <INDENT> def __init__(self, info): <NEW_LINE> <INDENT> self.info = info <NEW_LINE> <DEDENT> def __call__(self, value, system): <NEW_LINE> <INDENT> pkg, name = resolve_asset_spec(self.info.name) <NEW_LINE> tpl = os.path.join(package_path(self.info.package), name) <NEW_LI... | Renderer factory for Mustache templates. | 62598f98442bda511e95c1a0 |
class AutoMode(Enum): <NEW_LINE> <INDENT> AUTO_OFF = 'OFF' <NEW_LINE> AUTO_ON = 'ON' | Auto Mode. | 62598f98d99f1b3c44d053eb |
class SetPresetInfoWithData(TestMixins.UnsupportedSetWithDataMixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> PID = 'PRESET_INFO' | Attempt to SET PRESET_INFO with data. | 62598f98f7d966606f747d21 |
class PlayerCommandError(PlayerError): <NEW_LINE> <INDENT> pass | Command error | 62598f9896565a6dacd2ce17 |
class Detector: <NEW_LINE> <INDENT> def __init__(self, debugger=Debugger()): <NEW_LINE> <INDENT> self._debug = debugger <NEW_LINE> self._hough_rho = 1.0 <NEW_LINE> self._hough_theta = math.pi / 2 <NEW_LINE> self._hough_threshold = 80 <NEW_LINE> self._canny_threshold1 = 200 <NEW_LINE> self._canny_threshold2 = 255 <NEW_L... | Detect objects within an image.
Attributes:
lines (list): Collection of detected lines. | 62598f9899cbb53fe6830c0c |
@pytest.mark.django_db <NEW_LINE> class EntryBatchImportViewTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = reverse("td_biblio:import") <NEW_LINE> User = get_user_model() <NEW_LINE> self.fake_password = "fake123" <NEW_LINE> self.superuser = User.objects.create_superuser( "louis", "l... | Tests for the EntryBatchImportView | 62598f98a8ecb03325870f45 |
class Packet(object): <NEW_LINE> <INDENT> def __init__(self,data=None,frame=None): <NEW_LINE> <INDENT> self.data = None <NEW_LINE> if frame: <NEW_LINE> <INDENT> self.load(frame) <NEW_LINE> return <NEW_LINE> <DEDENT> if len(data)>20: <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> <DEDENT> def load(self,frame):... | data layer3 data
frame layer2 data | 62598f982ae34c7f260aae1c |
class TestTestingEnvironment(TestCase): <NEW_LINE> <INDENT> def create_app(self): <NEW_LINE> <INDENT> app.config.from_object('instance.config.TestingEnvironment') <NEW_LINE> return app <NEW_LINE> <DEDENT> def test_app_in_testing(self): <NEW_LINE> <INDENT> self.assertTrue(app.config['DEBUG']) <NEW_LINE> self.assertTrue(... | Test app in testing environment | 62598f98baa26c4b54d4efec |
class ItemsList(AstNode): <NEW_LINE> <INDENT> def __init__(self, items_list=[]): <NEW_LINE> <INDENT> self.list = items_list <NEW_LINE> <DEDENT> def repr(self): <NEW_LINE> <INDENT> return "ItemsList(%s)" % self.get_list_repr(self.list) | Helper node for all constructs, that represent lists of something. Used
to make ast-building rpythnoic, not really used in ast and not compiled.
Nodes, subclassed from this one can be in ast. | 62598f983c8af77a43b67dda |
class Elementwise(Atom): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def shape_from_args(self): <NEW_LINE> <INDENT> return reduce(op.add, [arg._dcp_attr.shape for arg in self.args]) <NEW_LINE> <DEDENT> def validate_arguments(self): <NEW_LINE> <INDENT> shape = self.args[0]._dcp_attr.shape <NEW_LINE> for a... | Abstract base class for elementwise atoms. | 62598f9807f4c71912baf187 |
class Munch(dict): <NEW_LINE> <INDENT> def __getattr__(self, k): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return object.__getattribute__(self, k) <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[k] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise Attr... | A dictionary that provides attribute-style access.
>>> b = Munch()
>>> b.hello = 'world'
>>> b.hello
'world'
>>> b['hello'] += "!"
>>> b.hello
'world!'
>>> b.foo = Munch(lol=True)
>>> b.foo.lol
True
>>> b.foo is b['foo']
True
A Munch is a subclass of dict; it supports all the methods a dict does...
>>> sorted(b.keys... | 62598f98cb5e8a47e493c011 |
class P0fMiddleware: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> enabled = settings.P0FENABLED <NEW_LINE> if not enabled: <NEW_LINE> <INDENT> raise MiddlewareNotUsed <NEW_LINE> <DEDENT> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> try: <NEW_LINE> ... | Adds "p0f" attribute to request. Requires P0FSOCKET setting in Django settings.py | 62598f98925a0f43d25e7d77 |
@implementer(IPurgePaths) <NEW_LINE> @adapter(ITraversable) <NEW_LINE> class TraversablePurgePaths(object): <NEW_LINE> <INDENT> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> def getRelativePaths(self): <NEW_LINE> <INDENT> return ["/" + self.context.virtual_url_path()] <NEW_... | Default purge for OFS.Traversable-style objects
| 62598f98097d151d1a2c0d5f |
class Product(models.Model): <NEW_LINE> <INDENT> contract = models.ForeignKey(Contract) <NEW_LINE> name = models.CharField(max_length=255) | Product | 62598f9815baa72349461cbe |
class V1LocalObjectReference(object): <NEW_LINE> <INDENT> openapi_types = { 'name': 'str' } <NEW_LINE> attribute_map = { 'name': 'name' } <NEW_LINE> def __init__(self, name=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> local_vars_configuration = Confi... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f98f7d966606f747d22 |
class Firebase(base.Group): <NEW_LINE> <INDENT> pass | Work with Google Firebase.
To view all options available for using Firebase Test Lab, run:
$ {command} test --help | 62598f981b99ca400228f3ca |
class UpdateOrganizationApiKeyReqBody(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create(**kwargs): <NEW_LINE> <INDENT> return UpdateOrganizationApiKeyReqBody(**kwargs) <NEW_LINE> <DEDENT> def __init__(self, json=None, **kwargs): <NEW_LINE> <INDENT> if json is None and not kwargs: <NEW_LINE> <INDENT> rais... | auto-generated. don't touch. | 62598f98b7558d589546336a |
class ThrottledSwiftConnection(SwiftConnection): <NEW_LINE> <INDENT> def __init__(self, locks, *args, **kwargs): <NEW_LINE> <INDENT> SwiftConnection.__init__(self, *args, **kwargs) <NEW_LINE> self.locks = locks or [] <NEW_LINE> <DEDENT> def _release_all(self, result): <NEW_LINE> <INDENT> for lock in self.locks: <NEW_LI... | A SwiftConnection that has a list of locks that it needs to acquire
before making requests. Locks can either be a DeferredSemaphore, a
DeferredLock, or anything else that implements
twisted.internet.defer._ConcurrencyPrimitive. Locks are acquired in the
order in the list.
:param locks: list of locks that implement
... | 62598f987047854f4633f11d |
class ChangeThresholdConditionPatch(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'change_percentage': {'key': 'changePercentage', 'type': 'float'}, 'shift_point': {'key': 'shiftPoint', 'type': 'int'}, 'within_range': {'key': 'withinRange', 'type': 'bool'}, 'anomaly_detector_direction': {'key': 'a... | ChangeThresholdConditionPatch.
:param change_percentage: change percentage, value range : [0, +∞).
:type change_percentage: float
:param shift_point: shift point, value range : [1, +∞).
:type shift_point: int
:param within_range: if the withinRange = true, detected data is abnormal when the value falls
in the range, ... | 62598f98a17c0f6771d5bf77 |
class ESDIRK(DIRK): <NEW_LINE> <INDENT> def __init__(self, advancing_table, estimator_table): <NEW_LINE> <INDENT> DIRK.__init__(self, advancing_table, estimator_table) <NEW_LINE> self.lqsolver = class_solvers_sp.solver_lq() <NEW_LINE> <DEDENT> def tstep_frw(self): <NEW_LINE> <INDENT> if callable(self.M): <NEW_LINE> <IN... | Singly diagonally implicit Runge-Kutta with an explicit first stage solver.
The matrix of coefficients defining the method takes the form:
.. math::
\begin{equation}
\begin{array}{c|cccc}
c_1 & 0 & 0 & \cdots & 0 \\
\vdots & a_{21} & a_{22} & \ddots & \vdots \\
... | 62598f98d53ae8145f9181c9 |
class Rip(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "rip" <NEW_LINE> self.a10_url="/axapi/v3/interface/ve/{ifnum}/ipv6/router/rip" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> for keys, value in kwargs.item... | Class Description::
RIP Routing for IPv6.
Class rip supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`
URL for this object::
`https://... | 62598f98be383301e0253538 |
class MatList(list): <NEW_LINE> <INDENT> def __init__(self, fp): <NEW_LINE> <INDENT> f = io.loadmat(fp, squeeze_me=True, struct_as_record=False) <NEW_LINE> for i in range(len(f['cmd'])): <NEW_LINE> <INDENT> self.append(f['cmd'][i]) | imitate matlab cell array, build a list of commands (mat_struct).
an element in the list has fields operator, fn_diary, etc. | 62598f9891f36d47f2230d3d |
class EndUser(OfficeUser, GuestOperator): <NEW_LINE> <INDENT> pass | An **end user** is somebody who uses our database, but won't work
on it. | 62598f98379a373c97d98d50 |
class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ("first_name", "last_name", "username") | An inner class that specifies the meta data of the ModelForm class.
In this case the form's default field configurations have been Overrided.
Attributes
----------
model : obj
Specifies the model class to be used for creating a form.
fields : list
Specifies the fields to be used in the form. | 62598f9863d6d428bbee24fa |
class TransitionChangeBase(type): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> m = type.__new__(cls, name, bases, attrs) <NEW_LINE> transition_change_registry.register(m.name, m) <NEW_LINE> return m | Metaclass for Profile. Register created Profile class
with profile_registry | 62598f98656771135c4893be |
class Task: <NEW_LINE> <INDENT> def __init__(self, name, action, args, kw): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.action = action <NEW_LINE> self.args = args <NEW_LINE> self.kw = kw <NEW_LINE> <DEDENT> def __call__(self, schedulerref): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.execute() <NEW_LINE... | Abstract base class of all scheduler tasks | 62598f9882261d6c5272fd76 |
class Config: <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> TESTING = True <NEW_LINE> REDIS_URL = os.environ['REDIS_URL'] <NEW_LINE> MEDIUM_TOKEN = os.environ['MEDIUM_TOKEN'] <NEW_LINE> MEDIUM_CLIENT_ID = os.environ['MEDIUM_CLIENT_ID'] <NEW_LINE> MEDIUM_CLIENT_SECRET = os.environ['MEDIUM_CLIENT_SECRET'] <NEW_LINE> MEDIUM... | Flask Config. | 62598f9807f4c71912baf188 |
class OmpEnv(dict): <NEW_LINE> <INDENT> _KEYS = [ "OMP_SCHEDULE", "OMP_NUM_THREADS", "OMP_DYNAMIC", "OMP_PROC_BIND", "OMP_NESTED", "OMP_STACKSIZE", "OMP_WAIT_POLICY", "OMP_MAX_ACTIVE_LEVELS", "OMP_THREAD_LIMIT", "OMP_STACKSIZE", "OMP_PROC_BIND", ] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self... | Dictionary with the OpenMP environment variables
see https://computing.llnl.gov/tutorials/openMP/#EnvironmentVariables | 62598f983539df3088ecbff3 |
class TestReportEntryTotal(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 testReportEntryTotal(self): <NEW_LINE> <INDENT> model = swagger_client.models.report_entry_total.ReportEntryTotal() | ReportEntryTotal unit test stubs | 62598f98fff4ab517ebcd52a |
@datadrive.DataDrive(test_data) <NEW_LINE> class Test(TestCase): <NEW_LINE> <INDENT> owner = "czs" <NEW_LINE> timeout = 5 <NEW_LINE> priority = TestCase.EnumPriority.High <NEW_LINE> status = TestCase.EnumStatus.Ready <NEW_LINE> tags = "egs_access_1" <NEW_LINE> def pre_test(self): <NEW_LINE> <INDENT> Test.data = re_test... | 按门禁组添加权限 | 62598f98d99f1b3c44d053ed |
class Message(models.Model): <NEW_LINE> <INDENT> apps = models.ManyToManyField(App) <NEW_LINE> code = models.CharField( unique=True, max_length=20, help_text='最大10个字母', verbose_name='代码', ) <NEW_LINE> en = models.CharField( blank=True, null=True, max_length=500, help_text='最大500个字母', verbose_name='英文', ) <NEW_LINE> zh_... | 信息 | 62598f98bde94217f3707508 |
class PicmaniacImageExtractor(ChronosImageExtractor): <NEW_LINE> <INDENT> category = "picmaniac" <NEW_LINE> pattern = [r"(?:https?://)?((?:www\.)?pic-maniac\.com/([a-z0-9]{12}))"] <NEW_LINE> test = [] | Extractor for single images from pic-maniac.com | 62598f984527f215b58e9c21 |
class ConfigFile(object): <NEW_LINE> <INDENT> instances = {} <NEW_LINE> def __new__(cls, filename): <NEW_LINE> <INDENT> files = [] <NEW_LINE> timestamp = 0 <NEW_LINE> for path in process.configuration.directories: <NEW_LINE> <INDENT> config_file = os.path.realpath(os.path.join(path, filename)) <NEW_LINE> if config_file... | Provide access to a configuration file | 62598f98009cb60464d01262 |
class CrosGenMock(partial_mock.PartialMock): <NEW_LINE> <INDENT> TARGET = 'chromite.scripts.cros_generate_sysroot.GenerateSysroot' <NEW_LINE> ATTRS = ('_InstallToolchain', '_InstallKernelHeaders', '_InstallBuildDependencies') <NEW_LINE> TOOLCHAIN = 'toolchain' <NEW_LINE> KERNEL_HEADERS = 'kernel_headers' <NEW_LINE> BUI... | Helper class to Mock out cros_generate_sysroot.GenerateSysroot. | 62598f9899cbb53fe6830c0e |
class Planet(Sphere): <NEW_LINE> <INDENT> def __init__(self, name, pos, mass, radius): <NEW_LINE> <INDENT> self.name = str(name) <NEW_LINE> self.pos = tuple(pos) <NEW_LINE> self.mass = float(mass) <NEW_LINE> self.radius = float(radius) <NEW_LINE> <DEDENT> def density(self): <NEW_LINE> <INDENT> return self.mass / self.v... | A simple planet. | 62598f98d58c6744b42dc16f |
class OandaError(Exception): <NEW_LINE> <INDENT> def __init__(self, error_response): <NEW_LINE> <INDENT> msg = "OANDA API returned error code %s (%s) " % (error_response['code'], error_response['message']) <NEW_LINE> super(OandaError, self).__init__(msg) | Generic error class, catches oanda response errors
| 62598f98e76e3b2f99fd8772 |
class ForestFire(): <NEW_LINE> <INDENT> def __init__(self, fire, scaler = _scaler, model = _model): <NEW_LINE> <INDENT> self.scaler = scaler <NEW_LINE> self.model = model <NEW_LINE> catagories = self._encode(fire) <NEW_LINE> quantities = self._scale(fire) <NEW_LINE> fire = quantities.join(catagories) <NEW_LINE> self.fi... | ForestFire class takes a fire instance as a pandas.Series object and
predicts the burned area given an input sklearn model and an sklearn
scaler function. The default scaler is a fitted
sklearn.preprocessing.StandardScaler instance. The defualt model is
a trained sklearn.ensemble.GradientBoostingRegressor instance. | 62598f98cc0a2c111447ad49 |
class Binarizer(torch.autograd.Function): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def forward(ctx, inputs): <NEW_LINE> <INDENT> outputs = inputs.clone() <NEW_LINE> outputs[inputs.le(DEFAULT_THRESHOLD)] = 0 <NEW_LINE> outputs[inputs.gt(DEFAULT_THRESHOLD)] = 1 <NEW_LINE> return outputs <NEW_LINE> <DEDENT> @staticmet... | Binarizes {0, 1} a real valued tensor. | 62598f986aa9bd52df0d4c0a |
class Block(base): <NEW_LINE> <INDENT> hash = db.Column(db.String, primary_key=True) <NEW_LINE> height = db.Column(db.Integer, nullable=False) <NEW_LINE> user = db.Column(db.String) <NEW_LINE> found_at = db.Column(db.DateTime, default=datetime.utcnow) <NEW_LINE> time_started = db.Column(db.DateTime, nullable=False) <NE... | This class stores metadata on all blocks found by the pool | 62598f988e71fb1e983bb7f2 |
class EventClickTask: <NEW_LINE> <INDENT> def __init__(self, module_name, event, events_thread, command): <NEW_LINE> <INDENT> self.events_thread = events_thread <NEW_LINE> self.module_name = module_name <NEW_LINE> self.command = command <NEW_LINE> self.event = event <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT... | A task to run an external on_click event | 62598f986fb2d068a7693cd2 |
class AllPairsAverageSetSimilarity(BaseTermSetSim): <NEW_LINE> <INDENT> def __init__(self, term_sim): <NEW_LINE> <INDENT> self.sim = term_sim <NEW_LINE> sim_proxy = term_set_sim.AllPairsAverageSetSimilarity(self.sim.term_sim) <NEW_LINE> super(self.__class__,self).__init__(sim_proxy) | A class to calculate the all pairs average set Similarity
Full details available in ggtk/AllPairsAverageSetSimilarity.hpp | 62598f98460517430c431ef8 |
class FileHelper(): <NEW_LINE> <INDENT> def filenameToMarkdown(self, filename): <NEW_LINE> <INDENT> if filename is None: <NEW_LINE> <INDENT> raise TypeError <NEW_LINE> <DEDENT> return os.path.splitext(filename)[0] + '.md' <NEW_LINE> <DEDENT> def isFileHtml(self, filename): <NEW_LINE> <INDENT> if filename is None: <NEW_... | Helper functions for manipulating files | 62598f980a50d4780f705115 |
class MediumName(Text): <NEW_LINE> <INDENT> max_length = 16 <NEW_LINE> def __init__(self, text, language = None): <NEW_LINE> <INDENT> Text.__init__(self, text, 16, language) | Medium name text, with maximum length of 16 characters | 62598f984428ac0f6e658269 |
class VideoWarningOverlay(object): <NEW_LINE> <INDENT> def __init__(self, drawing_area): <NEW_LINE> <INDENT> self.log = logging.getLogger('VideoWarningOverlay') <NEW_LINE> self.drawing_area = drawing_area <NEW_LINE> self.drawing_area.connect("draw", self.draw_callback) <NEW_LINE> self.text = None <NEW_LINE> self.blink_... | Displays a Warning-Overlay above the Video-Feed
of another VideoDisplay | 62598f98004d5f362081ee9b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.