<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def query(args):
 """ %prog query binfile fastafile ctgID baseID Get the depth at a particular base. """

    p = OptionParser(query.__doc__)
    opts, args = p.parse_args(args)

    if len(args) != 4:
        sys.exit(not p.print_help())

    binfile, fastafile, ctgID, baseID = args
    b = BinFile(binfile, fastafile)
    ar = b.mmarray

    fastasize, sizes, offsets = get_offsets(fastafile)
    oi = offsets[ctgID] + int(baseID) - 1
    print("\t".join((ctgID, baseID, str(ar[oi]))))