MCPcopy
hub / github.com/borgbackup/borg / get

Method get

src/borg/helpers/datastruct.py:45–52  ·  view source on GitHub ↗

Return a buffer of at least the requested size (None: any current size). init=True can be given to trigger shrinking of the buffer to the given size.

(self, size=None, init=False)

Source from the content-addressed store, hash-verified

43 self.buffer = self.allocator(size)
44
45 def get(self, size=None, init=False):
46 """
47 Return a buffer of at least the requested size (None: any current size).
48 init=True can be given to trigger shrinking of the buffer to the given size.
49 """
50 if size is not None:
51 self.resize(size, init)
52 return self.buffer
53
54
55class EfficientCollectionQueue:

Callers 15

test_typeMethod · 0.95
test_lenMethod · 0.95
test_resizeMethod · 0.95
test_getMethod · 0.95
add_lineMethod · 0.45
handle_log_eventMethod · 0.45
hash_partMethod · 0.45
pbkdf2Method · 0.45
argon2Method · 0.45
is_supported_msgpackFunction · 0.45
get_base_dirFunction · 0.45

Calls 1

resizeMethod · 0.95

Tested by 15

test_typeMethod · 0.76
test_lenMethod · 0.76
test_resizeMethod · 0.76
test_getMethod · 0.76
getattr_setattrFunction · 0.36
test_basic_operationsFunction · 0.36
test_read_dataFunction · 0.36
test_consistencyFunction · 0.36
test_consistency2Function · 0.36
test_max_data_sizeFunction · 0.36