<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register(tag, end_tag=None):
 """ Decorator for registering shortcode functions. """


    def register_function(function):
        tagmap[tag] = {'func': function, 'endtag': end_tag}
        if end_tag:
            tagmap['endtags'].append(end_tag)
        return function

    return register_function