def select_keys_py2(dct, keys):
    """Returns a dict containing only those entries in dict whose key is in
    keys.
    """

    return {k:v
            for k,v in dct.iteritems()
                if k in keys}