MCPcopy Create free account

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

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

↓ 3 callersMethod__init__
(self, **kwargs)
tests/pipelines/test_sub_pipeline.py:87
↓ 3 callersMethod_get_key
Get LMDB key for an image path.
datastudio/utils/database.py:236
↓ 3 callersMethod_get_length
Get text length (character or token count).
datastudio/operators/filters/length_anomaly.py:62
↓ 3 callersMethod_get_shard_id
Get shard ID for an image path.
datastudio/utils/database.py:191
↓ 3 callersMethod_get_shard_id_and_key
Get shard ID and LMDB key in one MD5 call (avoid double hashing). Args: image_path: Image path string. Returns:
datastudio/utils/database.py:240
↓ 3 callersMethod_is_anomaly
Check if length is out of bounds.
datastudio/operators/filters/length_anomaly.py:71
↓ 3 callersMethod_load_images_for_batch
Load images for a batch from LMDB cache or disk. When ``use_lmdb_cache=True``, images are cached to LMDB first and then read back. W
datastudio/datasets/data_loader.py:194
↓ 3 callersMethod_pre_encode_images
Pre-encode all PIL images to base64 strings in parallel. Encodes images before multi-threaded API calls to avoid PIL thread-safety is
datastudio/models/base.py:429
↓ 3 callersMethod_save
Save checkpoint to file.
datastudio/utils/checkpoint.py:48
↓ 3 callersMethodadd_keep_record
Add a keep record (for kept items with reason).
datastudio/operators/core/data_item.py:256
↓ 3 callersMethodbuild_requests
Build all requests for a DataItem. Args: item: DataItem to build requests for. batch_qa: If True, combine al
datastudio/operators/mllm/request.py:154
↓ 3 callersMethodcreate_config
Create a standard configuration from file paths. Args: file_paths: List of data file paths. sources: Optional mapping
datastudio/datasets/config/config.py:203
↓ 3 callersFunctiondenormalize_data
Convenience function to denormalize data. Args: data: List of normalized items. Returns: List of items in their original sch
datastudio/datasets/formatters/schema_converter.py:284
↓ 3 callersFunctionencode_image_to_base64
Encode PIL Image to base64 data URL string. Args: img: PIL Image object. target_size: Maximum dimension for thumbnail (-1 to skip
datastudio/utils/vision.py:19
↓ 3 callersMethodexport_json
Export statistics to JSON file. Args: output_path: Output file path (default: work_dir/stats.json) Returns:
datastudio/utils/statistics.py:465
↓ 3 callersMethodget
Read image data from cache. Args: image_path: Image path to read. Returns: bytes: Image data, or None if not
datastudio/utils/database.py:291
↓ 3 callersMethodget_sources_map
Get file_path to source mapping. Returns: dict: Mapping from file_path to source name.
datastudio/datasets/config/config.py:123
↓ 3 callersFunctionhas_meaningful_content
Check if string contains sufficient proportion of alphanumeric characters. Args: text: Text to check. threshold: Minimum rat
datastudio/utils/repetition.py:6
↓ 3 callersFunctionis_mixed_language
Check if question and answer are in different languages. Useful for detecting cases where question is English but answer is Chinese. Ar
datastudio/utils/language.py:32
↓ 3 callersMethodlog_metrics
Log metrics for tracking (to file and wandb). Args: metrics: Dictionary of metric name -> value step: Option
datastudio/utils/logging.py:275
↓ 3 callersMethodmark_kept
Mark this item as not rejected (kept).
datastudio/operators/core/data_item.py:242
↓ 3 callersFunctionnormalize_data
Convenience function to normalize data. Args: data: List of data items in any supported schema. Returns: List of items in st
datastudio/datasets/formatters/schema_converter.py:272
↓ 3 callersMethodprepare_inputs
Prepare message format for API interface. Args: inputs: Input message list. Returns: tuple: (formatted_messa
datastudio/models/base.py:200
↓ 3 callersMethodregister
Register a format handler (decorator). Args: format_class: Format class to register. Returns: The registered
datastudio/datasets/formatters/__init__.py:32
↓ 3 callersMethodregister_module
Register a module class. Can be used as a decorator or called directly: @REGISTRY.register_module() class MyClass: pa
datastudio/utils/registry.py:29
↓ 3 callersMethodrun
Execute the runner in the configured mode.
run.py:85
↓ 3 callersMethodsave
Save data to file. Args: data: List of data dictionaries. file_path: Output file path. **kwargs: Format-s
datastudio/datasets/formatters/base.py:46
↓ 3 callersMethodsave_yaml
Save YAML config and statistics.
datastudio/datasets/data_saver.py:195
↓ 3 callersFunctionunwrap_data_items
Extract raw dicts from DataItems.
datastudio/operators/core/data_item.py:424
↓ 2 callersMethod_build_model_kwargs
Build kwargs dict to reconstruct OpenAIAPI in worker processes. Returns: Dict of constructor arguments for OpenAIAPI.
datastudio/models/mp_openai_api.py:217
↓ 2 callersMethod_build_openai_headers
Build HTTP headers using instance API key. Overrides BaseAPI._build_openai_headers to use self.key directly. Returns: He
datastudio/models/openai_api.py:128
↓ 2 callersMethod_clear_message_buffers
Clear all message buffers to release memory. Args: messages: List of message objects to clear.
datastudio/models/base.py:98
↓ 2 callersMethod_collect_memory
Run garbage collection and optionally trim glibc malloc arenas. Args: trim: If True, call malloc_trim(0) to return freed memory t
datastudio/models/base.py:87
↓ 2 callersMethod_extract_conversations
Extract conversations at specified QA indices.
datastudio/operators/core/data_item.py:349
↓ 2 callersMethod_generate_async
Run async generation over all messages. Creates a shared :class:`aiohttp.ClientSession` with connection pooling and fires all request
datastudio/models/openai_api.py:379
↓ 2 callersMethod_get_shard_path
Get path to shard directory.
datastudio/utils/database.py:187
↓ 2 callersMethod_load_prompt
Load prompt from file or return as-is.
datastudio/operators/mllm/request.py:113
↓ 2 callersMethod_load_stats
Load statistics from processed file. Args: file_path: Path to processed file. source: Source name. Returns:
datastudio/datasets/saver/processed_checker.py:104
↓ 2 callersMethod_parse_qa_index
Parse QA index from various key formats (int, '0', 'qa_pair_0', etc.).
datastudio/operators/core/data_item.py:360
↓ 2 callersMethod_reindex_metadata
Re-index per-QA metadata fields based on new indices.
datastudio/operators/core/data_item.py:372
↓ 2 callersMethod_save_original
Save original content before rewriting. Args: qa_idx: QA pair index. field: 'answer' or 'question'.
datastudio/operators/core/data_item.py:179
↓ 2 callersMethod_save_yaml
Save YAML configuration file. Args: data_files: List of data file paths. yaml_path: Output YAML file path.
datastudio/datasets/saver/yaml_generator.py:75
↓ 2 callersMethod_update_stats
Update dataset-level statistics.
datastudio/datasets/data_saver.py:177
↓ 2 callersMethodadd_rewrite_record
Add a rewrite record.
datastudio/operators/core/data_item.py:266
↓ 2 callersMethodbuild_requests_selective
Build requests for specific QA indices only. Used by SelectiveMLLMRewriter for conditional rewriting. Args: ite
datastudio/operators/mllm/request.py:179
↓ 2 callersMethodclean
Clear data buffers.
datastudio/datasets/data_saver.py:219
↓ 2 callersMethodclean_item
Clean a single data item by removing temporary fields. Args: item: Data item dictionary. Returns: dict: Clea
datastudio/datasets/saver/simple_saver.py:56
↓ 2 callersMethodclose_all
Close all shards.
datastudio/utils/database.py:446
↓ 2 callersMethoddenormalize
Denormalize a list of items back to original schema. Args: data: List of normalized items. Returns: List of
datastudio/datasets/formatters/schema_converter.py:142
↓ 2 callersMethodend_operator
Record operator execution statistics. Args: name: Operator name (uses current if not specified) input_count:
datastudio/utils/statistics.py:142
↓ 2 callersMethodextensions
(self)
tests/datasets/test_formatters.py:52
↓ 2 callersMethodformat_all_qa
Format all QA pairs for prompt.
datastudio/operators/core/data_item.py:221
↓ 2 callersMethodformat_content
Format request content. Args: item: DataItem to format. qa_idx: QA pair index (-1 for all QA). Retu
datastudio/operators/mllm/request.py:205
↓ 2 callersMethodgenerate
Generate YAML configuration files. Args: dataset_stats: Dataset statistics {path: {"json_size": N, "source": S}}. cnt
datastudio/datasets/saver/yaml_generator.py:47
↓ 2 callersMethodgenerate_inner
Generate response for given inputs. Must be implemented by subclasses.
datastudio/models/base.py:110
↓ 2 callersMethodget_source_from_path
Get source name from file path. Args: file_path: Path to data file. Returns: Source name or None if not foun
datastudio/datasets/saver/processed_checker.py:38
↓ 2 callersMethodgroup_by_source
Group data by source file. Args: data_list: List of data items. Returns: dict: Mapping from source file path
datastudio/datasets/saver/simple_saver.py:78
↓ 2 callersMethodhas_processed
Check if dataset has already been processed.
datastudio/datasets/data_saver.py:89
↓ 2 callersMethodinit_from_config
Initialize logger from config dict. Args: cfg: Logger configuration dict work_dir: Working directory for log
datastudio/utils/logging.py:172
↓ 2 callersFunctioninit_sharded_lmdb
Initialize a single LMDB shard environment. Args: shard_path: Path to shard directory. map_size: Maximum database size in bytes.
datastudio/utils/database.py:56
↓ 2 callersMethodload
Load YAML configuration file. Args: yaml_path: Path to YAML file. Returns: StandardConfig instance.
datastudio/datasets/config/config.py:145
↓ 2 callersMethodload_file_paths
Load config and return all data file paths. Args: yaml_path: Path to YAML config file. data_root: Optional root direc
datastudio/datasets/config/config.py:171
↓ 2 callersMethodlog_stats
Log statistics summary. Args: title: Title for the stats section stats: Dictionary of stat name -> value
datastudio/utils/logging.py:297
↓ 2 callersMethodnormalize
Normalize a list of items to standard schema. Args: data: List of data items. Returns: List of normalized it
datastudio/datasets/formatters/schema_converter.py:130
↓ 2 callersFunctionprint_cfg
Print current config in YAML format.
datastudio/utils/config.py:319
↓ 2 callersMethodprint_summary
Print formatted statistics summary.
datastudio/utils/statistics.py:353
↓ 2 callersMethodprocess
Check if conversation length is within bounds. This is an item-level filter, so we override process() directly.
datastudio/operators/filters/conv_length.py:50
↓ 2 callersMethodprocess_batch
Process a batch of items. Flow: 1. Build requests using RequestBuilder 2. Execute model 3. Parse responses a
datastudio/operators/mllm/base.py:60
↓ 2 callersMethodprocess_single_message
Process a single message with retry logic. Args: message: Single processed message. all_kwargs: Arguments passed to g
datastudio/models/base.py:343
↓ 2 callersMethodrewrite
Remove think tags from an answer.
datastudio/operators/rewriters/remove_think.py:44
↓ 2 callersMethodsave
Save data to files. Args: data_list: List of data items. is_rejected: Whether this is rejected data. appe
datastudio/datasets/saver/simple_saver.py:101
↓ 2 callersFunctionsave_cfg
Save current config to YAML file. Args: save_file: Output file path.
datastudio/utils/config.py:309
↓ 2 callersMethodstart_operator
Mark operator start.
datastudio/utils/statistics.py:137
↓ 2 callersMethodsupported_extensions
Get all supported file extensions. Returns: list: List of supported extensions.
datastudio/datasets/formatters/__init__.py:130
↓ 2 callersMethodupdate_checkpoint
Update checkpoint with current progress.
datastudio/datasets/data_loader.py:393
↓ 1 callersMethod__init__
( self, name: str = "datastudio", level: Union[str, int] = "INFO", log_file: O
datastudio/utils/logging.py:79
↓ 1 callersMethod__init__
Initialize the MLLM rewriter. Args: model: MLLM model instance. request_builder: RequestBuilder config dict.
datastudio/operators/mllm/rewriter.py:30
↓ 1 callersMethod__init__
(self, should_reject=False, **kwargs)
tests/operators/test_operator.py:115
↓ 1 callersMethod__init__
(self, **kwargs)
tests/models/test_base_api.py:22
↓ 1 callersMethod_add_timestamp_to_filename
Add timestamp to filename before extension. Example: logs/run.log -> logs/run_20251003123456.log
datastudio/utils/logging.py:133
↓ 1 callersMethod_apply_filters
Apply filter decisions. Returns: - (item, None): Keep everything - (None, item): Reject everything
datastudio/operators/core/result.py:134
↓ 1 callersMethod_apply_rewrites
Apply rewrite decisions to modify item content.
datastudio/operators/core/result.py:124
↓ 1 callersMethod_build_payload
Build payload for model.generate().
datastudio/operators/mllm/request.py:246
↓ 1 callersMethod_build_requests
Build all requests for all items.
datastudio/operators/mllm/base.py:119
↓ 1 callersMethod_build_sub_pipeline
Build a sub-pipeline from config. Args: cfg: Sub-pipeline config dict. name: Name of the sub-pipeline.
datastudio/pipelines/pipeline.py:86
↓ 1 callersMethod_calculate_retry_delay
Calculate exponential backoff delay with full jitter. Delegates to base class with default max_delay of 2.0 seconds. Args:
datastudio/models/openai_api.py:241
↓ 1 callersMethod_cleanup_requests
(all_requests: List[Dict], payloads: List[Any])
datastudio/operators/mllm/base.py:137
↓ 1 callersFunction_clear_shared_data
Clear module-level globals after workers finish.
datastudio/models/mp_openai_api.py:44
↓ 1 callersMethod_count_image_tags
Count <image> tags in text.
datastudio/operators/rewriters/norm_image_tag.py:43
↓ 1 callersMethod_count_images_in_item
Count actual images in item.
datastudio/operators/rewriters/norm_image_tag.py:47
↓ 1 callersMethod_detect_patterns
Detect hint patterns and their positions. Returns: List of (start_pos, end_pos) tuples for found patterns, sorted by
datastudio/operators/rewriters/norm_prompt.py:116
↓ 1 callersMethod_ensure_lmdb_initialized
Ensure LMDB manager is initialized (lazy initialization).
datastudio/datasets/data_loader.py:127
↓ 1 callersMethod_execute_operator
Execute a single operator and apply results. Returns: List of DataItems (both kept and rejected).
datastudio/pipelines/sub_pipeline.py:86
↓ 1 callersMethod_extract_single_turn
Extract a single turn from multi-turn data.
datastudio/operators/rewriters/split.py:72
↓ 1 callersMethod_find_configs_root
Find the configs root directory by looking for 'configs' folder. Args: start_path: Starting path to search from. Returns
datastudio/utils/config.py:105
↓ 1 callersMethod_fix_hint_format
Fix hint formatting by adding proper newlines. Returns: Tuple of (fixed_text, was_fixed).
datastudio/operators/rewriters/norm_prompt.py:149
↓ 1 callersMethod_has_patterns
Check if text contains instruction patterns.
datastudio/operators/rewriters/norm_multi_turn_prompt.py:46
↓ 1 callersMethod_has_tags_in_response
Check if answer contains image/video/audio tags.
datastudio/operators/filters/response_tag.py:35
↓ 1 callersFunction_init_shared_data
Set module-level globals before forking workers. Must be called in the main process before Pool creation. Args: messages: The full p
datastudio/models/mp_openai_api.py:30
↓ 1 callersMethod_init_wandb
Initialize wandb logging.
datastudio/utils/logging.py:142
← previousnext →101–200 of 1,367, ranked by callers