def get_metadata(self, loadbalancer, node=None, raw=False):
        """
        Returns the current metadata for the load balancer. If 'node' is
        provided, returns the current metadata for that node.
        """
        if node:
            uri = "/loadbalancers/%s/nodes/%s/metadata" % (
                    utils.get_id(loadbalancer), utils.get_id(node))
        else:
            uri = "/loadbalancers/%s/metadata" % utils.get_id(loadbalancer)
        resp, body = self.api.method_get(uri)
        meta = body.get("metadata", [])
        if raw:
            return meta
        ret = dict([(itm["key"], itm["value"]) for itm in meta])
        return ret
dataset/ETHPy150Open rackspace/pyrax/pyrax/cloudloadbalancers.py/CloudLoadBalancerManager.get_metadata/original