<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_scoring_scheme( f, gap_open, gap_extend, gap1="-", gap2=None, **kwargs ):
 """ Initialize scoring scheme from a file containint a blastz style text blob. f can be either a file or the name of a file. """

    close_it = False
    if (type(f) == str):
        f = file(f,"rt")
        close_it = True
    ss = build_scoring_scheme("".join([line for line in f]),gap_open, gap_extend, gap1=gap1, gap2=gap2, **kwargs)
    if (close_it):
        f.close()
    return ss