code: def _union_dataset(children, schema=None, **kwargs):
      if any(v is not None for v in kwargs.values()):
          raise ValueError(
              "When passing a list of Datasets, you cannot pass any additional "
              "arguments"
          )
  
      if schema is None:
          # unify the children datasets' schemas
          schema = pa.unify_schemas(
              [child.schema for child in children]
          )
  
      for child in children:
          if getattr(child, "_scan_options", None):
              raise ValueError(
                  "Creating an UnionDataset from filtered or projected Datasets "
                  "is currently not supported. Union the unfiltered datasets "
                  "and apply the filter to the resulting union."
              )
  
      # create datasets with the requested schema
      children = [child.replace_schema(schema) for child in children]
  
      return UnionDataset(schema, children)
  
file_path: arrow/python/pyarrow/dataset.py
imports: import pyarrow
  from pyarrow.util import _is_iterable, _stringify_path, _is_path_like
  from pyarrow.compute import Expression, scalar, field
label_desc: Use image node_id 9 for calling a global function with example usage: _union_dataset(children, schema) and returns: UnionDataset