<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _n_rectangles(obj):
    '''
    Calculate the total number of rectangles with respect to
    the type of the object
    '''
    return sum(_total_rectangles(neu) for neu in obj.neurites) \
        if hasattr(obj, 'neurites') else _total_rectangles(obj)