Create a new FileCollection, and select all files that extension 
        matching ``ext``::
        
            dir_path = "your/path"
            
            fc = FileCollection.from_path_by_ext(dir_path, ext=[".jpg", ".png"])

def from_path_by_ext(dir_path, ext):
        """Create a new FileCollection, and select all files that extension 
        matching ``ext``::
        
            dir_path = "your/path"
            
            fc = FileCollection.from_path_by_ext(dir_path, ext=[".jpg", ".png"])
        """
        if isinstance(ext, (list, set, dict)): # collection of extension
            def filter(winfile):
                if winfile.ext in ext:
                    return True
                else:
                    return False
        else: # str
            def filter(winfile):
                if winfile.ext == ext:
                    return True
                else:
                    return False

        return FileCollection.from_path_by_criterion(
            dir_path, filter, keepboth=False)