def find_python_version(<EOL>self,<EOL>major=None,  <EOL>minor=None,  <EOL>patch=None,  <EOL>pre=None,  <EOL>dev=None,  <EOL>arch=None,  <EOL>name=None,  <EOL>):<EOL>
if isinstance(major, six.string_types) and not minor and not patch:<EOL><INDENT>if major.isdigit() or (major.count("<STR_LIT:.>") > <NUM_LIT:0> and major[<NUM_LIT:0>].isdigit()):<EOL><INDENT>version = major.split("<STR_LIT:.>", <NUM_LIT:2>)<EOL>if isinstance(version, (tuple, list)):<EOL><INDENT>if len(version) > <NUM_LIT:3>:<EOL><INDENT>major, minor, patch, rest = version<EOL><DEDENT>elif len(version) == <NUM_LIT:3>:<EOL><INDENT>major, minor, patch = version<EOL><DEDENT>elif len(version) == <NUM_LIT:2>:<EOL><INDENT>major, minor = version<EOL><DEDENT>else:<EOL><INDENT>major = major[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>major = major<EOL>name = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>name = "<STR_LIT>".format(major)<EOL>major = None<EOL><DEDENT><DEDENT>sub_finder = operator.methodcaller(<EOL>"<STR_LIT>", major, minor, patch, pre, dev, arch, name<EOL>)<EOL>alternate_sub_finder = None<EOL>if name and not (minor or patch or pre or dev or arch or major):<EOL><INDENT>alternate_sub_finder = operator.methodcaller(<EOL>"<STR_LIT>", None, None, None, None, None, None, name<EOL>)<EOL><DEDENT>if major and minor and patch:<EOL><INDENT>_tuple_pre = pre if pre is not None else False<EOL>_tuple_dev = dev if dev is not None else False<EOL>version_tuple = (major, minor, patch, _tuple_pre, _tuple_dev)<EOL>version_tuple_pre = (major, minor, patch, True, False)<EOL><DEDENT>if os.name == "<STR_LIT>" and self.windows_finder:<EOL><INDENT>windows_finder_version = sub_finder(self.windows_finder)<EOL>if windows_finder_version:<EOL><INDENT>return windows_finder_version<EOL><DEDENT><DEDENT>ver = next(iter(self.get_pythons(sub_finder)), None)<EOL>if not ver and alternate_sub_finder is not None:<EOL><INDENT>ver = next(iter(self.get_pythons(alternate_sub_finder)), None)<EOL><DEDENT>if ver:<EOL><INDENT>if ver.as_python.version_tuple[:<NUM_LIT:5>] in self.python_version_dict:<EOL><INDENT>self.python_version_dict[ver.as_python.version_tuple[:<NUM_LIT:5>]].append(ver)<EOL><DEDENT>else:<EOL><INDENT>self.python_version_dict[ver.as_python.version_tuple[:<NUM_LIT:5>]] = [ver]<EOL><DEDENT><DEDENT>return ver<EOL>
Search for a specific python version on the path.

        :param major: Major python version to search for.
        :type major: int
        :param int minor: Minor python version to search for, defaults to None
        :param int patch: Patch python version to search for, defaults to None
        :param bool pre: Search for prereleases (default None) - prioritize releases if None
        :param bool dev: Search for devreleases (default None) - prioritize releases if None
        :param str arch: Architecture to include, e.g. '64bit', defaults to None
        :param str name: The name of a python version, e.g. ``anaconda3-5.3.0``
        :return: A :class:`~pythonfinder.models.PathEntry` instance matching the version requested.
        :rtype: :class:`~pythonfinder.models.PathEntry`