code: def validate_format(input_format, valid_formats):
      """Check the input format is in list of valid formats
      :raise ValueError if not supported
      """
      if not input_format in valid_formats:
          raise ValueError(
              "{} data format is not in valid formats ({})".format(
                  input_format, valid_formats
              )
          )
  
      return input_format
  
file_path: cornac/cornac/utils/common.py
imports: import numbers
  import numpy
  import scipy.sparse
  from .fast_sparse_funcs import inplace_csr_row_normalize_l1, inplace_csr_row_normalize_l2
label_desc: Use image node_id 7 for calling a global function with example usage: validate_format(input_format, valid_formats) and returns: input_format