<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def md2tvd(self, kind='linear'):
 """ Provides an transformation and interpolation function that converts MD to TVD. Args: kind (str):
 The kind of interpolation to do, e.g. 'linear', 'cubic', 'nearest'. Returns: function. """

        if self.position is None:
            return lambda x: x
        return interp1d(self.md, self.tvd,
                        kind=kind,
                        assume_sorted=True,
                        fill_value="extrapolate",
                        bounds_error=False)