code: def validate():
      
      if not os.path.exists(os.path.join(ROOT, APP, '__init__.py')):
          message = ansi.error() + ' Python module not found.'
          if os.environ.get('LORE_APP') is None:
              message += ' $LORE_APP is not set. Should it be different than "%s"?' % APP
          else:
              message += ' $LORE_APP is set to "%s". Should it be different?' % APP
          sys.exit(message)
  
      if exists():
          return
  
      if len(sys.argv) > 1:
          command = sys.argv[1]
      else:
          command = 'lore'
      sys.exit(
          ansi.error() + ' %s is only available in lore '
                         'app directories (missing %s)' % (
              ansi.bold(command),
              ansi.underline(VERSION_PATH)
          )
      )
docs: Display error messages and exit if no lore environment can be found.