<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def asynchronize( framework, sync_method, doc=None, wrap_class=None, unwrap_class=None):
 """Decorate `sync_method` so it returns a Future. The method runs on a thread and resolves the Future when it completes. :Parameters: - `motor_class`: Motor class being created, e.g. MotorClient. - `framework`: An asynchronous framework - `sync_method`: Unbound method of pymongo Collection, Database, MongoClient, etc. - `doc`: Optionally override sync_method's docstring - `wrap_class`: Optional PyMongo class, wrap a returned object of this PyMongo class in the equivalent Motor class - `unwrap_class` Optional Motor class name, unwrap an argument with this Motor class name and pass the wrapped PyMongo object instead """

    @functools.wraps(sync_method)
    def method(self, *args, **kwargs):
        if unwrap_class is not None:
            # Don't call isinstance(), not checking subclasses.
            unwrapped_args = [
                obj.delegate
                if obj.__class__.__name__.endswith(
                    (unwrap_class, 'MotorClientSession'))
                else obj
                for obj in args]
            unwrapped_kwargs = {
                key: (obj.delegate
                      if obj.__class__.__name__.endswith(
                        (unwrap_class, 'MotorClientSession'))
                      else obj)
                for key, obj in kwargs.items()}
        else:
            # For speed, don't call unwrap_args_session/unwrap_kwargs_session.
            unwrapped_args = [
                obj.delegate
                if obj.__class__.__name__.endswith('MotorClientSession')
                else obj
                for obj in args]
            unwrapped_kwargs = {
                key: (obj.delegate
                      if obj.__class__.__name__.endswith('MotorClientSession')
                      else obj)
                for key, obj in kwargs.items()}

        loop = self.get_io_loop()
        return framework.run_on_executor(loop,
                                         sync_method,
                                         self.delegate,
                                         *unwrapped_args,
                                         **unwrapped_kwargs)

    if wrap_class is not None:
        method = framework.pymongo_class_wrapper(method, wrap_class)
        method.is_wrap_method = True  # For Synchro.

    # This is for the benefit of motor_extensions.py, which needs this info to
    # generate documentation with Sphinx.
    method.is_async_method = True
    name = sync_method.__name__
    method.pymongo_method_name = name

    if doc is not None:
        method.__doc__ = doc

    return method