import base64


def authorization_headers(user, token):
    """
    Prepares authorization header for an API request
    """
    if None in [user, token]:
        return None
    credentials = '%s:%s' % (user, token)
    auth = base64.b64encode(credentials.encode('utf-8'))
    headers = {'Authorization': 'Basic %s' % auth.decode('utf-8')}
    return headers