code: def import_file(self, import_file_path=None):
          
          skipped = 0
          invalid_count = 0
          if is_readable(import_file_path):
              import_entries = []
              with open(import_file_path, 'r') as infile:
                  for line in infile:
                      stripped_entry = line.strip()
                      if (not stripped_entry) or (stripped_entry.startswith('#')):
                          skipped += 1
                      else:
                          line = line.partition('#')[0]
                          line = line.rstrip()
                          import_entry = HostsEntry.str_to_hostentry(line)
                          if import_entry:
                              import_entries.append(import_entry)
                          else:
                              invalid_count += 1
              add_result = self.add(entries=import_entries)
              write_result = self.write()
              return {'result': 'success',
                      'skipped': skipped,
                      'invalid_count': invalid_count,
                      'add_result': add_result,
                      'write_result': write_result}
          else:
              return {'result': 'failed',
                      'message': 'Cannot read: file {0}.'.format(import_file_path)}
docs: Read a list of host entries from a file, convert them into instances
          of HostsEntry and then append to the list of entries in Hosts
          :param import_file_path: The path to the file containing the host entries
          :return: Counts reflecting the attempted additions