@tracing.trace
async def create_selection(self, source, index=None, name=None):
    'Creates a selection from `source`.\n\n    Args:\n      source: As documented in `executor_base.Executor`.\n      index: As documented in `executor_base.Executor`.\n      name: As documented in `executor_base.Executor`.\n\n    Returns:\n      An instance of `EagerValue` that represents the constructed selection.\n\n    Raises:\n      TypeError: If arguments are of the wrong types.\n      ValueError: If either both, or neither of `name` and `index` are present.\n    '
    py_typecheck.check_type(source, EagerValue)
    py_typecheck.check_type(source.type_signature, computation_types.StructType)
    py_typecheck.check_type(source.internal_representation, structure.Struct)
    if (index is not None):
        py_typecheck.check_type(index, int)
        if (name is not None):
            raise ValueError('Cannot simultaneously specify name {} and index {}.'.format(name, index))
        else:
            return EagerValue(source.internal_representation[index], self._tf_function_cache, source.type_signature[index])
    elif (name is not None):
        py_typecheck.check_type(name, str)
        return EagerValue(getattr(source.internal_representation, str(name)), self._tf_function_cache, getattr(source.type_signature, str(name)))
    else:
        raise ValueError('Must specify either name or index.')
Creates a selection from `source`.

Args:
  source: As documented in `executor_base.Executor`.
  index: As documented in `executor_base.Executor`.
  name: As documented in `executor_base.Executor`.

Returns:
  An instance of `EagerValue` that represents the constructed selection.

Raises:
  TypeError: If arguments are of the wrong types.
  ValueError: If either both, or neither of `name` and `index` are present.
@tracing.trace
async def create_selection(self, source, index=None, name=None):
    'Creates a selection from `source`.\n\n    Args:\n      source: As documented in `executor_base.Executor`.\n      index: As documented in `executor_base.Executor`.\n      name: As documented in `executor_base.Executor`.\n\n    Returns:\n      An instance of `EagerValue` that represents the constructed selection.\n\n    Raises:\n      TypeError: If arguments are of the wrong types.\n      ValueError: If either both, or neither of `name` and `index` are present.\n    '
    py_typecheck.check_type(source, EagerValue)
    py_typecheck.check_type(source.type_signature, computation_types.StructType)
    py_typecheck.check_type(source.internal_representation, structure.Struct)
    if (index is not None):
        py_typecheck.check_type(index, int)
        if (name is not None):
            raise ValueError('Cannot simultaneously specify name {} and index {}.'.format(name, index))
        else:
            return EagerValue(source.internal_representation[index], self._tf_function_cache, source.type_signature[index])
    elif (name is not None):
        py_typecheck.check_type(name, str)
        return EagerValue(getattr(source.internal_representation, str(name)), self._tf_function_cache, getattr(source.type_signature, str(name)))
    else:
        raise ValueError('Must specify either name or index.')