code: def get_system_environment(version):
      """
      Return the first Python environment found for a string of the form 'X.Y'
      where X and Y are the major and minor versions of Python.
  
      :raises: :exc:`.InvalidPythonEnvironment`
      :returns: :class:`Environment`
      """
      exe = which("python" + version)
      if exe:
          if exe == sys.executable:
              return SameEnvironment()
          return Environment(exe)
  
      if os.name == "nt":
          for exe in _get_executables_from_windows_registry(version):
              return Environment(exe)
      raise InvalidPythonEnvironment(
          "Cannot find executable python%s." % version
      )
  
imports: import os
  import sys
  import hashlib
  import filecmp
  from collections import namedtuple
  from jedi._compatibility import highest_pickle_protocol, which
  from jedi.cache import memoize_method, time_cache
  from jedi.evaluate.compiled.subprocess import CompiledSubprocess, EvaluatorSameProcess, EvaluatorSubprocess
  import parso
label_desc: Use image node_id 10 for calling a global function with example usage: get_system_environment(version) and returns: Environment, SameEnvironment, Environment