code: def _any(objs, query):
      ''' Whether any of a collection of objects satisfies a given query predicate
  
      Args:
          objs (seq[Model or Document]) :
  
          query (callable)
  
      Returns:
          True, if ``query(obj)`` is True for some object in ``objs``, else False
  
      '''
      for obj in objs:
          if isinstance(obj, Document):
              if _any(obj.roots, query):
                  return True
          else:
              if any(query(ref) for ref in obj.references()):
                  return True
      else:
          return Falsf _any(objs, query):
      ''' Whether any of a collection of objects satisfies a given query predicate
  
      Args:
          objs (seq[Model or Document]) :
  
          query (callable)
  
      Returns:
          True, if ``query(obj)`` is True for some object in ``objs``, else False
  
      '''
      for obj in objs:
          if isinstance(obj, Document):
              if _any(obj.roots, query):
                  return True
          else:
              if any(query(ref) for ref in obj.references()):
                  return True
      else:
          return False
docs: Whether any of a collection of objects satisfies a given query predicate
  
      Args:
          objs (seq[Model or Document]) :
  
          query (callable)
  
      Returns:
          True, if ``query(obj)`` is True for some object in ``objs``, else False