  def ListNetworkPolicies(
      self, namespace: Optional[str] = None) -> List[netpol.K8sNetworkPolicy]:
    """List the network policies in a namespace of this cluster.

    Args:
      namespace (str): Optional. The namespace in which to list network
          policies. If unspecified, it returns network policies in all
          namespaces of this cluster.

    Returns:
      List[netpol.K8sNetworkPolicy]: The list of network policies.
    """
    api = self._Api(client.NetworkingV1Api)
    if namespace is not None:
      policies = api.list_namespaced_network_policy(namespace)
    else:
      policies = api.list_network_policy_for_all_namespaces()
    return [
        netpol.K8sNetworkPolicy(
            self._api_client, policy.metadata.name, policy.metadata.namespace)
        for policy in policies.items
    ]
List the network policies in a namespace of this cluster.

Args:
namespace (str): Optional. The namespace in which to list network
policies. If unspecified, it returns network policies in all
namespaces of this cluster.

Returns:
List[netpol.K8sNetworkPolicy]: The list of network policies.
libcloudforensics/providers/kubernetes/cluster.py