original_docstring: 
      Returns a feature list automatically selecting the correct data type as specified by the parameter.
  
      :param value: Value to be converted to feature. It must be a str or bytes, a list of float (or equivalent type)
          or a list of int (or equivalent type).
      :type value: Union[Union[str, byte], list[float], list[int]]
      :param data_type: Type of the data (type of value in case of str of bytes, or type of the elements of the list in
          the case of list of float and list of int).
      :type data_type: type
      :raise ValueError: When the specified data type is not recognised as a type that can be converted to feature.
      :return: A list feature of the correct type.
      :rtype: tensorflow.train.Feature
      
docstring: Returns a feature list automatically selecting the correct data type as specified by the parameter.
docstring_tokens: Returns a feature list automatically selecting the correct data type as specified by the parameter .
code: def _auto_feature(value, data_type):
      """
      Returns a feature list automatically selecting the correct data type as specified by the parameter.
  
      :param value: Value to be converted to feature. It must be a str or bytes, a list of float (or equivalent type)
          or a list of int (or equivalent type).
      :type value: Union[Union[str, byte], list[float], list[int]]
      :param data_type: Type of the data (type of value in case of str of bytes, or type of the elements of the list in
          the case of list of float and list of int).
      :type data_type: type
      :raise ValueError: When the specified data type is not recognised as a type that can be converted to feature.
      :return: A list feature of the correct type.
      :rtype: tensorflow.train.Feature
      """
      if data_type in (np.float32, np.float64, float):
          feature = _float_feature(value)
      elif data_type in (int, bool, np.uint32, np.uint64, np.int64):
          feature = _int64_feature(value)
      elif data_type in (str, bytes):
          # The feature must be bytes, so it is necessary to encode the string as a bytes string.
          # Default parameters are used (utf-8 encoding).
          if data_type is str:
              value = value.encode()
          feature = _bytes_feature(value)
      else:
          raise ValueError(f'Unrecognised data_type {data_type}')
  
      return feature
code_tokens: def _auto_feature ( value , data_type ) : if data_type in ( np . float32 , np . float64 , float ) : feature = _float_feature ( value ) elif data_type in ( int , bool , np . uint32 , np . uint64 , np . int64 ) : feature = _int64_feature ( value ) elif data_type in ( str , bytes ) : if data_type is str : value = value . encode ( ) feature = _bytes_feature ( value ) else : raise ValueError ( f'Unrecognised data_type {data_type}' ) return feature
short_docstring: Returns a feature list automatically selecting the correct data type as specified by the parameter.
short_docstring_tokens: Returns a feature list automatically selecting the correct data type as specified by the parameter .
comment: """
      Returns a feature list automatically selecting the correct data type as specified by the parameter.
  
      :param value: Value to be converted to feature. It must be a str or bytes, a list of float (or equivalent type)
          or a list of int (or equivalent type).
      :type value: Union[Union[str, byte], list[float], list[int]]
      :param data_type: Type of the data (type of value in case of str of bytes, or type of the elements of the list in
          the case of list of float and list of int).
      :type data_type: type
      :raise ValueError: When the specified data type is not recognised as a type that can be converted to feature.
      :return: A list feature of the correct type.
      :rtype: tensorflow.train.Feature
      """$SEP$# The feature must be bytes, so it is necessary to encode the string as a bytes string.$SEP$# Default parameters are used (utf-8 encoding).