MCPcopy Create free account
hub / github.com/Freedium-cfd/web / random

Method random

database-lib/database_lib/main.py:145–151  ·  view source on GitHub ↗
(self, size: int)

Source from the content-addressed store, hash-verified

143 return self.cursor.execute("SELECT COUNT(*) FROM cache").fetchone()[0]
144
145 def random(self, size: int) -> list[CacheResponse]:
146 self.ensure_connection()
147 with self.connection:
148 self.cursor.execute(
149 "SELECT key, value FROM cache ORDER BY RANDOM() LIMIT ?", (size,)
150 )
151 return [CacheResponse(key, value) for key, value in self.cursor]
152
153 def enable_zstd(self):
154 self.ensure_connection()

Callers 5

test_randomMethod · 0.45
render_homepageFunction · 0.45
PxFunction · 0.45
IxFunction · 0.45
V_Function · 0.45

Calls 2

ensure_connectionMethod · 0.95
CacheResponseClass · 0.85

Tested by 1

test_randomMethod · 0.36