code: def __str__(self):
      contig_idx = {
          contig: i for i, contig in enumerate(self.rg.contigs)
      }
      max_contig_len = max(
          len(contig) for contig in self.variants_per_contig
      )
      contig_formatter = f"%{max_contig_len}s"
  
      max_allele_count_len = max(
          len(str(x)) for x in self.alleles_per_variant
      )
      allele_count_formatter = f"%{max_allele_count_len}s"
  
      max_allele_type_len = max(len(x) for x in self.allele_types)
      allele_type_formatter = f"%{max_allele_type_len}s"
  
      line_break = "=============================="
  
      builder = []
      builder.append(line_break)
      builder.append(f"Number of variants: {self.n_variants}")
      builder.append(line_break)
      builder.append("Alleles per variant")
      builder.append("-------------------")
      for n_alleles, count in sorted(
          self.alleles_per_variant.items(), key=lambda x: x[0]
      ):
          builder.append(
              f"  {allele_count_formatter % n_alleles} alleles: {count} variants"
          )
      builder.append(line_break)
      builder.append("Variants per contig")
      builder.append("-------------------")
      for contig, count in sorted(
          self.variants_per_contig.items(),
          key=lambda x: contig_idx[x[0]],
      ):
          builder.append(
              f"  {contig_formatter % contig}: {count} variants"
          )
      builder.append(line_break)
      builder.append("Allele type distribution")
      builder.append("------------------------")
      for allele_type, count in Counter(
          self.allele_types
      ).most_common():
          summary = f"  {allele_type_formatter % allele_type}: {count} alternate alleles"
          if allele_type == "SNP":
              nti = self.nti
              ntv = self.ntv
              summary += (
                  f" (Ti: {nti}, Tv: {ntv}, ratio: {nti / ntv:.2f})"
              )
          builder.append(summary)
      builder.append(line_break)
      return "\n".join(builder)
  
imports: import abc
  import logging
  import hail
  from collections import Counter
  import os
  from shlex import quote
  from typing import Dict, Tuple, List, Optional, Union
  from hailtop import pip_version
  from hailtop.utils import async_to_blocking
  import hailtop.batch_client
  from hailtop.config import get_deploy_config
  from hailtop import yamlx
  from hail.backend.service_backend import ServiceBackend
  from hail.typecheck import typecheck, oneof, anytype, nullable, numeric
  from hail.expr.expressions.expression_typecheck import expr_float64
  from hail.utils import FatalError
  from hail.utils.java import Env, info, warning
  from hail.utils.misc import divide_null, guess_cloud_spark_provider, new_temp_file
  from hail.matrixtable import MatrixTable
  from hail.table import Table
  from hail.ir import TableToTableApply
  from .misc import require_biallelic, require_row_key_variant, require_col_key_str, require_table_key_variant, require_alleles_field
label_desc: Use image node_id 4 for calling the _VariantSummary obj's underlying member method code with example usage: obj.__str__() and returns: str