<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datapath(self):
 """ Get an item's data path. """

        path = self._fields['path']
        if not path:  # stopped item with no base_dir?
            path = self.fetch('directory')
            if path and not self._fields['is_multi_file']:
                path = os.path.join(path, self._fields['name'])
        return os.path.expanduser(fmt.to_unicode(path))