code: def generate_annotations_json_string(source_path, only_simple=False):
      # type: (str, bool) -> List[FunctionData]
      
      items = parse_json(source_path)
      results = []
      for item in items:
          signature = unify_type_comments(item.type_comments)
          if is_signature_simple(signature) or not only_simple:
              data = {
                  'path': item.path,
                  'line': item.line,
                  'func_name': item.func_name,
                  'signature': signature,
                  'samples': item.samples
              }  # type: FunctionData
              results.append(data)
      return results
docs: Produce annotation data JSON file from a JSON file with runtime-collected types.
  
      Data formats:
  
      * The source JSON is a list of pyannotate_tools.annotations.parse.RawEntry items.
      * The output JSON is a list of FunctionData items.