import re


def argo_safe_name(name):
    """Some names are to be used in the Argo YAML file. For example,
    the generateName and template name in
    https://github.com/argoproj/argo/blob/master/examples/hello-world.yaml. As
    Argo is to use the YAML as part of Kubernetes job description
    YAML, these names must follow Kubernetes's convention -- no
    period or underscore. This function replaces these prohibited
    characters into dashes.
    """
    if name is None:
        return None
    # '_' and '.' are not allowed
    return re.sub(r"_|\.", "-", name)