code: def get_default_environment():
      """
      Tries to return an active Virtualenv. If there is no VIRTUAL_ENV variable
      set it will return the latest Python version installed on the system. This
      makes it possible to use as many new Python features as possible when using
      autocompletion and other functionality.
  
      :returns: :class:`Environment`
      """
      virtual_env = _get_virtual_env_from_var()
      if virtual_env is not None:
          return virtual_env
  
      return _try_get_same_env()
  
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 4 for calling a global function with example usage: get_default_environment() and returns: _try_get_same_env, virtual_env