def python_path(s):
    """
    Convert a path string to a python import compatible path as is generated by the python plugin.

    Python import paths cannot contain dashes, so these are replaced by underscores.
    See https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/python/python_generator.cc#L89-L95

    Args:
        s (string): The input string to be converted.

    Returns:
        (string): The converted string.

    """
    return s.replace("-", "_")