<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def state_nums():
 """ Get a dictionary of state names mapped to their 'legend' value. Returns: dictionary of state names mapped to their numeric value """

  st_nums = {}
  fname = pkg_resources.resource_filename(__name__, 'resources/States.csv')
  with open(fname, 'rU') as csvfile:
    reader = csv.reader(csvfile, delimiter = ',')
    i = 0
    for row in reader:
      st_nums[row[0]] = i
      i = i + 1
  return st_nums