code: def set_api_from_config_path(self) -> None:
          
          config = ConfigParser(allow_no_value=False)
          # TODO: Remove this after this issue https://github.com/python/mypy/issues/2427 is closed
          config.optionxform = str  # type:ignore
          config.read(self.config_path, "utf-8")
          if config.has_option("defaults", "dynamic_loading"):
              dynamic_loading = config.get("defaults", "dynamic_loading")
          else:
              dynamic_loading = "infura"
          self._set_rpc(dynamic_loading)
docs: Set the RPC mode based on a given config file.