def load_completions(self, docset):
    # Only load once
    if (len(self._completions) == 0):
      source = docset if docset in ['public', 'legacy', 'daily'] else 'public'
      source = "corona.completions-" + source
      if (_corona_utils.SUBLIME_VERSION < 3000):
        comp_path = os.path.join(_corona_utils.PACKAGE_DIR, source)
        json_data = open(comp_path)
        try:
          self._completions = json.load(json_data)
        except Exception as e:
          print("Corona Editor: failed to load {0} ({1})".format(comp_path, str(e)))
        finally:
          json_data.close()

      else:

        self._completions = json.loads(sublime.load_resource(_corona_utils.ST_PACKAGE_PATH + source))

      # _corona_utils.debug(self._completions)
      print("Corona Editor: loaded {0} completions from {1}".format(len(self._completions['completions']), source))
dataset/ETHPy150Open coronalabs/CoronaSDK-SublimeText/completions.py/CoronaLabs.load_completions/original