code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Shubert01(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=2): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self.bounds = zip([-10.0] * self.dimensions, [10.0] * self.dimensions) <NEW_LINE> self.global_optimum = [-7.0835, 4.8580] <NEW_LINE> self.fglob = -186.7309 <NEW_LINE> <DE... | Shubert 1 test objective function.
This class defines the Shubert 1 global optimization problem. This
is a multimodal minimization problem defined as follows:
.. math::
f_{\text{Shubert01}}(\mathbf{x}) = \left( \sum\limits_{i=1}^{5} i\cos[(i+1)x_1 + i] \right) \left( \sum\limits_{i=1}^{5} i\cos[(i+1)x_2 + i] \ri... | 62598faf009cb60464d0153e |
class Document(ABase): <NEW_LINE> <INDENT> __tablename__ = 'document' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> person_id = Column(Integer, ForeignKey('person.id'), nullable=False, index=True) <NEW_LINE> doc_type = Column(Integer, nullable=False) <NEW_LINE> doc_no = Column(String(50), nullable=False)... | Identity document of a person | 62598faf66673b3332c303ea |
class RecipeTypesValidationView(APIView): <NEW_LINE> <INDENT> renderer_classes = (JSONRenderer, BrowsableAPIRenderer) <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> name = rest_util.parse_string(request, u'name') <NEW_LINE> version = rest_util.parse_string(request, u'version') <NEW_LINE> description = rest_uti... | This view is the endpoint for validating a new recipe type before attempting to actually create it
| 62598faf4a966d76dd5eeef5 |
class LangStore(txt.TxtFile): <NEW_LINE> <INDENT> UnitClass = LangUnit <NEW_LINE> Name = "Mozilla .lang" <NEW_LINE> Extensions = ['lang'] <NEW_LINE> def __init__(self, inputfile=None, flavour=None, encoding="utf-8", mark_active=False): <NEW_LINE> <INDENT> self.is_active = False <NEW_LINE> self.mark_active = mark_active... | We extend TxtFile, since that has a lot of useful stuff for encoding | 62598faf30dc7b766599f86b |
class TiebaSpider(): <NEW_LINE> <INDENT> def __init__(self, keywords, page_num): <NEW_LINE> <INDENT> self.keywords = keywords <NEW_LINE> self.page_num = page_num <NEW_LINE> <DEDENT> def get_page_list(self): <NEW_LINE> <INDENT> return [i*50 for i in range(self.page_num)] <NEW_LINE> <DEDENT> def reuest_url(self, page_n, ... | 百度贴吧采集类 | 62598faf99fddb7c1ca62df8 |
class GeoPoint(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/Parse/GeoPoints/GeoPoint') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return GeoPointInputSet() <NEW_LINE> <DEDENT> def _make_result_set(s... | Create a new instance of the GeoPoint Choreography. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied. | 62598faf7d847024c075c3e0 |
class Encoding(object): <NEW_LINE> <INDENT> __slots__ = ('encoding',) <NEW_LINE> def __init__(self, filename): <NEW_LINE> <INDENT> with open(filename, 'rb') as file: <NEW_LINE> <INDENT> _log.debug('Parsing TeX encoding %s', filename) <NEW_LINE> self.encoding = self._parse(file) <NEW_LINE> _log.debug('Result: %s', self.... | Parses a \*.enc file referenced from a psfonts.map style file.
The format this class understands is a very limited subset of
PostScript.
Usage (subject to change)::
for name in Encoding(filename):
whatever(name)
Parameters
----------
filename : string or bytestring
Attributes
----------
encoding : list
... | 62598fafbe8e80087fbbf082 |
class BoolMixin(object): <NEW_LINE> <INDENT> def __add__(self, other): <NEW_LINE> <INDENT> q = self._clone() <NEW_LINE> if isinstance(other, self.__class__): <NEW_LINE> <INDENT> q.must += other.must <NEW_LINE> q.should += other.should <NEW_LINE> q.must_not += other.must_not <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>... | Mixin containing all the operator overrides for Bool queries and filters.
Except for and where should behavior differs | 62598faf7047854f4633f3f8 |
class Solution: <NEW_LINE> <INDENT> def removeElement(self, A, elem): <NEW_LINE> <INDENT> current = 0 <NEW_LINE> for index in xrange(len(A)): <NEW_LINE> <INDENT> if A[index] != elem: <NEW_LINE> <INDENT> A[current] = A[index] <NEW_LINE> current += 1 <NEW_LINE> <DEDENT> <DEDENT> return current | @param A: A list of integers
@param elem: An integer
@return: The new length after remove | 62598faf7d847024c075c3e1 |
class Engine(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def initialize(self, control, state, conf=None): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def reconfigure(self, control, newconf): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> ... | This is the superclass for any implementation of the state object that
is passed to the decision engine. The state object is a way for the
engine to find out relevant information that has been collected by the
EPU Controller.
The abc (abstract base class) module is not present in Python 2.5 but
Engine should be trea... | 62598faf851cf427c66b82da |
class Node(object): <NEW_LINE> <INDENT> def __init__(self, data='start', children=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.children = [] <NEW_LINE> if children is not None: <NEW_LINE> <INDENT> for child in children: <NEW_LINE> <INDENT> self.children.append(child) | Class used for pieces tree.
- For each node a list of children is created.
- Each child is also an instance of the Node class.
- Each node instance contains data which is which is referenced by the .data variable. | 62598fafdd821e528d6d8f53 |
class SDKPackage(MetaPackage): <NEW_LINE> <INDENT> root_env_var = 'CERBERO_SDK_ROOT_%(arch)s' <NEW_LINE> osx_framework_library = None <NEW_LINE> def __init__(self, config, store): <NEW_LINE> <INDENT> MetaPackage.__init__(self, config, store) <NEW_LINE> <DEDENT> def get_root_env_var(self): <NEW_LINE> <INDENT> return (se... | Creates an installer for SDK's.
On Windows the installer will add a new enviroment variable set in
root_env_var as well as a new key in the registry so that other installers
depending on the SDK could use them to set their environment easily and
check wether the requirements are met in the pre-installation step.
On O... | 62598faf3d592f4c4edbaedf |
class Workbook(TimeStampedModel): <NEW_LINE> <INDENT> workbook_title = models.CharField(max_length=128, unique=False) <NEW_LINE> workbook_description = models.CharField(max_length=512, unique=False) <NEW_LINE> workbook_notes = models.TextField(blank=True) <NEW_LINE> user = models.ForeignKey(User, on_delete=models.CASCA... | Base Workbook model for representing a group of samples | 62598fafa17c0f6771d5c254 |
class TwoLayerNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=3*32*32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.params['W1'] = np.random.randn(input_dim, hidden_dim) * weight_scale <NEW_LINE> self.params['b1... | A two-layer fully-connected neural network with ReLU nonlinearity and
softmax loss that uses a modular layer design. We assume an input dimension
of D, a hidden dimension of H, and perform classification over C classes.
The architecure should be affine - relu - affine - softmax.
Note that this class does not implemen... | 62598faf091ae35668704c3e |
class getFamilyInfosByUserId_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, (FamilyInfo, FamilyInfo.thrift_spec), False), None, ), (1, TType.STRUCT, 'ex', (XKCommon.ttypes.HealthServiceException, XKCommon.ttypes.HealthServiceException.thrift_spec), None, ), ) <NEW_LINE> de... | Attributes:
- success
- ex | 62598faf498bea3a75a57b3f |
class ReferenceAPIClient(APIClient): <NEW_LINE> <INDENT> def getCategories(self): <NEW_LINE> <INDENT> request = "reference/categories" <NEW_LINE> response = self.sendRequest(request) <NEW_LINE> if (response is None) or (response['status'] != 200): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> results = json.loads... | A client for the 3taps Reference API.
| 62598faf30bbd72246469988 |
class NamedTupleReader(UnicodeDictReader): <NEW_LINE> <INDENT> def __init__(self, f, **kw): <NEW_LINE> <INDENT> self._cls = None <NEW_LINE> UnicodeDictReader.__init__(self, f, **kw) <NEW_LINE> <DEDENT> @property <NEW_LINE> def cls(self): <NEW_LINE> <INDENT> if self._cls is None: <NEW_LINE> <INDENT> self._cls = namedtup... | Read namedtuple objects from a csv file. | 62598faf66673b3332c303ec |
class SignatureType(object): <NEW_LINE> <INDENT> REGEX_URL = 'REGEX_URL' <NEW_LINE> SNORT = 'SNORT' <NEW_LINE> SURICATA = 'SURICATA' <NEW_LINE> YARA = 'YARA' | Vocabulary for the Threat Indicator Signature Threat Type. | 62598faf97e22403b383af2d |
class asci_sink(gr.sync_block): <NEW_LINE> <INDENT> def __init__(self, vlen, filename): <NEW_LINE> <INDENT> self.vlen = vlen <NEW_LINE> self.filename = filename <NEW_LINE> gr.sync_block.__init__(self, name="asci_sink", in_sig=[(numpy.float32, self.vlen)], out_sig=[]) <NEW_LINE> <DEDENT> def work(self, input_items, outp... | docstring for block asci_sink | 62598faf55399d3f05626543 |
class future_is_full_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), (1, TType.STRUCT, 'e', (ClientException, ClientException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.e = e <NEW... | Attributes:
- success
- e | 62598faf5166f23b2e2433f9 |
class DefaultFormatter(): <NEW_LINE> <INDENT> use_color = False <NEW_LINE> def display(self, content): <NEW_LINE> <INDENT> return pformat(content) | Class to display a variable beautifully | 62598faf4a966d76dd5eeef7 |
class Redshift(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.connection = psycopg2.connect( dbname=config["dbname"], user=config["user"], password=config["password"], host=config["host"], port=config["port"], sslmode="require", ) <NEW_LINE> self.connec... | Redshift psycopg2 interface. | 62598faf99fddb7c1ca62df9 |
class GaussianEncoderBase(EncoderBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(GaussianEncoderBase, self).__init__() <NEW_LINE> <DEDENT> def freeze(self): <NEW_LINE> <INDENT> for param in self.parameters(): <NEW_LINE> <INDENT> param.requires_grad = False <NEW_LINE> <DEDENT> <DEDENT> def forwa... | docstring for EncoderBase | 62598faf0c0af96317c563a1 |
class LayerAllNodesGeojsonList(generics.RetrieveAPIView): <NEW_LINE> <INDENT> model = Layer <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> slug_value = self.kwargs.get('slug', None) <NEW_LINE> layer = Layer.objects.get(slug=slug_value) <NEW_LINE> <DEDENT> except Excepti... | ### GET
Retrieve list of nodes of the specified layer in GeoJSON format. | 62598faf8a43f66fc4bf219a |
class ObjectType(enum.Enum): <NEW_LINE> <INDENT> FIRMWARE = 0b00 <NEW_LINE> CONFIGURATION_PARAMETERS_BLOCK = 0b01 | Object type | 62598faf4e4d562566372446 |
class BuildHttp(Build): <NEW_LINE> <INDENT> def __init__(self, ref): <NEW_LINE> <INDENT> super(BuildHttp, self).__init__(ref=ref, type='http') <NEW_LINE> self.auth = ('user', 'pass') <NEW_LINE> self.http_verify = False <NEW_LINE> self.timeout = None <NEW_LINE> <DEDENT> def _load(self): <NEW_LINE> <INDENT> try: <NEW_LIN... | Build as a Http link | 62598fafa8370b77170f03fb |
class RotateNative2Celestial(_SkyRotation): <NEW_LINE> <INDENT> n_inputs = 2 <NEW_LINE> n_outputs = 2 <NEW_LINE> @property <NEW_LINE> def input_units(self): <NEW_LINE> <INDENT> return {'phi_N': u.deg, 'theta_N': u.deg} <NEW_LINE> <DEDENT> @property <NEW_LINE> def return_units(self): <NEW_LINE> <INDENT> return {'alpha_C... | Transform from Native to Celestial Spherical Coordinates.
Parameters
----------
lon : float or or `~astropy.units.Quantity`
Celestial longitude of the fiducial point.
lat : float or or `~astropy.units.Quantity`
Celestial latitude of the fiducial point.
lon_pole : float or or `~astropy.units.Quantity`
Longi... | 62598faf66656f66f7d5a410 |
class OverdueReportTable(ModelSQL, ModelView): <NEW_LINE> <INDENT> __name__ = 'overdue.report.table' <NEW_LINE> name = fields.Char('Name') | Overdue Report Table | 62598faf6e29344779b0067c |
class SubjectCodeDoesntExist(twc.Validator): <NEW_LINE> <INDENT> msgs = { 'exists': twc._("Subject code already exists."), 'parseerr': twc._("Error parsing session and subject code") } <NEW_LINE> def validate_python(self, value, state): <NEW_LINE> <INDENT> super(SubjectCodeDoesntExist, self).validate_python(value, stat... | Confirm a subject code doesn't exist.
`id`
Name of the sibling field this must match | 62598faffff4ab517ebcd805 |
class Solution: <NEW_LINE> <INDENT> @printTime() <NEW_LINE> def snakesAndLadders(self, board: List[List[int]]) -> int: <NEW_LINE> <INDENT> N = len(board) <NEW_LINE> N2 = N * N <NEW_LINE> step = 0 <NEW_LINE> visit = [False for _ in range(N2)] <NEW_LINE> cur = set() <NEW_LINE> cur.add(0) <NEW_LINE> def getValue(index): <... | BFS | 62598fafaad79263cf42e7f3 |
class ParseResult(object): <NEW_LINE> <INDENT> type = "Unknown" <NEW_LINE> subtype = "Unknown" <NEW_LINE> confidence = 0 <NEW_LINE> result_value = None <NEW_LINE> data = {} <NEW_LINE> def __init__( self, p_type="Unknown", subtype="Unknown", confidence=0, value=None, additional_data=None ): <NEW_LINE> <INDENT> if additi... | Represents a single result from the parsing process | 62598fafe5267d203ee6b92a |
class ChangeType(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> object.__init__(self) <NEW_LINE> self.__name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.__name | Describes the type of change performed. Should be considered an enum. | 62598faf5fcc89381b26615c |
class itkMeshToVTKPolyDataMD3S(ITKCommonBasePython.itkObject): <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): raise AttributeError("No constructor defined") <NEW_LINE> __repr__ = _swig_repr <NEW_... | Proxy of C++ itkMeshToVTKPolyDataMD3S class | 62598faf3d592f4c4edbaee1 |
class Gamble(Vector): <NEW_LINE> <INDENT> def __init__(self, data={}): <NEW_LINE> <INDENT> if isinstance(data, Mapping): <NEW_LINE> <INDENT> Vector.__init__(self, data) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> Vector.__init__(self, {component: 1 for component in data}) <NEW_LINE> <DEDENT> <DEDENT> def __add__(self... | Gambles map states to utility payoffs
This class derives from :class:`~murasyp.vectors.Vector`, so its methods
apply here as well.
What has changed:
* There is a new constructor. If `data` is not a
:class:`~collections.Mapping`, but is a :class:`~collections.Iterable`
:class:`~collections.Hashable` :class:`~coll... | 62598faf99cbb53fe6830ef9 |
class BacteriumAPI(object): <NEW_LINE> <INDENT> def __init__(self, function='bacterium/'): <NEW_LINE> <INDENT> self.function = function <NEW_LINE> <DEDENT> def get_all(self): <NEW_LINE> <INDENT> result_get = GetRest(function = self.function).performRequest() <NEW_LINE> return result_get <NEW_LINE> <DEDENT> def set_bact... | This class manage the requests for the Bacteria objects into the restAPI
:param function: the name of the function to access in the rest API
:type function: string | 62598faf91f36d47f2230eb7 |
class TestRouterMap(TestRouterMapControllers): <NEW_LINE> <INDENT> @property <NEW_LINE> def subject(self): <NEW_LINE> <INDENT> return self.router.add | router.add aliases router.map_controllers | 62598faf4428ac0f6e658546 |
class IntermediateLayerGetter(nn.ModuleDict): <NEW_LINE> <INDENT> _version = 2 <NEW_LINE> __annotations__ = { "return_layers": Dict[str, str], } <NEW_LINE> def __init__(self, model, return_layers): <NEW_LINE> <INDENT> if not set(return_layers).issubset([name for name, _ in model.named_children()]): <NEW_LINE> <INDENT> ... | Module wrapper that returns intermediate layers from a model
It has a strong assumption that the modules have been registered
into the model in the same order as they are used.
This means that one should **not** reuse the same nn.Module
twice in the forward if you want this to work.
Additionally, it is only able to q... | 62598faf4e4d562566372447 |
class GaugeRobustErrgenTable(WorkspaceTable): <NEW_LINE> <INDENT> def __init__(self, ws, gateset, targetGateset, confidenceRegionInfo=None, genType="logGTi"): <NEW_LINE> <INDENT> super(GaugeRobustErrgenTable,self).__init__(ws, self._create, gateset, targetGateset, confidenceRegionInfo, genType) <NEW_LINE> <DEDENT> def ... | Table displaying the first-order gauge invariant ("gauge robust")
linear combinations of standard error generator coefficients for
the gates in a gate set. | 62598fafcc0a2c111447b033 |
class TestUtil(Tester): <NEW_LINE> <INDENT> def test_add_calibration_exposures(self): <NEW_LINE> <INDENT> config = desisurvey.config.Configuration() <NEW_LINE> tiles = desisurvey.tiles.get_tiles() <NEW_LINE> tileID = tiles.tileID[0] <NEW_LINE> exposures = surveysim.exposures.ExposureList() <NEW_LINE> exposures.add(5884... | Test surveysim.util.
| 62598faff7d966606f748006 |
class Container(Segment): <NEW_LINE> <INDENT> def __defaults__(self): <NEW_LINE> <INDENT> self.segments = Process() <NEW_LINE> self.state = State.Container() <NEW_LINE> <DEDENT> def append_segment(self,segment): <NEW_LINE> <INDENT> self.segments.append(segment) <NEW_LINE> return | A container for the segment
Assumptions:
None
Source:
None | 62598fafd58c6744b42dc2e8 |
class Checks(upgradecheck.UpgradeCommands): <NEW_LINE> <INDENT> def _check_placeholder(self): <NEW_LINE> <INDENT> return upgradecheck.Result(upgradecheck.Code.SUCCESS) <NEW_LINE> <DEDENT> _upgrade_checks = ( (_('Placeholder'), _check_placeholder), (_('Policy File JSON to YAML Migration'), (common_checks.check_policy_js... | Various upgrade checks should be added as separate methods in this class
and added to _upgrade_checks tuple. | 62598faf56ac1b37e630220d |
class PSS_SigScheme: <NEW_LINE> <INDENT> def __init__(self, key, mgfunc, saltLen): <NEW_LINE> <INDENT> self._key = key <NEW_LINE> self._saltLen = saltLen <NEW_LINE> self._mgfunc = mgfunc <NEW_LINE> <DEDENT> def can_sign(self): <NEW_LINE> <INDENT> return self._key.has_private() <NEW_LINE> <DEDENT> def sign(self, mhash):... | This signature scheme can perform PKCS#1 PSS RSA signature or verification. | 62598faf4a966d76dd5eeef8 |
class PreciseBNHook(Hook): <NEW_LINE> <INDENT> def __init__(self, dataloader, num_iters=200, interval=1): <NEW_LINE> <INDENT> if not isinstance(dataloader, DataLoader): <NEW_LINE> <INDENT> raise TypeError('dataloader must be a pytorch DataLoader, but got' f' {type(dataloader)}') <NEW_LINE> <DEDENT> self.dataloader = da... | Precise BN hook.
Attributes:
dataloader (DataLoader): A PyTorch dataloader.
num_iters (int): Number of iterations to update the bn stats.
Default: 200.
interval (int): Perform precise bn interval (by epochs). Default: 1. | 62598faf851cf427c66b82dd |
class MachineLearning(Prisoner): <NEW_LINE> <INDENT> def __init__(self, name, agent=False): <NEW_LINE> <INDENT> super(MachineLearning, self).__init__(name) <NEW_LINE> self.agent = agent if agent else QLearning(2) <NEW_LINE> self.last_action = None <NEW_LINE> <DEDENT> def punish(self, state, action, reward, new_state): ... | implement the simplest ML algorithm possible
Non iterative version of the game
It should learn that he should always defect | 62598faf3539df3088ecc2d4 |
class ValidationFailedError(KaitaiStructError): <NEW_LINE> <INDENT> def __init__(self, msg, io, src_path): <NEW_LINE> <INDENT> super(ValidationFailedError, self).__init__("at pos %d: validation failed: %s" % (io.pos(), msg), src_path) <NEW_LINE> self.io = io | Common ancestor for all validation failures. Stores pointer to
KaitaiStream IO object which was involved in an error. | 62598faf7d847024c075c3e4 |
class ListParameter(MessageParameter): <NEW_LINE> <INDENT> type = tuple <NEW_LINE> def __init__(self, iparam, iname="item", length=None): <NEW_LINE> <INDENT> MessageParameter.__init__(self) <NEW_LINE> if not isinstance(iparam, MessageParameter): <NEW_LINE> <INDENT> raise ParameterError("Invalid parameter type: %s", ipa... | A class of list or tuple message parameters. | 62598faf4e4d562566372448 |
class IPublicPage(Interface): <NEW_LINE> <INDENT> pass | Only needed for schema compatibility. This interface should be deleted once
Axiom gains the ability to remove interfaces from existing stores. | 62598fafa8370b77170f03fd |
class Assignment(base.Assignment): <NEW_LINE> <INDENT> implements(ICourseBuilderPortlet) <NEW_LINE> title = _(u'Course Builder Portlet') | Assignment | 62598fafb7558d589546364c |
class StochasticVariableBoundsAnnotation(PySP_Annotation): <NEW_LINE> <INDENT> _ctypes = (Var,) <NEW_LINE> _ctypes_data = (_VarData,) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(StochasticVariableBoundsAnnotation, self).__init__() <NEW_LINE> self._default = (True, True) <NEW_LINE> <DEDENT> def _declare_imp... | This annotation is used to identify variable
bounds that are stochastic.
When calling declare, at most one of the keywords 'lb' or
'ub' can be set to False to disable the annotation for
one of the variable bounds. | 62598faf66656f66f7d5a412 |
class DrinkAction(): <NEW_LINE> <INDENT> def __init__(self, character, potion, effect_factory): <NEW_LINE> <INDENT> self.character = character <NEW_LINE> self.potion = potion <NEW_LINE> self.effect_factory = effect_factory <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> if not self.is_legal(): <NEW_LINE> <IN... | Action for drinking | 62598faf4527f215b58e9ef7 |
class GroupsCoursesList(SecureAPIView): <NEW_LINE> <INDENT> def post(self, request, group_id): <NEW_LINE> <INDENT> response_data = {} <NEW_LINE> try: <NEW_LINE> <INDENT> existing_group = Group.objects.get(id=group_id) <NEW_LINE> <DEDENT> except ObjectDoesNotExist: <NEW_LINE> <INDENT> return Response({}, status.HTTP_404... | ### The GroupsCoursesList view allows clients to interact with the set of Courses related to the specified Group
- URI: ```/api/groups/{group_id}/courses/```
- GET: Returns a JSON representation (array) of the set of related Course entities
- POST: Provides the ability to append to the related Course entity set
* c... | 62598fafbe383301e025381b |
class SCSGateSwitch(SwitchDevice): <NEW_LINE> <INDENT> def __init__(self, scs_id, name, logger): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._scs_id = scs_id <NEW_LINE> self._toggled = False <NEW_LINE> self._logger = logger <NEW_LINE> <DEDENT> @property <NEW_LINE> def scs_id(self): <NEW_LINE> <INDENT> return ... | Representation of a SCSGate switch. | 62598fafbf627c535bcb14c1 |
@attr.s(repr=False) <NEW_LINE> class Link(models__common.Signable): <NEW_LINE> <INDENT> _type = attr.ib("Link", init=False) <NEW_LINE> name = attr.ib("") <NEW_LINE> materials = attr.ib({}) <NEW_LINE> products = attr.ib({}) <NEW_LINE> byproducts = attr.ib({}) <NEW_LINE> command = attr.ib("") <NEW_LINE> return_value = at... | A link is the metadata representation of a supply chain step performed
by a functionary.
Links are recorded, signed and stored to a file when a functionary wraps
a command with toto-run.
Links also contain materials and products which are hashes of the file before
the command was executed and after the command was ex... | 62598faf4428ac0f6e658548 |
class Workflow(Resource): <NEW_LINE> <INDENT> def __init__(self, transport, wf_url): <NEW_LINE> <INDENT> super(Workflow, self).__init__(transport, wf_url) <NEW_LINE> <DEDENT> def is_running(self): <NEW_LINE> <INDENT> status = self.properties['status'] <NEW_LINE> return status not in ('SUCCESSFUL', 'FAILED', ) <NEW_LINE... | wrapper around a UNICORE workflow | 62598faf38b623060ffa90be |
class TwoRings(Structure): <NEW_LINE> <INDENT> __name_prefix__ = "TWORING" <NEW_LINE> ring1 = DefinitionProperty(restriction = RestrictType(RingResonator)) <NEW_LINE> ring2 = DefinitionProperty(restriction = RestrictType(RingResonator)) <NEW_LINE> def get_transformations(self): <NEW_LINE> <INDENT> t1 = Translation((0.0... | structure with two rings defined by the user, which are stacked
vertically, with the bottom one flipped. | 62598faf236d856c2adc944f |
class HandleRefManager(models.Manager): <NEW_LINE> <INDENT> @property <NEW_LINE> def tag(self): <NEW_LINE> <INDENT> return self.prop("tag") <NEW_LINE> <DEDENT> def prop(self, key): <NEW_LINE> <INDENT> return getattr(self.model._handleref, key) <NEW_LINE> <DEDENT> def get_queryset(self): <NEW_LINE> <INDENT> return Handl... | Custom manager to provide handleref querying | 62598faf3317a56b869be55c |
class EthernetMACAddress(object): <NEW_LINE> <INDENT> _STRUCT_ = construct.Array(6, construct.Byte) <NEW_LINE> _MAC_RE_ = re.compile( r'^([0-9A-Fa-f]{2})([:-])' r'([0-9A-Fa-f]{2})\2' r'([0-9A-Fa-f]{2})\2' r'([0-9A-Fa-f]{2})\2' r'([0-9A-Fa-f]{2})\2' r'([0-9A-Fa-f]{2})$' ) <NEW_LINE> def __init__(self, address): <NEW_LIN... | A representation of a MAC (EUI-48) address. | 62598faff7d966606f748008 |
class LicenseContentAdjuster(object): <NEW_LINE> <INDENT> def __init__(self, source_path): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._source_path = source_path <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def create_from_resource_query(source_path, _): <NEW_LINE> <INDENT> return LicenseContentAdjuster(sour... | An implementation of Adjuster for License Content routes. | 62598fafbaa26c4b54d4f2d7 |
class Host: <NEW_LINE> <INDENT> def __init__(self, host_url, auth): <NEW_LINE> <INDENT> self.host_url = host_url <NEW_LINE> self.rancher_auth = auth <NEW_LINE> self.hostname = None <NEW_LINE> self.initilize() <NEW_LINE> <DEDENT> def initilize(self): <NEW_LINE> <INDENT> host_props = r.get(self.host_url, auth=self.ranche... | Class models Hosts in Rancher | 62598faf097d151d1a2c104e |
class MILLIAMPERE( Unit ): <NEW_LINE> <INDENT> standard= AMPERE <NEW_LINE> name= "mA" <NEW_LINE> factor= 1.0E3 | millimpere | 62598faf60cbc95b06364373 |
class ParticipationSetting(models.Model): <NEW_LINE> <INDENT> name = models.CharField(default="Participation Settings", max_length="30", editable=False, help_text="The settings label.") <NEW_LINE> points_50_percent = models.IntegerField( default=5, help_text="The point amount for 50 percent participation." ) <NEW_LINE>... | participation settings models. | 62598faf30bbd7224646998a |
class Player(messages.Enum): <NEW_LINE> <INDENT> LEFT = 0 <NEW_LINE> RIGHT = 1 | two player game side | 62598fafd486a94d0ba2bff2 |
class CRAN(JSONHoster): <NEW_LINE> <INDENT> async def get_versions_from_json(self, data, _, orig_version): <NEW_LINE> <INDENT> res = [] <NEW_LINE> versions = list(set((str(data["latest"]), self.vals["version"], orig_version))) <NEW_LINE> for vers in versions: <NEW_LINE> <INDENT> if vers not in data['versions']: <NEW_LI... | R packages hosted on r-project.org (CRAN) | 62598faf67a9b606de545ff0 |
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') <NEW_LINE> class GetAwardedCertificateProgramsTestCase(TestCase): <NEW_LINE> <INDENT> def make_credential_result(self, **kwargs): <NEW_LINE> <INDENT> result = { 'id': 1, 'username': 'dummy-username', 'credential': { 'credential_id': Non... | Test the get_awarded_certificate_programs function | 62598faf55399d3f05626547 |
class precipitation(basetype): <NEW_LINE> <INDENT> known_units = ['IN', 'CM', 'MM'] <NEW_LINE> def value(self, units): <NEW_LINE> <INDENT> if units.upper() not in precipitation.known_units: <NEW_LINE> <INDENT> raise UnitsError("unrecognized precipitation unit: %s known: %s" % ( units, precipitation.known_units)) <NEW_L... | Precipitation | 62598faf851cf427c66b82df |
class KeyboardTestCase(TestCase, LoaderModuleMockMixin): <NEW_LINE> <INDENT> def setup_loader_modules(self): <NEW_LINE> <INDENT> return {keyboard: {}} <NEW_LINE> <DEDENT> def test_system(self): <NEW_LINE> <INDENT> name = 'salt' <NEW_LINE> ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} <NEW_LINE> moc... | Test cases for salt.states.keyboard | 62598faf85dfad0860cbfa85 |
class Tree: <NEW_LINE> <INDENT> def __init__(self, root, parent=None): <NEW_LINE> <INDENT> self.root = root <NEW_LINE> self.subtrees = [] <NEW_LINE> self.parent = parent <NEW_LINE> <DEDENT> def is_empty(self): <NEW_LINE> <INDENT> return self.root is None <NEW_LINE> <DEDENT> def add_subtree(self, new_tree): <NEW_LINE> <... | A recursive tree data structure, modified by keeping track of each node`s parent.
This version of tree is created specifically for the purposes of controller, it assumes that
values of the tree are tuples with the puzzle state and a string representation of a move.
Also, all of its attributes are public, as they need t... | 62598fafa05bb46b3848a88f |
class TestRequest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.req = Manager() <NEW_LINE> <DEDENT> @mock.patch('onion_py.manager.requests') <NEW_LINE> def test_without_parameters(self, mock_requests): <NEW_LINE> <INDENT> mock_requests.get.return_value = FakeResponse(200) <NEW_LINE> ... | Test case for the Manager object | 62598faf1b99ca400228f542 |
@ENTITY_ADAPTERS.register(camera.DOMAIN) <NEW_LINE> class CameraCapabilities(AlexaEntity): <NEW_LINE> <INDENT> def default_display_categories(self): <NEW_LINE> <INDENT> return [DisplayCategory.CAMERA] <NEW_LINE> <DEDENT> def interfaces(self): <NEW_LINE> <INDENT> if self._check_requirements(): <NEW_LINE> <INDENT> suppor... | Class to represent Camera capabilities. | 62598fafaad79263cf42e7f7 |
class Parameter(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def bstr(cls, arg): <NEW_LINE> <INDENT> if is_unicode(arg): <NEW_LINE> <INDENT> return arg.encode('latin1') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return arg <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def bparameters(cls, parameters):... | Abstract base class for HTTP Parameters
Provides conversion to strings based on the :meth:`to_bytes` method.
In Python 2, also provides conversion to the unicode string type.
In Python 3, implements __bytes__ to enable use of bytes(parameter)
which becomes portable as in Python 2 __str__ is mapped to to_bytes
too.
Th... | 62598faf379a373c97d99038 |
class Trading(Ebay): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Trading, self).__init__(**kwargs) <NEW_LINE> env_file = 'envs.yml' <NEW_LINE> if self.sandbox: <NEW_LINE> <INDENT> domain = 'api.sandbox.ebay.com' <NEW_LINE> certid = kwargs.get('certid', getenv('EBAY_SB_CERT_ID')) <NEW_LIN... | An Ebay Trading API object | 62598fafaad79263cf42e7f8 |
class Command(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( '--path', action='store', dest='path', required=True, help='Import files located in the path into django-filer' ) <NEW_LINE> parser.add_argument( '--folder', action='store', dest='base_folder', defa... | Import directory structure into the filer ::
manage.py --path=/tmp/assets/images
manage.py --path=/tmp/assets/news --folder=images | 62598faf4428ac0f6e65854a |
class AccountInvoice(models.Model): <NEW_LINE> <INDENT> _inherit = 'account.invoice' <NEW_LINE> credit_policy_id = fields.Many2one( 'credit.control.policy', string='Credit Control Policy', help="The Credit Control Policy used for this " "invoice. If nothing is defined, it will " "use the account setting or the partner ... | Check on cancelling of an invoice | 62598faf7b180e01f3e49062 |
class CustomDispatcher(Dispatcher): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CustomDispatcher, self).__init__(["SMALL", "BIG"]) <NEW_LINE> <DEDENT> def dispatch(self, image, polygon): <NEW_LINE> <INDENT> return "BIG" if polygon.area > 1000 else "SMALL" | Dispatch 'BIG' if area is larger 1000, otherwise 'SMALL' | 62598faf460517430c432070 |
class MutableDefaultArgumentValues(object): <NEW_LINE> <INDENT> name = 'mutabledefaults' <NEW_LINE> version = '1.0.0' <NEW_LINE> def __init__(self, tree, filename): <NEW_LINE> <INDENT> self.tree = tree <NEW_LINE> self.filename = filename <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def add_options(cls, parser): <NEW_LIN... | It's 100% perfect, but it will catch the most common cases of using a mutable type as a
default argument value. | 62598faf16aa5153ce400527 |
class MirrorError(BaseException): <NEW_LINE> <INDENT> pass | Raised if the distance from child A to child B is not the same as the
distance from child B to child A. | 62598faf38b623060ffa90c0 |
class WindfieldMap(FilledContourMapFigure): <NEW_LINE> <INDENT> def plot(self, data, xgrid, ygrid, title, lvls, cbarlab, map_kwargs): <NEW_LINE> <INDENT> self.add(data, xgrid, ygrid, title, lvls, cbarlab, map_kwargs) <NEW_LINE> self.cmap = sns.light_palette("orange", as_cmap=True) <NEW_LINE> super(WindfieldMap, self).p... | Plot a wind field using filled contours. Only presents the magnitude of
the wind field, not the direction. | 62598fafbaa26c4b54d4f2d9 |
class MoleculeDepictor(Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(MoleculeDepictor, self).__init__() <NEW_LINE> <DEDENT> def get(self, fmt): <NEW_LINE> <INDENT> args = depictor_arg_parser.parse_args() <NEW_LINE> try: <NEW_LINE> <INDENT> mol = read_molecule_from_string(args['val'], fmt,... | Render a small molecule in 2D | 62598faf4428ac0f6e65854b |
class Logging(object): <NEW_LINE> <INDENT> COLORS = { LOG_ERROR: "red", LOG_WARN: "yellow", LOG_INFO: "blue", LOG_DEBUG: "green", LOG_CACHE: "cyan", LOG_DATA: "magenta", } <NEW_LINE> MAPPING = { 0: LOG_WARN, 1: LOG_INFO, 2: LOG_DEBUG, 3: LOG_CACHE, 4: LOG_DATA, 5: LOG_ALL, } <NEW_LINE> LEVELS = "CRITICAL DEBUG ERROR FA... | Logging Configuration | 62598faf30bbd7224646998b |
class LinearGradientBrush(AbstractGradientBrush): <NEW_LINE> <INDENT> def __init__(self, x1, y1, x2, y2, stops, spreadMethod="pad", transforms=None, units="userSpaceOnUse"): <NEW_LINE> <INDENT> self.x1 = x1 <NEW_LINE> self.y1 = y1 <NEW_LINE> self.x2 = x2 <NEW_LINE> self.y2 = y2 <NEW_LINE> self.stops = stops <NEW_LINE> ... | A Brush representing a linear gradient.
| 62598fafcc40096d6161a1ec |
class MultiSubjectSlot(SlotManager, SubjectSlot): <NEW_LINE> <INDENT> def __init__(self, subject = None, listener = None, event = None, extra_kws = None, extra_args = None, *a, **k): <NEW_LINE> <INDENT> self._original_listener = listener <NEW_LINE> self._slot_subject = None <NEW_LINE> self._nested_slot = None <NEW_LINE... | A subject slot that takes a string describing the path to the event to listen to.
It will make sure that any changes to the elements of this path notify the given
listener and will follow the changing subjects. | 62598faf56b00c62f0fb28db |
class SerializeToJsonError(Error): <NEW_LINE> <INDENT> pass | Thrown if serialization to JSON fails. | 62598faff548e778e596b5ca |
class Primes: <NEW_LINE> <INDENT> __cached_primes = [2, 3] <NEW_LINE> __cached_until = 3 <NEW_LINE> def __init__(self, maximum=0): <NEW_LINE> <INDENT> self.max = maximum <NEW_LINE> if maximum > Primes.__cached_until: <NEW_LINE> <INDENT> Primes.__build_cache(maximum) <NEW_LINE> <DEDENT> <DEDENT> def __iter__(self): <NEW... | Iterator that yields prime numbers using a cache system.
To initialize the static cache, call the constructor with a maximum prime | 62598faf3346ee7daa33765a |
class EncryptionVersionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> FIXED = "Fixed" <NEW_LINE> AUTO_DETECTED = "AutoDetected" | Property of the key if user provided or auto detected
| 62598faf10dbd63aa1c70bd9 |
class Provider(object): <NEW_LINE> <INDENT> PROTO_TCP = 'TCP' <NEW_LINE> PROTO_UDP = 'UDP' <NEW_LINE> def __init__(self, service, domain, protocol=None, refresh_delta=None): <NEW_LINE> <INDENT> self._service = service <NEW_LINE> self._domain = domain <NEW_LINE> self._protocol = self.PROTO_UDP if protocol is None else p... | socket.AF_INET addresses provider based on SRV records
https://en.wikipedia.org/wiki/SRV_record | 62598faf283ffb24f3cf38b2 |
class Step(object): <NEW_LINE> <INDENT> def __init__(self, step_kind, step_name, additional_properties=None): <NEW_LINE> <INDENT> self.step_kind = step_kind <NEW_LINE> self.step_name = step_name <NEW_LINE> self.proto = dataflow.Step(kind=step_kind, name=step_name) <NEW_LINE> self.proto.properties = {} <NEW_LINE> self._... | Wrapper for a dataflow Step protobuf. | 62598faf4a966d76dd5eeefd |
class StatusResource(BaseResource): <NEW_LINE> <INDENT> @policy.ApiEnforcer(policy.GET_SITE_STATUSES) <NEW_LINE> def on_get(self, req, resp, **kwargs): <NEW_LINE> <INDENT> status_filters = req.get_param(name='filters') or None <NEW_LINE> if status_filters: <NEW_LINE> <INDENT> fltrs = status_filters.split(',') <NEW_LINE... | The status resource handles the retrieval of Drydock provisioning
node status and power state | 62598faf1b99ca400228f543 |
class sale_order_line(osv.osv): <NEW_LINE> <INDENT> _inherit = 'sale.order.line' <NEW_LINE> def _weight_net(self, cr, uid, ids, field_name, arg, context): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for line in self.browse(cr, uid, ids, context=context): <NEW_LINE> <INDENT> result[line.id] = 0.0 <NEW_LINE> if line.produ... | Add the net weight to the object "Sale Order Line". | 62598faf66656f66f7d5a416 |
class Restaurant(): <NEW_LINE> <INDENT> def __init__(self, restaurant_name, cuisine_type): <NEW_LINE> <INDENT> self.restaurant_name = restaurant_name <NEW_LINE> self.cuisine_type = cuisine_type <NEW_LINE> <DEDENT> def describe_restaurant(self): <NEW_LINE> <INDENT> string1 = f"Welcome to {self.restaurant_name} serving t... | Class Used to Represent a Restaurant | 62598faf442bda511e95c47e |
class BowtieIndex(Html): <NEW_LINE> <INDENT> MetadataElement(name="base_name", desc="base name for this index set", default='galaxy_generated_bowtie_index', set_in_upload=True, readonly=True) <NEW_LINE> MetadataElement(name="sequence_space", desc="sequence_space for this index set", default='unknown', set_in_upload=Tru... | base class for BowtieIndex
is subclassed by BowtieColorIndex and BowtieBaseIndex | 62598fafac7a0e7691f7252f |
class GpioPhysicalSensor(PhysicalSensor): <NEW_LINE> <INDENT> def __init__(self, broker, gpio_pin=None, **kwargs): <NEW_LINE> <INDENT> super(GpioPhysicalSensor, self).__init__(broker, **kwargs) <NEW_LINE> self._pin = gpio_pin <NEW_LINE> self._GPIO = None <NEW_LINE> <DEDENT> def on_start(self): <NEW_LINE> <INDENT> if se... | This class is specifically designed for use with GPIO sensors attached to a Raspberry Pi. | 62598fafe5267d203ee6b930 |
class MinimaxPlayer(IsolationPlayer): <NEW_LINE> <INDENT> def get_move(self, game, time_left): <NEW_LINE> <INDENT> self.time_left = time_left <NEW_LINE> best_move = (-1, -1) <NEW_LINE> try: <NEW_LINE> <INDENT> return self.minimax(game, self.search_depth) <NEW_LINE> <DEDENT> except SearchTimeout: <NEW_LINE> <INDENT> pas... | Game-playing agent that chooses a move using depth-limited minimax
search. You must finish and test this player to make sure it properly uses
minimax to return a good move before the search time limit expires. | 62598faf2ae34c7f260ab108 |
class VerticalScrolledFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, parent, bg, *args, **kw): <NEW_LINE> <INDENT> Frame.__init__(self, parent, *args, **kw) <NEW_LINE> vscrollbar = Scrollbar(self, orient=VERTICAL) <NEW_LINE> canvas = Canvas(self, bd=0, highlightthickness=0, yscrollcommand=vscrollbar.set,bg=bg) <N... | A pure Tkinter scrollable frame that actually works!
* Use the 'interior' attribute to place widgets inside the scrollable frame
* Construct and pack/place/grid normally
* This frame only allows vertical scrolling | 62598faf99cbb53fe6830eff |
class SchemaDoesNotExist(WWModeException): <NEW_LINE> <INDENT> pass | Exception to be raised when file with schema does not found | 62598faf7047854f4633f401 |
class Task(): <NEW_LINE> <INDENT> def __init__(self, init_pose=None, init_velocities=None, init_angle_velocities=None, runtime=5., target_pos=None): <NEW_LINE> <INDENT> self.sim = PhysicsSim(init_pose, init_velocities, init_angle_velocities, runtime) <NEW_LINE> self.action_repeat = 3 <NEW_LINE> self.state_size = self.a... | Task (environment) that defines the goal and provides feedback to the agent. | 62598faf01c39578d7f12da6 |
class UserLoginForm(forms.Form): <NEW_LINE> <INDENT> username = forms.CharField(label='Usuario') <NEW_LINE> password = forms.CharField(label='Contraseña', widget=forms.PasswordInput) | Used by the user to enter login credentials | 62598faf16aa5153ce400529 |
class ProcessMonitoredQueue(MonitoredQueueBase, ProcessProxy): <NEW_LINE> <INDENT> pass | Run zmq.monitored_queue in a background thread.
See MonitoredQueue and Proxy for details. | 62598faffff4ab517ebcd80c |
class TestCache(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.mock_logger = MagicMock() <NEW_LINE> self.mock_resolver = MagicMock() <NEW_LINE> self.mock_cache = MagicMock() <NEW_LINE> patch("se_dns.dnsutil.logging.getLogger", return_value=self.mock_logger).start() <NEW_LINE> patch("s... | Tests for the dnsutil.Cache class. | 62598faf8e7ae83300ee90c9 |
class SupplyCreatedTracker(object): <NEW_LINE> <INDENT> name = 'SupplyCreatedTracker' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._supply_created = defaultdict(int) <NEW_LINE> self._workers_created = defaultdict(int) <NEW_LINE> self._army_created = defaultdict(int) <NEW_LINE> <DEDENT> def _add_to_workers(se... | Builds ``player.metrics.army_created``, ``player.metrics.workers_created``, and
``player.metrics.supply_created`` arrays made of :class:`~metrics.metric_containers.SupplyCount`.
The ``metrics`` being of the type :class:`~metrics.sc2metric.Sc2MetricAnalyzer`. The supplies
are tracked whenever a unit is created. The uni... | 62598faf7b25080760ed74d6 |
class KernelCenterer(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def fit(self, K, y=None): <NEW_LINE> <INDENT> K = array2d(K) <NEW_LINE> n_samples = K.shape[0] <NEW_LINE> self.K_fit_rows_ = np.sum(K, axis=0) / n_samples <NEW_LINE> self.K_fit_all_ = self.K_fit_rows_.sum() / n_samples <NEW_LINE> return self <NE... | Center a kernel matrix
Let K(x_i, x_j) be a kernel defined by K(x_i, x_j) = phi(x_i)^T phi(x_j),
where phi(x) is a function mapping x to a hilbert space. KernelCenterer is
a class to center (i.e., normalize to have zero-mean) the data without
explicitly computing phi(x). It is equivalent equivalent to centering
phi(x)... | 62598faf9c8ee82313040185 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.