MCPcopy Create free account

hub / github.com/mwmbl/mwmbl / functions

Functions929 in github.com/mwmbl/mwmbl

↓ 278 callersMethodget
Get the next priority item from the queue, returning the item ID and the object
mwmbl/indexer/fsqueue.py:105
↓ 94 callersMethodappend
(self, tag_name)
mwmbl/justext/core.py:225
↓ 56 callersMethodformat
Human-readable formatting of bytes, using binary (powers of 1024) or metric (powers of 1000) representation.
mwmbl/templatetags/humanbytes.py:14
↓ 54 callersMethodcreate
(item_factory: Callable[..., T], index_path: str, num_pages: int, page_size: int)
mwmbl/tinysearchengine/indexer.py:269
↓ 24 callersFunctiontokenize
(input_text)
mwmbl/tokenizer.py:1
↓ 21 callersFunction_super_search_monthly_key
(user_id: int, year: int | None = None, month: int | None = None)
mwmbl/quota.py:28
↓ 20 callersFunctioncheck_email_verified
(request)
mwmbl/platform/api.py:33
↓ 19 callersMethodpredict
Predict class-1 probabilities. Parameters ---------- X : DataFrame with columns query, url, title, extract, score
mwmbl/tinysearchengine/ltr.py:174
↓ 16 callersMethodget_page
Get the page at index i, decompress and deserialise it using JSON
mwmbl/tinysearchengine/indexer.py:223
↓ 15 callersFunction_doc
(title, url, extract="")
test/test_mmr_rank.py:5
↓ 15 callersFunction_read_stream
(response)
test/test_super_search.py:76
↓ 15 callersFunction_stub_sources
Replace the live source adapters with deterministic stubs.
test/test_super_search.py:85
↓ 15 callersFunctionauth_headers
(token)
test/test_search_api_key.py:120
↓ 14 callersFunction_parse_sse
(body: bytes)
test/test_super_search.py:58
↓ 14 callersFunctionapi_key_header
(key)
test/test_search_api_key.py:124
↓ 13 callersMethodsearch
(self, s: str, additional_results: list[Document])
mwmbl/tinysearchengine/rank.py:247
↓ 11 callersFunction_monthly_key
(user_id: int, year: int | None = None, month: int | None = None)
mwmbl/quota.py:21
↓ 11 callersFunction_stub_scoring
Stub both the promotion scorer (_heuristic_score_docs) and the LTR final ranker (score_documents) to consume from a single shared score iterator.
test/test_super_search.py:97
↓ 11 callersMethodretrieve
(self, key: str)
mwmbl/tinysearchengine/indexer.py:213
↓ 10 callersMethodload
(self)
mwmbl/main.py:47
↓ 9 callersMethodas_tuple
Convert a type to a tuple - values at the end that are None can be truncated.
mwmbl/tinysearchengine/indexer.py:74
↓ 9 callersMethodfit
Train the XGBoost model. Parameters ---------- X : DataFrame with columns query, url, title, extract, score
mwmbl/tinysearchengine/ltr.py:150
↓ 9 callersMethodget_key_page_index
(self, key)
mwmbl/tinysearchengine/indexer.py:219
↓ 8 callersFunctionauth_headers
(token)
test/test_platform_billing.py:68
↓ 8 callersFunctionget_monthly_count
Return the current monthly request count for a user (0 if not set).
mwmbl/quota.py:64
↓ 8 callersFunctionsearch_with_recipe
( client: httpx.AsyncClient, recipe: Recipe, query: str, limit: int )
mwmbl/tinysearchengine/super_search_sources/recipe.py:96
↓ 7 callersMethodclose
(self)
test/test_ssrf.py:97
↓ 7 callersFunctionemit
(event_type: str, data: Any)
mwmbl/tinysearchengine/super_search.py:555
↓ 7 callersFunctionis_safe_host
Return True if every address ``host`` resolves to is a public address. ``host`` may be an IP literal or a hostname. Hostnames are resolved with
mwmbl/crawler/ssrf.py:41
↓ 7 callersFunctionmake_dataframe
Create a synthetic DataFrame with the columns expected by RustXGBPipeline.
test/test_rust_pipeline.py:27
↓ 7 callersFunctionmmr_rerank
Re-order a relevance-sorted list to demote near-duplicate / same-domain results. Greedy Maximal Marginal Relevance with a domain-dominant kernel
mwmbl/tinysearchengine/mmr_rank.py:41
↓ 7 callersFunctionparse_url
Custom URL parsing function using regex because urlparse is too slow.
mwmbl/utils.py:67
↓ 7 callersMethodput
Push a new item into the ready state
mwmbl/indexer/fsqueue.py:95
↓ 7 callersMethodrun
Main entry point for the crawler. Starts multiple worker processes for batch processing and one indexing process. Mo
mwmbl/crawl.py:265
↓ 7 callersFunctionvalidate_domain
(domain_or_url: str)
mwmbl/utils.py:80
↓ 7 callersMethodxpath
(self)
mwmbl/justext/core.py:222
↓ 6 callersFunction_dom
(html: str)
test/test_retrieve_extract.py:18
↓ 6 callersFunction_merge_user_ids
( existing: Optional[list[int]], incoming: Optional[list[int]] )
mwmbl/indexer/index_batches.py:28
↓ 6 callersFunction_recipe
(name: str)
test/test_super_search_recipes.py:45
↓ 6 callersMethodcheck_redis
Check Redis connection health.
mwmbl/crawl.py:123
↓ 6 callersFunctioncrawl_url
(url, redis: Redis)
mwmbl/crawler/retrieve.py:306
↓ 6 callersFunctioncreateChart
(elementId, labels, label)
front-end/src/stats/stats.js:6
↓ 6 callersFunctiongenerate_api_key
Return (raw_key, key_hash). Store only the hash; return raw_key to the user once.
mwmbl/models.py:130
↓ 6 callersMethodget_domain_count
(self, domain: str)
mwmbl/redis_url_queue.py:161
↓ 6 callersMethodis_domain_blacklisted
Check if domain is blacklisted by any provider.
mwmbl/indexer/blacklist_providers.py:133
↓ 6 callersMethodqueue_urls
(self, found_urls: list[FoundURL])
mwmbl/redis_url_queue.py:60
↓ 5 callersFunction_get_page_data
(page_size: int, items: list[T])
mwmbl/tinysearchengine/indexer.py:161
↓ 5 callersMethod_move
(self, name: str, old_state: FSState, new_state: FSState)
mwmbl/indexer/fsqueue.py:92
↓ 5 callersFunction_pad_to_page_size
(data: bytes, page_size: int)
mwmbl/tinysearchengine/indexer.py:170
↓ 5 callersFunction_prepare_results
(results: Optional[list[Document]])
mwmbl/views.py:68
↓ 5 callersFunction_trim_items_to_page
(compressor: ZstdCompressor, page_size: int, items:list[T])
mwmbl/tinysearchengine/indexer.py:156
↓ 5 callersFunctioncombine_documents
(existing_documents, documents, mark_synced, ranker)
mwmbl/indexer/index_batches.py:150
↓ 5 callersMethodcomplete
(self, term)
mwmbl/tinysearchengine/completer.py:24
↓ 5 callersFunctionevaluate
(ranking_model: RankingModel, fraction: float = 1.0, use_test=False)
mwmbl/rankeval/evaluation/evaluate.py:32
↓ 5 callersFunctionget_first_paragraph
Return the text of the first substantive <p> element, or empty string. A last-resort fallback for pages where justext finds no 'good' content — m
mwmbl/crawler/retrieve.py:281
↓ 5 callersMethodis_domain_blacklisted
Check if a domain should be blacklisted.
mwmbl/indexer/blacklist_providers.py:19
↓ 5 callersFunctionmockCompleterData
(mocker, data)
test/test_completer.py:6
↓ 5 callersMethodprocess_batch
Process a single batch of URLs by crawling them sequentially with rate limiting. This function handles the core crawling workflow:
mwmbl/crawl.py:131
↓ 5 callersFunctionresolve
(node)
mwmbl/tinysearchengine/super_search.py:235
↓ 5 callersMethodrun_indexing
Process completed crawl batches and integrate results into the search index. This function handles the indexing workflow: 1.
mwmbl/crawl.py:172
↓ 5 callersFunctionvalidate_url
Raise :class:`UnsafeURLError` if ``url`` is not safe to fetch.
mwmbl/crawler/ssrf.py:74
↓ 4 callersFunction_binary_search_fitting_size
(compressor: ZstdCompressor, page_size: int, items:list[T], lo:int, hi:int)
mwmbl/tinysearchengine/indexer.py:132
↓ 4 callersFunction_cache_robots_content
(redis: Redis, domain: str, content: List[str], error: bool = False)
mwmbl/crawler/retrieve.py:169
↓ 4 callersFunction_emit_final_results
( query: str, all_docs: list[Document], emit, last_results_key: list, lock: asyncio.Lock )
mwmbl/tinysearchengine/super_search.py:412
↓ 4 callersMethod_get_dir
(self, state: FSState)
mwmbl/indexer/fsqueue.py:86
↓ 4 callersMethod_get_path
(self, state: FSState, name: str)
mwmbl/indexer/fsqueue.py:89
↓ 4 callersMethod_start_new_pragraph
(self)
mwmbl/justext/core.py:160
↓ 4 callersFunctioncheck_date_str
(date_str)
mwmbl/crawler/app.py:403
↓ 4 callersFunctioncheck_email_verified
Check if user's email is verified.
mwmbl/evaluation/api.py:14
↓ 4 callersMethodfit
(self, X, y)
mwmbl/rankeval/ltr/baseline.py:9
↓ 4 callersMethodget_batch
(self, user_id: str)
mwmbl/redis_url_queue.py:101
↓ 4 callersFunctionget_default_crawler
Get the default crawler instance.
mwmbl/crawl.py:332
↓ 4 callersFunctionget_features
(terms, title, url, extract, score, is_complete)
mwmbl/tinysearchengine/rank.py:125
↓ 4 callersFunctionget_query_regex
(terms, is_complete: bool, use_word_boundaries: bool)
mwmbl/format.py:59
↓ 4 callersFunctionhtml_to_dom
Converts HTML to DOM.
mwmbl/justext/core.py:63
↓ 4 callersFunctionincrement_monthly
Increment the monthly counter and return the new value. Sets a 35-day TTL on first use so the key auto-expires.
mwmbl/quota.py:69
↓ 4 callersFunctionindex_pages
(index_path: str, page_documents: dict[int, list[Document]], mark_synced: bool = False)
mwmbl/indexer/index_batches.py:78
↓ 4 callersFunctioninvalidate_user_api_key_cache
(user_id: int)
mwmbl/search_auth.py:24
↓ 4 callersMethodis_domain_blacklisted
Check if domain is in the HaGeZi blacklist.
mwmbl/indexer/blacklist_providers.py:121
↓ 4 callersFunctionload_recipes
Load every ``*.yaml`` recipe in ``directory``, keyed by recipe name. A malformed recipe (missing required keys, bad YAML) is logged and skipped
mwmbl/tinysearchengine/super_search_sources/recipe.py:66
↓ 4 callersFunctionmake_labels
(n: int = 30, seed: int = 42)
test/test_rust_pipeline.py:66
↓ 4 callersFunctionnumberWithCommas
(x)
front-end/src/stats/stats.js:76
↓ 4 callersFunctionrust_get_features
Call the Rust get_features_py function.
test/test_rust_features.py:22
↓ 4 callersFunctionsearch
(session: requests.Session)
scripts/check_search_api_key.py:30
↓ 4 callersMethodupdate_found_urls
Update URLs with the most recent crawl date, if they've been crawled before, or None otherwise. Update the most recent URL status in
mwmbl/crawler/urls.py:88
↓ 3 callersFunction_cache_key
(key_hash: str)
mwmbl/search_auth.py:16
↓ 3 callersFunction_crawl_html
(monkeypatch, html: str)
test/test_retrieve_extract.py:62
↓ 3 callersFunction_get_count
Get the count for a given date and set it in the count_dict.
mwmbl/count_urls.py:119
↓ 3 callersFunction_get_user_id_hash
(batch: Union[Batch, NewBatchRequest, DatasetRequest])
mwmbl/crawler/app.py:366
↓ 3 callersFunction_make_doc
(values: dict, url: str)
mwmbl/tinysearchengine/super_search_sources/recipe.py:157
↓ 3 callersFunction_register_common_routes
Register the /complete and /raw endpoints (shared between v1 and v2).
mwmbl/tinysearchengine/search.py:335
↓ 3 callersFunction_set_count
(key, redis, today, count)
mwmbl/count_urls.py:84
↓ 3 callersFunction_walk
Walk a dotted path (``a.b.c``) through nested dicts; None if absent.
mwmbl/tinysearchengine/super_search_sources/recipe.py:167
↓ 3 callersFunctioncheck_rate_limit
Fixed-window rate limit: at most RATE_LIMIT requests per second. Returns True if the request is allowed, False if the limit is exceeded.
mwmbl/quota.py:43
↓ 3 callersFunctionclean_unicode
(s: str)
mwmbl/tokenizer.py:16
↓ 3 callersMethodcreate_tables
(self)
mwmbl/indexer/indexdb.py:28
↓ 3 callersMethoderror
Mark a task/file as in error state
mwmbl/indexer/fsqueue.py:137
↓ 3 callersFunctionfetch
Fetch with a maximum timeout and maximum fetch size to avoid big pages bringing us down. Redirects are followed manually so each hop can be
mwmbl/crawler/retrieve.py:56
↓ 3 callersMethodfrom_model_path
Load a pre-trained model from disk and return a ready-to-predict pipeline.
mwmbl/tinysearchengine/ltr.py:202
↓ 3 callersFunctionget_bigrams
(num_bigrams, tokens)
mwmbl/tokenizer.py:10
next →1–100 of 929, ranked by callers