def _to_const(cf):
 if isinstance(cf, string_types):
  if (cf not in _str_to_frame):
   raise ValueError(('Unknown cf %s' % cf))
  cf = _str_to_frame[cf]
 elif (not isinstance(cf, (int, np.integer))):
  raise TypeError(('cf must be str or int, not %s' % type(cf)))
 return int(cf)

def _to_const ( cf ) : if isinstance ( cf , string_types ) : if ( cf not in _str_to_frame ) : raise ValueError ( ( 'Unknown cf %s' % cf ) ) cf = _str_to_frame [ cf ] elif ( not isinstance ( cf , ( int , np . integer ) ) ) : raise TypeError ( ( 'cf must be str or int, not %s' % type ( cf ) ) ) return int ( cf )
convert string or int coord frame into int .