<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_types_collection(filter_filename=default_filter_filename):
 # type: (Callable[[Optional[str]], Optional[str]]) -> None """ Setup profiler hooks to enable type collection. Call this one time from the main thread. The optional argument is a filter that maps a filename (from code.co_filename) to either a normalized filename or None. For the default filter see default_filter_filename(). """

    global _filter_filename
    _filter_filename = filter_filename
    sys.setprofile(_trace_dispatch)
    threading.setprofile(_trace_dispatch)