<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_data_model(self):
 """ Try to download the data model from Earthref. If that fails, grab the cached data model. """

        if len(DM):
            self.dm = DM
            self.crit_map = CRIT_MAP
            return
        if not set_env.OFFLINE:
            dm = self.get_dm_online()
            if dm:
                print('-I- Using online data model')
                #self.cache_data_model(dm)
                return self.parse_response(dm)
        # if online is not available, get cached dm
        dm = self.get_dm_offline()
        print('-I- Using cached data model')
        return self.parse_cache(dm)