docs: def parse_json(path):
      # type: (str) -> List[FunctionInfo]
      """Deserialize a JSON file containing runtime collected types.
  
      The input JSON is expected to to have a list of RawEntry items.
      """
      with open(path) as f:
          data = json.load(f)  # type: List[RawEntry]
      result = []
  
      def assert_type(value, typ):
          # type: (object, type) -> None
          assert isinstance(value, typ), '%s: Unexpected type %r' % (path, type(value).__name__)
  
      def assert_dict_item(dictionary, key, typ):
          # type: (Mapping[Any, Any], str, type) -> None
          assert key in dictionary, '%s: Missing dictionary key %r' % (path, key)
          value = dictionary[key]
          assert isinstance(value, typ), '%s: Unexpected type %r for key %r' % (
              path, type(value).__name__, key)
  
      assert_type(data, list)
      for item in data:
          assert_type(item, dict)
          assert_dict_item(item, 'path', Text)
          assert_dict_item(item, 'line', int)
          assert_dict_item(item, 'func_name', Text)
          assert_dict_item(item, 'type_comments', list)
          for comment in item['type_comments']:
              assert_type(comment, Text)
          assert_type(item['samples'], int)
          info = FunctionInfo(encode(item['path']),
                              item['line'],
                              encode(item['func_name']),
                              [encode(comment) for comment in item['type_comments']],
                              item['samples'])
          result.append(info)
      return result