[docs]deflist_files(path:str,url:str,force_remote:bool=False)->List[str]:""" List the contents of a registered directory or a subdirectory thereof. Args: path: Absolute path of the directory to list. url: URL to the SewerRat REST API. Only used for remote access. force_remote: Whether to force remote access via the API, even if ``path`` is on the same filesystem as the caller. Returns: List of strings containing the relative paths of files in ``path``. """ifnotforce_remoteandos.path.exists(path):listing=[]forroot,dirs,filesinos.walk(path):rel=os.path.relpath(root,path)forfinfiles:ifrel!=".":listing.append(os.path.join(rel,f))else:listing.append(f)returnlistingelse:importurllibres=requests.get(url+"/list?path="+urllib.parse.quote_plus(path)+"&recursive=true")ifres.status_code>=300:raiseut.format_error(res)returnres.json()