<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_local_ref(region, ref_file, out_vcf_base):
 """Retrieve a local FASTA file corresponding to the specified region. """

    out_file = "{0}.fa".format(out_vcf_base)
    if not file_exists(out_file):
        with pysam.Fastafile(ref_file) as in_pysam:
            contig, start, end = region
            seq = in_pysam.fetch(contig, int(start), int(end))
            with open(out_file, "w") as out_handle:
                out_handle.write(">{0}-{1}-{2}\n{3}".format(contig, start, end,
                                                              str(seq)))
    with open(out_file) as in_handle:
        in_handle.readline()
        size = len(in_handle.readline().strip())
    return out_file, size