def check_type(obj, typ):
    """
    Check if obj is of correct type

    Parameters
    ----------
        obj: any
            Input object for type checking

        typ: type
            Reference object type (e.g. str, int)
    """
    if not isinstance(obj, typ):
        raise TypeError('%r is %r. Must be %r' % (obj, type(obj), typ))
