def has_extension(ffile, extensions):
    """Check if ffile has an extension given in extensions. Extensions can be
    a string or a list of strings."""
    if isinstance(extensions, str):
        extensions = [extensions]
    if ffile.rpartition('.')[-1] in extensions:
        return True
    return False
