docs: def get_data_model():
      """
      try to grab the up to date data model document from the EarthRef site.
      if that fails, try to get the data model document from the PmagPy directory on the user's computer.
      if that fails, return False.
      data_model is a set of nested dictionaries that looks like this:
      {'magic_contributions':
          {'group_userid': {'data_status': 'Optional', 'data_type': 'String(10)'}, 'activate': {'data_status': 'Optional', 'data_type': 'String(1)'}, ....},
      'er_synthetics':
          {'synthetic_type': {'data_status': 'Required', 'data_type': 'String(50)'}, 'er_citation_names': {'data_status': 'Required', 'data_type': 'List(500)'}, ...},
      ....
      }
      the top level keys are the file types.
      the second level keys are the possible headers for that file type.
      the third level keys are data_type and data_status for that header.
      """
      #print("-I- getting data model, please be patient!!!!")
      url = 'http://earthref.org/services/MagIC-data-model.txt'
      offline = True # always get cached data model, as 2.5 is now static
      #try:
      #    data = urllib2.urlopen(url)
      #except urllib2.URLError:
      #    print '-W- Unable to fetch data model online\nTrying to use cached data model instead'
      #    offline = True
      #except httplib.BadStatusLine:
      #    print '-W- Website: {} not responding\nTrying to use cached data model instead'.format(url)
      #    offline = True
      if offline:
          data = get_data_offline()
      data_model, file_type = pmag.magic_read(None, data)
      if file_type in ('bad file', 'empty_file'):
          print('-W- Unable to read online data model.\nTrying to use cached data model instead')
          data = get_data_offline()
          data_model, file_type = pmag.magic_read(None, data)
      ref_dicts = [d for d in data_model if d['column_nmb'] != '>>>>>>>>>>']
      file_types = [d['field_name'] for d in data_model if d['column_nmb'] == 'tab delimited']
      file_types.insert(0, file_type)
      complete_ref = {}
  
      dictionary = {}
      n = 0
      for d in ref_dicts:
          if d['field_name'] in file_types:
              complete_ref[file_types[n]] = dictionary
              n += 1
              dictionary = {}
          else:
              dictionary[d['field_name_oracle']] = {'data_type': d['data_type'], 'data_status': d['data_status']}
      return complete_ref