def METHOD_NAME(x: Dict) -> Dict:
    """Formats a deck object. Returns a dictionary with name and value."""
    name_fdict = dict(name=x['deck']['name'], wins=x['deck']['wins'], losses=x['deck']['losses'])
    competition = x.get('competition')
    if competition:
        name_fdict['src'] = competition['name']
        name_fstring = '{name} [{src}, {wins}-{losses}]'
    else:  # this can happen if the latest scrape attempt resulted in a bug and the competitions weren't updated
        name_fstring = '{name} [{wins}-{losses}]'
    return {
        'name': name_fstring.format(**name_fdict),
        'value': '[{arch} deck by {author} ({format})]({domain}/decks/{id})'.format(
            arch=x['tags'][0]['name'], author=x['author']['nickname'],
            format=x['format'], id=x['deck']['deck_id'], domain=link_domain),
    }