<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_category_tree(slug, reference=None, items=None):
 """ Builds a recursive tree with category relations as children. """


    if items is None:
        items = []

    for key in reference:
        category = reference[key]

        if category["parent"] == slug:
            children = _build_category_tree(category["nicename"],
                                            reference=reference)
            category["children"] = children
            items.append(category)

    return items