code: def glob_targets(targets, glob=True, recursive=True):
      from dvc.exceptions import DvcException
  
      if not glob:
          return targets
  
      from glob import iglob
  
      results = [
          exp_target
          for target in targets
          for exp_target in iglob(target, recursive=recursive)
      ]
  
      if not results:
          msg = f"Glob {targets} has no matches."
          raise DvcException(msg)
  
      return results
  
imports: import hashlib
  import json
  import os
  import re
  import sys
  from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Tuple
  import colorama
label_desc: Use image node_id 21 for calling a global function with example usage: glob_targets(targets, glob, recursive) and returns: results, targets