code: def write_context_error_report(self,file,context_type):
      
      if context_type == 'target':
        r = self.get_target_context_error_report()
      elif context_type == 'query':
        r = self.get_query_context_error_report()
      else:
        sys.stderr.write("ERROR invalid type must be target or query\n")
        sys.exit()
      of = open(file,'w')
      of.write("\t".join(r['header'])+"\n")
      for row in r['data']:
        of.write("\t".join([str(x) for x in row])+"\n")
      return
docs: Write a context error report relative to the target or query into the specified filename
  
      :param file: The name of a file to write the report to
      :param context_type: They type of profile, target or query based
      :type file: string
      :type context_type: string