def is_type(obj, typestr_or_type):
 if (typestr_or_type == 'all'):
  return True
 if (type(typestr_or_type) == type):
  test_type = typestr_or_type
 else:
  test_type = typestr2type.get(typestr_or_type, False)
 if test_type:
  return isinstance(obj, test_type)
 return False

def is_type ( obj , typestr_or_type ) : if ( typestr_or_type == 'all' ) : return True if ( type ( typestr_or_type ) == type ) : test_type = typestr_or_type else : test_type = typestr2type . get ( typestr_or_type , False ) if test_type : return isinstance ( obj , test_type ) return False
is_type verifies if obj is of a certain type .