<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize_version(version):
 """\ Canonicalizes the provided `version`. If the `version` is ``None``, this function returns ``None``. Otherwise this function checks if `version` is an integer or a Micro QR Code version. In case the string represents a Micro QR Code version, an uppercased string identifier is returned. If the `version` does not represent a valid version identifier (aside of ``None``, a VersionError is raised. :param version: An integer, a string or ``None``. :raises: VersionError: In case the version is not ``None`` and does not represent a valid (Micro) QR Code version. :rtype: int, str or ``None`` """

    if version is None:
        return None
    error = False
    try:
        version = int(version)
        # Don't want Micro QR Code constants as input
        error = version < 1
    except (ValueError, TypeError):
        try:
            version = consts.MICRO_VERSION_MAPPING[version.upper()]
        except (KeyError, AttributeError):
            error = True
    if error or not 0 < version < 41 and version not in consts.MICRO_VERSIONS:
        raise VersionError('Unsupported version "{0}". '
                           'Supported: {1} and 1 .. 40'
                           .format(version, ', '.join(sorted(consts.MICRO_VERSION_MAPPING.keys()))))
    return version