def get_prefix_from_ns_name(ns_name):
    """Parses prefix from prefix-identifier

    :param ns_name: The name of a namespace
    :returns: The prefix ending with a '-' or None if there is no '-'
    """
    dash_index = ns_name.find('-')
    if 0 <= dash_index:
        return ns_name[:dash_index + 1]
dataset/ETHPy150Open openstack/neutron/neutron/agent/l3/namespaces.py/get_prefix_from_ns_name/original