Sorry, the file isn't shipped yet with Bazel:
def absolute_label(label):
"""Expands a label to be of the full form //package:foo.
absolute_label("//pkg:foo") = "//pkg:foo"
absolute_label("//pkg:gws") = "//pkg:gws"
absolute_label("//pkg") = "//pkg:gws"
absolute_label(":foo") = "//current_package:foo"
"""
if label.startswith("//") and not (":" in label):
label += ":" + label[label.rfind("/")+1:]
elif label.startswith(":"):
label = "//" + PACKAGE_NAME + label
return label
--
Laurent