def _get_my_args(self, tensors: Sequence[Union[Text, Tuple[Text, tf.Tensor]]],
                   args_dict: Dict[Text, Any],
                   context: _Context) -> Tuple[Sequence[Text], Sequence[Any]]:
    """Helper function for check`, which extracts function args."""
    requested_tensor_names = []
    tensor_args = []
    for tensor_item in tensors:
      if isinstance(tensor_item, tuple):
        # Use the name and instance provided by the user from a `Dynamic`
        # contract.
        given_name, tensor_instance = tensor_item
        if not isinstance(given_name, str):
          raise ValueError(
              "Constructing contract for {}: Expected first item of each tuple "
              "in `tensors` to be a string, but got: {}".format(
                  context.func_name, type(given_name)))
        requested_tensor_names.append(given_name)
        tensor_args.append(tensor_instance)
      else:
        # Look up the requested tensor in the function args.
        requested_tensor_name = tensor_item
        maybe_tensor = _get_arg(
            args_dict=args_dict,
            tensor_name=requested_tensor_name,
            context=context)
        requested_tensor_names.append(requested_tensor_name)
        tensor_args.append(maybe_tensor)
    return requested_tensor_names, tensor_args
Helper function for check`, which extracts function args.
language/canine/tensor_contracts.py