<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def valueof(records, key):
 """Extract the value corresponding to the given key in all the dictionaries ['Robert Plant', 'James Hetfield'] """

    if isinstance(records, dict):
        records = [records]
    return map(operator.itemgetter(key), records)