def ValidateAccounts(accounts):
    """Returns whether given list of accounts are valid, with errors if not.

    This function works on a single set of accounts, whether people or bots.

    Args:
        accounts ([dict]): a list of accounts to validate

    Returns:
        (bool, [str]) or (bool, None): first element is whethe the data is
        valid; second parameter is list of error strings if data is not valid.
    """
    accounts_keys = ('name', 'email', 'github')
    for account in accounts:
        if not account:
            return (False, ['Invalid empty account found'])
        if sorted(account.keys()) != sorted(accounts_keys):
            return (False, ['The only allowed and required keys for '
                            'people/bot accounts are: '
                            '%s.' % str(accounts_keys),
                            'Invalid account record: %s' % account])
        for key in accounts_keys:
            # Covers value being either `None` or empty string.
            if not account[key]:
                return (False, 'The key '
                        '"%s" is empty in account (%s)\n' % (key, account))
    return (True, None)