def create_account(api, account_name: str) -> Tuple[(Box, Box)]:
    'Create new account.\n\n    :param api: api\n    :param account_name: account name\n    :raises RuntimeError: Cant find account\n    :return: user params\n    '
    QueryO(api=api, url='/account/add', request_data={'name': account_name}, errors_mapping={'DUPLICATE_NAME': DuplicateName()}, required_sid=True).get()
    account = api.Account.list().filter_by(Filter('name', FilterCondition.equals, account_name)).first()
    if (account is None):
        raise RuntimeError('Cant find test account')
    admin_role = api.Role.list(account_id=account.uuid).filter_by(Filter('name', FilterCondition.equals, 'Administrator')).first()
    if (admin_role is None):
        raise RuntimeError('Cant find admin role')
    api.Role.set(uuid=admin_role.uuid, permissions=json.dumps({'study_delete': 1, 'study_duplicate': 1, 'study_split': 1, 'study_merge': 1, 'study_delete_image': 1})).get()
    user = api.User.get(account_id=account.uuid).get()
    logger.info('Created account %s', account.name)
    return (account, user)
Create new account.

:param api: api
:param account_name: account name
:raises RuntimeError: Cant find account
:return: user params
def create_account(api, account_name: str) -> Tuple[(Box, Box)]:
    'Create new account.\n\n    :param api: api\n    :param account_name: account name\n    :raises RuntimeError: Cant find account\n    :return: user params\n    '
    QueryO(api=api, url='/account/add', request_data={'name': account_name}, errors_mapping={'DUPLICATE_NAME': DuplicateName()}, required_sid=True).get()
    account = api.Account.list().filter_by(Filter('name', FilterCondition.equals, account_name)).first()
    if (account is None):
        raise RuntimeError('Cant find test account')
    admin_role = api.Role.list(account_id=account.uuid).filter_by(Filter('name', FilterCondition.equals, 'Administrator')).first()
    if (admin_role is None):
        raise RuntimeError('Cant find admin role')
    api.Role.set(uuid=admin_role.uuid, permissions=json.dumps({'study_delete': 1, 'study_duplicate': 1, 'study_split': 1, 'study_merge': 1, 'study_delete_image': 1})).get()
    user = api.User.get(account_id=account.uuid).get()
    logger.info('Created account %s', account.name)
    return (account, user)