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 |
|---|---|---|---|---|---|---|
721,588 | pydal.objects | __radd__ | null | def __radd__(self, other):
if not hasattr(other, "type"):
if isinstance(other, str):
other = self._dialect.quote(other)
other = Expression(self.db, other, type=self.type)
return Expression(self.db, self._dialect.add, other, self, self.type)
| (self, other) | [
-0.0651630237698555,
-0.053015727549791336,
0.06361887603998184,
0.08612911403179169,
-0.010465888306498528,
-0.05744228512048721,
-0.024895088747143745,
0.034588903188705444,
0.028738299384713173,
-0.047662682831287384,
0.040079206228256226,
-0.0028309370391070843,
0.023333784192800522,
0... |
721,589 | pydal.objects | __str__ | null | def __str__(self):
if self._table:
return "%s.%s" % (self.tablename, self.name)
return "<no table>.%s" % self.name
| (self) | [
0.018064450472593307,
0.0038798886816948652,
0.04058031365275383,
-0.02632889524102211,
0.033523619174957275,
-0.05886906012892723,
0.04109792038798332,
-0.006064617540687323,
0.033627141267061234,
-0.06621906906366348,
-0.04444510489702225,
0.008553439751267433,
-0.03999369591474533,
0.00... |
721,590 | pydal.objects | __sub__ | null | def __sub__(self, other):
if self.type in ("integer", "bigint"):
result_type = "integer"
elif self.type in ["date", "time", "datetime", "double", "float"]:
result_type = "double"
elif self.type.startswith("decimal("):
result_type = self.type
else:
raise SyntaxError("subtr... | (self, other) | [
-0.00553956488147378,
-0.04929905757308006,
0.06947482377290726,
0.040491893887519836,
-0.03157946839928627,
-0.059404484927654266,
-0.025386381894350052,
0.0007127310382202268,
0.0033860206604003906,
-0.049825381487607956,
0.042807720601558685,
-0.010561577044427395,
0.021824920549988747,
... |
721,592 | pydal.objects | abs | null | def abs(self):
return Expression(self.db, self._dialect.aggregate, self, "ABS", self.type)
| (self) | [
0.04766475781798363,
-0.03971515968441963,
0.09716909378767014,
0.050227027386426926,
0.030385874211788177,
-0.053479138761758804,
-0.01956193335354328,
-0.06392531096935272,
-0.02108943834900856,
0.0131480498239398,
0.002997525269165635,
0.02524491213262081,
0.06839285045862198,
0.0132958... |
721,593 | pydal.objects | as_dict | null | def as_dict(self, flat=False, sanitize=True):
attrs = (
"name",
"authorize",
"represent",
"ondelete",
"onupdate",
"custom_store",
"autodelete",
"custom_retrieve",
"filter_out",
"uploadseparate",
"widget",
"uploadfs",
... | (self, flat=False, sanitize=True) | [
0.029056929051876068,
0.0007169607561081648,
0.01790582202374935,
-0.039790716022253036,
-0.01379088032990694,
-0.06521795690059662,
0.013431793078780174,
-0.007608761545270681,
-0.0037364454474300146,
-0.007977553643286228,
-0.0004603834531735629,
0.04309043288230896,
0.018342548981308937,
... |
721,597 | pydal.objects | avg | null | def avg(self):
return Expression(self.db, self._dialect.aggregate, self, "AVG", self.type)
| (self) | [
0.04291362315416336,
-0.056036245077848434,
0.08715276420116425,
0.06392307579517365,
0.07694628089666367,
-0.0460948646068573,
-0.0071412245742976665,
-0.08529704064130783,
0.009038371033966541,
0.052490487694740295,
0.03959983214735985,
-0.02301429584622383,
0.026245243847370148,
0.01634... |
721,598 | pydal.objects | belongs |
Accepts the following inputs::
field.belongs(1, 2)
field.belongs((1, 2))
field.belongs(query)
Does NOT accept:
field.belongs(1)
If the set you want back includes `None` values, you can do::
field.belongs((1, None), null=True)
... | def belongs(self, *value, **kwattr):
"""
Accepts the following inputs::
field.belongs(1, 2)
field.belongs((1, 2))
field.belongs(query)
Does NOT accept:
field.belongs(1)
If the set you want back includes `None` values, you can do::
field.belongs((1, None), null=Tru... | (self, *value, **kwattr) | [
-0.03871523216366768,
0.006413119845092297,
0.009192138910293579,
0.07670273631811142,
-0.04020708054304123,
0.017947640269994736,
0.005194172263145447,
0.030528271570801735,
0.024287987500429153,
-0.007709389086812735,
-0.0356951542198658,
0.0043208966962993145,
0.05352453514933586,
0.019... |
721,599 | pydal.objects | bind | null | def bind(self, table):
if self._table is not None:
raise ValueError("Field %s is already bound to a table" % self.longname)
self.db = self._db = table._db
self.table = self._table = table
self.tablename = self._tablename = table._tablename
if self._db and self._rname is None:
self._r... | (self, table) | [
0.0075719403102993965,
0.004657017532736063,
0.019185906276106834,
0.022862138226628304,
-0.03036092035472393,
0.020301578566432,
0.05047960206866264,
0.04393188655376434,
0.004625010769814253,
-0.046785078942775726,
-0.07103723287582397,
0.02721508964896202,
-0.006268798373639584,
0.06456... |
721,600 | pydal.objects | cast | null | def cast(self, cast_as, **kwargs):
return Expression(
self.db,
self._dialect.cast,
self,
self._dialect.types[cast_as] % kwargs,
cast_as,
)
| (self, cast_as, **kwargs) | [
-0.013726871460676193,
-0.03542856499552727,
0.08463490009307861,
0.015406674705445766,
-0.015949640423059464,
0.00787301454693079,
-0.030745478346943855,
0.034648049622774124,
-0.01524548139423132,
0.011962230317294598,
-0.0023160914424806833,
0.05738477036356926,
0.06125340983271599,
0.0... |
721,601 | pydal.objects | clone | null | def clone(self, point_self_references_to=False, **args):
field = copy.copy(self)
if point_self_references_to and self.type == "reference %s" % self._tablename:
field.type = "reference %s" % point_self_references_to
field.__dict__.update(args)
field.db = field._db = None
field.table = field._... | (self, point_self_references_to=False, **args) | [
-0.0010229438776150346,
-0.027219504117965698,
0.03875192999839783,
0.0320076048374176,
-0.1074620857834816,
-0.012314916588366032,
0.05440174788236618,
0.0427389070391655,
0.03387067839503288,
-0.008672607131302357,
-0.02772253379225731,
-0.0024825455620884895,
0.003851904533803463,
0.041... |
721,602 | pydal.objects | coalesce | null | def coalesce(self, *others):
return Expression(self.db, self._dialect.coalesce, self, others, self.type)
| (self, *others) | [
-0.01901630498468876,
-0.07189632952213287,
0.08037079870700836,
0.0689917728304863,
-0.05361470580101013,
-0.08754676580429077,
-0.012788593769073486,
-0.06502790749073029,
0.05006089434027672,
-0.008850355632603168,
0.029985278844833374,
0.013258448801934719,
0.016299691051244736,
0.0353... |
721,603 | pydal.objects | coalesce_zero | null | def coalesce_zero(self):
return Expression(self.db, self._dialect.coalesce_zero, self, None, self.type)
| (self) | [
-0.012500174343585968,
-0.05187113210558891,
0.08857838809490204,
0.05945306643843651,
0.022328300401568413,
-0.06640039384365082,
-0.0414501428604126,
-0.03794308006763458,
0.02291281148791313,
0.0020301302429288626,
0.01108899898827076,
0.041550345718860626,
0.042585764080286026,
0.02892... |
721,604 | pydal.objects | contains |
For GAE contains() is always case sensitive
| def contains(self, value, all=False, case_sensitive=False):
"""
For GAE contains() is always case sensitive
"""
if isinstance(value, (list, tuple)):
subqueries = [
self.contains(str(v), case_sensitive=case_sensitive)
for v in value
if str(v)
]
... | (self, value, all=False, case_sensitive=False) | [
0.02526540867984295,
-0.10006384551525116,
-0.023572731763124466,
0.05698079988360405,
-0.026619547978043556,
-0.002137002767995,
0.030379069969058037,
-0.06186283379793167,
0.023554915562272072,
-0.06275371462106705,
-0.023323286324739456,
0.01917177625000477,
-0.014147203415632248,
-0.04... |
721,605 | pydal.objects | count | null | def count(self, distinct=None):
return Expression(self.db, self._dialect.count, self, distinct, "integer")
| (self, distinct=None) | [
-0.036603834480047226,
-0.06429135054349899,
0.07059311121702194,
0.055542632937431335,
0.07588926702737808,
0.03499487414956093,
-0.0326484739780426,
-0.04779951274394989,
0.0026522695552557707,
0.02874339558184147,
0.010642598383128643,
0.030553476884961128,
0.018218116834759712,
0.03670... |
721,606 | pydal.objects | day | null | def day(self):
return Expression(self.db, self._dialect.extract, self, "day", "integer")
| (self) | [
0.06730417162179947,
-0.009793022647500038,
0.0998256504535675,
0.04286317899823189,
0.040402453392744064,
-0.04149980470538139,
-0.009635070338845253,
-0.0025895810686051846,
-0.022462433204054832,
0.00879543088376522,
0.03681112453341484,
0.005673801060765982,
0.06451091170310974,
0.0104... |
721,607 | pydal.objects | endswith | null | def endswith(self, value):
if self.type not in ("string", "text", "json", "jsonb", "upload"):
raise SyntaxError("endswith used with incompatible field type")
return Query(self.db, self._dialect.endswith, self, value)
| (self, value) | [
0.02504727430641651,
-0.0014673442346975207,
-0.0413314513862133,
0.04267696663737297,
-0.04391898214817047,
-0.010574365966022015,
0.0011988881742581725,
0.0471620187163353,
0.011143621988594532,
-0.05809863656759262,
0.024322766810655594,
-0.007646146230399609,
-0.010996995493769646,
0.0... |
721,608 | pydal.objects | epoch | null | def epoch(self):
return Expression(self.db, self._dialect.epoch, self, None, "integer")
| (self) | [
0.008179876953363419,
-0.0015281311934813857,
0.04981178790330887,
0.09838642179965973,
0.0420958437025547,
0.0045538716949522495,
-0.054792966693639755,
0.03496592119336128,
0.013958695344626904,
0.011370436288416386,
0.02785227820277214,
0.0022158920764923096,
0.0445050410926342,
0.03844... |
721,609 | pydal.objects | formatter | null | def formatter(self, value):
if value is None:
return self.map_none
requires = self.requires
if not requires or requires is DEFAULT:
return value
if not isinstance(requires, (list, tuple)):
requires = [requires]
elif isinstance(requires, tuple):
requires = list(require... | (self, value) | [
0.07015489786863327,
-0.009770553559064865,
0.051918916404247284,
-0.0026795275043696165,
0.027193069458007812,
-0.039368268102407455,
0.018379010260105133,
-0.042514871805906296,
0.050095316022634506,
-0.016805710271000862,
0.025566132739186287,
0.011406428180634975,
-0.0323241725564003,
... |
721,610 | pydal.objects | hour | null | def hour(self):
return Expression(self.db, self._dialect.extract, self, "hour", "integer")
| (self) | [
0.06361421197652817,
-0.025139467790722847,
0.07415072619915009,
0.02583092637360096,
0.04988381639122963,
-0.06170446798205376,
0.045800916850566864,
0.03351929038763046,
-0.08297505974769592,
0.006321909371763468,
0.04036802425980568,
-0.000585476285777986,
0.05376915633678436,
-0.005432... |
721,612 | pydal.objects | json_contains |
Containment operator, jsonvalue parameter must be a json string
e.g. '{"country": "Peru"}'
Example:
Usage::
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c': {u'c0': {u'c01':... | def json_contains(self, jsonvalue):
"""
Containment operator, jsonvalue parameter must be a json string
e.g. '{"country": "Peru"}'
Example:
Usage::
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c':... | (self, jsonvalue) | [
0.00514019001275301,
-0.12179121375083923,
0.004733444657176733,
0.029089005663990974,
0.005091022700071335,
0.038654226809740067,
-0.010664776898920536,
0.026264136657118797,
0.06797566264867783,
-0.053922828286886215,
-0.012801308184862137,
0.009198704734444618,
-0.022187741473317146,
-0... |
721,613 | pydal.objects | json_key |
Get the json in key which you can use to build queries or as one of the
fields you want to get in a select.
Example:
Usage::
To use as one of the fields you want to get in a select
>>> tj = db.define_table('tj', Field('testjson', 'json'))
... | def json_key(self, key):
"""
Get the json in key which you can use to build queries or as one of the
fields you want to get in a select.
Example:
Usage::
To use as one of the fields you want to get in a select
>>> tj = db.define_table('tj', Field('testjson', 'json'))
... | (self, key) | [
0.017914732918143272,
-0.1102445051074028,
0.031894750893116,
0.07891185581684113,
0.03454206883907318,
0.02832268364727497,
-0.011840404942631721,
-0.023952795192599297,
0.07350842654705048,
-0.051967229694128036,
0.009233883582055569,
0.02781497873365879,
0.0240253247320652,
-0.017425158... |
721,614 | pydal.objects | json_key_value |
Get the value int or text in key
Example:
Usage::
To use as one of the fields you want to get in a select
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c': {u'c0': {... | def json_key_value(self, key):
"""
Get the value int or text in key
Example:
Usage::
To use as one of the fields you want to get in a select
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c'... | (self, key) | [
0.041453976184129715,
-0.12675704061985016,
0.0379902645945549,
0.0714113786816597,
0.028704574331641197,
0.017871269956231117,
-0.020763834938406944,
-0.004734965041279793,
0.07439606636762619,
-0.0762753114104271,
0.016830313950777054,
0.046170517802238464,
0.02842821553349495,
-0.014177... |
721,615 | pydal.objects | json_path |
Get the json in path which you can use for more queries
Example:
Usage::
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c': {u'c0': {u'c01': [2, 4]}}})
>>> row = db(db... | def json_path(self, path):
"""
Get the json in path which you can use for more queries
Example:
Usage::
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c': {u'c0': {u'c01': [2, 4]}}})
>>> row... | (self, path) | [
0.0067423488944768906,
-0.06386063992977142,
0.05310896411538124,
0.03799166902899742,
0.030198507010936737,
0.02624780684709549,
-0.03501511365175247,
0.023307330906391144,
0.09272421151399612,
-0.02922436222434044,
0.060108378529548645,
0.031659726053476334,
-0.018301306292414665,
-0.016... |
721,616 | pydal.objects | json_path_value |
Get the value in path which you can use for more queries
Example:
Usage::
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c': {u'c0': {u'c01': [2, 4]}}})
>>> db(db.tj.t... | def json_path_value(self, path):
"""
Get the value in path which you can use for more queries
Example:
Usage::
>>> tj = db.define_table('tj', Field('testjson', 'json'))
>>> tj.insert(testjson={u'a': {u'a1': 2, u'a0': 1}, u'b': 3, u'c': {u'c0': {u'c01': [2, 4]}}})
... | (self, path) | [
0.04255125671625137,
-0.08751777559518814,
0.0310254767537117,
0.020014718174934387,
0.02125786803662777,
0.010096155107021332,
-0.027153952047228813,
0.009066116996109486,
0.07522834837436676,
-0.03029734641313553,
0.05331338196992874,
0.049797043204307556,
0.008955121040344238,
-0.017359... |
721,617 | pydal.objects | len | null | def len(self):
return Expression(self.db, self._dialect.length, self, None, "integer")
| (self) | [
-0.008230614475905895,
-0.03865586966276169,
0.07373850792646408,
0.04979785904288292,
0.07594741880893707,
0.04719914495944977,
-0.0013551887823268771,
-0.02178047224879265,
0.00034158877679146826,
-0.03686925396323204,
0.027562610805034637,
0.00723173376172781,
0.03745396435260773,
0.017... |
721,619 | pydal.objects | lower | null | def lower(self):
return Expression(self.db, self._dialect.lower, self, None, self.type)
| (self) | [
0.004445354919880629,
-0.04195762425661087,
0.10570971667766571,
0.054257798939943314,
0.0209951251745224,
-0.03556283935904503,
0.03543233126401901,
-0.015424157492816448,
0.03075043484568596,
-0.04564441367983818,
0.011729211546480656,
-0.008177005685865879,
0.015644386410713196,
0.04290... |
721,620 | pydal.objects | max | null | def max(self):
return Expression(self.db, self._dialect.aggregate, self, "MAX", self.type)
| (self) | [
0.07402648776769638,
-0.012809683568775654,
0.0831955224275589,
0.05447486415505409,
0.003097078064456582,
-0.06303712725639343,
-0.02730485051870346,
-0.0467553436756134,
0.008772947825491428,
-0.021102268248796463,
0.01774815283715725,
0.020343799144029617,
-0.01371984463185072,
-0.01417... |
721,621 | pydal.objects | min | null | def min(self):
return Expression(self.db, self._dialect.aggregate, self, "MIN", self.type)
| (self) | [
0.07467284798622131,
-0.026837605983018875,
0.111418716609478,
0.03405554220080376,
0.0688328817486763,
-0.027493782341480255,
0.04557143524289131,
-0.057579461485147476,
-0.010080506093800068,
0.013049704022705555,
0.007591138128191233,
-0.0010314269457012415,
0.006984175182878971,
0.0009... |
721,622 | pydal.objects | minutes | null | def minutes(self):
return Expression(self.db, self._dialect.extract, self, "minute", "integer")
| (self) | [
0.06614115834236145,
-0.01328433956950903,
0.08832023292779922,
0.06020033732056618,
0.04838469997048378,
-0.026733702048659325,
0.04534827917814255,
0.05003492906689644,
-0.04112369567155838,
0.015817441046237946,
0.002920904429629445,
0.02056184783577919,
0.05680086463689804,
0.042707912... |
721,623 | pydal.objects | month | null | def month(self):
return Expression(self.db, self._dialect.extract, self, "month", "integer")
| (self) | [
0.052218809723854065,
0.025761721655726433,
0.0499340295791626,
0.0040376861579716206,
0.04046378284692764,
-0.031142544001340866,
-0.010438795201480389,
-0.01246695127338171,
-0.024801451712846756,
-0.015008354559540749,
0.03834456577897072,
0.011837808415293694,
0.03894059732556343,
0.00... |
721,624 | pydal.objects | regexp | null | def regexp(self, value, match_parameter=None):
return Query(
self.db, self._dialect.regexp, self, value, match_parameter=match_parameter
)
| (self, value, match_parameter=None) | [
0.07693450152873993,
-0.06273745000362396,
0.03691233694553375,
0.06101352348923683,
0.001466183690354228,
-0.01576886884868145,
-0.0007705914904363453,
0.008087249472737312,
-0.020044885575771332,
-0.001188369351439178,
0.005218261852860451,
0.08829214423894882,
-0.028072981163859367,
0.0... |
721,625 | pydal.objects | replace | null | def replace(self, a, b):
return Expression(self.db, self._dialect.replace, self, (a, b), self.type)
| (self, a, b) | [
-0.003639049595221877,
-0.07912861555814743,
0.07729315757751465,
0.02032599225640297,
-0.09211277961730957,
-0.05030513182282448,
-0.06301737576723099,
0.045886438339948654,
0.01769177056849003,
0.003224796848371625,
0.03314020484685898,
-0.006385862827301025,
0.010630358010530472,
0.0791... |
721,626 | pydal.objects | retrieve |
If `nameonly==True` return (filename, fullfilename) instead of
(filename, stream)
| def retrieve(self, name, path=None, nameonly=False):
"""
If `nameonly==True` return (filename, fullfilename) instead of
(filename, stream)
"""
self_uploadfield = self.uploadfield
if self.custom_retrieve:
return self.custom_retrieve(name, path)
if self.authorize or isinstance(self_upl... | (self, name, path=None, nameonly=False) | [
0.04544062912464142,
-0.037341345101594925,
-0.0808773934841156,
0.08380159735679626,
0.019796108826994896,
-0.055136680603027344,
0.042708802968263626,
0.0016797353746369481,
0.06321672350168228,
-0.013572550378739834,
0.030858073383569717,
0.039707645773887634,
-0.02597157098352909,
0.00... |
721,627 | pydal.objects | retrieve_file_properties | null | def retrieve_file_properties(self, name, path=None):
m = re.match(REGEX_UPLOAD_PATTERN, name)
if not m or not self.isattachment:
raise TypeError("Can't retrieve %s file properties" % name)
self_uploadfield = self.uploadfield
if self.custom_retrieve_file_properties:
return self.custom_ret... | (self, name, path=None) | [
0.04459066689014435,
-0.010288981720805168,
-0.05560622736811638,
0.07836901396512985,
-0.0060920934192836285,
-0.05479327216744423,
0.042233094573020935,
-0.020953955128788948,
0.027660846710205078,
0.03172563016414642,
0.04491585120558739,
0.05767926946282387,
-0.030689110979437828,
0.02... |
721,628 | pydal.objects | seconds | null | def seconds(self):
return Expression(self.db, self._dialect.extract, self, "second", "integer")
| (self) | [
0.03713351860642433,
-0.001071473816409707,
0.04472380504012108,
0.057516057044267654,
0.0725003331899643,
0.006833712570369244,
0.002261545741930604,
0.037362534552812576,
-0.012334217317402363,
0.020726066082715988,
0.01498427428305149,
0.011221847496926785,
0.030492017045617104,
-0.0001... |
721,629 | pydal.objects | set_attributes | null | def set_attributes(self, *args, **attributes):
self.__dict__.update(*args, **attributes)
return self
| (self, *args, **attributes) | [
-0.01213499903678894,
-0.005138280801475048,
0.052918776869773865,
-0.0021066528279334307,
-0.046639129519462585,
-0.014231043867766857,
-0.0410723015666008,
0.03453807160258293,
0.041954848915338516,
0.00892728567123413,
-0.03903565928339958,
0.0025585328694432974,
0.037779729813337326,
0... |
721,630 | pydal.objects | st_asgeojson | null | def st_asgeojson(self, precision=15, options=0):
return Expression(
self.db,
self._dialect.st_asgeojson,
self,
dict(precision=precision, options=options),
"string",
)
| (self, precision=15, options=0) | [
-0.02172764763236046,
-0.06384791433811188,
0.10046116262674332,
-0.011856754310429096,
-0.008978091180324554,
0.013625671155750751,
-0.06761937588453293,
0.014718729071319103,
0.06294676661491394,
-0.0007921538199298084,
0.036746758967638016,
0.0031790451612323523,
-0.08343950659036636,
-... |
721,631 | pydal.objects | st_astext | null | def st_astext(self):
return Expression(self.db, self._dialect.st_astext, self, type="string")
| (self) | [
0.03118436224758625,
-0.07810410857200623,
0.12716346979141235,
0.009148087352514267,
0.05118211358785629,
-0.027747511863708496,
0.003449485870078206,
0.01496040727943182,
0.08194529265165329,
-0.03359352797269821,
0.008760599419474602,
0.004910989664494991,
-0.040534619241952896,
0.00293... |
721,632 | pydal.objects | st_aswkb | null | def st_aswkb(self):
return Expression(self.db, self._dialect.st_aswkb, self, type="string")
| (self) | [
0.055464379489421844,
-0.05815077945590019,
0.06349082291126251,
0.045668840408325195,
0.010802940465509892,
-0.055366095155477524,
-0.061492402106523514,
0.01968936249613762,
0.07895401865243912,
-0.025111308321356773,
0.03249891474843025,
-0.03104105032980442,
-0.02009887620806694,
-0.01... |
721,634 | pydal.objects | st_distance | null | def st_distance(self, other):
return Expression(self.db, self._dialect.st_distance, self, other, "double")
| (self, other) | [
0.023108353838324547,
-0.026161659508943558,
0.08302322775125504,
0.0674063190817833,
-0.005772917065769434,
-0.023208461701869965,
-0.027196113020181656,
0.009201630018651485,
0.0016705588204786181,
0.05709515139460564,
-0.001579835545271635,
-0.02445981651544571,
0.014574113301932812,
0.... |
721,635 | pydal.objects | st_dwithin | null | def st_dwithin(self, value, distance):
return Query(self.db, self._dialect.st_dwithin, self, (value, distance))
| (self, value, distance) | [
0.09832014888525009,
0.006032676436007023,
-0.020702481269836426,
0.017973216250538826,
0.0057497648522257805,
0.012007107026875019,
0.006490327883511782,
-0.02141808159649372,
-0.044999606907367706,
0.03200230747461319,
-0.063904769718647,
0.005171460099518299,
-0.02639400027692318,
0.026... |
721,639 | pydal.objects | st_simplify | null | def st_simplify(self, value):
return Expression(self.db, self._dialect.st_simplify, self, value, self.type)
| (self, value) | [
0.05089718475937843,
-0.07067380100488663,
0.10708151757717133,
0.00901827123016119,
0.012975268065929413,
-0.02829294465482235,
-0.010348424315452576,
-0.05417655408382416,
-0.006245027761906385,
-0.02846025861799717,
0.0054753790609538555,
0.019525645300745964,
-0.02436104416847229,
0.01... |
721,640 | pydal.objects | st_simplifypreservetopology | null | def st_simplifypreservetopology(self, value):
return Expression(
self.db, self._dialect.st_simplifypreservetopology, self, value, self.type
)
| (self, value) | [
0.054346878081560135,
-0.06859249621629715,
0.08360544592142105,
0.005229510832577944,
0.02407076209783554,
-0.04507221281528473,
-0.01191027369350195,
-0.06602361798286438,
-0.010459021665155888,
-0.027740593999624252,
0.01568853296339512,
0.009241304360330105,
-0.01077596191316843,
-0.00... |
721,642 | pydal.objects | st_transform | null | def st_transform(self, value):
return Expression(self.db, self._dialect.st_transform, self, value, self.type)
| (self, value) | [
0.038313932716846466,
-0.05972466245293617,
0.062309857457876205,
0.005555686075240374,
0.015444890595972538,
-0.0013505993410944939,
-0.02706170082092285,
-0.004445377271622419,
0.0004994835471734405,
-0.011194230988621712,
0.0036520040594041348,
0.03960653021931648,
-0.006384274456650019,
... |
721,644 | pydal.objects | st_x | null | def st_x(self):
return Expression(self.db, self._dialect.st_x, self, type="string")
| (self) | [
0.03142980486154556,
-0.060297928750514984,
0.10883841663599014,
0.036159053444862366,
0.0947820395231247,
-0.019097628071904182,
-0.0312984362244606,
-0.009803339838981628,
0.05441920831799507,
-0.051759008318185806,
0.0353708453476429,
0.009655551053583622,
-0.008378817699849606,
0.02648... |
721,645 | pydal.objects | st_y | null | def st_y(self):
return Expression(self.db, self._dialect.st_y, self, type="string")
| (self) | [
0.033930208534002304,
-0.03804890438914299,
0.11434284597635269,
0.010043407790362835,
0.05641959607601166,
-0.034093648195266724,
-0.05145101249217987,
0.026673460379242897,
0.03406096249818802,
-0.0224566999822855,
0.03974868357181549,
0.006366000510752201,
-0.0044496627524495125,
0.0304... |
721,646 | pydal.objects | startswith | null | def startswith(self, value):
if self.type not in ("string", "text", "json", "jsonb", "upload"):
raise SyntaxError("startswith used with incompatible field type")
return Query(self.db, self._dialect.startswith, self, value)
| (self, value) | [
0.009926645085215569,
-0.016084762290120125,
-0.04080287739634514,
0.01668430119752884,
0.011237064376473427,
0.04227602854371071,
0.05858347937464714,
0.019527826458215714,
0.04087139666080475,
-0.06656590849161148,
-0.009763913229107857,
0.005802676547318697,
0.003376686479896307,
0.0044... |
721,647 | pydal.objects | store | null | def store(self, file, filename=None, path=None):
# make sure filename is a str sequence
filename = "{}".format(filename)
if self.custom_store:
return self.custom_store(file, filename, path)
if isinstance(file, cgi.FieldStorage):
filename = filename or file.filename
file = file.fi... | (self, file, filename=None, path=None) | [
-0.010945791378617287,
0.03175991401076317,
-0.03810383751988411,
0.10996139794588089,
0.02191172167658806,
-0.027550768107175827,
0.013271897099912167,
0.012204506434500217,
-0.02829592674970627,
-0.01038188673555851,
0.009173519909381866,
0.04362205043435097,
-0.016101490706205368,
-0.00... |
721,648 | pydal.objects | sum | null | def sum(self):
return Expression(self.db, self._dialect.aggregate, self, "SUM", self.type)
| (self) | [
0.0007182052358984947,
-0.0804220661520958,
0.09450269490480423,
0.05104228854179382,
0.03770630434155464,
-0.03361073508858681,
-0.0319860465824604,
-0.056187134236097336,
0.0014459302183240652,
0.028652053326368332,
0.020613230764865875,
0.009942753240466118,
0.07060623914003372,
0.03242... |
721,649 | pydal.objects | upper | null | def upper(self):
return Expression(self.db, self._dialect.upper, self, None, self.type)
| (self) | [
0.01626022905111313,
-0.03762456402182579,
0.08237867802381516,
0.03710605204105377,
-0.018698858097195625,
-0.09177671372890472,
0.005731993820518255,
-0.011083205230534077,
-0.00440735649317503,
-0.05807340145111084,
0.015636393800377846,
0.02067568711936474,
0.015863241627812386,
0.0448... |
721,650 | pydal.objects | validate | null | def validate(self, value, record_id=None):
requires = self.requires
if not requires or requires is DEFAULT:
return ((value if value != self.map_none else None), None)
if not isinstance(requires, (list, tuple)):
requires = [requires]
for validator in requires:
# notice that some v... | (self, value, record_id=None) | [
0.09068530797958374,
-0.006150493863970041,
0.011271309107542038,
0.04835814610123634,
-0.00908324122428894,
-0.021715197712183,
0.044607169926166534,
0.0024339959491044283,
0.01812051422894001,
-0.03329908847808838,
0.0034935541916638613,
0.06365623325109482,
0.03388747572898865,
-0.00900... |
721,652 | pydal.objects | year | null | def year(self):
return Expression(self.db, self._dialect.extract, self, "year", "integer")
| (self) | [
0.02696133963763714,
0.012947674840688705,
0.025058958679437637,
0.02105739712715149,
0.055562663823366165,
-0.024320965632796288,
-0.030979299917817116,
-0.03253728523850441,
0.009905504062771797,
-0.010487698949873447,
0.049527522176504135,
-0.0432627834379673,
0.04742833971977234,
0.042... |
721,653 | pydal.helpers.classes | SQLCustomType |
Allows defining of custom SQL types
Args:
type: the web2py type (default = 'string')
native: the backend type
encoder: how to encode the value to store it in the backend
decoder: how to decode the value retrieved from the backend
validator: what validators to use ( defa... | class SQLCustomType(object):
"""
Allows defining of custom SQL types
Args:
type: the web2py type (default = 'string')
native: the backend type
encoder: how to encode the value to store it in the backend
decoder: how to decode the value retrieved from the backend
vali... | (type='string', native=None, encoder=None, decoder=None, validator=None, _class=None, widget=None, represent=None) | [
0.026877252385020256,
-0.05890463665127754,
0.0317770317196846,
0.03537139296531677,
0.04037846624851227,
-0.036122456192970276,
-0.032259855419397354,
-0.03655163198709488,
-0.015021218918263912,
-0.06033523008227348,
0.0057044867426157,
0.04653001204133034,
0.021351588889956474,
0.002537... |
721,654 | pydal.helpers.classes | __getitem__ | null | def __getitem__(self, i):
return None
| (self, i) | [
0.010968123562633991,
-0.029083270579576492,
-0.047767870128154755,
0.0031814987305551767,
-0.032599013298749924,
0.0020033949986100197,
-0.011389022693037987,
0.004149152897298336,
0.04466477409005165,
-0.030469760298728943,
-0.03320972993969917,
0.009920003823935986,
0.008232282474637032,
... |
721,655 | pydal.helpers.classes | __getslice__ | null | def __getslice__(self, a=0, b=100):
return None
| (self, a=0, b=100) | [
-0.044101323932409286,
-0.019404582679271698,
-0.08088016510009766,
0.0022258686367422342,
-0.05212277173995972,
0.02060280740261078,
-0.010201551951467991,
-0.020686017349362373,
-0.019620928913354874,
-0.08014791458845139,
0.017174553126096725,
0.02438054420053959,
-0.011915678158402443,
... |
721,656 | pydal.helpers.classes | __init__ | null | def __init__(
self,
type="string",
native=None,
encoder=None,
decoder=None,
validator=None,
_class=None,
widget=None,
represent=None,
):
self.type = type
self.native = native
self.encoder = encoder or (lambda x: x)
self.decoder = decoder or (lambda x: x)
self.vali... | (self, type='string', native=None, encoder=None, decoder=None, validator=None, _class=None, widget=None, represent=None) | [
0.02269582450389862,
0.008557225577533245,
0.03791454806923866,
-0.01013993751257658,
0.033417705446481705,
-0.007005373947322369,
0.012141472660005093,
0.015192271210253239,
0.01640906371176243,
-0.007014191243797541,
0.013322995975613594,
0.10094086825847626,
-0.023859713226556778,
0.041... |
721,657 | pydal.helpers.classes | __str__ | null | def __str__(self):
return self._class
| (self) | [
0.00391490338370204,
-0.021389588713645935,
0.029684575274586678,
-0.014650998637080193,
0.024589331820607185,
-0.060864683240652084,
0.027980362996459007,
0.015563968569040298,
0.07707207649946213,
-0.046570178121328354,
-0.048448286950588226,
-0.017824657261371613,
-0.03168441355228424,
... |
721,658 | pydal.helpers.classes | endswith | null | def endswith(self, text=None):
try:
return self.type.endswith(self, text)
except TypeError:
return False
| (self, text=None) | [
0.042174361646175385,
0.0032611864153295755,
0.018038636073470116,
0.033955078572034836,
-0.04527343809604645,
-0.06632693111896515,
0.012598412111401558,
0.04753037169575691,
0.023175688460469246,
-0.05116841569542885,
0.05039364844560623,
-0.02088506706058979,
0.03402245044708252,
0.0015... |
721,659 | pydal.helpers.classes | startswith | null | def startswith(self, text=None):
try:
return self.type.startswith(self, text)
except TypeError:
return False
| (self, text=None) | [
0.023637475445866585,
-0.01404789462685585,
0.020525068044662476,
-0.012844990938901901,
0.017883727326989174,
0.0011545351007953286,
0.07563991844654083,
0.016327522695064545,
0.0300641767680645,
-0.06854026764631271,
0.042463336139917374,
0.0012933316174894571,
0.04895733296871185,
0.006... |
721,671 | pydal.helpers.methods | geoLine | null | def geoLine(*line):
return "LINESTRING (%s)" % ",".join("%f %f" % item for item in line)
| (*line) | [
-0.0028150291182100773,
0.030083250254392624,
0.021338511258363724,
0.07488737255334854,
-0.025001848116517067,
-0.09386244416236877,
0.019177649170160294,
0.04416261613368988,
0.025980988517403603,
0.0010746278567239642,
0.00897264201194048,
0.02618356980383396,
-0.06209101900458336,
0.05... |
721,672 | pydal.helpers.methods | geoPoint | null | def geoPoint(x, y):
return "POINT (%f %f)" % (x, y)
| (x, y) | [
0.029240529984235764,
-0.011957467533648014,
0.05282052233815193,
0.09056860208511353,
0.01632010005414486,
-0.0520501509308815,
-0.012024455703794956,
0.03938930481672287,
0.026343272998929024,
-0.03128368407487869,
0.04394453018903732,
-0.0039146472699940205,
-0.052552565932273865,
0.027... |
721,673 | pydal.helpers.methods | geoPolygon | null | def geoPolygon(*line):
return "POLYGON ((%s))" % ",".join("%f %f" % item for item in line)
| (*line) | [
0.0019047444220632315,
0.02023247629404068,
0.04992825910449028,
0.05850967764854431,
-0.04151643067598343,
-0.09409034252166748,
-0.031018609181046486,
0.004494221415370703,
0.031425632536411285,
0.010209514759480953,
0.03332507610321045,
0.004284349735826254,
-0.09646464884281158,
0.0346... |
721,679 | json_log_formatter | JSONFormatter | JSON log formatter.
Usage example::
import logging
import json_log_formatter
json_handler = logging.FileHandler(filename='/var/log/my-log.json')
json_handler.setFormatter(json_log_formatter.JSONFormatter())
logger = logging.getLogger('my_json')
logger.addHandler(... | class JSONFormatter(logging.Formatter):
"""JSON log formatter.
Usage example::
import logging
import json_log_formatter
json_handler = logging.FileHandler(filename='/var/log/my-log.json')
json_handler.setFormatter(json_log_formatter.JSONFormatter())
logger = logging.... | (fmt=None, datefmt=None, style='%', validate=True, *, defaults=None) | [
-0.01793069764971733,
-0.012326140888035297,
-0.0038294570986181498,
0.05870701000094414,
0.0036789013538509607,
-0.049965064972639084,
-0.037298962473869324,
0.05128607153892517,
0.02851816453039646,
-0.06919734179973602,
-0.007814326323568821,
-0.00016542914090678096,
0.04250527545809746,
... |
721,681 | json_log_formatter | extra_from_record | Returns `extra` dict you passed to logger.
The `extra` keyword argument is used to populate the `__dict__` of
the `LogRecord`.
| def extra_from_record(self, record):
"""Returns `extra` dict you passed to logger.
The `extra` keyword argument is used to populate the `__dict__` of
the `LogRecord`.
"""
return {
attr_name: record.__dict__[attr_name]
for attr_name in record.__dict__
if attr_name not in BUILT... | (self, record) | [
0.00044749455992132425,
0.02751210704445839,
0.01805807277560234,
0.0784771591424942,
0.0012511416571214795,
-0.04218754544854164,
0.018127460032701492,
0.01318360771983862,
0.036914099007844925,
-0.01346983015537262,
-0.031658004969358444,
0.009618829004466534,
0.07355064898729324,
-0.013... |
721,682 | json_log_formatter | format | null | def format(self, record):
message = record.getMessage()
extra = self.extra_from_record(record)
json_record = self.json_record(message, extra, record)
mutated_record = self.mutate_json_record(json_record)
# Backwards compatibility: Functions that overwrite this but don't
# return a new value will... | (self, record) | [
-0.009845309890806675,
-0.004901120904833078,
-0.01536660734564066,
0.0604328028857708,
-0.04578973352909088,
-0.07738430798053741,
-0.034609321504831314,
0.06511858105659485,
0.027494512498378754,
-0.03855433687567711,
-0.017046254128217697,
-0.0046082595363259315,
0.009724719449877739,
-... |
721,687 | json_log_formatter | json_record | Prepares a JSON payload which will be logged.
Override this method to change JSON log format.
:param message: Log message, e.g., `logger.info(msg='Sign up')`.
:param extra: Dictionary that was passed as `extra` param
`logger.info('Sign up', extra={'referral_code': '52d6ce'})`.
... | def json_record(self, message, extra, record):
"""Prepares a JSON payload which will be logged.
Override this method to change JSON log format.
:param message: Log message, e.g., `logger.info(msg='Sign up')`.
:param extra: Dictionary that was passed as `extra` param
`logger.info('Sign up', extra... | (self, message, extra, record) | [
-0.045990608632564545,
0.010804370976984501,
-0.010894407518208027,
0.09248542040586472,
0.0012109900126233697,
-0.07404595613479614,
-0.03867964819073677,
0.0629894882440567,
0.01710692048072815,
-0.08060061186552048,
-0.012497056275606155,
0.01856551133096218,
0.052329171448946,
-0.04130... |
721,688 | json_log_formatter | mutate_json_record | Override it to convert fields of `json_record` to needed types.
Default implementation converts `datetime` to string in ISO8601 format.
| def mutate_json_record(self, json_record):
"""Override it to convert fields of `json_record` to needed types.
Default implementation converts `datetime` to string in ISO8601 format.
"""
for attr_name in json_record:
attr = json_record[attr_name]
if isinstance(attr, datetime):
... | (self, json_record) | [
-0.011647941544651985,
-0.003431263379752636,
0.00931119080632925,
0.04533833637833595,
-0.06947580724954605,
-0.04816750809550285,
-0.025856461375951767,
0.04788100719451904,
0.051712922751903534,
-0.03806844726204872,
-0.02141573838889599,
-0.003375306725502014,
0.013939927332103252,
-0.... |
721,689 | json_log_formatter | to_json | Converts record dict to a JSON string.
It makes best effort to serialize a record (represents an object as a string)
instead of raising TypeError if json library supports default argument.
Note, ujson doesn't support it.
ValueError and OverflowError are also caught to avoid crashing an ... | def to_json(self, record):
"""Converts record dict to a JSON string.
It makes best effort to serialize a record (represents an object as a string)
instead of raising TypeError if json library supports default argument.
Note, ujson doesn't support it.
ValueError and OverflowError are also caught to a... | (self, record) | [
-0.07020547986030579,
-0.024793222546577454,
0.006108344532549381,
0.04008657485246658,
-0.016291918233036995,
-0.045808084309101105,
-0.03416714817285538,
0.07222060114145279,
0.011119166389107704,
-0.09607823193073273,
0.021842503920197487,
0.030928554013371468,
0.005541590973734856,
0.0... |
721,691 | json_log_formatter | VerboseJSONFormatter | JSON log formatter with built-in log record attributes such as log level.
Usage example::
import logging
import json_log_formatter
json_handler = logging.FileHandler(filename='/var/log/my-log.json')
json_handler.setFormatter(json_log_formatter.VerboseJSONFormatter())
log... | class VerboseJSONFormatter(JSONFormatter):
"""JSON log formatter with built-in log record attributes such as log level.
Usage example::
import logging
import json_log_formatter
json_handler = logging.FileHandler(filename='/var/log/my-log.json')
json_handler.setFormatter(json_... | (fmt=None, datefmt=None, style='%', validate=True, *, defaults=None) | [
0.0030566914938390255,
-0.006529888603836298,
-0.007455457933247089,
0.029525648802518845,
0.040058623999357224,
-0.03185808286070824,
-0.01068106573075056,
0.034856926649808884,
0.009065947495400906,
-0.05549711361527443,
-0.005969919729977846,
-0.002832240890711546,
0.0023671425879001617,
... |
721,699 | json_log_formatter | json_record | null | def json_record(self, message, extra, record):
extra['filename'] = record.filename
extra['funcName'] = record.funcName
extra['levelname'] = record.levelname
extra['lineno'] = record.lineno
extra['module'] = record.module
extra['name'] = record.name
extra['pathname'] = record.pathname
ext... | (self, message, extra, record) | [
-0.010030558332800865,
0.03565651550889015,
0.004457064438611269,
0.07553642243146896,
0.017932111397385597,
-0.058192815631628036,
-0.018260981887578964,
0.07290545850992203,
0.01091331709176302,
-0.06660498678684235,
-0.002306422684341669,
-0.007516427896916866,
-0.009537252597510815,
-0... |
721,703 | json_log_formatter | _json_serializable | null | def _json_serializable(obj):
try:
return obj.__dict__
except AttributeError:
return str(obj)
| (obj) | [
-0.017704853788018227,
-0.022658636793494225,
0.03267350420355797,
-0.049287453293800354,
0.01188371330499649,
-0.02600288763642311,
0.04789252579212189,
0.03973756358027458,
0.016274159774184227,
-0.036590032279491425,
0.031063972041010857,
0.029221951961517334,
-0.04313546419143677,
-0.0... |
721,708 | pytest_alembic.config | Config | Pytest-alembic configuration options.
- `config_options`: Meant to simplify the creation of ``alembic.config.Config``
objects. Supply keys common to customization in alembic configuration. For
example:
- file/config_file_name (commonly alembic.ini)
- script_location
- sqlalchemy... | class Config:
"""Pytest-alembic configuration options.
- `config_options`: Meant to simplify the creation of ``alembic.config.Config``
objects. Supply keys common to customization in alembic configuration. For
example:
- file/config_file_name (commonly alembic.ini)
- script_locatio... | (config_options: Dict[str, Any] = <factory>, alembic_config: Optional[alembic.config.Config] = None, before_revision_data: Union[Dict, ForwardRef('RevisionSpec'), NoneType] = None, at_revision_data: Union[Dict, ForwardRef('RevisionSpec'), NoneType] = None, minimum_downgrade_revision: Optional[str] = None, skip_revision... | [
0.01864929124712944,
-0.030153095722198486,
0.022254319861531258,
-0.022534111514687538,
0.003459750209003687,
-0.04009651392698288,
-0.018154272809624672,
0.02455723285675049,
-0.047693975269794464,
-0.07141182571649551,
-0.03549068793654442,
-0.011546849273145199,
-0.015184160321950912,
... |
721,709 | pytest_alembic.config | __eq__ | null | from dataclasses import dataclass, field
from typing import Any, cast, Dict, List, Optional, TYPE_CHECKING, Union
import alembic.config
from alembic.util import immutabledict
if TYPE_CHECKING:
from pytest_alembic.revision_data import RevisionSpec
@dataclass
class Config:
"""Pytest-alembic configuration opti... | (self, other) | [
0.032305553555488586,
-0.035108502954244614,
0.0001261136494576931,
0.00026581366546452045,
0.02002985216677189,
-0.050166696310043335,
-0.012040416710078716,
0.00043476439896039665,
-0.04042797535657883,
-0.06980782002210617,
-0.023037398234009743,
0.01630622334778309,
-0.012275700457394123... |
721,712 | pytest_alembic.config | make_alembic_config | null | def make_alembic_config(self, stdout):
file = (
self.config_options.get("file")
or self.config_options.get("config_file_name")
or "alembic.ini"
)
alembic_config = self.config_options.get("alembic_config")
if not alembic_config and self.alembic_config:
alembic_config = sel... | (self, stdout) | [
-0.021259550005197525,
-0.013767196796834469,
0.06818040460348129,
-0.056866951286792755,
0.01439468190073967,
-0.028508400544524193,
-0.01639888621866703,
0.02243959531188011,
-0.05192200094461441,
-0.05548086762428284,
-0.05746633931994438,
0.007806094363331795,
-0.06199921295046806,
0.0... |
721,713 | pytest_alembic.runner | MigrationContext | Within a given environment/execution context, executes alembic commands. | class MigrationContext:
"""Within a given environment/execution context, executes alembic commands."""
command_executor: CommandExecutor
revision_data: RevisionData
connection_executor: ConnectionExecutor
history: AlembicHistory
config: Config
@classmethod
def from_config(
cls,... | (command_executor: pytest_alembic.executor.CommandExecutor, revision_data: pytest_alembic.revision_data.RevisionData, connection_executor: pytest_alembic.executor.ConnectionExecutor, history: pytest_alembic.history.AlembicHistory, config: pytest_alembic.config.Config) -> None | [
0.0400606170296669,
-0.048702724277973175,
-0.07979816198348999,
0.05706214904785156,
0.027319563552737236,
-0.059242866933345795,
-0.01567896641790867,
0.019515415653586388,
-0.03699145466089249,
-0.06271586567163467,
-0.022110067307949066,
0.008137312717735767,
0.025744600221514702,
0.05... |
721,714 | pytest_alembic.runner | __eq__ | null | import contextlib
import functools
from dataclasses import dataclass
from typing import Dict, List, Optional, Union
import alembic.command
import alembic.migration
import alembic.util
from alembic.script.revision import RevisionMap
from pytest_alembic.config import Config
from pytest_alembic.executor import CommandEx... | (self, other) | [
0.027426281943917274,
-0.040867697447538376,
-0.03367599844932556,
0.02307865582406521,
0.02626691572368145,
-0.04383857548236847,
-0.0014412837335839868,
0.026937173679471016,
-0.04934557154774666,
-0.023495303466916084,
-0.017770927399396896,
0.0043861218728125095,
-0.013704083859920502,
... |
721,716 | pytest_alembic.runner | __repr__ | null | def roundtrip_next_revision(self):
"""Upgrade, downgrade then upgrade.
This is meant to ensure that the given revision is idempotent.
"""
next_revision = self.migrate_up_one()
if next_revision:
self.migrate_down_one()
return self.migrate_up_one()
return None
| (self) | [
-0.02794455923140049,
-0.010630716569721699,
-0.040906794369220734,
0.07555131614208221,
-0.027254361659288406,
-0.07097244262695312,
0.03673194348812103,
0.04821278154850006,
0.0019296053797006607,
-0.03945906460285187,
0.007869928143918514,
0.012861230410635471,
0.005664665251970291,
0.0... |
721,717 | pytest_alembic.runner | generate_revision | Generate a test revision.
If `prevent_file_generation` is `True`, the final act of this process raises a
`RevisionSuccess`, which is used as a sentinal to indicate the revision was
generated successfully, while not actually finishing the generation of the
revision file on disk.
| def generate_revision(
self,
process_revision_directives=None,
*,
prevent_file_generation=True,
autogenerate=False,
**kwargs
):
"""Generate a test revision.
If `prevent_file_generation` is `True`, the final act of this process raises a
`RevisionSuccess`, which is used as a sentinal t... | (self, process_revision_directives=None, *, prevent_file_generation=True, autogenerate=False, **kwargs) | [
0.05686267092823982,
-0.0032666856423020363,
-0.019495252519845963,
0.03840692341327667,
0.05321529135107994,
-0.024984560906887054,
-0.035434309393167496,
-0.016340266913175583,
-0.04158014431595802,
-0.019513489678502083,
0.019513489678502083,
0.05135512724518776,
-0.00017837973427958786,
... |
721,718 | pytest_alembic.runner | insert_into | Insert data into a given table.
Args:
table: The name of the table to insert data into
data: The data to insert. This is eventually passed through to SQLAlchemy's
Table class `values` method, and so should accept either a list of
`dict`s representing a li... | def insert_into(self, table: Optional[str], data: Union[Dict, List] = None, revision=None):
"""Insert data into a given table.
Args:
table: The name of the table to insert data into
data: The data to insert. This is eventually passed through to SQLAlchemy's
Table class `values` metho... | (self, table: Optional[str], data: Union[Dict, List, NoneType] = None, revision=None) | [
-0.00993426889181137,
0.0010374754201620817,
-0.04745866730809212,
0.006861110217869282,
0.0006055259727872908,
0.020888369530439377,
0.007125174161046743,
0.005677375476807356,
-0.02620607241988182,
-0.01610790193080902,
-0.07167971134185791,
0.007958341389894485,
-0.046329569071531296,
-... |
721,719 | pytest_alembic.runner | managed_downgrade | Perform an downgrade, one migration at a time. | def managed_downgrade(self, dest_revision, *, current=None, return_current=True):
"""Perform an downgrade, one migration at a time."""
if current is None:
current = self.current
for next_revision, current_revision in reversed(
self.history.revision_window(dest_revision, current)
):
... | (self, dest_revision, *, current=None, return_current=True) | [
0.04970107600092888,
-0.023433543741703033,
-0.04134080931544304,
0.05451885610818863,
-0.033990152180194855,
-0.08891639113426208,
0.026054982095956802,
0.01939510926604271,
0.03232518211007118,
-0.028605572879314423,
-0.007262095808982849,
-0.016941938549280167,
-0.020015044137835503,
0.... |
721,720 | pytest_alembic.runner | managed_upgrade | Perform an upgrade one migration at a time, inserting static data at the given points. | def managed_upgrade(self, dest_revision, *, current=None, return_current=True):
"""Perform an upgrade one migration at a time, inserting static data at the given points."""
if current is None:
current = self.current
for current_revision, next_revision in self.history.revision_window(current, dest_re... | (self, dest_revision, *, current=None, return_current=True) | [
0.025788890197873116,
-0.05463898926973343,
-0.07653018087148666,
0.05599161610007286,
0.00026432389859110117,
-0.045668940991163254,
0.023564176633954048,
0.02890349179506302,
0.007417198270559311,
-0.004267002455890179,
-0.023528581485152245,
-0.026376215741038322,
-0.02256750501692295,
... |
721,721 | pytest_alembic.runner | migrate_down_before | Migrate down to, but not including the given `revision`. | def migrate_down_before(self, revision):
"""Migrate down to, but not including the given `revision`."""
next_revision = self.history.next_revision(revision)
return self.migrate_down_to(next_revision)
| (self, revision) | [
-0.020881831645965576,
0.08122219145298004,
-0.027526050806045532,
0.04667902737855911,
-0.02461072988808155,
-0.04840788245201111,
0.004491627682000399,
0.062001410871744156,
0.03759407624602318,
-0.030797312036156654,
-0.022712381556630135,
0.02732265554368496,
-0.007207791320979595,
0.0... |
721,722 | pytest_alembic.runner | migrate_down_one | Migrate down by exactly one revision. | def migrate_down_one(self):
"""Migrate down by exactly one revision."""
current = self.current
previous_revision = self.history.previous_revision(current)
self.managed_downgrade(previous_revision, current=current)
return previous_revision
| (self) | [
-0.010731703601777554,
0.03255534544587135,
-0.016797084361314774,
0.05971552059054375,
-0.04476988688111305,
-0.08243556320667267,
0.026992620900273323,
0.027478521689772606,
0.043697550892829895,
-0.03175109624862671,
0.0049427831545472145,
0.00539098447188735,
-0.0035898007918149233,
0.... |
721,723 | pytest_alembic.runner | migrate_down_to | Migrate down to, and including the given `revision`. | def migrate_down_to(self, revision, *, return_current: bool = True):
"""Migrate down to, and including the given `revision`."""
self.history.validate_revision(revision)
self.managed_downgrade(revision, return_current=return_current)
return revision
| (self, revision, *, return_current: bool = True) | [
0.0267298873513937,
0.03884536772966385,
0.01376994140446186,
0.041671738028526306,
-0.014545470476150513,
-0.07389926165342331,
0.0036126708146184683,
0.04053429514169693,
0.017190884798765182,
-0.028332645073533058,
-0.022369692102074623,
0.0106419762596488,
-0.02166309952735901,
-0.0005... |
721,724 | pytest_alembic.runner | migrate_up_before | Migrate up to, but not including the given `revision`. | def migrate_up_before(self, revision):
"""Migrate up to, but not including the given `revision`."""
preceeding_revision = self.history.previous_revision(revision)
return self.managed_upgrade(preceeding_revision)
| (self, revision) | [
-0.05954831838607788,
0.027065888047218323,
-0.038891442120075226,
0.06446021050214767,
0.000025265191652579233,
-0.03616635128855705,
0.027486426755785942,
0.04050631448626518,
0.016325322911143303,
-0.014929133467376232,
-0.003244458232074976,
0.0014077541418373585,
0.011918074451386929,
... |
721,725 | pytest_alembic.runner | migrate_up_one | Migrate up by exactly one revision. | def migrate_up_one(self):
"""Migrate up by exactly one revision."""
current = self.current
next_revision = self.history.next_revision(current)
new_revision = self.managed_upgrade(next_revision, current=current)
if current == new_revision:
return None
return new_revision
| (self) | [
-0.033130791038274765,
-0.020694002509117126,
-0.039417147636413574,
0.06823243945837021,
-0.023259514942765236,
-0.05936358496546745,
0.06221792846918106,
0.016641851514577866,
0.01645495928823948,
-0.006575188133865595,
-0.009845791384577751,
-0.012462275102734566,
0.009488998912274837,
... |
721,726 | pytest_alembic.runner | migrate_up_to | Migrate up to, and including the given `revision`. | def migrate_up_to(self, revision, *, return_current: bool = True):
"""Migrate up to, and including the given `revision`."""
return self.managed_upgrade(revision, return_current=return_current)
| (self, revision, *, return_current: bool = True) | [
-0.023278364911675453,
-0.011801669374108315,
-0.01852349005639553,
0.05226942151784897,
0.0009155914885923266,
-0.037115395069122314,
0.035199761390686035,
0.03364330902695656,
-0.01738608255982399,
-0.018266931176185608,
-0.018677424639463425,
-0.027571436017751694,
0.004519697278738022,
... |
721,727 | pytest_alembic.runner | raw_command | Execute a raw alembic command. | def raw_command(self, *args, **kwargs):
"""Execute a raw alembic command."""
return self.command_executor.run_command(*args, **kwargs)
| (self, *args, **kwargs) | [
0.010114786215126514,
-0.07935956120491028,
0.018010079860687256,
0.03317378833889961,
0.041306279599666595,
-0.060824256390333176,
-0.03153034672141075,
0.03815493732690811,
0.03625735640525818,
-0.040594685822725296,
-0.004396628122776747,
-0.011402430944144726,
-0.010707779787480831,
-0... |
721,728 | pytest_alembic.runner | refresh_history | Refresh the context's version of the alembic history.
Note this is not done automatically to avoid the expensive reevaluation
step which can make long histories take seconds longer to evaluate for
each test.
| def refresh_history(self) -> AlembicHistory:
"""Refresh the context's version of the alembic history.
Note this is not done automatically to avoid the expensive reevaluation
step which can make long histories take seconds longer to evaluate for
each test.
"""
script = self.command_executor.scrip... | (self) -> pytest_alembic.history.AlembicHistory | [
0.014936301857233047,
-0.0381646454334259,
-0.06817899644374847,
-0.02255505695939064,
0.04379897937178612,
-0.019489837810397148,
-0.04068060591816902,
0.031520381569862366,
0.0016909647965803742,
-0.026771949604153633,
-0.018373601138591766,
-0.034231241792440414,
0.01590193435549736,
0.... |
721,729 | pytest_alembic.runner | roundtrip_next_revision | Upgrade, downgrade then upgrade.
This is meant to ensure that the given revision is idempotent.
| def roundtrip_next_revision(self):
"""Upgrade, downgrade then upgrade.
This is meant to ensure that the given revision is idempotent.
"""
next_revision = self.migrate_up_one()
if next_revision:
self.migrate_down_one()
return self.migrate_up_one()
return None
| (self) | [
-0.02794455923140049,
-0.010630716569721699,
-0.040906794369220734,
0.07555131614208221,
-0.027254361659288406,
-0.07097244262695312,
0.03673194348812103,
0.04821278154850006,
0.0019296053797006607,
-0.03945906460285187,
0.007869928143918514,
0.012861230410635471,
0.005664665251970291,
0.0... |
721,730 | pytest_alembic.runner | set_revision | null | def set_revision(self, revision: str):
self.command_executor.stamp(revision)
| (self, revision: str) | [
0.02532171830534935,
0.06250526756048203,
-0.015642791986465454,
0.08547109365463257,
0.018995407968759537,
0.0010852753184735775,
-0.035816144198179245,
0.07776090502738953,
0.023740140721201897,
0.028731994330883026,
0.002866609487682581,
0.013929416425526142,
-0.014365997165441513,
0.00... |
721,731 | pytest_alembic.runner | table_at_revision | Return a reference to a `sqlalchemy.Table` at the given revision.
Args:
name: The name of the table to produce a `sqlalchemy.Table` for.
revision: The revision of the table to return.
schema: The schema of the table.
| def table_at_revision(self, name, *, revision=None, schema=None):
"""Return a reference to a `sqlalchemy.Table` at the given revision.
Args:
name: The name of the table to produce a `sqlalchemy.Table` for.
revision: The revision of the table to return.
schema: The schema of the table.
... | (self, name, *, revision=None, schema=None) | [
0.0021147066727280617,
-0.015856431797146797,
-0.044323720037937164,
-0.018093841150403023,
0.01236324105411768,
0.0018295031040906906,
0.007211890537291765,
0.019544178619980812,
-0.05260125547647476,
0.0002915597870014608,
-0.05256588011980057,
0.029431233182549477,
-0.05642165616154671,
... |
721,733 | pytest_alembic.plugin.fixtures | create_alembic_fixture | Create a new fixture `alembic_runner`-like fixture.
In many cases, this function should not be strictly necessary. You **can**
generally rely solely on the :code:`--test-alembic` flag, automatic insertion
of tests, and the :func:`alembic_runner` fixture.
However this may be useful in some situations:
... | def create_alembic_fixture(raw_config=None):
"""Create a new fixture `alembic_runner`-like fixture.
In many cases, this function should not be strictly necessary. You **can**
generally rely solely on the :code:`--test-alembic` flag, automatic insertion
of tests, and the :func:`alembic_runner` fixture.
... | (raw_config=None) | [
-0.00496061472222209,
-0.020171035081148148,
-0.02188694290816784,
-0.01882021501660347,
0.03475624695420265,
-0.0022692414931952953,
-0.03873569145798683,
0.05355820804834366,
-0.017159070819616318,
-0.036873750388622284,
-0.037165816873311996,
0.05344868078827858,
-0.03229191154241562,
0... |
721,738 | pytest_alembic.runner | runner | Manage the alembic execution context, in a given context.
Yields:
`MigrationContext` to the caller.
| def set_revision(self, revision: str):
self.command_executor.stamp(revision)
| (config: pytest_alembic.config.Config, engine=None) | [
0.02532171830534935,
0.06250526756048203,
-0.015642791986465454,
0.08547109365463257,
0.018995407968759537,
0.0010852753184735775,
-0.035816144198179245,
0.07776090502738953,
0.023740140721201897,
0.028731994330883026,
0.002866609487682581,
0.013929416425526142,
-0.014365997165441513,
0.00... |
721,739 | aiopg.connection | Connection | Low-level asynchronous interface for wrapped psycopg2 connection.
The Connection instance encapsulates a database session.
Provides support for creating asynchronous cursors.
| class Connection:
"""Low-level asynchronous interface for wrapped psycopg2 connection.
The Connection instance encapsulates a database session.
Provides support for creating asynchronous cursors.
"""
_source_traceback = None
def __init__(
self,
dsn: Optional[str],
tim... | (dsn: Optional[str], timeout: float, echo: bool = False, enable_json: bool = True, enable_hstore: bool = True, enable_uuid: bool = True, **kwargs: Any) | [
-0.00042065020534209907,
-0.09313862025737762,
-0.07546178996562958,
0.0467318557202816,
0.019281970337033272,
0.014019557274878025,
0.01495419442653656,
0.026393340900540352,
-0.020226767286658287,
-0.14247120916843414,
0.016020899638533592,
0.02915661595761776,
-0.001014005159959197,
0.0... |
721,740 | aiopg.connection | __aenter__ | null | def __await__(self) -> Generator[Any, None, "Connection"]:
return self._connect().__await__()
| (self) -> aiopg.connection.Connection | [
-0.015419294126331806,
-0.11391815543174744,
-0.04742031544446945,
0.020804081112146378,
0.006145494990050793,
0.00003826243482762948,
-0.004083463456481695,
-0.0006629484705626965,
0.023368265479803085,
-0.05531800165772438,
-0.011974740773439407,
0.03388142213225365,
0.029847104102373123,
... |
721,743 | aiopg.connection | __del__ | null | def __del__(self) -> None:
try:
_conn = self._conn
except AttributeError:
return
if _conn is not None and not _conn.closed:
self.close()
warnings.warn(f"Unclosed connection {self!r}", ResourceWarning)
context = {"connection": self, "message": "Unclosed connection"}
... | (self) -> NoneType | [
-0.044850293546915054,
-0.06205417215824127,
0.007282537873834372,
0.011729065328836441,
-0.02009623683989048,
-0.019701823592185974,
-0.006103997118771076,
0.06588560342788696,
0.028792085126042366,
-0.042821887880563736,
-0.04233356565237045,
0.010395576246082783,
0.05431618168950081,
0.... |
721,744 | aiopg.connection | __init__ | null | def __init__(
self,
dsn: Optional[str],
timeout: float,
echo: bool = False,
enable_json: bool = True,
enable_hstore: bool = True,
enable_uuid: bool = True,
**kwargs: Any,
):
self._enable_json = enable_json
self._enable_hstore = enable_hstore
self._enable_uuid = enable_uuid
... | (self, dsn: Optional[str], timeout: float, echo: bool = False, enable_json: bool = True, enable_hstore: bool = True, enable_uuid: bool = True, **kwargs: Any) | [
-0.03047606348991394,
-0.059108659625053406,
-0.018983803689479828,
-0.0025298662949353456,
0.028769874945282936,
0.031848859041929245,
-0.01771887019276619,
0.037555769085884094,
-0.032731372863054276,
-0.10033175349235535,
-0.0035104346461594105,
0.09209498018026352,
-0.01731683686375618,
... |
721,745 | aiopg.connection | __repr__ | null | def __repr__(self) -> str:
return (
f"<"
f"{type(self).__module__}::{type(self).__name__} "
f"isexecuting={self.isexecuting()}, "
f"closed={self.closed}, "
f"echo={self.echo}, "
f">"
)
| (self) -> str | [
0.04789026454091072,
-0.07069684565067291,
0.054081130772829056,
-0.01152781955897808,
0.055682215839624405,
-0.05276468023657799,
0.02529715932905674,
0.001633330131880939,
-0.01994241587817669,
-0.043371643871068954,
0.006782378535717726,
0.01738067902624607,
-0.012532945722341537,
0.061... |
721,746 | aiopg.connection | _close | Remove the connection from the event_loop and close it. | def _close(self) -> None:
"""Remove the connection from the event_loop and close it."""
# N.B. If connection contains uncommitted transaction the
# transaction will be discarded
if self._fileno is not None:
self._loop.remove_reader(self._fileno)
if self._writing:
self._writin... | (self) -> NoneType | [
-0.03330724686384201,
-0.0660490095615387,
-0.002376228105276823,
0.044296566396951675,
-0.03347689285874367,
-0.07211858034133911,
-0.03328839689493179,
0.0716661885380745,
0.021073855459690094,
-0.07272176444530487,
-0.02704918012022972,
-0.03302450478076935,
0.04388187453150749,
0.03826... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.