index int64 0 731k | package stringlengths 2 98 ⌀ | name stringlengths 1 76 | docstring stringlengths 0 281k ⌀ | code stringlengths 4 8.19k | signature stringlengths 2 42.8k ⌀ | embed_func_code listlengths 768 768 |
|---|---|---|---|---|---|---|
722,807 | gitdb.db.base | db_path |
:return: the given relative path relative to our database root, allowing
to pontentially access datafiles | def db_path(self, rela_path):
"""
:return: the given relative path relative to our database root, allowing
to pontentially access datafiles"""
return join(self._root_path, force_text(rela_path))
| (self, rela_path) | [
0.015149763785302639,
0.031068550422787666,
0.029171625152230263,
0.10369855165481567,
0.03766506165266037,
-0.0010771669913083315,
-0.004421885125339031,
0.03489657863974571,
0.002300661988556385,
-0.01902051456272602,
0.015568453818559647,
0.0015925195766612887,
0.00416127173230052,
0.03... |
722,808 | gitdb.db.base | root_path | :return: path at which this db operates | def root_path(self):
""":return: path at which this db operates"""
return self._root_path
| (self) | [
0.0033024600706994534,
0.026035577058792114,
0.05076853930950165,
0.05420877784490585,
0.053941573947668076,
-0.007005724590271711,
0.021526528522372246,
0.0649636909365654,
0.041216038167476654,
-0.011873826384544373,
-0.013410243205726147,
-0.04986673220992088,
-0.008216487243771553,
0.0... |
722,809 | gitdb.stream | FlexibleSha1Writer | Writer producing a sha1 while passing on the written bytes to the given
write function | class FlexibleSha1Writer(Sha1Writer):
"""Writer producing a sha1 while passing on the written bytes to the given
write function"""
__slots__ = 'writer'
def __init__(self, writer):
Sha1Writer.__init__(self)
self.writer = writer
def write(self, data):
Sha1Writer.write(self, ... | (writer) | [
-0.046970147639513016,
-0.026832371950149536,
-0.01571970246732235,
0.04679018631577492,
0.006699095014482737,
-0.024492863565683365,
-0.08249469846487045,
0.02882995270192623,
-0.006127714645117521,
-0.025410670787096024,
0.07378452271223068,
0.07759972661733627,
0.013200231827795506,
0.0... |
722,810 | gitdb.stream | __init__ | null | def __init__(self, writer):
Sha1Writer.__init__(self)
self.writer = writer
| (self, writer) | [
-0.04196518287062645,
0.01194103341549635,
-0.0008010013843886554,
-0.00023496577341575176,
0.009187390096485615,
-0.004434995818883181,
-0.07363636791706085,
0.09065577387809753,
-0.03736719861626625,
0.02233796752989292,
0.04172499105334282,
0.07178345322608948,
-0.011246188543736935,
0.... |
722,812 | gitdb.stream | write | null | def write(self, data):
Sha1Writer.write(self, data)
self.writer(data)
| (self, data) | [
-0.02821941487491131,
0.020194191485643387,
-0.008519151248037815,
0.029216011986136436,
0.054830290377140045,
-0.01004464365541935,
-0.09294573217630386,
0.028359288349747658,
-0.012920785695314407,
0.0058615608140826225,
0.015936801210045815,
-0.014100966043770313,
0.033726923167705536,
... |
722,813 | gitdb.db.git | GitDB | A git-style object database, which contains all objects in the 'objects'
subdirectory
``IMPORTANT``: The usage of this implementation is highly discouraged as it fails to release file-handles.
This can be a problem with long-running processes and/or big repositories.
| class GitDB(FileDBBase, ObjectDBW, CompoundDB):
"""A git-style object database, which contains all objects in the 'objects'
subdirectory
``IMPORTANT``: The usage of this implementation is highly discouraged as it fails to release file-handles.
This can be a problem with long-running processes and/or b... | (root_path) | [
0.013553815893828869,
-0.04476456344127655,
-0.09905197471380234,
0.05915703997015953,
0.06857166439294815,
-0.05904882773756981,
-0.02681906148791313,
0.04905705899000168,
-0.0031675167847424746,
-0.10482338815927505,
-0.01128131989389658,
0.02034424990415573,
-0.06355774402618408,
0.0185... |
722,816 | gitdb.db.git | __init__ | Initialize ourselves on a git objects directory | def __init__(self, root_path):
"""Initialize ourselves on a git objects directory"""
super().__init__(root_path)
| (self, root_path) | [
-0.02386714704334736,
-0.054064273834228516,
-0.03005876950919628,
0.01971633918583393,
0.002082970691844821,
-0.04320299252867699,
0.014951556921005249,
0.11698360741138458,
0.013308528810739517,
-0.016352454200387,
0.029903113842010498,
0.009157720021903515,
-0.009105835109949112,
0.0221... |
722,818 | gitdb.db.git | _set_cache_ | null | def _set_cache_(self, attr):
if attr == '_dbs' or attr == '_loose_db':
self._dbs = list()
loose_db = None
for subpath, dbcls in ((self.packs_dir, self.PackDBCls),
(self.loose_dir, self.LooseDBCls),
(self.alternates_dir, self.Refer... | (self, attr) | [
0.025205733254551888,
0.03507624566555023,
-0.005833434872329235,
0.06183252111077309,
0.03396061435341835,
-0.01854030229151249,
0.020762111991643906,
0.03254243731498718,
0.015070495195686817,
-0.03687260299921036,
0.004805256612598896,
0.07843464612960815,
-0.008197063580155373,
0.01957... |
722,823 | gitdb.db.git | ostream | null | def ostream(self):
return self._loose_db.ostream()
| (self) | [
-0.018907180055975914,
-0.0440460629761219,
-0.018156765028834343,
-0.0026244111359119415,
0.0700821802020073,
-0.040718138217926025,
-0.0356609970331192,
0.014298656955361366,
0.02933141402900219,
-0.0566725991666317,
-0.0448291040956974,
-0.020049113780260086,
-0.046721450984478,
0.04509... |
722,826 | gitdb.db.git | set_ostream | null | def set_ostream(self, ostream):
return self._loose_db.set_ostream(ostream)
| (self, ostream) | [
-0.02327829971909523,
-0.007264032028615475,
-0.03017495572566986,
0.0037196853663772345,
0.003531822469085455,
-0.03506774082779884,
-0.027620021253824234,
0.08416257798671722,
-0.014244182035326958,
-0.046423010528087616,
-0.058012060821056366,
0.006466658320277929,
-0.04608903080224991,
... |
722,829 | gitdb.db.git | store | null | def store(self, istream):
return self._loose_db.store(istream)
| (self, istream) | [
0.0014708386734127998,
0.011741884984076023,
-0.05464651808142662,
0.02828313037753105,
0.03793150186538696,
-0.027869392186403275,
-0.030600063502788544,
0.057294439524412155,
-0.002987188519909978,
-0.04100971296429634,
-0.04392242804169655,
0.03491948917508125,
-0.06805162876844406,
0.0... |
722,832 | gitdb.base | IStream | Represents an input content stream to be fed into the ODB. It is mutable to allow
the ODB to record information about the operations outcome right in this instance.
It provides interfaces for the OStream and a StreamReader to allow the instance
to blend in without prior conversion.
The only method you... | class IStream(list):
"""Represents an input content stream to be fed into the ODB. It is mutable to allow
the ODB to record information about the operations outcome right in this instance.
It provides interfaces for the OStream and a StreamReader to allow the instance
to blend in without prior convers... | (type, size, stream, sha=None) | [
0.0014951208140701056,
-0.07499143481254578,
-0.07577454298734665,
0.003509979695081711,
0.041131556034088135,
-0.016687553375959396,
-0.001675747218541801,
0.026942472904920578,
0.01809527352452278,
-0.06384154409170151,
-0.006409325636923313,
0.044786036014556885,
-0.03749571740627289,
0... |
722,833 | gitdb.base | __init__ | null | def __init__(self, type, size, stream, sha=None):
list.__init__(self, (sha, type, size, stream, None))
| (self, type, size, stream, sha=None) | [
-0.021044423803687096,
-0.013096426613628864,
-0.05765547975897789,
0.010088842362165451,
-0.015133263543248177,
0.013001085259020329,
-0.006903576198965311,
0.023835323750972748,
0.01739545166492462,
-0.004459372255951166,
-0.0009826653404161334,
0.0537378191947937,
-0.04122210666537285,
... |
722,834 | gitdb.base | __new__ | null | def __new__(cls, type, size, stream, sha=None):
return list.__new__(cls, (sha, type, size, stream, None))
| (cls, type, size, stream, sha=None) | [
-0.0031078807078301907,
-0.034700315445661545,
-0.04251789674162865,
-0.017167340964078903,
-0.03809547796845436,
0.01788119599223137,
-0.012553400360047817,
0.015260825864970684,
-0.0040611382573843,
-0.001019093208014965,
-0.004322304856032133,
0.03372529521584511,
-0.02965109795331955,
... |
722,835 | gitdb.base | _binsha | null | def _binsha(self):
return self[0]
| (self) | [
0.00011217212158953771,
-0.04965690150856972,
-0.013108441606163979,
0.06648144125938416,
0.023178664967417717,
-0.050375621765851974,
0.0030831382609903812,
0.053217824548482895,
0.04897085204720497,
-0.05259711295366287,
0.018801018595695496,
0.07167581468820572,
0.0009504641639068723,
0... |
722,836 | gitdb.base | _error | :return: the error that occurred when processing the stream, or None | def _error(self):
""":return: the error that occurred when processing the stream, or None"""
return self[4]
| (self) | [
-0.020542532205581665,
0.004145708866417408,
-0.0029441160149872303,
0.07341261208057404,
0.01709597185254097,
-0.04837159439921379,
0.02466472238302231,
0.03438009321689606,
0.0738915428519249,
-0.06284201890230179,
0.04782424867153168,
0.011819225735962391,
0.06109735742211342,
-0.005396... |
722,837 | gitdb.base | _set_binsha | null | def _set_binsha(self, binsha):
self[0] = binsha
| (self, binsha) | [
-0.014802136458456516,
0.016448695212602615,
-0.04914342984557152,
0.07572478801012039,
-0.035903412848711014,
-0.009001185186207294,
-0.012277414090931416,
0.10119155794382095,
0.056776706129312515,
-0.033657338470220566,
-0.016921551898121834,
0.057182010263204575,
-0.020383546128869057,
... |
722,838 | gitdb.base | _set_error | Set this input stream to the given exc, may be None to reset the error | def _set_error(self, exc):
"""Set this input stream to the given exc, may be None to reset the error"""
self[4] = exc
| (self, exc) | [
-0.027709541842341423,
0.013439297676086426,
0.04083511605858803,
0.08044924587011337,
-0.028930526226758957,
-0.014338077045977116,
-0.0032517164945602417,
0.03598509728908539,
0.07542964816093445,
-0.03038892336189747,
0.04378582537174225,
-0.03873230889439583,
0.05324844643473625,
0.015... |
722,839 | gitdb.base | _set_size | null | def _set_size(self, size):
self[2] = size
| (self, size) | [
0.028579875826835632,
0.020182956010103226,
-0.039893798530101776,
-0.003094045678153634,
-0.015402782708406448,
0.03341906517744064,
0.01383468322455883,
0.021548720076680183,
-0.029507245868444443,
-0.016743255779147148,
-0.011440381407737732,
-0.023470906540751457,
0.0379716120660305,
0... |
722,840 | gitdb.base | _set_stream | null | def _set_stream(self, stream):
self[3] = stream
| (self, stream) | [
-0.024278171360492706,
0.01559885311871767,
-0.04346492886543274,
0.02205708622932434,
-0.015137550421059132,
0.027831906452775,
-0.00890996865928173,
0.09082530438899994,
0.0322057381272316,
0.01656416989862919,
-0.021544527262449265,
-0.02330430969595909,
-0.013411938212811947,
0.0289937... |
722,841 | gitdb.base | _set_type | null | def _set_type(self, type):
self[1] = type
| (self, type) | [
0.002416418632492423,
0.07174805551767349,
0.02680223621428013,
0.004850051365792751,
-0.0017547545721754432,
-0.009484927169978619,
0.012178922072052956,
0.05625543370842934,
-0.041933365166187286,
0.005706449039280415,
-0.023290574550628662,
0.004124910570681095,
0.009321394376456738,
0.... |
722,842 | gitdb.base | _size | null | def _size(self):
return self[2]
| (self) | [
0.013694028370082378,
-0.03306829556822777,
-0.033250994980335236,
0.020777719095349312,
0.046405233442783356,
0.02619221620261669,
0.03268629312515259,
0.00225050444714725,
-0.0034774858504533768,
-0.02702266164124012,
0.009193019941449165,
-0.026325087994337082,
0.0006804454023949802,
-0... |
722,843 | gitdb.base | _stream | null | def _stream(self):
return self[3]
| (self) | [
-0.02630525268614292,
-0.02066108211874962,
-0.06345415115356445,
0.01857445016503334,
0.04077485203742981,
0.0015938365831971169,
-0.00846197921782732,
0.06184642016887665,
0.06831155717372894,
-0.02300426922738552,
0.0052892714738845825,
-0.0018108378862962127,
-0.022833233699202538,
0.0... |
722,844 | gitdb.base | _type | null | def _type(self):
return self[1]
| (self) | [
0.03525415062904358,
0.017592428252100945,
0.03859766572713852,
0.0022845901548862457,
0.051036231219768524,
-0.04628948122262955,
0.05633734539151192,
0.027337124571204185,
0.0037116471212357283,
-0.0406765341758728,
-0.005911783315241337,
0.02193206548690796,
-0.014041027054190636,
-0.01... |
722,845 | gitdb.base | read | Implements a simple stream reader interface, passing the read call on
to our internal stream | def read(self, size=-1):
"""Implements a simple stream reader interface, passing the read call on
to our internal stream"""
return self[3].read(size)
| (self, size=-1) | [
-0.0370362251996994,
-0.05605112388730049,
-0.07928013801574707,
0.015014917589724064,
0.0317428894340992,
0.04145590588450432,
0.017250454053282738,
0.016094142571091652,
0.04817107692360878,
-0.06951572746038437,
0.024719368666410446,
0.010218366980552673,
-0.033353161066770554,
0.042038... |
722,846 | gitdb.base | InvalidOInfo | Carries information about a sha identifying an object which is invalid in
the queried database. The exception attribute provides more information about
the cause of the issue | class InvalidOInfo(tuple):
"""Carries information about a sha identifying an object which is invalid in
the queried database. The exception attribute provides more information about
the cause of the issue"""
__slots__ = tuple()
def __new__(cls, sha, exc):
return tuple.__new__(cls, (sha, ex... | (sha, exc) | [
0.03175143897533417,
-0.02851368486881256,
0.005071286112070084,
0.055417437106370926,
0.02250327169895172,
-0.11841944605112076,
-0.00390855735167861,
0.020696571096777916,
0.012807903811335564,
-0.07498705387115479,
0.03248485177755356,
0.09509331732988358,
0.00906481221318245,
0.0053306... |
722,847 | gitdb.base | __init__ | null | def __init__(self, sha, exc):
tuple.__init__(self, (sha, exc))
| (self, sha, exc) | [
-0.01626000553369522,
-0.023595914244651794,
0.021360687911510468,
0.0603678934276104,
-0.01411721296608448,
-0.07179611176252365,
-0.006886343006044626,
0.07098941504955292,
0.04426754638552666,
-0.03373005613684654,
0.044233936816453934,
0.10917311906814575,
0.0007252928335219622,
0.0170... |
722,848 | gitdb.base | __new__ | null | def __new__(cls, sha, exc):
return tuple.__new__(cls, (sha, exc))
| (cls, sha, exc) | [
0.007121911738067865,
-0.05555429682135582,
0.01942032016813755,
0.036945976316928864,
-0.023835567757487297,
-0.05355812981724739,
-0.0008812519954517484,
0.056738462299108505,
0.02457989938557148,
-0.024901317432522774,
0.037419643253088,
0.09892860054969788,
-0.0038443098310381174,
0.02... |
722,849 | gitdb.base | InvalidOStream | Carries information about an invalid ODB stream | class InvalidOStream(InvalidOInfo):
"""Carries information about an invalid ODB stream"""
__slots__ = tuple()
| (sha, exc) | [
0.009798619896173477,
-0.015775145962834358,
-0.03319090977311134,
0.004655921831727028,
0.002269367454573512,
-0.06627364456653595,
-0.002591631142422557,
0.02168857306241989,
0.016415167599916458,
-0.08148989826440811,
0.006891485303640366,
0.04640597477555275,
0.0010405962821096182,
0.0... |
722,852 | gitdb.db.loose | LooseObjectDB | A database which operates on loose object files | class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW):
"""A database which operates on loose object files"""
# CONFIGURATION
# chunks in which data will be copied between streams
stream_chunk_size = chunk_size
# On windows we need to keep it writable, otherwise it cannot be removed
# either
... | (root_path) | [
0.030352966859936714,
-0.026519732549786568,
-0.0830795168876648,
0.05084904283285141,
0.07142335176467896,
-0.0585937425494194,
-0.03254338726401329,
0.06590818613767624,
-0.028455907478928566,
-0.07513923943042755,
-0.012487351894378662,
0.05186602473258972,
-0.0415397584438324,
0.045568... |
722,854 | gitdb.db.loose | __init__ | null | def __init__(self, root_path):
super().__init__(root_path)
self._hexsha_to_file = dict()
# Additional Flags - might be set to 0 after the first failure
# Depending on the root, this might work for some mounts, for others not, which
# is why it is per instance
self._fd_open_flags = getattr(os, 'O... | (self, root_path) | [
0.018291011452674866,
-0.011527055874466896,
0.027888039126992226,
0.0643107071518898,
0.02645379677414894,
-0.005874195136129856,
-0.032049112021923065,
0.07932598143815994,
-0.0007409143727272749,
-0.023921741172671318,
0.06207966059446335,
0.03373124822974205,
-0.0030101374723017216,
-0... |
722,855 | gitdb.db.loose | _map_loose_object |
:return: memory map of that file to allow random read access
:raise BadObject: if object could not be located | def _map_loose_object(self, sha):
"""
:return: memory map of that file to allow random read access
:raise BadObject: if object could not be located"""
db_path = self.db_path(self.object_path(bin_to_hex(sha)))
try:
return file_contents_ro_filepath(db_path, flags=self._fd_open_flags)
excep... | (self, sha) | [
0.08622836321592331,
0.015545811504125595,
-0.048890575766563416,
0.08873378485441208,
0.028620995581150055,
-0.07265730947256088,
0.008851629681885242,
0.10119131207466125,
-0.016093872487545013,
-0.07349245250225067,
0.035093341022729874,
0.0691775530576706,
-0.04217464476823807,
0.01427... |
722,857 | gitdb.db.loose | has_object | null | def has_object(self, sha):
try:
self.readable_db_object_path(bin_to_hex(sha))
return True
except BadObject:
return False
# END check existence
| (self, sha) | [
0.015445869415998459,
-0.018930349498987198,
-0.06846277415752411,
0.07851579785346985,
0.0546952486038208,
-0.01442352868616581,
0.030227217823266983,
0.05800081789493561,
-0.020702406764030457,
-0.015420311130583286,
0.011731363832950592,
0.05762596055865288,
0.037553995847702026,
-0.037... |
722,858 | gitdb.db.loose | info | null | def info(self, sha):
m = self._map_loose_object(sha)
try:
typ, size = loose_object_header_info(m)
return OInfo(sha, typ, size)
finally:
if hasattr(m, 'close'):
m.close()
# END assure release of system resources
| (self, sha) | [
0.04520171508193016,
0.006173302419483662,
-0.03368513286113739,
0.026007413864135742,
0.04859098047018051,
-0.072696253657341,
0.06916865706443787,
0.038734447211027145,
-0.04004865139722824,
-0.02479696273803711,
0.007184893824160099,
0.027511831372976303,
-0.025419481098651886,
-0.05730... |
722,859 | gitdb.db.loose | object_path |
:return: path at which the object with the given hexsha would be stored,
relative to the database root | def object_path(self, hexsha):
"""
:return: path at which the object with the given hexsha would be stored,
relative to the database root"""
return join(hexsha[:2], hexsha[2:])
| (self, hexsha) | [
-0.005031223874539137,
0.026917893439531326,
-0.03679399937391281,
0.08171927183866501,
0.023614564910531044,
-0.04790673777461052,
0.007881403900682926,
0.08727563917636871,
0.004290092270821333,
-0.03445626050233841,
0.03736996650695801,
0.02657909132540226,
-0.0059375218115746975,
-0.01... |
722,860 | gitdb.db.base | ostream |
Return the output stream
:return: overridden output stream this instance will write to, or None
if it will write to the default stream | def ostream(self):
"""
Return the output stream
:return: overridden output stream this instance will write to, or None
if it will write to the default stream"""
return self._ostream
| (self) | [
-0.014514700509607792,
-0.07585607469081879,
0.001887259422801435,
-0.01258172933012247,
0.03733595460653305,
-0.027322813868522644,
-0.030875302851200104,
0.029743382707238197,
0.03176342323422432,
-0.0132347596809268,
-0.013034497387707233,
-0.046983398497104645,
-0.041585009545087814,
0... |
722,861 | gitdb.db.loose | partial_to_complete_sha_hex | :return: 20 byte binary sha1 string which matches the given name uniquely
:param name: hexadecimal partial name (bytes or ascii string)
:raise AmbiguousObjectName:
:raise BadObject: | def partial_to_complete_sha_hex(self, partial_hexsha):
""":return: 20 byte binary sha1 string which matches the given name uniquely
:param name: hexadecimal partial name (bytes or ascii string)
:raise AmbiguousObjectName:
:raise BadObject: """
candidate = None
for binsha in self.sha_iter():
... | (self, partial_hexsha) | [
0.006177595816552639,
-0.026044130325317383,
-0.03393847495317459,
0.015950903296470642,
-0.011003419756889343,
-0.06495712697505951,
0.03734494000673294,
-0.005826135165989399,
0.05136731639504433,
-0.06149659305810928,
0.025863895192742348,
0.054070860147476196,
-0.02431386336684227,
0.0... |
722,862 | gitdb.db.loose | readable_db_object_path |
:return: readable object path to the object identified by hexsha
:raise BadObject: If the object file does not exist | def readable_db_object_path(self, hexsha):
"""
:return: readable object path to the object identified by hexsha
:raise BadObject: If the object file does not exist"""
try:
return self._hexsha_to_file[hexsha]
except KeyError:
pass
# END ignore cache misses
# try filesystem
... | (self, hexsha) | [
0.012681773863732815,
0.027566775679588318,
-0.05058608949184418,
0.07304137945175171,
0.05439326539635658,
-0.057601165026426315,
0.030545538291335106,
0.08474491536617279,
-0.010972069576382637,
-0.07004498690366745,
0.04149116948246956,
0.037437230348587036,
-0.02093946747481823,
-0.037... |
722,864 | gitdb.db.loose | set_ostream | :raise TypeError: if the stream does not support the Sha1Writer interface | def set_ostream(self, stream):
""":raise TypeError: if the stream does not support the Sha1Writer interface"""
if stream is not None and not isinstance(stream, Sha1Writer):
raise TypeError("Output stream musst support the %s interface" % Sha1Writer.__name__)
return super().set_ostream(stream)
| (self, stream) | [
-0.0259824488312006,
-0.01906205527484417,
0.01929214410483837,
-0.022619597613811493,
0.016389474272727966,
-0.00048340982175432146,
-0.05373481661081314,
0.09210671484470367,
-0.019982414320111275,
0.02339836210012436,
0.02546917088329792,
0.03069043904542923,
-0.006464638281613588,
0.02... |
722,865 | gitdb.db.loose | sha_iter | null | def sha_iter(self):
# find all files which look like an object, extract sha from there
for root, dirs, files in os.walk(self.root_path()):
root_base = basename(root)
if len(root_base) != 2:
continue
for f in files:
if len(f) != 38:
continue
... | (self) | [
0.003791481489315629,
-0.05806637182831764,
-0.06767294555902481,
0.05607390031218529,
0.012061581015586853,
-0.02252206765115261,
-0.02323366515338421,
0.027289772406220436,
0.022397538647055626,
0.01597536914050579,
0.019337667152285576,
0.030385222285985947,
-0.007240506820380688,
0.037... |
722,866 | gitdb.db.loose | size | null | def size(self):
return len(tuple(self.sha_iter()))
| (self) | [
-0.023510832339525223,
-0.059336863458156586,
-0.0466923825442791,
0.08726008981466293,
0.06421025842428207,
0.026787200942635536,
-0.011236794292926788,
-0.026836594566702843,
0.01987225003540516,
-0.008417305536568165,
0.025223106145858765,
0.023049835115671158,
-0.010635852813720703,
-0... |
722,867 | gitdb.db.loose | store | note: The sha we produce will be hex by nature | def store(self, istream):
"""note: The sha we produce will be hex by nature"""
tmp_path = None
writer = self.ostream()
if writer is None:
# open a tmp file to write the data to
fd, tmp_path = tempfile.mkstemp(prefix='obj', dir=self._root_path)
if istream.binsha is None:
... | (self, istream) | [
0.0053348178043961525,
-0.0026330938562750816,
-0.04582635685801506,
0.015034486539661884,
0.07437632232904434,
-0.02305958978831768,
-0.03872546926140785,
0.07415670901536942,
-0.02401125431060791,
-0.01623321883380413,
0.010532375425100327,
0.05204878747463226,
-0.04937680438160896,
0.01... |
722,868 | gitdb.db.loose | stream | null | def stream(self, sha):
m = self._map_loose_object(sha)
type, size, stream = DecompressMemMapReader.new(m, close_on_deletion=True)
return OStream(sha, type, size, stream)
| (self, sha) | [
0.017920678481459618,
-0.010048815980553627,
-0.04740533232688904,
-0.0003077667497564107,
0.02194368839263916,
0.0011864395346492529,
0.025583554059267044,
0.06478612869977951,
-0.010754149407148361,
0.009247696958482265,
-0.004723988473415375,
0.05855133384466171,
-0.05660078302025795,
0... |
722,869 | gitdb.db.mem | MemoryDB | A memory database stores everything to memory, providing fast IO and object
retrieval. It should be used to buffer results and obtain SHAs before writing
it to the actual physical storage, as it allows to query whether object already
exists in the target storage before introducing actual IO | class MemoryDB(ObjectDBR, ObjectDBW):
"""A memory database stores everything to memory, providing fast IO and object
retrieval. It should be used to buffer results and obtain SHAs before writing
it to the actual physical storage, as it allows to query whether object already
exists in the target storage... | () | [
0.01048762071877718,
-0.04425831884145737,
-0.08613435924053192,
0.027805689722299576,
0.07429739832878113,
-0.02648426778614521,
-0.024641722440719604,
0.051516830921173096,
-0.024381158873438835,
-0.08635769784450531,
-0.00743532320484519,
0.05348965898156166,
-0.05084681510925293,
0.046... |
722,871 | gitdb.db.mem | __init__ | null | def __init__(self):
super().__init__()
self._db = LooseObjectDB("path/doesnt/matter")
# maps 20 byte shas to their OStream objects
self._cache = dict()
| (self) | [
-0.0016656911466270685,
-0.03320043534040451,
-0.07467376440763474,
0.03027952089905739,
0.02117208018898964,
-0.01194671355187893,
-0.02115393802523613,
0.07028332352638245,
0.0004297460545785725,
-0.05602346360683441,
-0.015493535436689854,
0.08730081468820572,
-0.05036306381225586,
0.07... |
722,872 | gitdb.db.mem | has_object | null | def has_object(self, sha):
return sha in self._cache
| (self, sha) | [
0.0023065442219376564,
-0.024306440725922585,
-0.08654461801052094,
0.08442208915948868,
0.056760672479867935,
0.013068990781903267,
0.020643357187509537,
0.03663083165884018,
-0.0018679157365113497,
-0.0032244548201560974,
0.023056883364915848,
0.03322450816631317,
0.025555996224284172,
-... |
722,873 | gitdb.db.mem | info | null | def info(self, sha):
# we always return streams, which are infos as well
return self.stream(sha)
| (self, sha) | [
0.008076061494648457,
-0.017598092555999756,
-0.025370171293616295,
0.036412112414836884,
0.058134499937295914,
-0.012553634122014046,
0.03818671032786369,
0.011797786690294743,
0.03818671032786369,
0.0030541974119842052,
0.0002390263689449057,
0.01983276940882206,
-0.01210176944732666,
-0... |
722,875 | gitdb.db.mem | set_ostream | null | def set_ostream(self, stream):
raise UnsupportedOperation("MemoryDB's always stream into memory")
| (self, stream) | [
0.017386898398399353,
-0.01481666136533022,
-0.014573076739907265,
-0.010574929416179657,
0.006614580750465393,
0.014354689978063107,
-0.015295431017875671,
0.057418759912252426,
-0.02420726604759693,
-0.05076638236641884,
-0.0033282891381531954,
0.013237561099231243,
-0.036319296807050705,
... |
722,876 | gitdb.db.mem | sha_iter | null | def sha_iter(self):
return self._cache.keys()
| (self) | [
-0.006635753903537989,
-0.03001869097352028,
-0.09581060707569122,
0.03797011822462082,
0.05118424445390701,
0.018935875967144966,
-0.028215274214744568,
-0.01258292980492115,
0.09181030094623566,
-0.00511924410238862,
0.0162307508289814,
0.01411583460867405,
-0.005074158776551485,
0.02826... |
722,877 | gitdb.db.mem | size | null | def size(self):
return len(self._cache)
| (self) | [
-0.020988309755921364,
-0.0278457123786211,
-0.0410112589597702,
0.03471975773572922,
0.08009178936481476,
0.041910044848918915,
-0.026913639158010483,
-0.009595369920134544,
0.004747752100229263,
-0.042409371584653854,
0.004088226705789566,
-0.006229084450751543,
-0.019640132784843445,
0.... |
722,878 | gitdb.db.mem | store | null | def store(self, istream):
zstream = ZippedStoreShaWriter()
self._db.set_ostream(zstream)
istream = self._db.store(istream)
zstream.close() # close to flush
zstream.seek(0)
# don't provide a size, the stream is written in object format, hence the
# header needs decompression
decomp_st... | (self, istream) | [
-0.0027087528724223375,
0.003341322299093008,
-0.0216700229793787,
0.03495398163795471,
0.0599314384162426,
-0.007717347703874111,
-0.04102664813399315,
0.08060742169618607,
-0.0345202200114727,
-0.011033819057047367,
0.017070339992642403,
0.05526850000023842,
-0.06669089943170547,
0.00696... |
722,879 | gitdb.db.mem | stream | null | def stream(self, sha):
try:
ostream = self._cache[sha]
# rewind stream for the next one to read
ostream.stream.seek(0)
return ostream
except KeyError as e:
raise BadObject(sha) from e
# END exception handling
| (self, sha) | [
-0.015101279132068157,
-0.014112863689661026,
-0.11592832207679749,
0.024839326739311218,
0.02363603748381138,
-0.009583339095115662,
0.008904339745640755,
0.07666671276092529,
0.05548882111907005,
-0.018599413335323334,
-0.017258604988455772,
0.05256654694676399,
-0.030855773016810417,
0.... |
722,880 | gitdb.db.mem | stream_copy | Copy the streams as identified by sha's yielded by sha_iter into the given odb
The streams will be copied directly
**Note:** the object will only be written if it did not exist in the target db
:return: amount of streams actually copied into odb. If smaller than the amount
of input ... | def stream_copy(self, sha_iter, odb):
"""Copy the streams as identified by sha's yielded by sha_iter into the given odb
The streams will be copied directly
**Note:** the object will only be written if it did not exist in the target db
:return: amount of streams actually copied into odb. If smaller than ... | (self, sha_iter, odb) | [
-0.052393604069948196,
-0.044956378638744354,
-0.09035676717758179,
0.026141300797462463,
0.01377367228269577,
0.022552190348505974,
0.009860802441835403,
0.02288520149886608,
0.010674826800823212,
-0.022589191794395447,
-0.019370093941688538,
0.030710941180586815,
-0.04732444882392883,
0.... |
722,881 | gitdb.stream | NullStream | A stream that does nothing but providing a stream interface.
Use it like /dev/null | class NullStream:
"""A stream that does nothing but providing a stream interface.
Use it like /dev/null"""
__slots__ = tuple()
def read(self, size=0):
return ''
def close(self):
pass
def write(self, data):
return len(data)
| () | [
-0.01645514741539955,
-0.05041728913784027,
0.011971431784331799,
-0.030824430286884308,
0.02875639498233795,
0.009939051233232021,
-0.0302539374679327,
0.04161030799150467,
0.027241023257374763,
-0.030699634924530983,
0.02727667987346649,
0.01725740171968937,
-0.00109195860568434,
0.00793... |
722,883 | gitdb.stream | read | null | def read(self, size=0):
return ''
| (self, size=0) | [
-0.0276884026825428,
-0.01929648593068123,
-0.0286573339253664,
-0.007718594279140234,
0.03281223773956299,
0.025750543922185898,
-0.021759865805506706,
0.00892565120011568,
0.06394937634468079,
-0.08165287226438522,
0.025274289771914482,
0.022433189675211906,
-0.02706434763967991,
0.04338... |
722,884 | gitdb.stream | write | null | def write(self, data):
return len(data)
| (self, data) | [
-0.0419548824429512,
0.0028653910849243402,
-0.010227115824818611,
0.04823340103030205,
0.07985489070415497,
0.032782360911369324,
-0.05013003572821617,
0.012279079295694828,
0.006540121976286173,
-0.061673350632190704,
0.02619318850338459,
-0.03754030168056488,
0.001114886486902833,
-0.02... |
722,885 | gitdb.base | ODeltaPackInfo | Adds delta specific information,
Either the 20 byte sha which points to some object in the database,
or the negative offset from the pack_offset, so that pack_offset - delta_info yields
the pack offset of the base object | class ODeltaPackInfo(OPackInfo):
"""Adds delta specific information,
Either the 20 byte sha which points to some object in the database,
or the negative offset from the pack_offset, so that pack_offset - delta_info yields
the pack offset of the base object"""
__slots__ = tuple()
def __new__(cl... | (packoffset, type, size, delta_info) | [
0.027060629799962044,
-0.05667031556367874,
-0.061953142285346985,
0.0048949262127280235,
0.03709061071276665,
-0.06472385674715042,
-0.015183506533503532,
0.01950581930577755,
-0.0533454604446888,
-0.05042697489261627,
0.027891842648386955,
0.012976172380149364,
-0.011165972799062729,
0.0... |
722,886 | gitdb.base | __init__ | null | def __init__(self, *args):
tuple.__init__(self)
| (self, *args) | [
-0.017711760476231575,
-0.01587088219821453,
0.024092284962534904,
0.01068782340735197,
-0.05365358665585518,
-0.028095750138163567,
-0.015888754278421402,
0.06405545026063919,
0.025254003703594208,
-0.01386021263897419,
-0.005142844747751951,
0.06927425414323807,
-0.01365467719733715,
0.0... |
722,887 | gitdb.base | __new__ | null | def __new__(cls, packoffset, type, size, delta_info):
return tuple.__new__(cls, (packoffset, type, size, delta_info))
| (cls, packoffset, type, size, delta_info) | [
0.043214164674282074,
-0.04869655892252922,
-0.02798529341816902,
-0.02667740173637867,
-0.024043701589107513,
-0.03149689361453056,
-0.007117258384823799,
0.026713233441114426,
-0.05880136415362358,
-0.00526291923597455,
0.012577257119119167,
0.03278686851263046,
-0.00980918575078249,
0.0... |
722,888 | gitdb.base | ODeltaPackStream | Provides a stream outputting the uncompressed offset delta information | class ODeltaPackStream(ODeltaPackInfo):
"""Provides a stream outputting the uncompressed offset delta information"""
__slots__ = tuple()
def __new__(cls, packoffset, type, size, delta_info, stream):
return tuple.__new__(cls, (packoffset, type, size, delta_info, stream))
#{ Stream Reader Inter... | (packoffset, type, size, delta_info, stream) | [
0.027481645345687866,
-0.061461590230464935,
-0.0687948688864708,
-0.01574658416211605,
0.03982478752732277,
-0.033871036022901535,
-0.024432161822915077,
0.06349457800388336,
-0.04908214509487152,
-0.025557566434144974,
0.025466809049248695,
-0.013114589266479015,
-0.02927866205573082,
0.... |
722,890 | gitdb.base | __new__ | null | def __new__(cls, packoffset, type, size, delta_info, stream):
return tuple.__new__(cls, (packoffset, type, size, delta_info, stream))
| (cls, packoffset, type, size, delta_info, stream) | [
0.03746204823255539,
-0.05094694346189499,
-0.029331449419260025,
-0.02729429304599762,
-0.021290989592671394,
-0.026717398315668106,
-0.009104106575250626,
0.0393730066716671,
-0.0539395771920681,
-0.0041486783884465694,
0.012258995324373245,
0.03713754564523697,
-0.01755920797586441,
0.0... |
722,891 | gitdb.base | read | null | def read(self, size=-1):
return self[4].read(size)
| (self, size=-1) | [
-0.007902886718511581,
-0.013392615132033825,
-0.07237817347049713,
0.0026246209163218737,
0.026188161224126816,
0.03983784839510918,
0.009619463235139847,
0.004589976742863655,
0.039108093827962875,
-0.07237817347049713,
0.027415471151471138,
0.005216071382164955,
-0.03063301555812359,
0.... |
722,892 | gitdb.base | OInfo | Carries information about an object in an ODB, providing information
about the binary sha of the object, the type_string as well as the uncompressed size
in bytes.
It can be accessed using tuple notation and using attribute access notation::
assert dbi[0] == dbi.binsha
assert dbi[1] == dbi... | class OInfo(tuple):
"""Carries information about an object in an ODB, providing information
about the binary sha of the object, the type_string as well as the uncompressed size
in bytes.
It can be accessed using tuple notation and using attribute access notation::
assert dbi[0] == dbi.binsha
... | (sha, type, size) | [
0.031654760241508484,
-0.05564240366220474,
-0.05255322530865669,
0.013808248564600945,
0.05646122246980667,
-0.09438738226890564,
-0.0009141916525550187,
0.016785768792033195,
-0.04659818857908249,
-0.0772666409611702,
0.002677441807463765,
0.07391693443059921,
-0.02082403004169464,
0.030... |
722,894 | gitdb.base | __new__ | null | def __new__(cls, sha, type, size):
return tuple.__new__(cls, (sha, type, size))
| (cls, sha, type, size) | [
0.013313357718288898,
-0.04526893422007561,
-0.01418391428887844,
-0.0023258805740624666,
-0.018325651064515114,
-0.01908189244568348,
-0.006225797347724438,
0.017991498112678528,
-0.016338320448994637,
-0.026063930243253708,
0.023988666012883186,
0.0868094190955162,
-0.0220189206302166,
0... |
722,895 | gitdb.base | OPackInfo | As OInfo, but provides a type_id property to retrieve the numerical type id, and
does not include a sha.
Additionally, the pack_offset is the absolute offset into the packfile at which
all object information is located. The data_offset property points to the absolute
location in the pack at which that ... | class OPackInfo(tuple):
"""As OInfo, but provides a type_id property to retrieve the numerical type id, and
does not include a sha.
Additionally, the pack_offset is the absolute offset into the packfile at which
all object information is located. The data_offset property points to the absolute
loc... | (packoffset, type, size) | [
0.018459247425198555,
-0.06037301570177078,
-0.05571792274713516,
-0.0074571059085428715,
0.06560105085372925,
-0.08751580864191055,
0.003712886944413185,
0.013150647282600403,
-0.03860149160027504,
-0.06445518136024475,
0.020715178921818733,
0.025728359818458557,
-0.006969216279685497,
0.... |
722,897 | gitdb.base | __new__ | null | def __new__(cls, packoffset, type, size):
return tuple.__new__(cls, (packoffset, type, size))
| (cls, packoffset, type, size) | [
0.03825351223349571,
-0.04560306295752525,
-0.013578741811215878,
-0.029254795983433723,
-0.024235589429736137,
-0.01970038004219532,
-0.007851471193134785,
0.009939818643033504,
-0.05212802812457085,
-0.019090905785560608,
0.0056779757142066956,
0.04434826225042343,
-0.01136491447687149,
... |
722,898 | gitdb.base | OPackStream | Next to pack object information, a stream outputting an undeltified base object
is provided | class OPackStream(OPackInfo):
"""Next to pack object information, a stream outputting an undeltified base object
is provided"""
__slots__ = tuple()
def __new__(cls, packoffset, type, size, stream, *args):
"""Helps with the initialization of subclasses"""
return tuple.__new__(cls, (pack... | (packoffset, type, size, stream, *args) | [
-0.013567497953772545,
-0.06227883696556091,
-0.038252297788858414,
-0.0180564746260643,
0.041726455092430115,
-0.035948384553194046,
-0.0189250148832798,
0.03631408512592316,
-0.01512172631919384,
-0.06429019570350647,
0.021777480840682983,
0.019491849467158318,
-0.019016439095139503,
0.0... |
722,900 | gitdb.base | __new__ | Helps with the initialization of subclasses | def __new__(cls, packoffset, type, size, stream, *args):
"""Helps with the initialization of subclasses"""
return tuple.__new__(cls, (packoffset, type, size, stream))
| (cls, packoffset, type, size, stream, *args) | [
0.011899949982762337,
-0.0496392697095871,
-0.012009207159280777,
-0.02731434442102909,
-0.03581821173429489,
-0.011790691874921322,
-0.03334170952439308,
0.03206704184412956,
-0.027041200548410416,
-0.02600325644016266,
0.011626806110143661,
0.06508097797632217,
-0.025730112567543983,
0.0... |
722,901 | gitdb.base | read | null | def read(self, size=-1):
return self[3].read(size)
| (self, size=-1) | [
-0.021232279017567635,
-0.025740617886185646,
-0.07896219938993454,
0.014569221995770931,
0.029619112610816956,
0.046807147562503815,
0.002761770971119404,
-0.0003289055894128978,
0.04140377417206764,
-0.07571354508399963,
0.032503124326467514,
0.012207318097352982,
-0.03477386757731438,
0... |
722,902 | gitdb.base | OStream | Base for object streams retrieved from the database, providing additional
information about the stream.
Generally, ODB streams are read-only as objects are immutable | class OStream(OInfo):
"""Base for object streams retrieved from the database, providing additional
information about the stream.
Generally, ODB streams are read-only as objects are immutable"""
__slots__ = tuple()
def __new__(cls, sha, type, size, stream, *args, **kwargs):
"""Helps with th... | (sha, type, size, stream, *args, **kwargs) | [
0.004135989584028721,
-0.05747042968869209,
-0.06385193765163422,
0.0015008524060249329,
0.04013339430093765,
-0.0532652772963047,
-0.0026328316889703274,
0.04610913619399071,
0.00013796718849334866,
-0.06503232568502426,
-0.00468238303437829,
0.0373668447136879,
-0.023386554792523384,
0.0... |
722,903 | gitdb.base | __init__ | null | def __init__(self, *args, **kwargs):
tuple.__init__(self)
| (self, *args, **kwargs) | [
-0.01603645458817482,
-0.01954718492925167,
0.026109959930181503,
0.005667448975145817,
-0.048373993486166,
-0.027874145656824112,
-0.021417222917079926,
0.0605468787252903,
0.02485738694667816,
-0.015886498615145683,
-0.005914435256272554,
0.074589803814888,
-0.01586003601551056,
0.053842... |
722,904 | gitdb.base | __new__ | Helps with the initialization of subclasses | def __new__(cls, sha, type, size, stream, *args, **kwargs):
"""Helps with the initialization of subclasses"""
return tuple.__new__(cls, (sha, type, size, stream))
| (cls, sha, type, size, stream, *args, **kwargs) | [
-0.010813494212925434,
-0.05471198260784149,
-0.009443904273211956,
-0.007716251537203789,
-0.027857279404997826,
-0.01794789358973503,
-0.029951946809887886,
0.043289780616760254,
0.0004878604377154261,
-0.02270117588341236,
0.024491488933563232,
0.0981091856956482,
-0.029200013726949692,
... |
722,906 | gitdb.db.base | ObjectDBR | Defines an interface for object database lookup.
Objects are identified either by their 20 byte bin sha | class ObjectDBR:
"""Defines an interface for object database lookup.
Objects are identified either by their 20 byte bin sha"""
def __contains__(self, sha):
return self.has_obj
#{ Query Interface
def has_object(self, sha):
"""
Whether the object identified by the given 20 b... | () | [
0.0036950642243027687,
-0.07970879971981049,
-0.10297554731369019,
0.04902898520231247,
0.042533379048109055,
-0.05816687270998955,
-0.021211640909314156,
0.020385928452014923,
-0.0009300736128352582,
-0.0969570204615593,
-0.021652022376656532,
0.05152447149157524,
-0.024294301867485046,
0... |
722,908 | gitdb.db.base | has_object |
Whether the object identified by the given 20 bytes
binary sha is contained in the database
:return: True if the object identified by the given 20 bytes
binary sha is contained in the database | def has_object(self, sha):
"""
Whether the object identified by the given 20 bytes
binary sha is contained in the database
:return: True if the object identified by the given 20 bytes
binary sha is contained in the database"""
raise NotImplementedError("To be implemented in subclass")
| (self, sha) | [
-0.0017374888993799686,
-0.04917372763156891,
-0.06580550968647003,
0.08824467658996582,
0.030291153118014336,
-0.04700884595513344,
0.009570148773491383,
0.05625254288315773,
-0.025463124737143517,
-0.04841773584485054,
0.0029337573796510696,
0.054328203201293945,
0.0158672034740448,
-0.0... |
722,909 | gitdb.db.base | info | :return: OInfo instance
:param sha: bytes binary sha
:raise BadObject: | def info(self, sha):
""" :return: OInfo instance
:param sha: bytes binary sha
:raise BadObject:"""
raise NotImplementedError("To be implemented in subclass")
| (self, sha) | [
0.029094690456986427,
-0.039810217916965485,
-0.01032556314021349,
0.06483571976423264,
0.012894238345324993,
-0.08491037786006927,
0.03835209459066391,
0.04825378209352493,
0.0018862379947677255,
-0.04913543909788132,
0.02943379059433937,
0.06185165047645569,
-0.003876324975863099,
-0.027... |
722,910 | gitdb.db.base | sha_iter | Return iterator yielding 20 byte shas for all objects in this data base | def sha_iter(self):
"""Return iterator yielding 20 byte shas for all objects in this data base"""
raise NotImplementedError()
| (self) | [
0.00893019512295723,
-0.07646587491035461,
-0.08500032126903534,
0.023521343246102333,
0.025913052260875702,
-0.0025465681683272123,
-0.02020047977566719,
0.01765391230583191,
0.03637462854385376,
-0.014083554968237877,
0.03726936876773834,
0.042981941252946854,
-0.007132111582905054,
0.06... |
722,911 | gitdb.db.base | size | :return: amount of objects in this database | def size(self):
""":return: amount of objects in this database"""
raise NotImplementedError()
| (self) | [
-0.014158033765852451,
-0.05038740113377571,
-0.04232541844248772,
0.025424987077713013,
0.04245758056640625,
0.02509457804262638,
0.0016985097900032997,
-0.020336685702204704,
-0.022302620112895966,
-0.048504069447517395,
-0.01337331160902977,
-0.010168342851102352,
-0.031554076820611954,
... |
722,912 | gitdb.db.base | stream | :return: OStream instance
:param sha: 20 bytes binary sha
:raise BadObject: | def stream(self, sha):
""":return: OStream instance
:param sha: 20 bytes binary sha
:raise BadObject:"""
raise NotImplementedError("To be implemented in subclass")
| (self, sha) | [
-0.01989542506635189,
-0.04839977249503136,
-0.03582531958818436,
0.02940252237021923,
0.010040919296443462,
-0.014014920219779015,
0.006948146503418684,
0.06890527904033661,
0.013997972942888737,
-0.011405128054320812,
0.014014920219779015,
0.06754954159259796,
-0.021183373406529427,
0.02... |
722,913 | gitdb.db.base | ObjectDBW | Defines an interface to create objects in the database | class ObjectDBW:
"""Defines an interface to create objects in the database"""
def __init__(self, *args, **kwargs):
self._ostream = None
#{ Edit Interface
def set_ostream(self, stream):
"""
Adjusts the stream to which all data should be sent when storing new objects
:p... | (*args, **kwargs) | [
0.0015063290484249592,
-0.04550639167428017,
-0.08744222670793533,
-0.019036902114748955,
0.05082579329609871,
-0.08540190756320953,
-0.02812724933028221,
0.06685686856508255,
-0.03004004806280136,
-0.05618163198232651,
-0.04022342339158058,
0.03628852590918541,
-0.050352148711681366,
0.04... |
722,914 | gitdb.db.base | __init__ | null | def __init__(self, *args, **kwargs):
self._ostream = None
| (self, *args, **kwargs) | [
-0.030911868438124657,
-0.03370800241827965,
-0.008894452825188637,
-0.020602194592356682,
-0.016931194812059402,
0.00021054099488537759,
-0.03698445484042168,
0.0804188922047615,
0.01748012937605381,
-0.01184497494250536,
-0.005682328715920448,
0.020190494135022163,
-0.033982470631599426,
... |
722,916 | gitdb.db.base | set_ostream |
Adjusts the stream to which all data should be sent when storing new objects
:param stream: if not None, the stream to use, if None the default stream
will be used.
:return: previously installed stream, or None if there was no override
:raise TypeError: if the stream doesn'... | def set_ostream(self, stream):
"""
Adjusts the stream to which all data should be sent when storing new objects
:param stream: if not None, the stream to use, if None the default stream
will be used.
:return: previously installed stream, or None if there was no override
:raise TypeError: if ... | (self, stream) | [
-0.01986841671168804,
-0.040420182049274445,
-0.026018571108579636,
-0.027966119349002838,
0.014768913388252258,
-0.011104445904493332,
-0.035021714866161346,
0.07516855746507645,
0.014188065193593502,
-0.009857331402599812,
-0.027334021404385567,
-0.03618340939283371,
-0.07305017113685608,
... |
722,917 | gitdb.db.base | store |
Create a new object in the database
:return: the input istream object with its sha set to its corresponding value
:param istream: IStream compatible instance. If its sha is already set
to a value, the object will just be stored in the our database format,
in which case ... | def store(self, istream):
"""
Create a new object in the database
:return: the input istream object with its sha set to its corresponding value
:param istream: IStream compatible instance. If its sha is already set
to a value, the object will just be stored in the our database format,
in... | (self, istream) | [
-0.010259559378027916,
-0.01808258146047592,
-0.04082939028739929,
0.016002824530005455,
0.02836824581027031,
-0.05015784502029419,
-0.022398732602596283,
0.06397648900747299,
-0.0015456778928637505,
-0.03412891551852226,
-0.021041233092546463,
0.052838034927845,
-0.040724966675043106,
0.0... |
722,918 | gitdb.db.pack | PackedDB | A database operating on a set of object packs | class PackedDB(FileDBBase, ObjectDBR, CachingDB, LazyMixin):
"""A database operating on a set of object packs"""
# sort the priority list every N queries
# Higher values are better, performance tests don't show this has
# any effect, but it should have one
_sort_interval = 500
def __init__(se... | (root_path) | [
0.03361639007925987,
-0.06196732819080353,
-0.1428745687007904,
0.07560250163078308,
0.07630980014801025,
-0.04797850921750069,
-0.012259864248335361,
0.024834085255861282,
-0.023635603487491608,
-0.10310860723257065,
-0.028016934171319008,
0.02613080106675625,
-0.07017986476421356,
0.0103... |
722,921 | gitdb.db.pack | __init__ | null | def __init__(self, root_path):
super().__init__(root_path)
# list of lists with three items:
# * hits - number of times the pack was hit with a request
# * entity - Pack entity instance
# * sha_to_index - PackIndexFile.sha_to_index method for direct cache query
# self._entities = list() # ... | (self, root_path) | [
0.024054350331425667,
-0.041457727551460266,
-0.08188086003065109,
0.04053398221731186,
0.019638843834400177,
0.010456806980073452,
-0.014355015940964222,
0.0383169911801815,
-0.001783984829671681,
-0.01603623479604721,
0.021892784163355827,
0.05191453546285629,
-0.04740665480494499,
0.006... |
722,922 | gitdb.db.pack | _pack_info | :return: tuple(entity, index) for an item at the given sha
:param sha: 20 or 40 byte sha
:raise BadObject:
**Note:** This method is not thread-safe, but may be hit in multi-threaded
operation. The worst thing that can happen though is a counter that
was not incremented, o... | def _pack_info(self, sha):
""":return: tuple(entity, index) for an item at the given sha
:param sha: 20 or 40 byte sha
:raise BadObject:
**Note:** This method is not thread-safe, but may be hit in multi-threaded
operation. The worst thing that can happen though is a counter that
was not ... | (self, sha) | [
0.01796458289027214,
-0.032635949552059174,
-0.07875840365886688,
0.05310964956879616,
0.05924304947257042,
-0.03634735196828842,
0.05565361678600311,
-0.00013633252820000052,
-0.009792527183890343,
-0.05310964956879616,
-0.019044898450374603,
0.028558634221553802,
-0.07150984555482864,
-0... |
722,923 | gitdb.db.pack | _set_cache_ | null | def _set_cache_(self, attr):
if attr == '_entities':
self._entities = list()
self.update_cache(force=True)
# END handle entities initialization
| (self, attr) | [
0.0034164704848080873,
0.02596260793507099,
-0.03717256709933281,
0.030977141112089157,
0.019510464742779732,
0.013280807062983513,
0.007996723055839539,
0.013905484229326248,
0.05531387776136398,
0.009892147965729237,
-0.008073737844824791,
0.024148477241396904,
-0.027810968458652496,
0.0... |
722,924 | gitdb.db.pack | _sort_entities | null | def _sort_entities(self):
self._entities.sort(key=lambda l: l[0], reverse=True)
| (self) | [
-0.024944061413407326,
0.007408746052533388,
-0.040026914328336716,
0.03292205184698105,
-0.0017623057356104255,
-0.015254056081175804,
0.034034863114356995,
-0.006343016400933266,
0.09292818605899811,
-0.02302660420536995,
-0.025645988062024117,
-0.03591807931661606,
-0.031860604882240295,
... |
722,926 | gitdb.db.pack | entities | :return: list of pack entities operated upon by this database | def entities(self):
""":return: list of pack entities operated upon by this database"""
return [item[1] for item in self._entities]
| (self) | [
0.01170080155134201,
-0.0679996907711029,
-0.07719623297452927,
0.013102504424750805,
0.02073494903743267,
0.010367474518716335,
0.01443583145737648,
-0.047418586909770966,
0.06837575882673264,
0.0004129254666622728,
-0.014136687852442265,
-0.05107669159770012,
-0.09825596213340759,
0.0041... |
722,927 | gitdb.db.pack | has_object | null | def has_object(self, sha):
try:
self._pack_info(sha)
return True
except BadObject:
return False
# END exception handling
| (self, sha) | [
0.023890387266874313,
-0.026569683104753494,
-0.06567709892988205,
0.06825334578752518,
0.039261989295482635,
-0.023220563307404518,
0.026741433888673782,
0.050185270607471466,
-0.017587171867489815,
-0.002129696775227785,
0.026260534301400185,
0.047505974769592285,
0.023272087797522545,
-... |
722,928 | gitdb.db.pack | info | null | def info(self, sha):
entity, index = self._pack_info(sha)
return entity.info_at_index(index)
| (self, sha) | [
0.03393608331680298,
-0.01199151948094368,
-0.015177153050899506,
0.04681066423654556,
0.04922052472829819,
-0.03872278705239296,
0.05882694199681282,
-0.025518083944916725,
0.028142519295215607,
-0.009490879252552986,
-0.004341045394539833,
0.006346509326249361,
-0.04304732382297516,
-0.0... |
722,929 | gitdb.db.pack | partial_to_complete_sha | :return: 20 byte sha as inferred by the given partial binary sha
:param partial_binsha: binary sha with less than 20 bytes
:param canonical_length: length of the corresponding canonical representation.
It is required as binary sha's cannot display whether the original hex sha
had... | def partial_to_complete_sha(self, partial_binsha, canonical_length):
""":return: 20 byte sha as inferred by the given partial binary sha
:param partial_binsha: binary sha with less than 20 bytes
:param canonical_length: length of the corresponding canonical representation.
It is required as binary s... | (self, partial_binsha, canonical_length) | [
-0.014316278509795666,
0.0025437832809984684,
-0.05374602973461151,
0.05029803887009621,
0.023638300597667694,
-0.05250190943479538,
0.006998180877417326,
-0.011987995356321335,
0.046210210770368576,
-0.07336759567260742,
-0.017115551978349686,
0.04841408133506775,
-0.06753800064325333,
-0... |
722,931 | gitdb.db.pack | sha_iter | null | def sha_iter(self):
for entity in self.entities():
index = entity.index()
sha_by_index = index.sha
for index in range(index.size()):
yield sha_by_index(index)
# END for each index
# END for each entity
| (self) | [
-0.006483457982540131,
-0.07881952077150345,
-0.08993155509233475,
0.0556291900575161,
0.018514305353164673,
-0.009421072900295258,
-0.01747039519250393,
-0.03302551805973053,
0.07585171610116959,
0.03090318851172924,
0.010939487256109715,
-0.0034681970719248056,
-0.01066341158002615,
0.02... |
722,932 | gitdb.db.pack | size | null | def size(self):
sizes = [item[1].index().size() for item in self._entities]
return reduce(lambda x, y: x + y, sizes, 0)
| (self) | [
-0.01693989709019661,
-0.0930732861161232,
-0.029736600816249847,
0.034421730786561966,
0.04608211666345596,
0.03919427469372749,
0.006175457965582609,
-0.047725409269332886,
0.019649581983685493,
0.04045296460390091,
-0.011704088188707829,
-0.036676887422800064,
-0.027061879634857178,
-0.... |
722,933 | gitdb.db.pack | store | Storing individual objects is not feasible as a pack is designed to
hold multiple objects. Writing or rewriting packs for single objects is
inefficient | def store(self, istream):
"""Storing individual objects is not feasible as a pack is designed to
hold multiple objects. Writing or rewriting packs for single objects is
inefficient"""
raise UnsupportedOperation()
| (self, istream) | [
0.0076109375804662704,
-0.021724263206124306,
-0.07068244367837906,
0.013848597183823586,
0.03113866038620472,
-0.023064449429512024,
-0.02576136775314808,
0.03163502737879753,
-0.015519694425165653,
-0.035672131925821304,
-0.009488853625953197,
0.01879570633172989,
-0.06955734640359879,
0... |
722,934 | gitdb.db.pack | stream | null | def stream(self, sha):
entity, index = self._pack_info(sha)
return entity.stream_at_index(index)
| (self, sha) | [
-0.024304457008838654,
-0.01051587238907814,
-0.07814638316631317,
0.017160972580313683,
0.024138329550623894,
0.011047479696571827,
0.032959699630737305,
0.029703600332140923,
0.04933987185359001,
0.019702723249793053,
-0.014818575233221054,
0.02694588340818882,
-0.041432201862335205,
0.0... |
722,935 | gitdb.db.pack | update_cache |
Update our cache with the actually existing packs on disk. Add new ones,
and remove deleted ones. We keep the unchanged ones
:param force: If True, the cache will be updated even though the directory
does not appear to have changed according to its modification timestamp.
:... | def update_cache(self, force=False):
"""
Update our cache with the actually existing packs on disk. Add new ones,
and remove deleted ones. We keep the unchanged ones
:param force: If True, the cache will be updated even though the directory
does not appear to have changed according to its modifi... | (self, force=False) | [
0.061149392277002335,
-0.033238258212804794,
-0.10369136184453964,
0.03713981434702873,
0.06793960183858871,
-0.03196274861693382,
-0.04074124991893768,
0.048806969076395035,
0.01116070244461298,
-0.047981638461351395,
-0.003477168269455433,
-0.023578155785799026,
-0.056047357618808746,
0.... |
722,936 | gitdb.db.ref | ReferenceDB | A database consisting of database referred to in a file | class ReferenceDB(CompoundDB):
"""A database consisting of database referred to in a file"""
# Configuration
# Specifies the object database to use for the paths found in the alternates
# file. If None, it defaults to the GitDB
ObjectDBCls = None
def __init__(self, ref_file):
super().... | (ref_file) | [
0.016882263123989105,
-0.04664762318134308,
-0.09187829494476318,
0.0722273737192154,
0.011578007601201534,
-0.03574080392718315,
-0.013377166353166103,
0.04888492077589035,
0.04664762318134308,
-0.08740369975566864,
-0.02983061596751213,
0.017851758748292923,
-0.06286802142858505,
0.01388... |
722,939 | gitdb.db.ref | __init__ | null | def __init__(self, ref_file):
super().__init__()
self._ref_file = ref_file
| (self, ref_file) | [
0.01463113073259592,
-0.056359533220529556,
-0.0032278404105454683,
0.0361064188182354,
-0.04082050547003746,
-0.0005120568093843758,
0.011994733475148678,
0.10161477327346802,
-0.0048363045789301395,
0.006809237413108349,
-0.01357482559978962,
0.026049697771668434,
-0.03394142910838127,
0... |
722,941 | gitdb.db.ref | _set_cache_ | null | def _set_cache_(self, attr):
if attr == '_dbs':
self._dbs = list()
self._update_dbs_from_ref_file()
else:
super()._set_cache_(attr)
# END handle attrs
| (self, attr) | [
0.03502710536122322,
0.02264832705259323,
-0.020469937473535538,
0.03741296008229256,
0.012179958634078503,
0.0005629665101878345,
0.005718270316720009,
0.04778623953461647,
0.035182707011699677,
-0.023512765765190125,
-0.030756773427128792,
0.05376816540956497,
-0.0013668956235051155,
0.0... |
722,942 | gitdb.db.ref | _update_dbs_from_ref_file | null | def _update_dbs_from_ref_file(self):
dbcls = self.ObjectDBCls
if dbcls is None:
# late import
from gitdb.db.git import GitDB
dbcls = GitDB
# END get db type
# try to get as many as possible, don't fail if some are unavailable
ref_paths = list()
try:
with codecs.op... | (self) | [
0.034003086388111115,
-0.04949696362018585,
-0.07782971113920212,
0.05530005693435669,
-0.0316704697906971,
-0.02271929569542408,
-0.009411060251295567,
0.04475587606430054,
0.010420911945402622,
-0.02639838121831417,
-0.06743723899126053,
0.0019071027636528015,
-0.04877631738781929,
0.036... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.