Did I find the right examples for you? yes no

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
Convert an arbitrary string to a standard version string

Spaces become dots, and all other non-alphanumeric characters become
dashes, with runs of multiple dashes condensed to a single dash.

        def safe_version(version):
    """Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    """
    version = version.replace(' ','.')
    return re.sub('[^A-Za-z0-9.]+', '-', version)
        


src/m/e/merlin-1-1.0/merlin/command/egg_info.py   merlin(Download)
from distutils.util import convert_path
from distutils.filelist import FileList
from merlin import parse_requirements, safe_name, parse_version, \
    safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename
from sdist import walk_revctrl
    def tagged_version(self):
        return safe_version(self.distribution.get_version() + self.vtags)
 
    def run(self):
        self.mkpath(self.egg_info)

src/m/e/merlin-1-1.0/merlin/dist.py   merlin(Download)
        dist = merlin.working_set.by_key.get(key)
        if dist is not None and not dist.has_metadata('PKG-INFO'):
            dist._version = merlin.safe_version(str(attrs['version']))
            self._patched_dist = dist