code: def get_lst(source, extract=None, transform=None):
    
    if extract is None:
      raw_list = source
    else:
      raw_list = extract(source)
  
    if transform is None:
      return raw_list
    else:
      tlist = []
      for idx, item in enumerate(raw_list):
        try:
          tlist.append(transform(item))
        except Exception as ex:
          raise Exception("An error occurred with item #{0}".format(idx)) from ex
      return tlist
docs: Extract a list from a source, transform each item, and return the result.