code: def elements_and_dtype(elements, dtype, source=None):
      if source is None:
          prefix = ""
      else:
          prefix = "%s." % (source,)
  
      if elements is not None:
          st.check_strategy(elements, "%selements" % (prefix,))
      else:
          with check("dtype is not None"):
              if dtype is None:
                  raise InvalidArgument(
                      (
                          "At least one of %(prefix)selements or %(prefix)sdtype "
                          "must be provided."
                      )
                      % {"prefix": prefix}
                  )
  
      with check("is_categorical_dtype"):
          if is_categorical_dtype(dtype):
              raise InvalidArgument(
                  "%sdtype is categorical, which is currently unsupported"
                  % (prefix,)
              )
  
      dtype = try_convert(np.dtype, dtype, "dtype")
  
      if elements is None:
          elements = npst.from_dtype(dtype)
      elif dtype is not None:
  
          def convert_element(value):
              name = "draw(%selements)" % (prefix,)
              try:
                  return np.array([value], dtype=dtype)[0]
              except TypeError:
                  raise InvalidArgument(
                      "Cannot convert %s=%r of type %s to dtype %s"
                      % (name, value, type(value).__name__, dtype.str)
                  )
              except ValueError:
                  raise InvalidArgument(
                      "Cannot convert %s=%r to type %s"
                      % (name, value, dtype.str)
                  )
  
          elements = elements.map(convert_element)
      assert elements is not None
  
      return elements, dtype
  
imports: from __future__ import absolute_import, division, print_function
  from collections import OrderedDict
  from copy import copy
  import attr
  import numpy
  import pandas
  import hypothesis.extra.numpy
  import hypothesis.internal.conjecture.utils
  import hypothesis.strategies._internal.core
  from hypothesis.control import reject
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.compat import abc, hrange
  from hypothesis.internal.coverage import check, check_function
  from hypothesis.internal.validation import check_type, check_valid_interval, check_valid_size, try_convert
label_desc: Use image node_id 3 for calling a global function with example usage: elements_and_dtype(elements, dtype, source) and returns: elements,  dtype, np