def _validate_input(dist_matrix_header, dist_matrix, mapping_header, mapping, field):
 if ((dist_matrix_header is None) or (dist_matrix is None) or (mapping_header is None) or (mapping is None) or (field is None)):
  raise ValueError("The input(s) cannot be 'None'.")
 for input_arg in (dist_matrix_header, dist_matrix, mapping_header, mapping):
  try:
   iter(input_arg)
  except:
   raise ValueError('The headers, distance matrix, and mapping data must be iterable.')
 if (not isinstance(field, str)):
  raise ValueError('The field must be a string.')
 if (field not in mapping_header):
  raise ValueError(("The field '%s' is not in the mapping file header." % field))
 if (not (set(zip(*mapping)[0]) & set(dist_matrix_header))):
  raise ValueError('The mapping file does not share at least one sample with the distance matrix.')

def _validate_input ( dist_matrix_header , dist_matrix , mapping_header , mapping , field ) : if ( ( dist_matrix_header is None ) or ( dist_matrix is None ) or ( mapping_header is None ) or ( mapping is None ) or ( field is None ) ) : raise ValueError ( "The input(s) cannot be 'None'." ) for input_arg in ( dist_matrix_header , dist_matrix , mapping_header , mapping ) : try : iter ( input_arg ) except : raise ValueError ( 'The headers, distance matrix, and mapping data must be iterable.' ) if ( not isinstance ( field , str ) ) : raise ValueError ( 'The field must be a string.' ) if ( field not in mapping_header ) : raise ValueError ( ( "The field '%s' is not in the mapping file header." % field ) ) if ( not ( set ( zip ( * mapping ) [ 0 ] ) & set ( dist_matrix_header ) ) ) : raise ValueError ( 'The mapping file does not share at least one sample with the distance matrix.' )
validates the input data to make sure it can be used and makes sense .