<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalised(version):
 """Normalise a version string according to PEP 440, if possible."""

    norm_version = pkg_resources.parse_version(version)
    if not isinstance(norm_version, tuple):
        # Let setuptools (>= 8) do the normalisation
        return str(norm_version)
    else:
        # Homegrown normalisation for older setuptools (< 8)
        public, sep, local = version.lower().partition('+')
        # Remove leading 'v' from public version
        if len(public) >= 2:
            if public[0] == 'v' and public[1] in '0123456789':
                public = public[1:]
        # Turn all chars except alphanumerics into periods in local version
        local = NON_ALPHANUMERIC.sub('.', local)
        return public + sep + local