def extract_keywise(dic, key):
    """This function will extract a key from all entries in a dictionary. Key should be first-level key.
    
    Args:
        dic (dict): The input dictionary containing a dict of dictionaries.
        key: The key name to be extracted.
    
    Returns:
        dict: The result dictionary

    .. code-block:: python
        :caption: Example

        >>> dic = {'agent1':{'a':[1,2],'b':{'c':2,'d':4}}, 'agent2':{'a':[3,4],'b':{'c':9,'d':7}}}
        >>> key = 'a'
        >>> extract_keywise(dic, key)
        {'agent1':[1,2], 'agent2':[3,4]}


    """
    res = {}
    for name in dic:
        res[name] = dic[name][key]
    return res