def arr2dict(arr, keyname='key', valuename='value'):
    """
    arr2dict -  transform an array to dictionary key:
    """
    res = {}
    for item in arr:
        res[item[keyname]] = item[valuename] if valuename in item else None
    return res
