code: def get_hosts_files(option):
      
      if option is not None:
          return option.split(',')
  
      # Use hosts file from the current dir if it exists
      if os.path.isfile('hosts'):
          return ['hosts']
  
      # Perhaps it's configured in a configuration file. Try to find a
      # configuration file and see if it contains a `hostsfile` entry.
      config_locations = [
          '.',
          '/etc/ansible/'
      ]
      config_dir = util.find_path(config_locations, 'ansible.cfg')
      log.debug('config_dir = {0}'.format(config_dir))
      if config_dir:
          with open(os.path.join(config_dir, 'ansible.cfg'), 'r') as cf:
              for line in cf:
                  if line.startswith('hostfile'):
                      return [line.split('=', 1)[1].strip()]
docs: Find out the location of the `hosts` file. This looks in multiple places
      such as the `-i` option, current dir and ansible configuration files. The
      first match is returned as a list.