parameters: ( module_file, force = False )
return_statement: return module
docstring: Load and return the module contained in a file.
    Using force = True the module will be loaded regardless
    of the criteria in _ShouldLoad.
    This will return None if the module was not allowed to be loaded.
docstring_summary: Load and return the module contained in a file.
    Using force = True the module will be loaded regardless
    of the criteria in _ShouldLoad.
    This will return None if the module was not allowed to be loaded.
docstring_tokens: Load and return the module contained in a file . Using force = True the module will be loaded regardless of the criteria in _ShouldLoad . This will return None if the module was not allowed to be loaded .
function: def Load( module_file, force = False ):
    """Load and return the module contained in a file.
    Using force = True the module will be loaded regardless
    of the criteria in _ShouldLoad.
    This will return None if the module was not allowed to be loaded."""
  
    if not module_file:
      return None
  
    with _module_for_module_file_lock:
      if module_file in _module_for_module_file:
        return _module_for_module_file[ module_file ]
  
    is_global = module_file == _GlobalYcmExtraConfFileLocation()
    if not force and not _ShouldLoad( module_file, is_global ):
      Disable( module_file )
      return None
  
    # This has to be here because a long time ago, the ycm_extra_conf.py files
    # used to import clang_helpers.py from the cpp folder. This is not needed
    # anymore, but there are a lot of old ycm_extra_conf.py files that we don't
    # want to break.
    sys.path.insert( 0, _PathToCppCompleterFolder() )
  
    # By default, the Python interpreter compiles source files into bytecode to
    # load them faster next time they are run. These *.pyc files are generated
    # along the source files prior to Python 3.2 or in a __pycache__ folder for
    # newer versions. We disable the generation of these files when loading
    # ycm_extra_conf.py files as users do not want them inside their projects.
    # The drawback is negligible since ycm_extra_conf.py files are generally small
    # files thus really fast to compile and only loaded once by editing session.
    old_dont_write_bytecode = sys.dont_write_bytecode
    sys.dont_write_bytecode = True
    try:
      module = LoadPythonSource( _RandomName(), module_file )
      module.is_global_ycm_extra_conf = is_global
    finally:
      sys.dont_write_bytecode = old_dont_write_bytecode
  
    del sys.path[ 0 ]
  
    with _module_for_module_file_lock:
      _module_for_module_file[ module_file ] = module
    return module
function_tokens: def Load ( module_file , force = False ) : if not module_file : return None with _module_for_module_file_lock : if module_file in _module_for_module_file : return _module_for_module_file [ module_file ] is_global = module_file == _GlobalYcmExtraConfFileLocation ( ) if not force and not _ShouldLoad ( module_file , is_global ) : Disable ( module_file ) return None # This has to be here because a long time ago, the ycm_extra_conf.py files # used to import clang_helpers.py from the cpp folder. This is not needed # anymore, but there are a lot of old ycm_extra_conf.py files that we don't # want to break. sys . path . insert ( 0 , _PathToCppCompleterFolder ( ) ) # By default, the Python interpreter compiles source files into bytecode to # load them faster next time they are run. These *.pyc files are generated # along the source files prior to Python 3.2 or in a __pycache__ folder for # newer versions. We disable the generation of these files when loading # ycm_extra_conf.py files as users do not want them inside their projects. # The drawback is negligible since ycm_extra_conf.py files are generally small # files thus really fast to compile and only loaded once by editing session. old_dont_write_bytecode = sys . dont_write_bytecode sys . dont_write_bytecode = True try : module = LoadPythonSource ( _RandomName ( ) , module_file ) module . is_global_ycm_extra_conf = is_global finally : sys . dont_write_bytecode = old_dont_write_bytecode del sys . path [ 0 ] with _module_for_module_file_lock : _module_for_module_file [ module_file ] = module return module