
    {h                         d Z ddlmZmZmZmZ dee   deee      fdZdee   dee   fdZdee   dee   fdZ	dee   de
eef   fdZy	)
z
Utility functions for batch processing.

This module contains helper functions for filtering, extracting, and manipulating
batch results.
   )BatchResultBatchSuccess
BatchErrorTresultsreturnc                 F    | D cg c]  }|j                   s| c}S c c}w )z!Filter to only successful resultssuccessr   rs     W/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/instructor/batch/utils.pyfilter_successfulr      s    ,!!))A,,,   c                 F    | D cg c]  }|j                   r| c}S c c}w )zFilter to only error resultsr
   r   s     r   filter_errorsr      s    0!aiiA000r   c                 Z    | D cg c]  }|j                   s|j                   c}S c c}w )z7Extract just the result objects from successful results)r   resultr   s     r   extract_resultsr      s     %3AHH333s   ((c                 B    | D ci c]  }|j                   | c}S c c}w )z0Create a dictionary mapping custom_id to results)	custom_idr   s     r   get_results_by_custom_idr      s    $+,qAKKN,,,s   N)__doc__modelsr   r   r   r   listr   r   r   dictstrr        r   <module>r       s    = <-tK0 -T,q/5J -
14, 1j1A 1
4T+. 447 4
-d;&7 -DkAQ<R -r   