def getitem(d, key):
    """
    Ability to access a dictionary keys based on a dynamic key:

    Usage:

     my_vals = {'hello': 'world', 'testing': 'again'}

     {{ my_vals|get:'hello' }}

     would return "world"
    """
    if not isinstance(d, dict):
        return ''

    return d.get(key, '')