code: def network_get(endpoint, relation_id=None):
      
      if not has_juju_version('2.2'):
          raise NotImplementedError(juju_version())  # earlier versions require --primary-address
      if relation_id and not has_juju_version('2.3'):
          raise NotImplementedError  # 2.3 added the -r option
  
      cmd = ['network-get', endpoint, '--format', 'yaml']
      if relation_id:
          cmd.append('-r')
          cmd.append(relation_id)
      response = subprocess.check_output(
          cmd,
          stderr=subprocess.STDOUT).decode('UTF-8').strip()
      return yaml.safe_load(response)
docs: Retrieve the network details for a relation endpoint
  
      :param endpoint: string. The name of a relation endpoint
      :param relation_id: int. The ID of the relation for the current context.
      :return: dict. The loaded YAML output of the network-get query.
      :raise: NotImplementedError if request not supported by the Juju version.