<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _dataflash_dir(self, mpstate):
        '''returns directory path to store DF logs in.  May be relative'''
        if mpstate.settings.state_basedir is None:
            ret = 'dataflash'
        else:
            ret = os.path.join(mpstate.settings.state_basedir,'dataflash')

        try:
            os.makedirs(ret)
        except OSError as e:
            if e.errno != errno.EEXIST:
                print("DFLogger: OSError making (%s): %s" % (ret, str(e)))
        except Exception as e:
            print("DFLogger: Unknown exception making (%s): %s" % (ret, str(e)))

        return ret