index int64 0 731k | package stringlengths 2 98 ⌀ | name stringlengths 1 76 | docstring stringlengths 0 281k ⌀ | code stringlengths 4 8.19k | signature stringlengths 2 42.8k ⌀ | embed_func_code listlengths 768 768 |
|---|---|---|---|---|---|---|
722,220 | openap.kinematic | descent_vs_post_concas | Get vertical rate after constant CAS descent. | def descent_vs_post_concas(self):
"""Get vertical rate after constant CAS descent."""
return self._get_var("de_vs_avg_after_cas")
| (self) | [
-0.002468584571033716,
-0.006829333025962114,
0.02344110980629921,
0.048887163400650024,
0.05851088464260101,
-0.010768207721412182,
0.014301917515695095,
-0.09850946813821793,
0.02345781773328781,
0.012748087756335735,
-0.005250441376119852,
-0.013224261812865734,
-0.05323120206594467,
-0... |
722,221 | openap.kinematic | finalapp_vcas | Get CAS for final approach. | def finalapp_vcas(self):
"""Get CAS for final approach."""
return self._get_var("fa_va_avg")
| (self) | [
0.01577281393110752,
-0.01836686208844185,
-0.014846963807940483,
0.023304728791117668,
0.05401625484228134,
0.012678305618464947,
-0.00742765236645937,
-0.11450511962175369,
0.07086505740880966,
0.00034745439188554883,
0.0012584469513967633,
0.008411888964474201,
-0.01694055274128914,
-0.... |
722,222 | openap.kinematic | finalapp_vs | Get vertical speed for final approach. | def finalapp_vs(self):
"""Get vertical speed for final approach."""
return self._get_var("fa_vs_avg")
| (self) | [
0.03494010120630264,
-0.024826735258102417,
-0.008324014022946358,
0.010736110620200634,
0.060547344386577606,
0.006563724018633366,
-0.020210126414895058,
-0.04706285521388054,
-0.022119874134659767,
0.03862674906849861,
0.006410114001482725,
-0.017270773649215698,
-0.0030846595764160156,
... |
722,223 | openap.kinematic | initclimb_vcas | Get initial climb CAS. | def initclimb_vcas(self):
"""Get initial climb CAS."""
return self._get_var("ic_va_avg")
| (self) | [
-0.007589579559862614,
-0.013773681595921516,
-0.008466938510537148,
0.017206454649567604,
0.009906488470733166,
0.0209373589605093,
0.00468492554500699,
-0.07087014615535736,
0.09104088693857193,
-0.005634687840938568,
-0.04030739888548851,
0.028433240950107574,
-0.017121274024248123,
-0.... |
722,224 | openap.kinematic | initclimb_vs | Get initial climb vertical rate. | def initclimb_vs(self):
"""Get initial climb vertical rate."""
return self._get_var("ic_vs_avg")
| (self) | [
-0.0011225754860788584,
-0.05056249722838402,
0.0044987741857767105,
0.014021603390574455,
0.009378801099956036,
0.015631334856152534,
0.011895064264535904,
-0.02753487043082714,
0.04310689866542816,
0.03365184739232063,
-0.04602136090397835,
0.015792308375239372,
0.0012401281856000423,
0.... |
722,225 | openap.kinematic | landing_acceleration | Get landing deceleration. | def landing_acceleration(self):
"""Get landing deceleration."""
return self._get_var("ld_acc_brk")
| (self) | [
-0.011317113414406776,
0.012841219082474709,
-0.02556455135345459,
0.04179922118782997,
0.0315094031393528,
0.022617386654019356,
-0.0031576768960803747,
-0.060223210602998734,
-0.08117334544658661,
-0.04567263647913933,
-0.007860510610044003,
-0.06648804247379303,
-0.01874396950006485,
-0... |
722,226 | openap.kinematic | landing_distance | Get breaking distance for landing. | def landing_distance(self):
"""Get breaking distance for landing."""
return self._get_var("ld_d_brk")
| (self) | [
0.011788316071033478,
0.014985578134655952,
-0.028648151084780693,
0.04559279605746269,
-0.023695362731814384,
0.015536830760538578,
0.03039519675076008,
-0.039418771862983704,
-0.10068409144878387,
-0.00742918299511075,
-0.05770338326692581,
-0.04620341211557388,
0.013637131080031395,
-0.... |
722,227 | openap.kinematic | landing_speed | Get landing speed. | def landing_speed(self):
"""Get landing speed."""
return self._get_var("ld_v_app")
| (self) | [
0.0325794592499733,
-0.006007529329508543,
-0.027027497068047523,
0.03457203507423401,
0.03746723011136055,
0.02137335017323494,
-0.005126198288053274,
-0.053407832980155945,
-0.09067068994045258,
0.004768556449562311,
-0.034401729702949524,
-0.027129679918289185,
-0.00042629617382772267,
... |
722,228 | openap.kinematic | takeoff_acceleration | Get takeoff takeoff acceleration. | def takeoff_acceleration(self):
"""Get takeoff takeoff acceleration."""
return self._get_var("to_acc_tof")
| (self) | [
0.0025884045753628016,
0.01933690533041954,
0.011394055560231209,
0.010878066532313824,
0.03261728212237358,
-0.003157261526212096,
0.005210644565522671,
-0.02412460744380951,
-0.03704971447587013,
-0.017797395586967468,
-0.0022627392318099737,
-0.04652361199259758,
0.0013682171702384949,
... |
722,229 | openap.kinematic | takeoff_distance | Get takeoff takeoff distance. | def takeoff_distance(self):
"""Get takeoff takeoff distance."""
return self._get_var("to_d_tof")
| (self) | [
0.03440413624048233,
0.020225461572408676,
0.02446516416966915,
0.01798398047685623,
-0.005369130522012711,
-0.0052735633216798306,
0.022310560569167137,
-0.011728682555258274,
-0.044829633086919785,
0.01251059491187334,
-0.04528140276670456,
-0.03614171966910362,
0.025942109525203705,
0.0... |
722,230 | openap.kinematic | takeoff_speed | Get takeoff speed. | def takeoff_speed(self):
"""Get takeoff speed."""
return self._get_var("to_v_lof")
| (self) | [
0.040286947041749954,
-0.017696619033813477,
-0.01150194089859724,
0.01907512918114662,
0.01900620386004448,
-0.006142984144389629,
0.00008507989696227014,
-0.012096423655748367,
-0.05927592143416405,
-0.004195839166641235,
-0.046145614236593246,
-0.030878618359565735,
0.014078031294047832,
... |
722,246 | jarowinkler | jaro_similarity |
Calculates the jaro similarity
Parameters
----------
s1 : Sequence[Hashable]
First string to compare.
s2 : Sequence[Hashable]
Second string to compare.
processor: callable, optional
Optional callable that is used to preprocess the strings before
comparing them. ... | def jaro_similarity(s1, s2, *, processor=None, score_cutoff=None) -> float:
"""
Calculates the jaro similarity
Parameters
----------
s1 : Sequence[Hashable]
First string to compare.
s2 : Sequence[Hashable]
Second string to compare.
processor: callable, optional
Optio... | (s1, s2, *, processor=None, score_cutoff=None) -> float | [
0.03336724266409874,
0.005348522216081619,
0.030129864811897278,
0.03287050127983093,
0.027132295072078705,
-0.04665932431817055,
-0.05460716784000397,
0.04758428782224655,
0.020691800862550735,
0.04703616350889206,
0.0072027333080768585,
0.06622061133384705,
0.030301155522465706,
0.039636... |
722,247 | jarowinkler | jarowinkler_similarity |
Calculates the jaro winkler similarity
Parameters
----------
s1 : Sequence[Hashable]
First string to compare.
s2 : Sequence[Hashable]
Second string to compare.
prefix_weight : float, optional
Weight used for the common prefix of the two strings.
Has to be betwee... | def jarowinkler_similarity(s1, s2, *, prefix_weight=0.1, processor=None, score_cutoff=None) -> float:
"""
Calculates the jaro winkler similarity
Parameters
----------
s1 : Sequence[Hashable]
First string to compare.
s2 : Sequence[Hashable]
Second string to compare.
prefix_we... | (s1, s2, *, prefix_weight=0.1, processor=None, score_cutoff=None) -> float | [
0.02605156973004341,
0.007945815101265907,
0.019577521830797195,
0.027777982875704765,
0.0033880851697176695,
-0.05227578058838844,
-0.06991972029209137,
0.07458103448152542,
0.048995595425367355,
0.055245209485292435,
0.009995929896831512,
0.051688797771930695,
0.04830503091216087,
0.0307... |
722,249 | notifiers.core | all_providers | Returns a list of all :class:`~notifiers.core.Provider` names | def all_providers() -> list:
"""Returns a list of all :class:`~notifiers.core.Provider` names"""
return list(_all_providers.keys())
| () -> list | [
0.0138778667896986,
-0.03165604919195175,
0.028826052322983742,
-0.013088732957839966,
0.01901176944375038,
0.01349690556526184,
0.028590219095349312,
-0.0703870877623558,
0.0888909101486206,
0.03122066520154476,
-0.02147894725203514,
-0.05964761599898338,
0.003333409084007144,
0.013823444... |
722,252 | notifiers.core | get_notifier |
Convenience method to return an instantiated :class:`~notifiers.core.Provider` object according to it ``name``
:param provider_name: The ``name`` of the requested :class:`~notifiers.core.Provider`
:param strict: Raises a :class:`ValueError` if the given provider string was not found
:return: :class:`P... | def get_notifier(provider_name: str, strict: bool = False) -> Provider:
"""
Convenience method to return an instantiated :class:`~notifiers.core.Provider` object according to it ``name``
:param provider_name: The ``name`` of the requested :class:`~notifiers.core.Provider`
:param strict: Raises a :class... | (provider_name: str, strict: bool = False) -> notifiers.core.Provider | [
0.06163156032562256,
-0.017506422474980354,
0.03243864327669144,
0.039694901555776596,
0.024995850399136543,
-0.015323948115110397,
0.062489625066518784,
-0.01813131757080555,
0.06151963770389557,
0.009387434460222721,
0.011928989551961422,
0.02400720864534378,
-0.015613080002367496,
0.016... |
722,254 | notifiers.core | notify |
Quickly sends a notification without needing to get a notifier via the :func:`get_notifier` method.
:param provider_name: Name of the notifier to use. Note that if this notifier name does not exist it will raise a
:param kwargs: Notification data, dependant on provider
:return: :class:`Response`
:... | def notify(provider_name: str, **kwargs) -> Response:
"""
Quickly sends a notification without needing to get a notifier via the :func:`get_notifier` method.
:param provider_name: Name of the notifier to use. Note that if this notifier name does not exist it will raise a
:param kwargs: Notification dat... | (provider_name: str, **kwargs) -> notifiers.core.Response | [
0.03647942468523979,
-0.03799645975232124,
0.014085502363741398,
0.006059323903173208,
0.035562146455049515,
-0.03686750307679176,
-0.009896013885736465,
0.026936208829283714,
0.026124771684408188,
0.014791101217269897,
0.04685171693563461,
0.007197101134806871,
0.010328192263841629,
-0.03... |
722,257 | 2dwavesim.room | Room | null | class Room:
def __init__(self, ds, width, height,*, walls=[], physics_params={}):
'''Create a 'room' system, with parameters for simulation.
Params:
ds: (float) size of unit step in space
width: (float) width of room, rounded down to nearest multiple of ds
height: (float) height of room, rounded down to n... | (ds, width, height, *, walls=[], physics_params={}) | [
0.07578914612531662,
0.030021408572793007,
-0.04187091812491417,
0.021432502195239067,
-0.057140082120895386,
-0.03487255051732063,
-0.09813620150089264,
-0.005581794772297144,
-0.08036193996667862,
0.0004768508078996092,
-0.039823099970817566,
0.00777872558683157,
-0.03755658119916916,
0.... |
722,258 | 2dwavesim.room | __init__ | Create a 'room' system, with parameters for simulation.
Params:
ds: (float) size of unit step in space
width: (float) width of room, rounded down to nearest multiple of ds
height: (float) height of room, rounded down to nearest multiple of ds
Keyword params:
walls: (Wall) List of wall objects containing... | nit__(self, ds, width, height,*, walls=[], physics_params={}):
ate a 'room' system, with parameters for simulation.
:
float) size of unit step in space
: (float) width of room, rounded down to nearest multiple of ds
t: (float) height of room, rounded down to nearest multiple of ds
d params:
: (Wall) List of wall object... | (self, ds, width, height, *, walls=[], physics_params={}) | [
0.046315014362335205,
0.061215758323669434,
-0.00529852882027626,
-0.020107237622141838,
-0.050206735730171204,
-0.00733204185962677,
-0.11450782418251038,
-0.04217786714434624,
-0.07594119757413864,
0.019108010455965996,
-0.030257273465394974,
0.014813091605901718,
-0.059602972120046616,
... |
722,259 | 2dwavesim.room | add_source_data | Add a source which is based on a list of values. `loc` is the coordinate in the room. | _source_data(self, loc, data):
a source which is based on a list of values. `loc` is the coordinate in the room.'''
nate = namedtuple('Coordinate', 'x y')
oc = Coordinate(int(loc[0] // self.point_spacing), int(loc[1] // self.point_spacing))
ata_sources.append((loc, true_loc, data))
| (self, loc, data) | [
0.0013081921497359872,
-0.02613719180226326,
-0.02874913439154625,
-0.00564143992960453,
-0.01377932820469141,
-0.01189588662236929,
-0.02109098993241787,
0.006254446692764759,
0.003795756259933114,
-0.021997174248099327,
-0.048400890082120895,
-0.010341159068048,
-0.007511555217206478,
0.... |
722,260 | 2dwavesim.room | add_source_func | Add a source which is based on a function in time. `loc` is the coordinate in the room. | _source_func(self, loc, func):
a source which is based on a function in time. `loc` is the coordinate in the room.'''
nate = namedtuple('Coordinate', 'x y')
oc = Coordinate(int(loc[0] // self.point_spacing), int(loc[1] // self.point_spacing))
unc_sources.append((loc, true_loc, func))
| (self, loc, func) | [
-0.01087249256670475,
-0.02124551124870777,
-0.01246010884642601,
0.018480561673641205,
-0.031966377049684525,
-0.019087066873908043,
-0.041991546750068665,
0.035070255398750305,
-0.005467463284730911,
-0.04006500169634819,
-0.05611954256892204,
0.004874337464570999,
0.014012047089636326,
... |
722,261 | 2dwavesim.room | add_walls | null | _walls(self, walls):
alls = self.walls + walls
| (self, walls) | [
-0.02663758583366871,
-0.010209647007286549,
-0.04107841104269028,
0.08736442774534225,
-0.07893633097410202,
-0.01906600221991539,
-0.058688342571258545,
0.0239652618765831,
-0.01721593178808689,
0.03515133634209633,
-0.03458603471517563,
0.013327358290553093,
0.020247992128133774,
0.0562... |
722,262 | 2dwavesim.room | create_mask | Create the wall mask based on all current walls. This uses a modified version of the
Bressenham algorithm for rasterizing the walls to pixels on the grid.
| ate_mask(self):
ate the wall mask based on all current walls. This uses a modified version of the
nham algorithm for rasterizing the walls to pixels on the grid.
essenham_ABC(p0, p1):
1.y - p0.y
(p1.x - p0.x)
1.x * p0.y - p0.x * p1.y
n A,B,C
ll in self.walls:
C = bressenham_ABC(wall.endpoint1, wall.endpoint2)
ne_mask... | (self) | [
0.0474122017621994,
-0.005878306459635496,
0.046044543385505676,
0.00646131532266736,
-0.06014195829629898,
-0.045658793300390244,
-0.0648060292005539,
-0.011563737876713276,
-0.07259117066860199,
0.007802674081176519,
-0.024161988869309425,
0.018603678792715073,
-0.002097516553476453,
0.0... |
722,263 | 2dwavesim.room | get_mask | Return the a 2D numpy array of the wall mask, as currently calculated.
| _mask(self):
turn the a 2D numpy array of the wall mask, as currently calculated.
self.mask_points
| (self) | [
0.036833085119724274,
0.014414777979254723,
0.02933504246175289,
0.021533707156777382,
-0.05978215113282204,
-0.023067014291882515,
-0.04839186742901802,
0.020067796111106873,
-0.007498043589293957,
0.020640680566430092,
-0.02151685766875744,
-0.04829077050089836,
0.0012268568389117718,
-0... |
722,264 | 2dwavesim.room | run | Solve the system using a finite differences solver, and return the solved system.
Make sure the numerical stability is maintained by ensuring (wavespeed)*dt/ds<=1.
`dt` is the time step. `t_final` is the time limit on the simulation.
| (self, dt, t_final):
ve the system using a finite differences solver, and return the solved system.
ure the numerical stability is maintained by ensuring (wavespeed)*dt/ds<=1.
s the time step. `t_final` is the time limit on the simulation.
reate_mask()
onstant = (self.wavespeed * dt / self.point_spacing)**2
onstant = s... | (self, dt, t_final) | [
0.06683967262506485,
0.02446174807846546,
-0.0026439446955919266,
0.03744068741798401,
-0.03983449935913086,
-0.014821051619946957,
-0.07312342524528503,
-0.05064404755830765,
-0.06381000578403473,
0.009093673899769783,
-0.04836244881153107,
-0.022367164492607117,
-0.050307419151067734,
0.... |
722,265 | 2dwavesim.room | Wall | null | class Wall:
def __init__(self, endpoint1, endpoint2, transmission):
Coordinate = namedtuple('Coordinate', 'x y')
self.endpoint1 = Coordinate(endpoint1[0], endpoint1[1])
self.endpoint2 = Coordinate(endpoint2[0], endpoint2[1])
self.transmission = transmission
| (endpoint1, endpoint2, transmission) | [
0.036567386239767075,
-0.00009806815796764567,
-0.01906282640993595,
0.022837301716208458,
-0.07313477247953415,
-0.051942307502031326,
-0.06433920562267303,
0.013859938830137253,
-0.07548948377370834,
0.01684662140905857,
-0.012241070158779621,
0.06430457532405853,
-0.03892210125923157,
0... |
722,266 | 2dwavesim.room | __init__ | null | nit__(self, endpoint1, endpoint2, transmission):
nate = namedtuple('Coordinate', 'x y')
ndpoint1 = Coordinate(endpoint1[0], endpoint1[1])
ndpoint2 = Coordinate(endpoint2[0], endpoint2[1])
ransmission = transmission
| (self, endpoint1, endpoint2, transmission) | [
0.018039776012301445,
-0.007717863656580448,
-0.013047185726463795,
-0.0018452833173796535,
-0.048309605568647385,
-0.05121895670890808,
-0.06134781241416931,
0.007035423070192337,
-0.021658508107066154,
-0.01900058053433895,
-0.03325999528169632,
0.05671440064907074,
-0.03918645158410072,
... |
722,270 | statsmodels.compat.patsy | monkey_patch_cat_dtype | null | def monkey_patch_cat_dtype():
patsy.util.safe_is_pandas_categorical_dtype = (
_safe_is_pandas_categorical_dtype
)
| () | [
-0.04683564230799675,
0.017605362460017204,
0.05120338499546051,
0.03435397520661354,
0.01140652783215046,
-0.008701886981725693,
-0.022880252450704575,
0.027953553944826126,
0.05170735344290733,
-0.04854913800954819,
-0.01997402310371399,
0.0016746512847021222,
0.02755037695169449,
-0.022... |
722,271 | statsmodels | test |
Run the test suite
Parameters
----------
extra_args : list[str]
List of argument to pass to pytest when running the test suite. The
default is ['--tb=short', '--disable-pytest-warnings'].
exit : bool
Flag indicating whether the test runner should exist when finished.
R... | def test(extra_args=None, exit=False):
"""
Run the test suite
Parameters
----------
extra_args : list[str]
List of argument to pass to pytest when running the test suite. The
default is ['--tb=short', '--disable-pytest-warnings'].
exit : bool
Flag indicating whether the ... | (extra_args=None, exit=False) | [
0.002885970752686262,
-0.027856478467583656,
0.009555419906973839,
0.0041838702745735645,
0.02177412062883377,
0.006046367343515158,
-0.025445129722356796,
-0.003900446929037571,
0.027028702199459076,
-0.0017185360193252563,
0.01053615566343069,
0.05240185186266899,
-0.004953162744641304,
... |
722,273 | aiopygismeteo._gismeteo | Gismeteo | Асинхронная обёртка для Gismeteo API. | class Gismeteo:
"""Асинхронная обёртка для Gismeteo API."""
__slots__ = (
"_session",
"_settings",
"current",
"search",
"step3",
"step6",
"step24",
)
def __init__(
self,
*,
lang: Optional[Lang] = None,
session: Opt... | (*, lang: 'Optional[Lang]' = None, session: 'Optional[ClientSession]' = None, token: 'str') -> 'None' | [
0.00660156924277544,
-0.066362664103508,
-0.09905093163251877,
0.007094632368534803,
-0.0004277209809515625,
-0.0073731220327317715,
-0.05964239314198494,
0.030186429619789124,
-0.013367492705583572,
-0.0135501092299819,
0.057377953082323074,
0.035518817603588104,
0.006268294993788004,
0.0... |
722,274 | aiopygismeteo._gismeteo | __init__ | Асинхронная обёртка для Gismeteo API.
Args:
lang:
Язык. По умолчанию "ru".
session:
Экземпляр aiohttp.ClientSession.
По умолчанию для каждого запроса создаётся новый экземпляр.
token:
X-Gismeteo-Token.
... | def __init__(
self,
*,
lang: Optional[Lang] = None,
session: Optional[ClientSession] = None,
token: str,
) -> None:
"""Асинхронная обёртка для Gismeteo API.
Args:
lang:
Язык. По умолчанию "ru".
session:
Экземпляр aiohttp.ClientSession.
По у... | (self, *, lang: Optional[Literal['ru', 'en', 'ua', 'lt', 'lv', 'pl', 'ro']] = None, session: Optional[aiohttp.client.ClientSession] = None, token: str) -> NoneType | [
-0.007338885683566332,
-0.06668239831924438,
-0.07294297218322754,
0.022639984264969826,
-0.015542239882051945,
0.0016004048520699143,
-0.06293333321809769,
0.02640724740922451,
0.01914571039378643,
-0.009891343303024769,
0.06540844589471817,
0.03508833423256874,
0.0070067476481199265,
0.0... |
722,283 | nv.core | create | null | def create(project_dir, environment_name='', project_name=None, use_pew=False, aws_profile=None,
environment_vars=None, password=None, use_keyring=False, python_virtualenv=None, python_bin=None):
project_dir = realpath(project_dir)
_valid_environment_name(environment_name)
nv_dir = join(project_d... | (project_dir, environment_name='', project_name=None, use_pew=False, aws_profile=None, environment_vars=None, password=None, use_keyring=False, python_virtualenv=None, python_bin=None) | [
0.013038761913776398,
-0.0493188202381134,
-0.039588991552591324,
-0.05168234184384346,
-0.03285295143723488,
-0.04033743962645531,
-0.09068045020103455,
-0.023044338449835777,
-0.023556433618068695,
0.004054917022585869,
0.016052251681685448,
-0.0016901643248274922,
-0.02507302723824978,
... |
722,285 | nv.core | launch_shell | null | def launch_shell(project_dir, environment_name='', password=None, update_keyring=False):
return invoke(
command=os.environ['SHELL'], arguments=[],
project_dir=project_dir, environment_name=environment_name,
password=password, update_keyring=update_keyring
)
| (project_dir, environment_name='', password=None, update_keyring=False) | [
0.049104828387498856,
-0.10481789708137512,
-0.032724834978580475,
-0.0567324236035347,
0.05068659037351608,
0.01796175166964531,
0.000781542737968266,
-0.009692667983472347,
-0.0036050924099981785,
0.019613811746239662,
0.03544897586107254,
-0.014183105900883675,
-0.011599565856158733,
0.... |
722,286 | nv.core | remove | null | def remove(project_dir, environment_name=''):
nv_dir, nv_conf = _load_nv(project_dir, environment_name)
venv = nv_conf.get('venv')
if venv:
shutil.rmtree(join(workon_home, venv))
shutil.rmtree(nv_dir)
| (project_dir, environment_name='') | [
0.05234438180923462,
-0.02312474325299263,
-0.058224160224199295,
-0.06489269435405731,
0.023483267053961754,
-0.016823699697852135,
-0.07102343440055847,
-0.02437957376241684,
0.024272017180919647,
0.047145795077085495,
0.009751830250024796,
0.01925269328057766,
-0.01912721060216427,
0.02... |
722,287 | flake8_unused_arguments | FunctionFinder | null | class FunctionFinder(NodeVisitor):
functions: List[FunctionTypes]
def __init__(self, only_top_level: bool = False) -> None:
super().__init__()
self.functions = []
self.only_top_level = only_top_level
def visit_function_types(self, function: FunctionTypes) -> None:
self.func... | (only_top_level: bool = False) -> None | [
-0.009311599656939507,
-0.051746904850006104,
-0.006487318314611912,
-0.04924485832452774,
-0.024394970387220383,
0.06357476860284805,
0.004155864007771015,
-0.04060141742229462,
-0.025304805487394333,
-0.00945849996060133,
-0.0018386263400316238,
0.006302507594227791,
0.014320435002446175,
... |
722,288 | flake8_unused_arguments | __init__ | null | def __init__(self, only_top_level: bool = False) -> None:
super().__init__()
self.functions = []
self.only_top_level = only_top_level
| (self, only_top_level: bool = False) -> NoneType | [
-0.05350131914019585,
-0.005803737323731184,
0.00727838696911931,
-0.012443971820175648,
-0.008619369938969612,
0.024767212569713593,
-0.012202508747577667,
0.020093178376555443,
-0.02863062173128128,
-0.01666957512497902,
-0.007851861417293549,
0.021679934114217758,
-0.023007981479167938,
... |
722,291 | flake8_unused_arguments | visit_function_types | null | def visit_function_types(self, function: FunctionTypes) -> None:
self.functions.append(function)
if self.only_top_level:
return
if isinstance(function, ast.Lambda):
self.visit(function.body)
else:
for obj in function.body:
self.visit(obj)
| (self, function: Union[ast.AsyncFunctionDef, ast.FunctionDef, ast.Lambda]) -> NoneType | [
-0.00526830367743969,
-0.005632111337035894,
0.02707834541797638,
-0.04207274690270424,
-0.021331103518605232,
0.04487268626689911,
-0.023283692076802254,
-0.06229861453175545,
-0.03186771273612976,
0.0150220338255167,
-0.04199906438589096,
-0.019286412745714188,
0.01576806977391243,
-0.02... |
722,300 | flake8_unused_arguments | Plugin | null | class Plugin:
name = "flake8-unused-arguments"
version = "0.0.13"
ignore_abstract = False
ignore_overload = False
ignore_override = False
ignore_stubs = False
ignore_variadic_names = False
ignore_lambdas = False
ignore_nested_functions = False
ignore_dunder_methods = False
... | (tree: ast.Module) | [
-0.01242164708673954,
-0.05080098286271095,
0.02171146310865879,
-0.005235728807747364,
-0.020866060629487038,
-0.012652210891246796,
0.015005887486040592,
0.010951800271868706,
-0.01868530735373497,
-0.04960973188281059,
-0.009746141731739044,
-0.03448856249451637,
-0.0019585948903113604,
... |
722,301 | flake8_unused_arguments | __init__ | null | def __init__(self, tree: ast.Module):
self.tree = tree
| (self, tree: ast.Module) | [
0.01828128844499588,
0.02551550418138504,
0.057737551629543304,
-0.006949102506041527,
-0.05589921027421951,
0.017277009785175323,
0.004855435341596603,
0.0586567223072052,
-0.029515599831938744,
-0.015821656212210655,
0.027949605137109756,
-0.011310908943414688,
-0.010800258256494999,
0.0... |
722,302 | flake8_unused_arguments | run | null | def run(self) -> Iterable[LintResult]:
finder = FunctionFinder(self.ignore_nested_functions)
finder.visit(self.tree)
for function in finder.functions:
decorator_names = set(get_decorator_names(function))
# ignore overload functions, it's not a surprise when they're empty
if self.igno... | (self) -> Iterable[Tuple[int, int, str, str]] | [
-0.016575569286942482,
-0.04015720263123512,
0.010141429491341114,
0.014104043133556843,
-0.04943053424358368,
-0.008359274826943874,
0.019659871235489845,
-0.011530387215316296,
0.017382390797138214,
-0.01323594432324171,
-0.024878673255443573,
0.0023770572151988745,
0.02373482659459114,
... |
722,303 | ast | Store | Store | from ast import Store
| null | [
0.002364503685384989,
0.025371897965669632,
-0.006192449014633894,
0.0047122822143137455,
0.025422072038054466,
-0.0003007895138580352,
-0.03192811459302902,
0.024953771382570267,
0.03515604883432388,
-0.07218530774116516,
0.0007317208219319582,
0.026877151802182198,
-0.05261699855327606,
... |
722,306 | flake8_unused_arguments | get_arguments | Get all of the argument names of the given function. | def get_arguments(function: FunctionTypes) -> List[ast.arg]:
"""Get all of the argument names of the given function."""
args = function.args
ordered_arguments: List[ast.arg] = []
# plain old args
ordered_arguments.extend(args.args)
# *arg name
if args.vararg is not None:
ordered_a... | (function: Union[ast.AsyncFunctionDef, ast.FunctionDef, ast.Lambda]) -> List[ast.arg] | [
-0.03052007220685482,
0.023439878597855568,
0.005990191362798214,
-0.032005563378334045,
0.05262880027294159,
0.04950348287820816,
0.004605984315276146,
-0.0341469831764698,
0.04576081782579422,
-0.018192432820796967,
-0.052165787667036057,
-0.02625652216374874,
-0.04421745240688324,
-0.01... |
722,307 | flake8_unused_arguments | get_decorator_names | null | def get_decorator_names(function: FunctionTypes) -> Iterable[str]:
if isinstance(function, ast.Lambda):
return
for decorator in function.decorator_list:
if isinstance(decorator, ast.Name):
yield decorator.id
elif isinstance(decorator, ast.Attribute):
yield decora... | (function: Union[ast.AsyncFunctionDef, ast.FunctionDef, ast.Lambda]) -> Iterable[str] | [
-0.019393572583794594,
0.0011395596666261554,
0.04354194179177284,
-0.039947766810655594,
0.017053615301847458,
-0.012879129499197006,
0.00043025982449762523,
-0.024635080248117447,
0.03274069353938103,
0.022875431925058365,
-0.0614379420876503,
0.003762652864679694,
0.032366301864385605,
... |
722,308 | flake8_unused_arguments | get_unused_arguments | Generator that yields all of the unused arguments in the given function. | def get_unused_arguments(function: FunctionTypes) -> List[Tuple[int, ast.arg]]:
"""Generator that yields all of the unused arguments in the given function."""
arguments = list(enumerate(get_arguments(function)))
class NameFinder(NodeVisitor):
def visit_Name(self, name: ast.Name) -> None:
... | (function: Union[ast.AsyncFunctionDef, ast.FunctionDef, ast.Lambda]) -> List[Tuple[int, ast.arg]] | [
-0.03638456389307976,
-0.0055418056435883045,
-0.019283078610897064,
-0.011749181896448135,
0.023683244362473488,
0.053578488528728485,
0.014254318550229073,
-0.03294577822089195,
0.04359491914510727,
-0.03956451639533043,
-0.0441865399479866,
-0.01516023464500904,
-0.04633115604519844,
-0... |
722,309 | flake8_unused_arguments | is_dunder_method | null | def is_dunder_method(function: FunctionTypes) -> bool:
if isinstance(function, ast.Lambda):
return False
if not hasattr(function, "name"):
return False
name = function.name
return len(name) > 4 and name.startswith("__") and name.endswith("__")
| (function: Union[ast.AsyncFunctionDef, ast.FunctionDef, ast.Lambda]) -> bool | [
0.02761927619576454,
0.013387077488005161,
0.04959242418408394,
0.01221829280257225,
0.00044222758151590824,
-0.02713378146290779,
0.016210142523050308,
0.007772416807711124,
0.00967393908649683,
0.0244006235152483,
-0.050275713205337524,
-0.006212539039552212,
0.059302326291799545,
-0.029... |
722,310 | flake8_unused_arguments | is_stub_function | null | def is_stub_function(function: FunctionTypes) -> bool:
if isinstance(function, ast.Lambda):
return isinstance(function.body, ast.Ellipsis)
statement = function.body[0]
if isinstance(statement, ast.Expr) and isinstance(statement.value, ast.Str):
if len(function.body) > 1:
# first... | (function: Union[ast.AsyncFunctionDef, ast.FunctionDef, ast.Lambda]) -> bool | [
0.034710485488176346,
-0.05894438549876213,
0.06351203471422195,
-0.00798431783914566,
-0.04897531867027283,
-0.03068660758435726,
-0.0016233721980825067,
0.033024806529283524,
-0.013730126433074474,
0.017400557175278664,
-0.039115000516176224,
0.03170163929462433,
0.004671868402510881,
-0... |
722,312 | first | first |
Return first element of `iterable` that evaluates true, else return None
(or an optional default value).
>>> first([0, False, None, [], (), 42])
42
>>> first([0, False, None, [], ()]) is None
True
>>> first([0, False, None, [], ()], default='ohai')
'ohai'
>>> import re
>>> m... | def first(iterable, default=None, key=None):
"""
Return first element of `iterable` that evaluates true, else return None
(or an optional default value).
>>> first([0, False, None, [], (), 42])
42
>>> first([0, False, None, [], ()]) is None
True
>>> first([0, False, None, [], ()], def... | (iterable, default=None, key=None) | [
0.02105783484876156,
-0.03233816847205162,
-0.018495768308639526,
-0.008433092385530472,
0.032446809113025665,
-0.0030464150477200747,
0.05819422006607056,
-0.005128659773617983,
0.08053761720657349,
-0.04052229970693588,
-0.0014383334200829268,
0.02779344469308853,
0.010384065099060535,
-... |
722,313 | paramz.model | Model | null | class Model(Parameterized):
_fail_count = 0 # Count of failed optimization steps (see objective)
_allowed_failures = 10 # number of allowed failures
def __init__(self, name):
super(Model, self).__init__(name) # Parameterized.__init__(self)
self.optimization_runs = []
self.samplin... | (*args, **kw) | [
0.05755262076854706,
-0.02013726904988289,
-0.03404377028346062,
0.06111891567707062,
-0.00738878920674324,
-0.042098674923181534,
-0.09419937431812286,
-0.039844121783971786,
0.004363074898719788,
-0.04873936250805855,
-0.029186228290200233,
-0.0051163011230528355,
0.001619179849512875,
0... |
722,314 | paramz.core.pickleable | __deepcopy__ | null | def __deepcopy__(self, memo):
s = self.__new__(self.__class__) # fresh instance
memo[id(self)] = s # be sure to break all cycles --> self is already done
import copy
s.__setstate__(copy.deepcopy(self.__getstate__(), memo)) # standard copy
return s
| (self, memo) | [
-0.008759387768805027,
-0.04055817052721977,
0.08472315222024918,
0.00665695033967495,
-0.11453451216220856,
0.001955220475792885,
-0.014519236981868744,
0.023425841704010963,
0.022174499928951263,
-0.0028868254739791155,
-0.046336423605680466,
0.0741235539317131,
-0.032019611448049545,
0.... |
722,315 | paramz.parameterized | __getitem__ | null | def __getitem__(self, name, paramlist=None):
if isinstance(name, (int, slice, tuple, np.ndarray)):
return self.param_array[name]
else:
paramlist = self.grep_param_names(name)
if len(paramlist) < 1: raise AttributeError(name)
if len(paramlist) == 1:
#if isinstance(para... | (self, name, paramlist=None) | [
0.03661400079727173,
-0.052258167415857315,
-0.024964092299342155,
0.0028015258722007275,
0.011067414656281471,
-0.00809946097433567,
-0.017761489376425743,
-0.058582402765750885,
0.03188006952404976,
-0.01864910125732422,
0.006379712373018265,
-0.003837073454633355,
-0.0002081785787595436,
... |
722,316 | paramz.core.pickleable | __getstate__ | null | def __getstate__(self):
ignore_list = ['_param_array_', # parameters get set from bottom to top
'_gradient_array_', # as well as gradients
'_optimizer_copy_',
'logger',
'observers',
'_fixes_', # and fixes
... | (self) | [
-0.00650283508002758,
-0.0477091483771801,
-0.02658771723508835,
0.011081314645707607,
-0.009068642742931843,
0.00016181553655769676,
-0.04346998780965805,
-0.021102838218212128,
0.04625890776515007,
-0.06124471127986908,
-0.03900771215558052,
0.04164789244532585,
-0.028595739975571632,
0.... |
722,317 | paramz.model | __init__ | null | def __init__(self, name):
super(Model, self).__init__(name) # Parameterized.__init__(self)
self.optimization_runs = []
self.sampling_runs = []
self.preferred_optimizer = 'lbfgsb'
#from paramz import Tie
#self.tie = Tie()
#self.link_parameter(self.tie, -1)
self.obj_grads = None
#self... | (self, name) | [
0.028783803805708885,
-0.015245659276843071,
-0.01882956176996231,
0.02835223451256752,
-0.04218121990561485,
-0.018397992476820946,
-0.08068471401929855,
-0.01131462398916483,
-0.027451567351818085,
0.011661755852401257,
-0.03865360841155052,
0.045521192252635956,
-0.027733026072382927,
0... |
722,318 | paramz.parameterized | __setattr__ | null | def __setattr__(self, name, val):
# override the default behaviour, if setting a param, so broadcasting can by used
if hasattr(self, "parameters"):
pnames = self.parameter_names(False, adjust_for_printing=True, recursive=False)
if name in pnames:
param = self.parameters[pnames.index(... | (self, name, val) | [
0.057487573474645615,
0.003999724984169006,
0.032855041325092316,
0.03187533840537071,
-0.028866250067949295,
0.0019069219706580043,
-0.035584211349487305,
-0.01681240275502205,
0.036528926342725754,
-0.014494355767965317,
-0.03575915843248367,
-0.04142744094133377,
0.042896997183561325,
0... |
722,319 | paramz.parameterized | __setitem__ | null | def __setitem__(self, name, value, paramlist=None):
if not self._model_initialized_:
raise AttributeError("""Model is not initialized, this change will only be reflected after initialization if in leaf.
If you are loading a model, set updates off, then initialize, then set the values, then update the model... | (self, name, value, paramlist=None) | [
0.04598713293671608,
-0.0036644856445491314,
-0.04525833576917648,
0.043837178498506546,
-0.051853954792022705,
-0.0038375752046704292,
-0.054659824818372726,
-0.009141855873167515,
0.02257450856268406,
-0.01251710020005703,
-0.019877957180142403,
-0.03833475708961487,
0.03361579403281212,
... |
722,320 | paramz.parameterized | __setstate__ | null | def __setstate__(self, state):
super(Parameterized, self).__setstate__(state)
self._connect_parameters()
self._connect_fixes()
self._notify_parent_change()
self.parameters_changed()
return self
| (self, state) | [
-0.006621093023568392,
-0.031342763453722,
0.03099197894334793,
0.02353776805102825,
-0.03907760605216026,
-0.00007981760427355766,
-0.034938324242830276,
0.0037731460761278868,
0.055389173328876495,
-0.03323701024055481,
-0.03523649275302887,
0.0722619965672493,
-0.015846775844693184,
0.0... |
722,321 | paramz.model | __str__ | null | def __str__(self, VT100=True):
model_details = [['Name', self.name],
['Objective', '{}'.format(float(self.objective_function()))],
["Number of Parameters", '{}'.format(self.size)],
["Number of Optimization Parameters", '{}'.format(self._size_transformed... | (self, VT100=True) | [
0.00488080270588398,
-0.025708602741360664,
-0.003165679518133402,
-0.041527874767780304,
0.020399019122123718,
-0.06210935488343239,
-0.038134120404720306,
-0.07656017690896988,
0.04769502207636833,
-0.04561498016119003,
-0.05794926732778549,
-0.018656525760889053,
-0.03904642164707184,
0... |
722,322 | paramz.core.indexable | _add_io | null | def _add_io(self, name, operations):
self._index_operations[name] = operations
def do_raise(self, x):
self._index_operations.__setitem__(name, x)
self._connect_fixes()
self._notify_parent_change()
#raise AttributeError("Cannot set {name} directly, use the appropriate methods to s... | (self, name, operations) | [
-0.020698919892311096,
-0.04647396132349968,
-0.021590670570731163,
0.032188791781663895,
-0.0041114878840744495,
0.016951849684119225,
-0.019961509853601456,
0.019652826711535454,
0.0053505077958106995,
-0.03362931311130524,
0.046576857566833496,
-0.013719250448048115,
0.05895847827196121,
... |
722,323 | paramz.core.parameter_core | _add_parameter_name | null | def _add_parameter_name(self, param):
try:
pname = adjust_name_for_printing(param.name)
def warn_and_retry(param, match=None):
#===================================================================
# print """
# WARNING: added a parameter with formatted name {},
... | (self, param) | [
0.01601107232272625,
0.025737935677170753,
0.02491825632750988,
0.09362561255693436,
-0.0319310687482357,
-0.020710568875074387,
-0.000904493557754904,
0.009663110598921776,
0.008283316157758236,
-0.026211528107523918,
0.008037412539124489,
-0.039198894053697586,
0.030819948762655258,
-0.0... |
722,324 | paramz.core.indexable | _add_to_index_operations |
Helper preventing copy code.
This adds the given what (transformation, prior etc) to parameter index operations which.
reconstrained are reconstrained indices.
warn when reconstraining parameters if warning is True.
TODO: find out which parameters have changed specifically
... | def _add_to_index_operations(self, which, reconstrained, what, warning):
"""
Helper preventing copy code.
This adds the given what (transformation, prior etc) to parameter index operations which.
reconstrained are reconstrained indices.
warn when reconstraining parameters if warning is True.
TOD... | (self, which, reconstrained, what, warning) | [
0.004709293134510517,
-0.030517632141709328,
0.00894588977098465,
0.016292564570903778,
-0.03216102719306946,
-0.016840361058712006,
-0.00311449496075511,
-0.032620470970869064,
0.03514740616083145,
-0.0629790648818016,
-0.006737028248608112,
-0.009718991816043854,
0.031065430492162704,
-0... |
722,325 | paramz.model | _checkgrad |
Check the gradient of the ,odel by comparing to a numerical
estimate. If the verbose flag is passed, individual
components are tested (and printed)
:param verbose: If True, print a "full" checking of each parameter
:type verbose: bool
:param step: The size of the step ... | def _checkgrad(self, target_param=None, verbose=False, step=1e-6, tolerance=1e-3, df_tolerance=1e-12):
"""
Check the gradient of the ,odel by comparing to a numerical
estimate. If the verbose flag is passed, individual
components are tested (and printed)
:param verbose: If True, print a "full" chec... | (self, target_param=None, verbose=False, step=1e-06, tolerance=0.001, df_tolerance=1e-12) | [
0.026979224756360054,
-0.03108864277601242,
-0.012397737242281437,
0.05058356374502182,
-0.01006509643048048,
-0.01267566904425621,
-0.04605724662542343,
-0.052965834736824036,
-0.05610249191522598,
-0.022294091060757637,
-0.009211449883878231,
-0.00826350413262844,
0.03964496776461601,
-0... |
722,326 | paramz.core.constrainable | _connect_fixes | null | def _connect_fixes(self):
fixed_indices = self.constraints[__fixed__]
if fixed_indices.size > 0:
self._ensure_fixes()
self._fixes_[:] = UNFIXED
self._fixes_[fixed_indices] = FIXED
else:
self._fixes_ = None
del self.constraints[__fixed__]
| (self) | [
-0.023421941325068474,
0.003922545351088047,
-0.006535477004945278,
0.006837695837020874,
-0.04721326008439064,
0.007660401985049248,
-0.007744351401925087,
0.0775022804737091,
0.03922125697135925,
-0.025990799069404602,
-0.03042333759367466,
-0.006451527588069439,
0.033781323581933975,
-0... |
722,327 | paramz.parameterized | _connect_parameters | null | def _connect_parameters(self, ignore_added_names=False):
# connect parameterlist to this parameterized object
# This just sets up the right connection for the params objects
# to be used as parameters
# it also sets the constraints for each parameter to the constraints
# of their respective parents
... | (self, ignore_added_names=False) | [
-0.019845327362418175,
-0.06368964910507202,
-0.024883577600121498,
0.03444087132811546,
-0.06499729305505753,
0.004562309943139553,
-0.02449897862970829,
0.020826054736971855,
0.03949835151433945,
0.004552694968879223,
-0.01393211167305708,
-0.006456461735069752,
0.006321851629763842,
0.0... |
722,328 | paramz.core.indexable | _disconnect_parent |
From Parentable:
disconnect the parent and set the new constraints to constr
| def _disconnect_parent(self, *args, **kw):
"""
From Parentable:
disconnect the parent and set the new constraints to constr
"""
for name, iop in list(self._index_operations.items()):
iopc = iop.copy()
iop.clear()
self.remove_index_operation(name)
self.add_index_operat... | (self, *args, **kw) | [
-0.012004763819277287,
-0.0027539830189198256,
0.010573560371994972,
0.00878672394901514,
-0.11144307255744934,
-0.026993371546268463,
-0.03027212992310524,
0.026230063289403915,
0.07147344946861267,
-0.03231918439269066,
-0.024130964651703835,
-0.034106019884347916,
0.028953686356544495,
... |
722,329 | paramz.core.constrainable | _ensure_fixes | null | def _ensure_fixes(self):
# Ensure that the fixes array is set:
# Parameterized: ones(self.size)
# Param: ones(self._realsize_
if (not hasattr(self, "_fixes_")) or (self._fixes_ is None) or (self._fixes_.size != self.size):
self._fixes_ = np.ones(self.size, dtype=bool)
self._fixes_[self.c... | (self) | [
0.004446764010936022,
0.02924717217683792,
-0.0043828124180436134,
0.002270279685035348,
-0.019884666427969933,
0.005977337248623371,
-0.04529474675655365,
0.03409043699502945,
0.02116369642317295,
-0.012108158320188522,
-0.0017234940314665437,
0.014615058898925781,
0.03171996399760246,
-0... |
722,330 | paramz.parameterized | _format_spec | null | def _format_spec(self, name, names, desc, iops, VT100=True):
nl = max([len(str(x)) for x in names + [name]])
sl = max([len(str(x)) for x in desc + ["value"]])
lls = [reduce(lambda a,b: max(a, len(b)), iops[opname], len(opname)) for opname in iops]
if VT100:
format_spec = [" \033[1m{{name!s:<{0}... | (self, name, names, desc, iops, VT100=True) | [
0.04191653057932854,
-0.039481546729803085,
0.019688595086336136,
-0.049604129046201706,
0.005696126259863377,
-0.0490475594997406,
-0.018940705806016922,
-0.04264702647924423,
0.005013460759073496,
0.015166479162871838,
0.00858767144382,
0.02532384730875492,
-0.020975658670067787,
-0.0479... |
722,331 | paramz.core.constrainable | _get_original | null | def _get_original(self, param):
# if advanced indexing is activated it happens that the array is a copy
# you can retrieve the original param through this method, by passing
# the copy here
return self.parameters[param._parent_index_]
#================================================================... | (self, param) | [
0.049442462623119354,
0.005701641086488962,
-0.008175458759069443,
0.054525651037693024,
-0.04906969889998436,
-0.02397569827735424,
-0.0019358469871804118,
0.005756709259003401,
0.08241540193557739,
-0.021789927035570145,
-0.007942479103803635,
-0.079229936003685,
-0.032752666622400284,
-... |
722,332 | paramz.model | _grads |
Gets the gradients from the likelihood and the priors.
Failures are handled robustly. The algorithm will try several times to
return the gradients, and will raise the original exception if
the objective cannot be computed.
:param x: the parameters of the model.
:type x... | def _grads(self, x):
"""
Gets the gradients from the likelihood and the priors.
Failures are handled robustly. The algorithm will try several times to
return the gradients, and will raise the original exception if
the objective cannot be computed.
:param x: the parameters of the model.
:type... | (self, x) | [
-0.039617493748664856,
-0.023639166727662086,
-0.027305427938699722,
0.08981424570083618,
-0.005221228115260601,
-0.017638174816966057,
-0.055851180106401443,
-0.05136411637067795,
0.01866874098777771,
-0.0025741339195519686,
-0.01973578706383705,
-0.013379111886024475,
0.0015960086602717638... |
722,333 | paramz.core.constrainable | _has_fixes | null | def _has_fixes(self):
return self.constraints[__fixed__].size != 0
| (self) | [
0.04871886223554611,
0.03126632422208786,
-0.019052915275096893,
0.026431499049067497,
-0.013426325283944607,
0.0015972189139574766,
-0.006944796536117792,
0.001974149839952588,
0.004163087345659733,
-0.03362477570772171,
0.01409174595028162,
0.004721113946288824,
0.03503984585404396,
-0.0... |
722,334 | paramz.core.parameter_core | _name_changed | null | def _name_changed(self, param, old_name):
self._remove_parameter_name(None, old_name)
self._add_parameter_name(param)
| (self, param, old_name) | [
0.015590596944093704,
0.022291969507932663,
-0.007691935636103153,
0.04734028875827789,
-0.09364694356918335,
-0.019328895956277847,
-0.012618908658623695,
0.030629925429821014,
0.06777172535657883,
-0.006533407606184483,
-0.02077597752213478,
-0.04933864250779152,
0.040518324822187424,
0.... |
722,335 | paramz.core.parameter_core | _notify_parent_change |
Notify all parameters that the parent has changed
| def _notify_parent_change(self):
"""
Notify all parameters that the parent has changed
"""
for p in self.parameters:
p._parent_changed(self)
| (self) | [
0.029667750000953674,
0.0014687739312648773,
0.004896618891507387,
0.07183966785669327,
-0.09291715919971466,
-0.013512296602129936,
-0.007717681583017111,
0.01374950259923935,
0.11047043651342392,
0.01985756866633892,
-0.021789107471704483,
-0.08058241754770279,
0.044967565685510635,
0.01... |
722,336 | paramz.model | _objective |
The objective function passed to the optimizer. It combines
the likelihood and the priors.
Failures are handled robustly. The algorithm will try several times to
return the objective, and will raise the original exception if
the objective cannot be computed.
:param x: ... | def _objective(self, x):
"""
The objective function passed to the optimizer. It combines
the likelihood and the priors.
Failures are handled robustly. The algorithm will try several times to
return the objective, and will raise the original exception if
the objective cannot be computed.
:par... | (self, x) | [
-0.016664763912558556,
-0.021410716697573662,
-0.0043886578641831875,
0.05623234435915947,
0.0092402258887887,
-0.049544867128133774,
-0.051090896129608154,
-0.05662783980369568,
-0.007509930524975061,
-0.03318571299314499,
-0.011271636933088303,
-0.007950369268655777,
-0.015622093342244625,... |
722,337 | paramz.model | _objective_grads | null | def _objective_grads(self, x):
try:
self.optimizer_array = x
obj_f, self.obj_grads = self.objective_function(), self._transform_gradients(self.objective_function_gradients())
self._fail_count = 0
except (LinAlgError, ZeroDivisionError, ValueError):#pragma: no cover
if self._fail_... | (self, x) | [
-0.04211509972810745,
-0.03508354723453522,
-0.018116913735866547,
0.06760679185390472,
-0.004499079659581184,
-0.038478728383779526,
-0.05406317114830017,
-0.04389617592096329,
-0.013766257092356682,
-0.035936981439590454,
-0.021057549864053726,
0.010964768007397652,
-0.00843693409115076,
... |
722,338 | paramz.core.indexable | _offset_for |
Return the offset of the param inside this parameterized object.
This does not need to account for shaped parameters, as it
basically just sums up the parameter sizes which come before param.
| def _offset_for(self, param):
"""
Return the offset of the param inside this parameterized object.
This does not need to account for shaped parameters, as it
basically just sums up the parameter sizes which come before param.
"""
if param.has_parent():
p = param._parent_._get_original(pa... | (self, param) | [
0.01641521230340004,
-0.016905762255191803,
0.0074036517180502415,
0.06809543073177338,
-0.00664057582616806,
0.007453614845871925,
0.015543126501142979,
-0.04542117565870285,
-0.03203101456165314,
0.023346485570073128,
0.006240869406610727,
-0.04858249053359032,
0.02291044220328331,
-0.02... |
722,339 | paramz.core.parameter_core | _parameters_changed_notification |
In parameterizable we just need to make sure, that the next call to optimizer_array
will update the optimizer_array to the latest parameters
| def _parameters_changed_notification(self, me, which=None):
"""
In parameterizable we just need to make sure, that the next call to optimizer_array
will update the optimizer_array to the latest parameters
"""
self._optimizer_copy_transformed = False # tells the optimizer array to update on next requ... | (self, me, which=None) | [
0.02198367565870285,
-0.008049448020756245,
-0.01773211732506752,
0.06042054668068886,
-0.05768986791372299,
-0.00482189143076539,
-0.06245991215109825,
-0.0035321649629622698,
0.03477292135357857,
-0.005763802211731672,
-0.01883821375668049,
-0.035360537469387054,
0.007440230343490839,
-0... |
722,340 | paramz.core.indexable | _parent_changed |
From Parentable:
Called when the parent changed
update the constraints and priors view, so that
constraining is automized for the parent.
| def _parent_changed(self, parent):
"""
From Parentable:
Called when the parent changed
update the constraints and priors view, so that
constraining is automized for the parent.
"""
from .index_operations import ParameterIndexOperationsView
#if getattr(self, "_in_init_"):
#import ... | (self, parent) | [
0.02462036907672882,
-0.007784768007695675,
-0.023901909589767456,
0.0545678474009037,
-0.07177582383155823,
-0.0006713650072924793,
-0.004945978056639433,
-0.021238353103399277,
0.05278046429157257,
-0.031577154994010925,
-0.022184617817401886,
-0.04500007629394531,
0.04047904163599014,
-... |
722,341 | paramz.core.parameter_core | _pass_through_notify_observers | null | def _pass_through_notify_observers(self, me, which=None):
self.notify_observers(which=which)
| (self, me, which=None) | [
0.026126941666007042,
0.008326935581862926,
0.018288858234882355,
0.05770931765437126,
-0.05573747307062149,
-0.04656839743256569,
0.00952236633747816,
0.09878941625356674,
0.04627262055873871,
0.028509587049484253,
0.004366814158856869,
-0.01344140712171793,
0.03851669654250145,
-0.037267... |
722,342 | paramz.core.parameter_core | _propagate_param_grad |
For propagating the param_array and gradient_array.
This ensures the in memory view of each subsequent array.
1.) connect param_array of children to self.param_array
2.) tell all children to propagate further
| def _propagate_param_grad(self, parray, garray):
"""
For propagating the param_array and gradient_array.
This ensures the in memory view of each subsequent array.
1.) connect param_array of children to self.param_array
2.) tell all children to propagate further
"""
#if self.param_array.size ... | (self, parray, garray) | [
-0.004819109104573727,
-0.03520524874329567,
-0.01986503042280674,
0.08431601524353027,
-0.05032474175095558,
0.0178141500800848,
-0.047197841107845306,
-0.04881647229194641,
0.02111579105257988,
-0.021446874365210533,
-0.000630553753580898,
-0.06205982714891434,
0.05025116726756096,
0.003... |
722,343 | paramz.core.indexable | _raveled_index |
Flattened array of ints, specifying the index of this object.
This has to account for shaped parameters!
| def _raveled_index(self):
"""
Flattened array of ints, specifying the index of this object.
This has to account for shaped parameters!
"""
return np.r_[:self.size]
| (self) | [
-0.019878830760717392,
-0.041910476982593536,
0.005047834012657404,
0.03861180692911148,
0.021580250933766365,
-0.01289953850209713,
-0.00768243009224534,
-0.007734514307230711,
0.03694511204957962,
0.010095668025314808,
-0.03621593117713928,
-0.057501036673784256,
-0.00025350390933454037,
... |
722,344 | paramz.core.indexable | _raveled_index_for |
get the raveled index for a param
that is an int array, containing the indexes for the flattened
param inside this parameterized logic.
!Warning! be sure to call this method on the highest parent of a hierarchy,
as it uses the fixes to do its work
| def _raveled_index_for(self, param):
"""
get the raveled index for a param
that is an int array, containing the indexes for the flattened
param inside this parameterized logic.
!Warning! be sure to call this method on the highest parent of a hierarchy,
as it uses the fixes to do its work
"""... | (self, param) | [
-0.00849407259374857,
-0.021808622404932976,
0.005017595831304789,
0.0672357827425003,
0.015527667477726936,
-0.010456311516463757,
-0.0004967196146026254,
-0.03239933401346207,
-0.028761576861143112,
-0.007266554050147533,
-0.01128959096968174,
-0.031628772616386414,
-0.0020047982688993216,... |
722,345 | paramz.core.indexable | _raveled_index_for_transformed |
get the raveled index for a param for the transformed parameter array
(optimizer array).
that is an int array, containing the indexes for the flattened
param inside this parameterized logic.
!Warning! be sure to call this method on the highest parent of a hierarchy,
as... | def _raveled_index_for_transformed(self, param):
"""
get the raveled index for a param for the transformed parameter array
(optimizer array).
that is an int array, containing the indexes for the flattened
param inside this parameterized logic.
!Warning! be sure to call this method on the highest... | (self, param) | [
-0.005418554879724979,
0.00751577690243721,
0.010249185375869274,
0.06009111553430557,
0.008138800971210003,
-0.02865910902619362,
0.0030997644644230604,
-0.012083157896995544,
-0.001642019604332745,
0.008393275551497936,
-0.017190201207995415,
-0.020779170095920563,
0.012346407398581505,
... |
722,346 | paramz.core.indexable | _remove_from_index_operations |
Helper preventing copy code.
Remove given what (transform prior etc) from which param index ops.
| def _remove_from_index_operations(self, which, transforms):
"""
Helper preventing copy code.
Remove given what (transform prior etc) from which param index ops.
"""
if len(transforms) == 0:
transforms = which.properties()
removed = np.empty((0,), dtype=int)
for t in list(transforms):... | (self, which, transforms) | [
-0.004104527644813061,
-0.02749571017920971,
0.0023728269152343273,
0.000615238503087312,
-0.08615322411060333,
-0.041842829436063766,
-0.006257036235183477,
0.020921414718031883,
0.04780023172497749,
-0.006754955276846886,
-0.007363033480942249,
0.011527047492563725,
0.020251646637916565,
... |
722,347 | paramz.core.parameter_core | _remove_parameter_name | null | def _remove_parameter_name(self, param=None, pname=None):
assert param is None or pname is None, "can only delete either param by name, or the name of a param"
pname = adjust_name_for_printing(pname) or adjust_name_for_printing(param.name)
if pname in self._added_names_:
del self.__dict__[pname]
... | (self, param=None, pname=None) | [
0.016478223726153374,
0.023009901866316795,
-0.002729338826611638,
0.04346504062414169,
-0.054092857986688614,
-0.025206999853253365,
0.0016031140694394708,
0.059577081352472305,
0.04182999208569527,
0.026467349380254745,
-0.022669266909360886,
-0.03309270367026329,
-0.014783564023673534,
... |
722,348 | paramz.model | _repr_html_ | Representation of the model in html for notebook display. | def _repr_html_(self):
"""Representation of the model in html for notebook display."""
model_details = [['<b>Model</b>', self.name + '<br>'],
['<b>Objective</b>', '{}<br>'.format(float(self.objective_function()))],
["<b>Number of Parameters</b>", '{}<br>'.format(self.si... | (self) | [
0.027401242405176163,
-0.05194513499736786,
-0.028518538922071457,
-0.009625235572457314,
0.029086343944072723,
-0.014195161871612072,
-0.0232800655066967,
-0.05088278651237488,
0.015669627115130424,
0.020495982840657234,
-0.01555057056248188,
-0.005705539137125015,
0.009171905927360058,
0... |
722,349 | paramz.core.constrainable | _set_fixed | null | def _set_fixed(self, param, index):
self._ensure_fixes()
offset = self._offset_for(param)
self._fixes_[index+offset] = FIXED
if np.all(self._fixes_): self._fixes_ = None # ==UNFIXED
| (self, param, index) | [
0.03778144344687462,
0.04900365322828293,
-0.016365723684430122,
0.037441376596689224,
-0.030470002442598343,
-0.004342230502516031,
-0.03601309284567833,
0.022784488275647163,
-0.018448634073138237,
0.012276418507099152,
-0.042678408324718475,
-0.0400598905980587,
0.015634579584002495,
-0... |
722,350 | paramz.core.constrainable | _set_unfixed | null | def _set_unfixed(self, param, index):
self._ensure_fixes()
offset = self._offset_for(param)
self._fixes_[index+offset] = UNFIXED
if np.all(self._fixes_): self._fixes_ = None # ==UNFIXED
| (self, param, index) | [
0.030949758365750313,
0.06419458985328674,
-0.003666213247925043,
0.02534707635641098,
-0.04823032021522522,
-0.0216682069003582,
-0.04053507000207901,
-0.008581217378377914,
-0.011222240515053272,
-0.005872691515833139,
-0.03911752626299858,
-0.025228947401046753,
-0.006754438858479261,
-... |
722,351 | paramz.core.parameter_core | _setup_observers |
Setup the default observers
1: parameters_changed_notify
2: pass through to parent, if present
| def _setup_observers(self):
"""
Setup the default observers
1: parameters_changed_notify
2: pass through to parent, if present
"""
self.add_observer(self, self._parameters_changed_notification, -100)
if self.has_parent():
self.add_observer(self._parent_, self._parent_._pass_through_n... | (self) | [
0.015149528160691261,
0.04003104940056801,
0.0191615279763937,
0.017747098580002785,
-0.051132991909980774,
0.002299561398103833,
-0.020104482769966125,
0.05049249529838562,
0.04020896553993225,
0.054015230387449265,
0.0022662021219730377,
-0.014073138125240803,
0.03810955956578255,
0.0020... |
722,352 | paramz.parameterized | _short | null | def _short(self):
return self.hierarchy_name()
| (self) | [
0.00907110795378685,
0.009573685005307198,
0.09227648377418518,
0.01155103836208582,
0.03450481593608856,
-0.022871386259794235,
0.0441279336810112,
0.007283251266926527,
0.04554503783583641,
-0.07639174908399582,
-0.02740282006561756,
-0.02000422403216362,
-0.0018692167941480875,
-0.05378... |
722,353 | paramz.core.parameter_core | _size_transformed |
As fixes are not passed to the optimiser, the size of the model for the optimiser
is the size of all parameters minus the size of the fixes.
| def _size_transformed(self):
"""
As fixes are not passed to the optimiser, the size of the model for the optimiser
is the size of all parameters minus the size of the fixes.
"""
return self.size - self.constraints[__fixed__].size
| (self) | [
0.014418326318264008,
-0.01742621138691902,
0.0010869200341403484,
0.017789997160434723,
-0.0019442557822912931,
0.012262231670320034,
0.011241857893764973,
-0.03744328394532204,
-0.0099641727283597,
-0.006415046285837889,
-0.0045517547987401485,
-0.053378861397504807,
0.004070404451340437,
... |
722,354 | paramz.core.parameter_core | _transform_gradients |
Transform the gradients by multiplying the gradient factor for each
constraint to it.
| def _transform_gradients(self, g):
"""
Transform the gradients by multiplying the gradient factor for each
constraint to it.
"""
#py3 fix
#[np.put(g, i, c.gradfactor(self.param_array[i], g[i])) for c, i in self.constraints.iteritems() if c != __fixed__]
[np.put(g, i, c.gradfactor(self.param_... | (self, g) | [
-0.0053862775675952435,
-0.030851062387228012,
-0.0026320302858948708,
0.03456994891166687,
-0.0613529309630394,
-0.026119519025087357,
-0.02032294124364853,
-0.03547784686088562,
0.009419438429176807,
-0.007931009866297245,
0.01385416928678751,
0.002944120205938816,
0.0007142055546864867,
... |
722,355 | paramz.core.parameter_core | _traverse | null | def _traverse(self, visit, *args, **kwargs):
for c in self.parameters:
c.traverse(visit, *args, **kwargs)
| (self, visit, *args, **kwargs) | [
-0.03450005501508713,
-0.020896511152386665,
-0.04948560148477554,
0.02084655873477459,
-0.07019895315170288,
0.03098677657544613,
-0.019997376948595047,
-0.027390247210860252,
0.041093695908784866,
0.030070994049310684,
0.00981553178280592,
-0.006685218308120966,
0.02514241449534893,
0.01... |
722,356 | paramz.core.parameter_core | _trigger_params_changed |
First tell all children to update,
then update yourself.
If trigger_parent is True, we will tell the parent, otherwise not.
| def _trigger_params_changed(self, trigger_parent=True):
"""
First tell all children to update,
then update yourself.
If trigger_parent is True, we will tell the parent, otherwise not.
"""
[p._trigger_params_changed(trigger_parent=False) for p in self.parameters if not p.is_fixed]
self.notify... | (self, trigger_parent=True) | [
0.07847872376441956,
0.003673418192192912,
-0.002524157054722309,
0.054995834827423096,
-0.07362019270658493,
-0.018759315833449364,
-0.023364795371890068,
0.012222234159708023,
0.03620278090238571,
0.030399538576602936,
-0.034988150000572205,
-0.04706699028611183,
0.03203591704368591,
-0.... |
722,357 | paramz.core.indexable | add_index_operation |
Add index operation with name to the operations given.
raises: attribute error if operations exist.
| def add_index_operation(self, name, operations):
"""
Add index operation with name to the operations given.
raises: attribute error if operations exist.
"""
if name not in self._index_operations:
self._add_io(name, operations)
else:
raise AttributeError("An index operation with t... | (self, name, operations) | [
-0.027614830061793327,
-0.04513208195567131,
-0.003036096226423979,
0.025192776694893837,
-0.00764993904158473,
0.00041788964881561697,
-0.030855607241392136,
-0.026386747136712074,
0.029149934649467468,
-0.01835303194820881,
0.04533676430583,
-0.004146914929151535,
0.0688750371336937,
-0.... |
722,358 | paramz.core.observable | add_observer |
Add an observer `observer` with the callback `callble`
and priority `priority` to this observers list.
| def add_observer(self, observer, callble, priority=0):
"""
Add an observer `observer` with the callback `callble`
and priority `priority` to this observers list.
"""
self.observers.add(priority, observer, callble)
| (self, observer, callble, priority=0) | [
-0.04610176384449005,
0.03130194917321205,
-0.04912425950169563,
0.0058061471208930016,
0.016163410618901253,
-0.024475276470184326,
-0.00959729589521885,
0.06788458675146103,
-0.01954200677573681,
0.007994852028787136,
0.03133669123053551,
-0.011273565702140331,
0.028835315257310867,
-0.0... |
722,359 | paramz.parameterized | build_pydot |
Build a pydot representation of this model. This needs pydot installed.
Example Usage::
np.random.seed(1000)
X = np.random.normal(0,1,(20,2))
beta = np.random.uniform(0,1,(2,1))
Y = X.dot(beta)
m = RidgeRegression(X, Y)
G = m.bui... | def build_pydot(self, G=None): # pragma: no cover
"""
Build a pydot representation of this model. This needs pydot installed.
Example Usage::
np.random.seed(1000)
X = np.random.normal(0,1,(20,2))
beta = np.random.uniform(0,1,(2,1))
Y = X.dot(beta)
m = RidgeRegression(... | (self, G=None) | [
0.057061269879341125,
-0.08420837670564651,
0.07325231283903122,
0.036532673984766006,
-0.044385142624378204,
-0.030998554080724716,
-0.05956657975912094,
-0.021482110023498535,
0.07022350281476974,
-0.011030848138034344,
0.002446885220706463,
-0.026997534558176994,
-0.008156283758580685,
... |
722,360 | paramz.core.observable | change_priority | null | def change_priority(self, observer, callble, priority):
self.remove_observer(observer, callble)
self.add_observer(observer, callble, priority)
| (self, observer, callble, priority) | [
-0.03435058891773224,
0.08113788068294525,
-0.05197479948401451,
-0.004135870840400457,
0.003107098862528801,
-0.05709579959511757,
0.005274793598800898,
0.0585256852209568,
0.017856985330581665,
-0.013276352547109127,
0.004518282599747181,
-0.021215561777353287,
-0.0017686561914160848,
-0... |
722,361 | paramz.core.gradcheckable | checkgrad |
Check the gradient of this parameter with respect to the highest parent's
objective function.
This is a three point estimate of the gradient, wiggling at the parameters
with a stepsize step.
The check passes if either the ratio or the difference between numerical and
ana... | def checkgrad(self, verbose=0, step=1e-6, tolerance=1e-3, df_tolerance=1e-12):
"""
Check the gradient of this parameter with respect to the highest parent's
objective function.
This is a three point estimate of the gradient, wiggling at the parameters
with a stepsize step.
The check passes if ei... | (self, verbose=0, step=1e-06, tolerance=0.001, df_tolerance=1e-12) | [
0.013819507323205471,
0.0119874756783247,
0.007759710308164358,
0.06693961471319199,
-0.04104455187916756,
0.025806982070207596,
-0.01891924813389778,
-0.016021467745304108,
0.029611971229314804,
-0.029048269614577293,
0.010965765453875065,
-0.017113640904426575,
0.03678155690431595,
-0.03... |
722,362 | paramz.core.constrainable | constrain |
:param transform: the :py:class:`paramz.transformations.Transformation`
to constrain the this parameter to.
:param warning: print a warning if re-constraining parameters.
Constrain the parameter to the given
:py:class:`paramz.transformations.Transformation`.
... | def constrain(self, transform, warning=True, trigger_parent=True):
"""
:param transform: the :py:class:`paramz.transformations.Transformation`
to constrain the this parameter to.
:param warning: print a warning if re-constraining parameters.
Constrain the parameter to the given
... | (self, transform, warning=True, trigger_parent=True) | [
0.06895928084850311,
0.0006094718119129539,
0.024701567366719246,
0.03021830879151821,
-0.019715281203389168,
-0.04650330916047096,
0.0143134705722332,
-0.0016101548681035638,
-0.00981343537569046,
-0.017858684062957764,
-0.04130483791232109,
-0.016178907826542854,
-0.011944100260734558,
-... |
722,363 | paramz.core.constrainable | constrain_bounded |
:param lower, upper: the limits to bound this parameter to
:param warning: print a warning if re-constraining parameters.
Constrain this parameter to lie within the given range.
| def constrain_bounded(self, lower, upper, warning=True, trigger_parent=True):
"""
:param lower, upper: the limits to bound this parameter to
:param warning: print a warning if re-constraining parameters.
Constrain this parameter to lie within the given range.
"""
self.constrain(Logistic(lower, u... | (self, lower, upper, warning=True, trigger_parent=True) | [
-0.007507176138460636,
0.01891505718231201,
-0.00477920426055789,
0.028397805988788605,
-0.02589261159300804,
-0.04664032906293869,
-0.02464842051267624,
-0.03513997420668602,
-0.03594701737165451,
-0.059283994138240814,
-0.025388211011886597,
0.008827026933431625,
-0.005220555700361729,
-... |
722,364 | paramz.core.constrainable | constrain_fixed |
Constrain this parameter to be fixed to the current value it carries.
This does not override the previous constraints, so unfixing will
restore the constraint set before fixing.
:param warning: print a warning for overwriting constraints.
| def constrain_fixed(self, value=None, warning=True, trigger_parent=True):
"""
Constrain this parameter to be fixed to the current value it carries.
This does not override the previous constraints, so unfixing will
restore the constraint set before fixing.
:param warning: print a warning for overwrit... | (self, value=None, warning=True, trigger_parent=True) | [
0.06501882523298264,
0.01809568516910076,
-0.005605823360383511,
0.014509703032672405,
-0.034446366131305695,
-0.0388786755502224,
0.004955809563398361,
-0.00009154451254289597,
0.018235284835100174,
-0.05618910863995552,
-0.05430450290441513,
-0.016080206260085106,
-0.012633823789656162,
... |
722,365 | paramz.core.constrainable | constrain_negative |
:param warning: print a warning if re-constraining parameters.
Constrain this parameter to the default negative constraint.
| def constrain_negative(self, warning=True, trigger_parent=True):
"""
:param warning: print a warning if re-constraining parameters.
Constrain this parameter to the default negative constraint.
"""
self.constrain(NegativeLogexp(), warning=warning, trigger_parent=trigger_parent)
| (self, warning=True, trigger_parent=True) | [
0.03716304153203964,
-0.008659187704324722,
0.06907405704259872,
0.040952473878860474,
-0.05215457081794739,
-0.06059769541025162,
0.0016028223326429725,
0.018315594643354416,
0.032575830817222595,
-0.07306293398141861,
-0.04361172765493393,
0.005588583182543516,
-0.0012018571142107248,
-0... |
722,366 | paramz.core.constrainable | constrain_positive |
:param warning: print a warning if re-constraining parameters.
Constrain this parameter to the default positive constraint.
| def constrain_positive(self, warning=True, trigger_parent=True):
"""
:param warning: print a warning if re-constraining parameters.
Constrain this parameter to the default positive constraint.
"""
self.constrain(Logexp(), warning=warning, trigger_parent=trigger_parent)
| (self, warning=True, trigger_parent=True) | [
0.00951834861189127,
-0.015718070790171623,
0.06604231148958206,
0.061320286244153976,
-0.00697571923956275,
-0.03764411807060242,
0.022702045738697052,
0.01444675587117672,
0.02801845222711563,
-0.06746222078800201,
-0.03807339444756508,
-0.012292125262320042,
0.01872299611568451,
-0.0073... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.