docs: def _plain_or_callable(obj):
      """Returns the value of the called object of obj is a callable,
      otherwise the plain object.
      Returns None if obj is None.
  
      >>> obj = None
      >>> _plain_or_callable(obj)
  
      >>> stmt = 'select * from sys.nodes'
      >>> _plain_or_callable(stmt)
      'select * from sys.nodes'
  
      >>> def _args():
      ...     return [1, 'name']
      >>> _plain_or_callable(_args)
      [1, 'name']
  
      >>> _plain_or_callable((x for x in range(10)))
      0
  
      >>> class BulkArgsGenerator:
      ...     def __call__(self):
      ...         return [[1, 'foo'], [2, 'bar'], [3, 'foobar']]
      >>> _plain_or_callable(BulkArgsGenerator())
      [[1, 'foo'], [2, 'bar'], [3, 'foobar']]
      """
      if callable(obj):
          return obj()
      elif isinstance(obj, types.GeneratorType):
          return next(obj)
      else:
          return obj