  def ToKeywords(self) -> Dict[str, str]:
    """Builds the keyword arguments to be passed to the K8s API.

    Returns:
      Dict[str, str]: The keyword arguments to be passed to a Kubernetes
          API call.
    """
    keywords = defaultdict(list)
    for selector in self._selectors:
      keywords[selector.keyword].append(selector.ToString())
    return {k: ','.join(vs) for k, vs in keywords.items()}
Builds the keyword arguments to be passed to the K8s API.

Returns:
Dict[str, str]: The keyword arguments to be passed to a Kubernetes
API call.
libcloudforensics/providers/kubernetes/selector.py