Any typing, or other improvements that you could make for this simple function?
def get_json_parsed_from(url: Union[str, bytes]) -> Dict[Any, Any]:
"""Gets a JSON file and returns it parsed, or returns an empty dict if any error occurred."""
try:
headers = random_headers()
headers['Accept'] = 'application/json,text/*;q=0.99'
return dict(requests.get(url, headers=random_headers()).json())
except BaseException:
_LOGGER.exception('Failed getting JSON from %s', repr(url), exc_info=False)
return {}