MCPcopy Create free account

hub / github.com/Open-Bee/DataStudio / functions

Functions1,367 in github.com/Open-Bee/DataStudio

↓ 112 callersMethodget
Get a registered module by name. Args: name: Name of the registered module. Returns: The registered module c
datastudio/utils/registry.py:62
↓ 102 callersMethodinfo
Log info message. Args: msg: Message (str or dict). Dict auto-logged to wandb. to_wandb: If True, also log s
datastudio/utils/logging.py:238
↓ 46 callersMethodupdate
Update checkpoint for a file. Args: file_path: Path to the data file. processed_idx: Index of last processed item (ex
datastudio/utils/checkpoint.py:113
↓ 41 callersMethodget
Get format handler instance based on file extension. Args: file_path: Path to data file. Returns: BaseFormat
datastudio/datasets/formatters/__init__.py:46
↓ 40 callersMethodload
(self, file_path)
tests/datasets/test_formatters.py:38
↓ 34 callersMethodsave
(self, data, file_path, **kwargs)
tests/datasets/test_formatters.py:41
↓ 29 callersMethodclose
Close logger and cleanup.
datastudio/utils/logging.py:330
↓ 29 callersMethodwarning
Log warning message.
datastudio/utils/logging.py:254
↓ 27 callersMethoddump
Convert Config to plain dict recursively. Returns: dict: Plain dictionary representation.
datastudio/utils/config.py:271
↓ 26 callersMethodexists
Check if image exists in cache. Args: image_path: Image path to check. Returns: bool: True if image exists.
datastudio/utils/database.py:253
↓ 24 callersMethodprocess
Concrete implementation of abstract method.
tests/operators/test_operator.py:22
↓ 23 callersMethodadd_filter
Add a filter decision.
datastudio/operators/core/result.py:68
↓ 21 callersMethodrewrite
Concrete implementation of rewrite method.
tests/operators/test_operator.py:200
↓ 20 callersMethodget_progress
Get progress info for a file. Args: file_path: Path to the data file. Returns: Progress dict or None if not
datastudio/utils/checkpoint.py:157
↓ 19 callersFunctionbuild_from_cfg
Build a module from configuration. Args: cfg: Configuration dict with 'type' key, or string name, or None. registry: Registry con
datastudio/utils/registry.py:86
↓ 18 callersMethodadd_rewrite
Add a rewrite decision.
datastudio/operators/core/result.py:72
↓ 18 callersMethodcheck
Concrete implementation of check method.
tests/operators/test_operator.py:119
↓ 16 callersMethod_add_decision
Add decision based on parsed response. Subclasses implement this to add FilterDecision or RewriteDecision. Args:
datastudio/operators/mllm/base.py:146
↓ 16 callersMethodgenerate
Main method to generate responses. Args: messages: Input messages (list of message dicts). **kwargs: Additional argum
datastudio/models/base.py:537
↓ 16 callersMethodnormalize_item
Convert a single item to standard schema. Stores original schema info for later denormalization. Args: item: Data item i
datastudio/datasets/formatters/schema_converter.py:83
↓ 14 callersMethodget_qa
Get a specific QA pair. Args: qa_idx: Index of the QA pair. Returns: QA object at the specified index.
datastudio/operators/core/data_item.py:109
↓ 12 callersMethod_get_adaptive_resize_size
Get adaptive resize size based on image count. Args: image_count: Number of images in the item. Returns: Res
datastudio/datasets/data_loader.py:170
↓ 12 callersMethodclear
Clear checkpoint(s). Args: file_path: Specific file to clear, or None to clear all.
datastudio/utils/checkpoint.py:168
↓ 12 callersMethodget_answer
Get answer at index.
datastudio/operators/core/data_item.py:131
↓ 12 callersMethodget_question
Get question at index.
datastudio/operators/core/data_item.py:127
↓ 12 callersFunctionwrap_items
Wrap raw dicts into DataItems.
datastudio/pipelines/sub_pipeline.py:11
↓ 11 callersFunctionbuild_dataloaders
Build dataloaders with checkpoint support. Args: dataset_config: Dataloader configuration dict. logger: Logger instance.
datastudio/datasets/builder.py:11
↓ 11 callersFunctiondetect_consecutive_repetition
Detect consecutive repetitive patterns at the end of text. Looks for patterns like "ABCABCABC..." where the same substring is repeated m
datastudio/utils/repetition.py:26
↓ 11 callersFunctiondetect_language
Detect if text is primarily Chinese or English. Args: text: Input text to analyze. Returns: "chinese", "english", or "u
datastudio/utils/language.py:7
↓ 11 callersMethodis_completed
Check if a file has been fully processed. Args: file_path: Path to the data file. Returns: True if file is c
datastudio/utils/checkpoint.py:100
↓ 10 callersMethod_parse_openai_response
Parse OpenAI-format API response content. Args: data: Parsed JSON response from OpenAI API. Returns: Extract
datastudio/models/base.py:294
↓ 10 callersMethodcheck_content
Check input content type. Args: msgs: Raw input messages. Returns: str: Message type (str/dict/liststr/listd
datastudio/models/base.py:139
↓ 10 callersFunctionget_qa_count
Get number of QA pairs in conversation. Args: conversations: List of conversation turns. Returns: Number of complete QA
datastudio/utils/qa_utils.py:6
↓ 10 callersFunctionunwrap_items
Extract raw dicts from DataItems.
datastudio/pipelines/sub_pipeline.py:16
↓ 9 callersMethodadd_file
Add file to configuration list. Args: file_path: Path to data file. is_rejected: Whether this is a rejected data file
datastudio/datasets/saver/yaml_generator.py:33
↓ 9 callersMethoderror
Log error message. Errors are logged to wandb by default.
datastudio/utils/logging.py:261
↓ 9 callersMethodfrom_dict
Create config from dict, automatically handling field aliases. Args: data: Raw configuration dictionary. Returns:
datastudio/datasets/config/config.py:46
↓ 9 callersFunctionload_str_to_dict
Parse MLLM response string to dictionary. Tries in order (fast to slow): 1. Standard json.loads (fastest) 2. json_repair.loads (hand
datastudio/utils/json_parser.py:9
↓ 9 callersMethodparse_response
Parse model response. Args: response: Raw response from model. qa_idx: QA index (used to format key_template
datastudio/operators/mllm/request.py:258
↓ 9 callersMethodrecord_operator
Record operator statistics directly (called from Pipeline). Args: name: Operator name input_count: Number of input it
datastudio/utils/statistics.py:196
↓ 8 callersMethod_log_to_wandb
Log metrics to wandb.
datastudio/utils/logging.py:212
↓ 8 callersMethodapply_to
Apply all decisions to a data item. Order: rewrite first, then filter (to preserve rewritten content). Args: it
datastudio/operators/core/result.py:101
↓ 8 callersMethodget_start_index
Get the starting index for processing a file. Args: file_path: Path to the data file. total_items: Total number of it
datastudio/utils/checkpoint.py:67
↓ 8 callersMethodrecord_dataset
Record dataset statistics (called from DataSaver). Statistics are merged by filename (basename), so kept and rejected parts
datastudio/utils/statistics.py:249
↓ 7 callersMethod_build_payload
Build request payload for chat completions API. Args: message: Preprocessed message list (OpenAI format). **kwargs: O
datastudio/models/openai_api.py:149
↓ 7 callersFunctionapply_resize_image_pil
Resize PIL image maintaining aspect ratio. Args: img_pil: PIL Image object. resize_image_size: Maximum dimension for the larger s
datastudio/utils/vision.py:71
↓ 7 callersMethoddenormalize_item
Convert a single item back to its original schema. Args: item: Data item in standard schema with schema metadata. Return
datastudio/datasets/formatters/schema_converter.py:108
↓ 7 callersFunctioninit_cfg
Initialize global config from file. Args: filename: Path to the config file.
datastudio/utils/config.py:290
↓ 7 callersMethodload
Load data from file. Args: file_path: Path to the data file. Returns: list: List of data dictionaries.
datastudio/datasets/formatters/base.py:34
↓ 7 callersMethodsplit
Split this item into kept and rejected parts. Creates two new DataItems: - kept_item: Contains only the kept QA pairs
datastudio/operators/core/data_item.py:300
↓ 7 callersFunctionwrap_data_list
Wrap a list of raw dicts into DataItems.
datastudio/operators/core/data_item.py:419
↓ 6 callersMethod_should_skip
Check if this item should be skipped.
datastudio/operators/mllm/base.py:132
↓ 6 callersMethodbuild_request
Build a single request. Args: item: DataItem to build request for. qa_idx: QA pair index (-1 for batch_qa mo
datastudio/operators/mllm/request.py:126
↓ 6 callersFunctioncalculate_qa_statistics
Calculate QA statistics and optionally adjust batch size. Args: datas: List of data items with "conversations" field. batch_
datastudio/utils/qa_utils.py:19
↓ 6 callersMethoddetect_schema
Detect the schema type of a data item. Args: item: A single data item dict. Returns: Schema type string (Sch
datastudio/datasets/formatters/schema_converter.py:50
↓ 6 callersMethodencode_image_directly
Encode image directly without caching. Args: img_item: PIL Image object or other image data. Returns: Base64
datastudio/models/base.py:114
↓ 6 callersFunctionget_stats_collector
Get or create global statistics collector.
datastudio/utils/statistics.py:495
↓ 6 callersMethodmark_completed
Mark a file as fully processed. Args: file_path: Path to the data file. total_items: Total number of items in the fil
datastudio/utils/checkpoint.py:134
↓ 6 callersMethodmerge_dict_b2a
Merge dict b into dict a recursively. Supports special keys: - _cover_: Replace entire dict instead of merging. Args:
datastudio/utils/config.py:198
↓ 6 callersMethodsave
Save accumulated data to disk.
datastudio/datasets/data_saver.py:159
↓ 5 callersMethod_cleanup_batch_images
(datas: list)
datastudio/datasets/data_saver.py:141
↓ 5 callersMethod_format_message
Format message with additional key-value pairs.
datastudio/utils/logging.py:187
↓ 5 callersMethod_get_env
Lazy-load shard environment with LRU eviction (thread-safe). Args: shard_id: Shard ID to load. Returns: lmdb
datastudio/utils/database.py:195
↓ 5 callersMethod_process_single_request
Process a single request with concurrency control and retry. Args: session: Shared aiohttp session. semaphore: Concur
datastudio/models/openai_api.py:254
↓ 5 callersMethod_request_non_streaming
Make a non-streaming API request. Args: session: Shared aiohttp session. message: Preprocessed message list.
datastudio/models/openai_api.py:197
↓ 5 callersMethod_should_rewrite
Check if this QA pair should be rewritten.
datastudio/operators/mllm/rewriter.py:144
↓ 5 callersMethodend_pipeline
Mark pipeline end.
datastudio/utils/statistics.py:129
↓ 5 callersMethodgenerate_inner
(self, inputs, **kwargs)
tests/models/test_base_api.py:27
↓ 5 callersFunctionget_cfg
Get the global config instance. Returns: Config: Global configuration object.
datastudio/utils/config.py:300
↓ 5 callersFunctionget_logger
Get the global DataStudio logger instance. Args: name: Logger name (ignored if instance exists) Returns: Logger instanc
datastudio/utils/logging.py:343
↓ 5 callersFunctionget_shard_id
Calculate shard ID based on key hash. Args: key: Key string to hash. num_shards: Total number of shards. Returns: in
datastudio/utils/database.py:42
↓ 5 callersFunctionparse_file
Parse input to determine if it's an image file. Args: s: Input to parse (string path, PIL Image, list, or other). image_name: Nam
datastudio/utils/vision.py:104
↓ 5 callersMethodprocess_batch
(self, items)
tests/pipelines/test_sub_pipeline.py:450
↓ 5 callersMethodstart_pipeline
Mark pipeline start.
datastudio/utils/statistics.py:124
↓ 4 callersMethod_calculate_retry_delay
Calculate exponential backoff delay with full jitter. Args: attempt: Current retry attempt (0-indexed). max_delay: Ma
datastudio/models/base.py:329
↓ 4 callersMethodadd_filter_record
Add a filter record (for rejected items).
datastudio/operators/core/data_item.py:248
↓ 4 callersFunctionbuild_file
Build file path and create parent directories. Creates the directory structure if it doesn't exist and returns the full file path. Args:
datastudio/utils/files.py:6
↓ 4 callersMethodcheck
Check for text length anomalies in a QA pair.
datastudio/operators/filters/length_anomaly.py:75
↓ 4 callersFunctioncopy_image
Return image reference directly (images are pre-encoded to base64).
datastudio/operators/mllm/request.py:12
↓ 4 callersMethoddetect_schema_from_list
Detect schema from a list of items (uses first valid item). Args: data: List of data items. Returns: Detecte
datastudio/datasets/formatters/schema_converter.py:68
↓ 4 callersMethoddfs
Deep-first search conversion of nested dicts to Config objects. Args: cfg_other: Input configuration (dict, list, or value).
datastudio/utils/config.py:250
↓ 4 callersMethodexpand_items
Expand multi-turn items into single-turn items. This should be called directly instead of through Pipeline for splitting ope
datastudio/operators/rewriters/split.py:51
↓ 4 callersMethodexport_csv
Export statistics to CSV file. Args: output_path: Output file path (default: work_dir/stats.csv) Returns:
datastudio/utils/statistics.py:410
↓ 4 callersMethodformat
(self, record: logging.LogRecord)
datastudio/utils/logging.py:54
↓ 4 callersMethodformat_qa
Format a single QA pair for prompt. Display index is always 0 (standard for single-QA prompts).
datastudio/operators/core/data_item.py:199
↓ 4 callersMethodget_file_paths
Get all data file paths. Returns: List of file paths from all datasets.
datastudio/datasets/config/config.py:115
↓ 4 callersMethodget_instance
Get or create singleton logger instance.
datastudio/utils/logging.py:165
↓ 4 callersMethodget_source_from_path
Get source name from file path. Args: file_path: Path to data file. Returns: Source name, or 'unknown' if no
datastudio/datasets/saver/simple_saver.py:35
↓ 4 callersMethodget_summary
Get statistics summary as dictionary.
datastudio/utils/statistics.py:301
↓ 4 callersMethodincremental_save
Incrementally save data if threshold is reached. This enables item-level resume by saving progress periodically without waiting for t
datastudio/datasets/data_saver.py:209
↓ 4 callersMethodis_empty
Check if there are no items to process.
datastudio/datasets/data_loader.py:412
↓ 4 callersMethodload_from_file
Load configuration from a Python file. Args: filename: Path to the config file.
datastudio/utils/config.py:237
↓ 4 callersMethodmark_rejected
Mark this item as rejected.
datastudio/operators/core/data_item.py:238
↓ 4 callersMethodpre_process
Validate and preprocess raw input messages into API-ready format. Args: msg: Raw input message (str, dict, or list). Ret
datastudio/models/base.py:398
↓ 4 callersMethodpreproc_content
Convert raw input messages to unified dict list format. Args: inputs: Raw input. Returns: list: Processed in
datastudio/models/base.py:160
↓ 4 callersMethodresult
Create Result for testing.
tests/operators/test_result.py:131
↓ 4 callersMethodset_answer
Set answer at index. Args: qa_idx: Index of the QA pair. value: New answer value. save_original: Whether
datastudio/operators/core/data_item.py:158
↓ 4 callersMethodset_question
Set question at index. Args: qa_idx: Index of the QA pair. value: New question value. save_original: Whet
datastudio/operators/core/data_item.py:137
↓ 4 callersMethodshutdown
Shutdown and release resources.
datastudio/models/base.py:592
↓ 4 callersMethodto_dict
Convert to dictionary. Returns: dict: Configuration as dictionary.
datastudio/datasets/config/config.py:68
next →1–100 of 1,367, ranked by callers