<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def print_red_laws():
 """Print available extinction laws to screen. Available extinction laws are extracted from ``pysynphot.locations.EXTDIR``. The printed names may be used with :func:`Extinction` to retrieve available reddening laws. Examples -------- name reference None Cardelli, Clayton, & Mathis (1989, ApJ, 345, 245) R_V = 3.10. gal3 Cardelli, Clayton, & Mathis (1989, ApJ, 345, 245) R_V = 3.10. lmc30dor Gordon et al. (2003, ApJ, 594, 279) R_V = 2.76. lmcavg Gordon et al. (2003, ApJ, 594, 279) R_V = 3.41. mwavg Cardelli, Clayton, & Mathis (1989, ApJ, 345, 245) R_V = 3.10. mwdense Cardelli, Clayton, & Mathis (1989, ApJ, 345, 245) R_V = 5.00. mwrv21 Cardelli, Clayton, & Mathis (1989, ApJ, 345, 245) R_V = 2.1. mwrv4 Cardelli, Clayton, & Mathis (1989, ApJ, 345, 245) R_V = 4.0. smcbar Gordon et al. (2003, ApJ, 594, 279) R_V=2.74. xgalsb Calzetti et al. (2000. ApJ, 533, 682) """

    laws = {}

    # start by converting the Cache.RedLaws file names to RedLaw objects
    # if they aren't already
    for k in Cache.RedLaws:
        if isinstance(Cache.RedLaws[k],str):
            Cache.RedLaws[k] = RedLaw(Cache.RedLaws[k])

        laws[str(k)] = Cache.RedLaws[k].litref

    # get the length of the longest name and litref
    maxname = max([len(name) for name in laws.keys()])
    maxref = max([len(ref) for ref in laws.values()])

    s = '%-' + str(maxname) + 's   %-' + str(maxref) + 's'

    print(s % ('name','reference'))
    print(s % ('-'*maxname,'-'*maxref))

    for k in sorted(laws.keys()):
        print(s % (k, laws[k]))