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
730,485
chromadb.config
__getitem__
null
def __getitem__(self, key: str) -> Any: val = getattr(self, key) # Error on legacy config values if isinstance(val, str) and val in _legacy_config_values: raise ValueError(LEGACY_ERROR) return val
(self, key: str) -> Any
[ 0.05430515855550766, -0.06868425011634827, -0.003766483860090375, -0.011069760657846928, 0.008728251792490482, 0.009615795686841011, 0.049666743725538254, -0.008661352097988129, 0.08705952018499374, -0.05769477039575577, -0.03874862194061279, 0.03814205899834633, 0.04641985148191452, -0.01...
730,487
pydantic.v1.env_settings
__init__
null
def __init__( __pydantic_self__, _env_file: Optional[DotenvType] = env_file_sentinel, _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[StrPath] = None, **values: Any, ) -> None: # Uses something other than `self` the first arg to a...
(__pydantic_self__, _env_file: Union[str, os.PathLike, List[Union[str, os.PathLike]], Tuple[Union[str, os.PathLike], ...], NoneType] = '<object object at 0x7fd50aaedf00>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Union[str, os.PathLike, NoneType] = None, **val...
[ -0.004130335059016943, -0.047853682190179825, 0.002840864472091198, -0.021312080323696136, -0.013252890668809414, -0.025968501344323158, -0.007423409726470709, 0.0158228762447834, -0.0020092008635401726, -0.012894704006612301, -0.0006374595686793327, 0.051077358424663544, -0.0196286048740148...
730,499
pydantic.v1.env_settings
_build_values
null
def _build_values( self, init_kwargs: Dict[str, Any], _env_file: Optional[DotenvType] = None, _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[StrPath] = None, ) -> Dict[str, Any]: # Configure built-in sources init_settings = I...
(self, init_kwargs: Dict[str, Any], _env_file: Union[str, os.PathLike, List[Union[str, os.PathLike]], Tuple[Union[str, os.PathLike], ...], NoneType] = None, _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Union[str, os.PathLike, NoneType] = None) -> Dict[str, Any]
[ -0.0013927338877692819, -0.09864471107721329, -0.02783109061419964, -0.013962716795504093, -0.02518949657678604, 0.007552131544798613, -0.05566218122839928, 0.013991019688546658, 0.016236376017332077, -0.011490938253700733, -0.0003888687351718545, 0.05890757218003273, -0.009641822427511215, ...
730,507
chromadb.config
require
Return the value of a required config key, or raise an exception if it is not set
def require(self, key: str) -> Any: """Return the value of a required config key, or raise an exception if it is not set""" val = self[key] if val is None: raise ValueError(f"Missing required config value '{key}'") return val
(self, key: str) -> Any
[ 0.04682513698935509, -0.027856461703777313, 0.0005635918932966888, 0.00493669742718339, 0.017931193113327026, -0.012034821324050426, 0.0582374706864357, -0.021908216178417206, 0.06619151681661606, -0.04641014337539673, 0.003373986342921853, 0.009778291918337345, 0.06926938891410828, -0.018...
730,508
chromadb.auth.token_authn
TokenTransportHeader
Accceptable token transport headers.
class TokenTransportHeader(Enum): """ Accceptable token transport headers. """ # I don't love having this enum here -- it's weird to have an enum # for just two values and it's weird to have users pass X_CHROMA_TOKEN # to configure "x-chroma-token". But I also like having a single source # o...
(value, names=None, *, module=None, qualname=None, type=None, start=1)
[ 0.0013278903206810355, -0.04354776814579964, -0.09814076870679855, -0.03294223174452782, 0.042914602905511856, -0.04660807177424431, -0.004458545707166195, -0.03151760995388031, -0.0422462597489357, -0.02590705268085003, 0.0636683851480484, 0.05213068798184395, 0.014334180392324924, 0.0237...
730,513
chromadb
configure
Override Chroma's default settings, environment variables or .env files
def configure(**kwargs) -> None: # type: ignore """Override Chroma's default settings, environment variables or .env files""" global __settings __settings = chromadb.config.Settings(**kwargs)
(**kwargs) -> NoneType
[ -0.048952117562294006, -0.05568167567253113, -0.016579680144786835, -0.00027191851404495537, -0.01975451223552227, -0.012174713425338268, -0.04562351852655411, 0.013721426948904991, 0.0021990914829075336, 0.008326021023094654, -0.05908263847231865, 0.012916412204504013, -0.053800296038389206...
730,515
chromadb
get_settings
null
def get_settings() -> Settings: return __settings
() -> chromadb.config.Settings
[ -0.00600025849416852, -0.02341773547232151, 0.024618644267320633, 0.005228245165199041, 0.023229019716382027, 0.034363165497779846, -0.0013928405242040753, 0.040110375732183456, 0.02705477550625801, -0.004563455935567617, -0.039012402296066284, 0.016066452488303185, -0.05225671827793121, 0...
730,526
sphinx_adc_theme
get_html_theme_path
Return list of HTML theme paths.
def get_html_theme_path(): """Return list of HTML theme paths.""" return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
()
[ -0.014700784347951412, -0.04755324125289917, 0.04513762146234512, -0.06729232519865036, 0.02576088160276413, 0.01734934188425541, 0.02733103558421135, 0.03875347599387169, -0.01970457285642624, 0.055076178163290024, 0.0621505007147789, 0.001057912944816053, 0.012129873037338257, 0.01416589...
730,527
sphinx_adc_theme
get_theme_version
Return the theme version
def get_theme_version(): """Return the theme version""" return __version__
()
[ 0.035888221114873886, -0.05835234373807907, 0.025063978508114815, -0.011945747770369053, 0.06722243875265121, 0.015378237701952457, 0.05152134597301483, 0.03629603981971741, 0.00780806690454483, 0.030790461227297783, 0.042957112193107605, -0.004532756749540567, -0.029006246477365494, -0.00...
730,529
sphinx_adc_theme
setup
null
def setup(app): app.connect('html-page-context', update_context) app.add_html_theme('sphinx_adc_theme', get_html_theme_path()) return {'version': __version__, 'parallel_read_safe': True}
(app)
[ -0.02593524008989334, -0.04510314762592316, 0.034840602427721024, -0.03145693615078926, 0.06633471697568893, 0.06968120485544205, 0.013906493782997131, -0.00830578338354826, -0.03028566762804985, 0.026418620720505714, 0.029727919027209282, -0.032646797597408295, 0.0777127593755722, 0.06164...
730,530
sphinx_adc_theme
update_context
null
def update_context(app, pagename, templatename, context, doctree): context['adc_theme_version'] = __version__
(app, pagename, templatename, context, doctree)
[ 0.004920679610222578, -0.0476786345243454, 0.014024155214428902, -0.03782854229211807, 0.04146119952201843, 0.025079311802983284, 0.03206519037485123, 0.017848923802375793, 0.0164604801684618, 0.0007367921061813831, 0.009981077164411545, -0.06898556649684906, -0.011221070773899555, 0.01047...
730,531
pickledb_ujson
PickleDB
null
class PickleDB: key_string_error = TypeError("Key/name must be a string!") def __init__(self, location, auto_dump, sig): """Creates a database object and loads the data from the location path. If the file does not exist it will be created on the first update. """ self.load(locat...
(location, auto_dump, sig)
[ 0.042839791625738144, 0.022416625171899796, -0.06914561241865158, 0.024273276329040527, 0.059686459600925446, -0.036703068763017654, -0.06277436763048172, 0.010494966991245747, -0.026266733184456825, -0.1340697854757309, -0.08442878723144531, 0.04455963522195816, -0.06762120127677917, 0.01...
730,532
pickledb_ujson
__delitem__
Sytax sugar for rem()
def __delitem__(self, key): """Sytax sugar for rem()""" return self.rem(key)
(self, key)
[ 0.03125898167490959, 0.0026966966688632965, -0.01773976720869541, -0.004678758326917887, -0.05242899805307388, -0.04365159571170807, -0.039380598813295364, 0.04963771626353264, 0.10257115960121155, -0.016789723187685013, -0.033579446375370026, 0.00804174691438675, 0.04721636325120926, 0.03...
730,533
pickledb_ujson
__getitem__
Syntax sugar for get()
def __getitem__(self, item): """Syntax sugar for get()""" return self.get(item)
(self, item)
[ 0.03080846183001995, -0.053526151925325394, -0.03945088014006615, -0.013105715624988079, 0.008725999854505062, -0.004797628149390221, 0.011751681566238403, -0.004918822553008795, 0.11373889446258545, -0.0407881960272789, -0.03500429913401604, 0.01422571949660778, 0.0308251790702343, 0.0277...
730,534
pickledb_ujson
__init__
Creates a database object and loads the data from the location path. If the file does not exist it will be created on the first update.
def __init__(self, location, auto_dump, sig): """Creates a database object and loads the data from the location path. If the file does not exist it will be created on the first update. """ self.load(location, auto_dump) self.dthread = None if sig: self.set_sigterm_handler()
(self, location, auto_dump, sig)
[ 0.02315235137939453, 0.016750985756516457, -0.022955387830734253, 0.03864097222685814, 0.00680872518569231, -0.04483642056584358, -0.008084521628916264, 0.08308345824480057, -0.06868710368871689, -0.057442184537649155, -0.03224856033921242, 0.05565159395337105, -0.08014688640832901, 0.0010...
730,535
pickledb_ujson
__setitem__
Sytax sugar for set()
def __setitem__(self, key, value): """Sytax sugar for set()""" return self.set(key, value)
(self, key, value)
[ 0.018866533413529396, -0.035411033779382706, -0.015059079974889755, 0.02219592221081257, -0.044562581926584244, 0.0007288372726179659, -0.042172253131866455, 0.029469355940818787, 0.07785646617412567, -0.017406724393367767, -0.05593372508883476, -0.01368463970720768, 0.056787412613630295, ...
730,536
pickledb_ujson
_autodumpdb
Write/save the json dump into the file if auto_dump is enabled
def _autodumpdb(self): """Write/save the json dump into the file if auto_dump is enabled""" if self.auto_dump: self.dump()
(self)
[ -0.012866957113146782, 0.008722353726625443, -0.007809351198375225, 0.011465605348348618, 0.05870389938354492, -0.04365423321723938, -0.04049482196569443, 0.0234917514026165, -0.05544257164001465, -0.053947798907756805, -0.055136822164058685, -0.03191684931516647, -0.02741553634405136, -0....
730,537
pickledb_ujson
_loaddb
Load or reload the json info from the file
def _loaddb(self): """Load or reload the json info from the file""" try: self.db = load(open(self.loco)) except ValueError: if stat(self.loco).st_size == 0: # Error raised because file is empty self.db = {} else: raise # File is not empty, avoid overwriting ...
(self)
[ 0.021064771339297295, -0.026937268674373627, -0.0412980355322361, 0.056230463087558746, 0.0049587092362344265, -0.029327843338251114, -0.023056915029883385, 0.0702967420220375, -0.004828786943107843, -0.07247944176197052, -0.04992489144206047, -0.01592850126326084, -0.03869958594441414, 0....
730,538
pickledb_ujson
append
Add more to a key's value
def append(self, key, more): """Add more to a key's value""" tmp = self.db[key] self.db[key] = tmp + more self._autodumpdb() return True
(self, key, more)
[ -0.01546753104776144, 0.014887392520904541, -0.07323402911424637, 0.07029920816421509, 0.061221733689308167, -0.014187812805175781, -0.05920831114053726, 0.006684396415948868, 0.03576386719942093, -0.07978618890047073, -0.0560004822909832, -0.007806282956153154, 0.019451722502708435, 0.057...
730,539
pickledb_ujson
dadd
Add a key-value pair to a dict, "pair" is a tuple
def dadd(self, name, pair): """Add a key-value pair to a dict, "pair" is a tuple""" self.db[name][pair[0]] = pair[1] self._autodumpdb() return True
(self, name, pair)
[ -0.005019721575081348, 0.05807112157344818, -0.06701046973466873, 0.03811350464820862, 0.0336265042424202, -0.037524476647377014, -0.0708911195397377, 0.0271298848092556, -0.006435984745621681, -0.07165338844060898, -0.038702528923749924, 0.02286810241639614, 0.0060245320200920105, 0.02687...
730,540
pickledb_ujson
dcreate
Create a dict, name must be str
def dcreate(self, name): """Create a dict, name must be str""" if isinstance(name, str): self.db[name] = {} self._autodumpdb() return True else: raise self.key_string_error
(self, name)
[ -0.001954288687556982, 0.0486941784620285, -0.03565109521150589, -0.05154626816511154, -0.00417161313816905, -0.02311234548687935, -0.03156426176428795, 0.04552906006574631, 0.002111892681568861, -0.061006851494312286, -0.03545979782938957, 0.09620578587055206, 0.007278040982782841, 0.0024...
730,541
pickledb_ujson
deldb
Delete everything from the database
def deldb(self): """Delete everything from the database""" self.db = {} self._autodumpdb() return True
(self)
[ -0.026929493993520737, 0.034868448972702026, -0.0030492404475808144, -0.041373495012521744, 0.03408154845237732, -0.044835858047008514, -0.06435099989175797, 0.02063428796827793, -0.03161592409014702, -0.0009213296580128372, -0.06260232627391815, 0.010308399796485901, -0.017836418002843857, ...
730,542
pickledb_ujson
dexists
Determine if a key exists or not in a dict
def dexists(self, name, key): """Determine if a key exists or not in a dict""" return key in self.db[name]
(self, name, key)
[ 0.06317675113677979, -0.037609316408634186, -0.07314839959144592, 0.05976086109876633, 0.03888596594333649, 0.0033447276800870895, -0.012533564120531082, -0.03189891204237938, 0.040300626307725906, -0.05147990956902504, -0.05720756575465202, 0.022841623052954674, 0.05065181478857994, -0.03...
730,543
pickledb_ujson
dget
Return the value for a key in a dict
def dget(self, name, key): """Return the value for a key in a dict""" return self.db[name][key]
(self, name, key)
[ 0.05475132167339325, -0.04180198162794113, -0.04059978574514389, 0.030278097838163376, 0.03036396950483322, 0.002582568908110261, -0.0013352932874113321, -0.02584715746343136, 0.08202393352985382, -0.07041418552398682, -0.06873111426830292, 0.024833880364894867, 0.0059336828999221325, -0.0...
730,544
pickledb_ujson
dgetall
Return all key-value pairs from a dict
def dgetall(self, name): """Return all key-value pairs from a dict""" return self.db[name]
(self, name)
[ 0.027928316965699196, -0.0292154923081398, -0.05626311153173447, -0.04386558011174202, 0.013616959564387798, 0.022220710292458534, -0.037294212728738785, -0.06639114767313004, 0.10094164311885834, -0.03433031961321831, -0.07634981721639633, 0.02093353495001793, -0.016309866681694984, 0.016...
730,545
pickledb_ujson
dkeys
Return all the keys for a dict
def dkeys(self, name): """Return all the keys for a dict""" return self.db[name].keys()
(self, name)
[ -0.01057436317205429, -0.028681378811597824, -0.04064599797129631, -0.006176101975142956, 0.03299538418650627, 0.03703976050019264, -0.018536731600761414, -0.044016312807798386, 0.08965037763118744, -0.024586446583271027, -0.049611035734415054, -0.0074820988811552525, 0.007760149892419577, ...
730,546
pickledb_ujson
dmerge
Merge two dicts together into name1
def dmerge(self, name1, name2): """Merge two dicts together into name1""" first = self.db[name1] second = self.db[name2] first.update(second) self._autodumpdb() return True
(self, name1, name2)
[ -0.0038321553729474545, -0.0005341661162674427, -0.02503444068133831, 0.022975631058216095, -0.00817901361733675, -0.03930770605802536, -0.07736974209547043, -0.01932513527572155, 0.03432504087686539, -0.02723165974020958, -0.03136657923460007, -0.03858106583356857, -0.002028533723205328, ...
730,547
pickledb_ujson
dpop
Remove one key-value pair in a dict
def dpop(self, name, key): """Remove one key-value pair in a dict""" value = self.db[name][key] del self.db[name][key] self._autodumpdb() return value
(self, name, key)
[ 0.04401925206184387, 0.03799741715192795, -0.0871933326125145, -0.020143209025263786, -0.009877920150756836, -0.026763705536723137, -0.04838596284389496, 0.029281606897711754, 0.07831905037164688, -0.06983213871717453, -0.06641624867916107, 0.013408264145255089, -0.04285714402794838, 0.026...
730,548
pickledb_ujson
drem
Remove a dict and all of its pairs
def drem(self, name): """Remove a dict and all of its pairs""" del self.db[name] self._autodumpdb() return True
(self, name)
[ 0.028303448110818863, 0.05264957249164581, -0.049552541226148605, -0.03554706647992134, -0.013721579685807228, -0.03685470297932625, -0.07708172500133514, 0.02818300761282444, 0.02876800298690796, -0.017343388870358467, -0.0652441754937172, 0.027546394616365433, -0.022143790498375893, 0.03...
730,549
pickledb_ujson
dump
Force dump memory db to file
def dump(self): """Force dump memory db to file""" dump(self.db, open(self.loco, "w")) self.dthread = Thread(target=dump, args=(self.db, open(self.loco, "w"))) self.dthread.start() self.dthread.join() return True
(self)
[ 0.016676049679517746, 0.05151979252696037, -0.035817332565784454, 0.08110258728265762, 0.04566039890050888, -0.05870112404227257, -0.05752209946513176, 0.02990434691309929, -0.09517942368984222, -0.09646563231945038, -0.06438188254833221, -0.021615447476506233, -0.07281368970870972, 0.0263...
730,550
pickledb_ujson
dvals
Return all the values for a dict
def dvals(self, name): """Return all the values for a dict""" return self.db[name].values()
(self, name)
[ 0.06582191586494446, -0.05614420399069786, -0.027094215154647827, -0.02355358935892582, 0.007148691453039646, 0.029909854754805565, -0.04387003555893898, -0.05361518636345863, 0.09731662273406982, -0.008113933727145195, -0.06170804426074028, 0.057256970554590225, -0.0031233374029397964, -0...
730,551
pickledb_ujson
exists
Return True if key exists in db, return False if not
def exists(self, key): """Return True if key exists in db, return False if not""" return key in self.db
(self, key)
[ 0.02771918475627899, -0.0415116623044014, -0.07114367187023163, 0.07235176861286163, 0.06926440447568893, -0.02055448107421398, -0.013490450568497181, 0.009966826066374779, 0.034699320793151855, -0.05030394718050957, -0.07080809026956558, 0.0061034224927425385, 0.04261908680200577, -0.0191...
730,552
pickledb_ujson
get
Get the value of a key
def get(self, key): """Get the value of a key""" try: return self.db[key] except KeyError: return False
(self, key)
[ 0.07150586694478989, -0.03691064566373825, -0.060064926743507385, 0.05247168242931366, 0.051858775317668915, -0.02157093584537506, 0.01694859191775322, -0.01694859191775322, 0.07545571029186249, -0.07804354280233383, -0.0657513439655304, 0.048623986542224884, 0.022439220920205116, -0.00205...
730,553
pickledb_ujson
getall
Return a list of all keys in db
def getall(self): """Return a list of all keys in db""" return self.db.keys()
(self)
[ -0.04606511816382408, -0.03496865928173065, -0.0590054988861084, 0.02392159402370453, 0.0538688600063324, 0.022884387522935867, -0.004560413770377636, -0.05758963152766228, 0.09976933896541595, -0.030704591423273087, -0.06980561465024948, -0.04484681412577629, -0.012339458800852299, 0.0190...
730,554
pickledb_ujson
ladd
Add a value to a list
def ladd(self, name, value): """Add a value to a list""" self.db[name].append(value) self._autodumpdb() return True
(self, name, value)
[ 0.014404546469449997, 0.03257352486252785, -0.08470835536718369, 0.021125521510839462, 0.017524385824799538, 0.0069960025139153, -0.060540348291397095, -0.002348473994061351, -0.012599680572748184, -0.06442510336637497, -0.07549494504928589, -0.01983633264899254, 0.009454057551920414, 0.02...
730,555
pickledb_ujson
lappend
Add more to a value in a list
def lappend(self, name, pos, more): """Add more to a value in a list""" tmp = self.db[name][pos] self.db[name][pos] = tmp + more self._autodumpdb() return True
(self, name, pos, more)
[ 0.010810349136590958, 0.016349252313375473, -0.057183556258678436, 0.041722945868968964, 0.020395584404468536, 0.00850678700953722, -0.03582168370485306, -0.010646426118910313, 0.00387162365950644, -0.0586329884827137, -0.05445724353194237, -0.04879755526781082, 0.02769451029598713, 0.0396...
730,556
pickledb_ujson
lcreate
Create a list, name must be str
def lcreate(self, name): """Create a list, name must be str""" if isinstance(name, str): self.db[name] = [] self._autodumpdb() return True else: raise self.key_string_error
(self, name)
[ -0.006370543036609888, 0.03527769073843956, -0.05825483798980713, -0.03130419924855232, -0.01769067347049713, 0.010097851045429707, -0.027745334431529045, 0.03880200535058975, 0.01734515279531479, -0.03970035910606384, -0.05991333723068237, 0.04215355962514877, -0.009104478172957897, -0.02...
730,557
pickledb_ujson
lexists
Determine if a value exists in a list
def lexists(self, name, value): """Determine if a value exists in a list""" return value in self.db[name]
(self, name, value)
[ 0.06354986876249313, -0.05846178159117699, -0.04070470109581947, 0.018986420705914497, 0.030682191252708435, 0.042480409145355225, -0.02706247940659523, -0.045929379761219025, 0.02390376664698124, -0.05135894939303398, -0.045895230025053024, 0.018508344888687134, 0.015520374290645123, -0.0...
730,558
pickledb_ujson
lextend
Extend a list with a sequence
def lextend(self, name, seq): """Extend a list with a sequence""" self.db[name].extend(seq) self._autodumpdb() return True
(self, name, seq)
[ 0.026376722380518913, 0.024195441976189613, -0.009991945698857307, 0.04476660117506981, 0.009773816913366318, 0.0050882576033473015, -0.05087418854236603, -0.0228698942810297, 0.03953152522444725, -0.03724956884980202, -0.026729082688689232, -0.0522836297750473, 0.016519010066986084, 0.029...
730,559
pickledb_ujson
lget
Return one value in a list
def lget(self, name, pos): """Return one value in a list""" return self.db[name][pos]
(self, name, pos)
[ 0.05528491362929344, -0.044935524463653564, -0.05498732626438141, 0.0311969593167305, 0.028254162520170212, 0.02982475608587265, -0.008109225891530514, -0.026088396087288857, 0.07142069935798645, -0.06712223589420319, -0.06351813673973083, -0.02387303113937378, -0.03683456405997276, 0.0050...
730,560
pickledb_ujson
lgetall
Return all values in a list
def lgetall(self, name): """Return all values in a list""" return self.db[name]
(self, name)
[ 0.02822679653763771, -0.04263559356331825, -0.05976860225200653, 0.004882251378148794, 0.015081643126904964, 0.039977021515369415, -0.03270697966217995, -0.08001969009637833, 0.08441781997680664, -0.04191351309418678, -0.07805037498474121, -0.014055960811674595, -0.036202508956193924, 0.01...
730,561
pickledb_ujson
llen
Returns the length of the list
def llen(self, name): """Returns the length of the list""" return len(self.db[name])
(self, name)
[ 0.002031405922025442, -0.02528338134288788, -0.02953573502600193, 0.05524764955043793, 0.03550221771001816, 0.03916122019290924, -0.012954847887158394, -0.009196953848004341, 0.03480997309088707, -0.05224792659282684, -0.05485207960009575, -0.03342548757791519, -0.023453880101442337, -0.03...
730,562
pickledb_ujson
load
Loads, reloads or changes the path to the db file
def load(self, location, auto_dump): """Loads, reloads or changes the path to the db file""" location = path.expanduser(location) self.loco = location self.auto_dump = auto_dump if path.exists(location): self._loaddb() else: self.db = {} return True
(self, location, auto_dump)
[ 0.026344580575823784, 0.009224073961377144, -0.029069282114505768, 0.02101665735244751, 0.040401965379714966, -0.04821162298321724, 0.031065084040164948, 0.07330665737390518, -0.0780271589756012, -0.07191827148199081, -0.06289377808570862, -0.00536697031930089, -0.04776039719581604, 0.0263...
730,563
pickledb_ujson
lpop
Remove one value in a list
def lpop(self, name, pos): """Remove one value in a list""" value = self.db[name][pos] del self.db[name][pos] self._autodumpdb() return value
(self, name, pos)
[ 0.050766125321388245, 0.029512040317058563, -0.0821734368801117, -0.013969145715236664, -0.00391110684722662, -0.008507556281983852, -0.04883701354265213, 0.012784603051841259, 0.06244233623147011, -0.05851642042398453, -0.06971881538629532, -0.03472403064370155, -0.04822782054543495, 0.01...
730,564
pickledb_ujson
lrange
Return range of values in a list
def lrange(self, name, start=None, end=None): """Return range of values in a list""" return self.db[name][start:end]
(self, name, start=None, end=None)
[ 0.030536413192749023, 0.006974213290959597, -0.04543343186378479, -0.02674204483628273, -0.030354943126440048, 0.053286124020814896, -0.01627453975379467, -0.037217799574136734, -0.023706551641225815, -0.05807032808661461, -0.02078653685748577, -0.0050399103201925755, -0.0005913233617320657,...
730,565
pickledb_ujson
lremlist
Remove a list and all of its values
def lremlist(self, name): """Remove a list and all of its values""" number = len(self.db[name]) del self.db[name] self._autodumpdb() return number
(self, name)
[ 0.02301483228802681, 0.030582770705223083, -0.06437932699918747, 0.001502141123637557, -0.005006417166441679, 0.006250462029129267, -0.07270751893520355, -0.01397822704166174, 0.020336678251624107, -0.02624589204788208, -0.06444843858480453, -0.01503220945596695, -0.03517882525920868, 0.00...
730,566
pickledb_ujson
lremvalue
Remove a value from a certain list
def lremvalue(self, name, value): """Remove a value from a certain list""" self.db[name].remove(value) self._autodumpdb() return True
(self, name, value)
[ 0.06464941054582596, 0.03870685398578644, -0.07617177069187164, 0.005593002308160067, -0.02621854469180107, -0.014325330033898354, -0.07720671594142914, 0.010884146206080914, 0.04319160431623459, -0.050815679132938385, -0.06623632460832596, 0.01866346411406994, -0.014385702088475227, 0.005...
730,567
pickledb_ujson
rem
Delete a key
def rem(self, key): """Delete a key""" if not key in self.db: # return False instead of an exception return False del self.db[key] self._autodumpdb() return True
(self, key)
[ 0.022251969203352928, 0.04598037153482437, -0.04889808967709541, 0.041304998099803925, 0.01907060667872429, -0.043343883007764816, -0.06313513219356537, 0.04661313071846962, 0.02527514472603798, -0.03849274292588234, -0.06404910981655121, 0.023517483845353127, 0.02464238740503788, 0.033975...
730,568
pickledb_ujson
set
Set the str value of a key
def set(self, key, value): """Set the str value of a key""" if isinstance(key, str): self.db[key] = value self._autodumpdb() return True else: raise self.key_string_error
(self, key, value)
[ 0.007520303595811129, 0.004853498190641403, -0.07074235379695892, 0.035615596920251846, 0.011112416163086891, -0.034306202083826065, 0.003947832155972719, 0.053597982972860336, 0.044344913214445114, -0.07074235379695892, -0.07241838425397873, 0.0327523835003376, 0.01698724366724491, 0.0433...
730,569
pickledb_ujson
set_sigterm_handler
Assigns sigterm_handler for graceful shutdown during dump()
def set_sigterm_handler(self): """Assigns sigterm_handler for graceful shutdown during dump()""" def sigterm_handler(): if self.dthread is not None: self.dthread.join() sys_exit(0) signal(SIGTERM, sigterm_handler)
(self)
[ 0.017569247633218765, 0.04574737325310707, -0.015085350722074509, 0.028041645884513855, -0.013201956637203693, -0.004490120802074671, 0.004007899202406406, 0.03451979532837868, -0.0128107201308012, -0.015058054588735104, -0.01710522174835205, 0.011937261559069157, -0.012910803779959679, -0...
730,570
pickledb_ujson
totalkeys
Get a total number of keys, lists, and dicts inside the db
def totalkeys(self, name=None): """Get a total number of keys, lists, and dicts inside the db""" if name is None: total = len(self.db) return total else: total = len(self.db[name]) return total
(self, name=None)
[ -0.04831314459443092, -0.044599369168281555, -0.02415657229721546, 0.02345811016857624, 0.046098507940769196, 0.04109002277255058, -0.02476985566318035, -0.03199297562241554, 0.06166910380125046, -0.03597932308912277, -0.03792138770222664, -0.023849928751587868, -0.00011838455247925594, -0...
730,591
pickledb_ujson
load
Return a pickledb object. location is the path to the json file.
def load(location, auto_dump, sig=True): """Return a pickledb object. location is the path to the json file.""" return PickleDB(location, auto_dump, sig)
(location, auto_dump, sig=True)
[ 0.009347129613161087, -0.019599922001361847, -0.04401865601539612, 0.005630492232739925, 0.02223147265613079, -0.02229982428252697, -0.004318988882005215, 0.07812628149986267, -0.024179503321647644, -0.06438753753900528, -0.046410974115133286, 0.0347740538418293, -0.08550829440355301, -0.0...
730,593
signal
signal
Set the action for the given signal. The action can be SIG_DFL, SIG_IGN, or a callable Python object. The previous action is returned. See getsignal() for possible return values. *** IMPORTANT NOTICE *** A signal handler function is called with two arguments: the first is the signal number, the second is the interru...
@_wraps(_signal.signal) def signal(signalnum, handler): handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) return _int_to_enum(handler, Handlers)
(signalnum, handler)
[ -0.0024578736629337072, -0.04099351167678833, 0.002034476725384593, 0.034340750426054, -0.026819484308362007, -0.013670293614268303, -0.015424677170813084, 0.048497408628463745, -0.03678993880748749, -0.022112177684903145, -0.016275813803076744, 0.0243876650929451, 0.0018466621404513717, -...