import copy


def get_category_obj(data, category_name):
    """Extract obj with `name` == `category_name` from `data`."""
    cats = copy.copy(data)
    while(cats):
        cat = cats.pop()
        if cat['name'] == category_name:
            return cat
        if 'children' in cat:
            cats.extend(cat['children'])
    return None