[docs]classJSONArgumentProvider(ArgumentProvider):def__init__(self,url:str,use_class_defaults:bool=True):""" An argument provider that grabs arguments from a JSON stored at a URL. This can either be a local file by starting the URL with (file://...) or a web resource that serves a JSON like for example a CouchDB URL Args: url: URL of the CouchDB document """ArgumentProvider.__init__(self)self.url=urlself.use_class_defaults=use_class_defaultsdef_build_arguments(self,target_class:type,arguments:dict={})->dict:# if the class defines arguments, take them as defaultsifself.use_class_defaultsandhasattr(target_class,"arguments"):arguments.update(target_class.arguments)try:d=json.loads(file_from_url(self.url).read())exceptExceptionase:logger.warning(f"Could not load arguments from JSON. Error: {e}")d={}iftarget_class.__name__ind.keys():arguments.update(d[target_class.__name__])returnarguments