nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:ctx; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, comment:"""Sort the variants of a vcf file"""; 14, assignment; 15, assignment; 16, assignment; 17, assignment; 18, call; 19, identifier:line; 20, call; 21, block; 22, identifier:head; 23, attribute; 24, identifier:vcf_handle; 25, attribute; 26, identifier:outfile; 27, attribute; 28, identifier:silent; 29, attribute; 30, identifier:print_headers; 31, argument_list; 32, identifier:sort_variants; 33, argument_list; 34, expression_statement; 35, attribute; 36, identifier:head; 37, attribute; 38, identifier:handle; 39, attribute; 40, identifier:outfile; 41, attribute; 42, identifier:silent; 43, identifier:head; 44, keyword_argument; 45, keyword_argument; 46, identifier:vcf_handle; 47, call; 48, identifier:ctx; 49, identifier:parent; 50, identifier:ctx; 51, identifier:parent; 52, identifier:ctx; 53, identifier:parent; 54, identifier:ctx; 55, identifier:parent; 56, identifier:outfile; 57, identifier:outfile; 58, identifier:silent; 59, identifier:silent; 60, identifier:print_variant; 61, argument_list; 62, keyword_argument; 63, keyword_argument; 64, keyword_argument; 65, identifier:variant_line; 66, identifier:line; 67, identifier:outfile; 68, identifier:outfile; 69, identifier:silent; 70, identifier:silent
code: def sort(ctx):
      """Sort the variants of a vcf file"""
      head = ctx.parent.head
      vcf_handle = ctx.parent.handle
      outfile = ctx.parent.outfile
      silent = ctx.parent.silent
  
      print_headers(head, outfile=outfile, silent=silent)
  
      for line in sort_variants(vcf_handle):
          print_variant(variant_line=line, outfile=outfile, silent=silent)