code: def plinkify(dataset, min=None, max=None):
      vcf = utils.new_temp_file(prefix="plink", extension="vcf")
      hl.export_vcf(dataset, vcf)
  
      local_tmpdir = utils.new_local_temp_dir()
      plinkpath = f"{local_tmpdir}/plink-ibd"
      local_vcf = f"{local_tmpdir}/input.vcf"
  
      hl.hadoop_copy(vcf, local_vcf)
  
      threshold_string = "{} {}".format(
          "--min {}".format(min) if min else "",
          "--max {}".format(max) if max else "",
      )
  
      plink_command = "plink --double-id --allow-extra-chr --vcf {} --genome full --out {} {}".format(
          utils.uri_path(local_vcf),
          utils.uri_path(plinkpath),
          threshold_string,
      )
      result_file = utils.uri_path(plinkpath + ".genome")
  
      sp.run(plink_command, check=True, capture_output=True, shell=True)
  
      ### format of .genome file is:
      # _, fid1, iid1, fid2, iid2, rt, ez, z0, z1, z2, pihat, phe,
      # dst, ppc, ratio, ibs0, ibs1, ibs2, homhom, hethet (+ separated)
  
      ### format of ibd is:
      # i (iid1), j (iid2), ibd: {Z0, Z1, Z2, PI_HAT}, ibs0, ibs1, ibs2
      results = {}
      with open(result_file) as f:
          f.readline()
          for line in f:
              row = line.strip().split()
              results[(row[1], row[3])] = (
                  list(map(float, row[6:10])),
                  list(map(int, row[14:17])),
              )
      return results
  
file_path: hail/hail/python/test/hail/methods/relatedness/test_identity_by_descent.py
imports: import os
  import pytest
  import subprocess
  import unittest
  import hail
  import hail.utils
  from ...helpers import test_timeout, qobtest
label_desc: Use image node_id 2 for calling a global function with example usage: plinkify(dataset, min, max) and returns: results