def list2dict(obj):
    """
    Converting a list of pairs into a dictionary.

    >>> data = list2dict([("first-name", "Agatha"), ("surname", "Christie")])
    >>> data['first-name']
    'Agatha'
    >>> data['surname']
    'Christie'
    """
    assert isinstance(obj, list) and all([(isinstance(entry, tuple) or isinstance(entry, list)) and
                                          len(entry) == 2 for entry in obj])
    return dict(obj)