'Push an element onto an array that may not have been defined in the dict'

def push(self, my_dict, key, element):

    if (key in my_dict):
        my_dict[key].append(element)
    else:
        my_dict[key] = [element]
