code: def from_auth_file(cls, location=None, api_version=None, user_agent=None):
          
          location = search_auth_file() if not location else location
  
          a = load_json(location)
          try:
              section = a['dhis']
              baseurl = section['baseurl']
              username = section['username']
              password = section['password']
              assert all([baseurl, username, password])
          except (KeyError, AssertionError):
              raise ClientException("Auth file found but not valid: {}".format(location))
          else:
              return cls(baseurl, username, password, api_version=api_version, user_agent=user_agent)
docs: Alternative constructor to load from JSON file.
          If auth_file_path is not specified, it tries to find `dish.json` in:
          - DHIS_HOME
          - Home folder
          :param location: authentication file path
          :param api_version: see Api
          :param user_agent: see Api
          :return: Api instance