code: def get_var(data, var_name, not_found=None):
      
      try:
          for key in str(var_name).split('.'):
              try:
                  data = data[key]
              except TypeError:
                  data = data[int(key)]
      except (KeyError, TypeError, ValueError):
          return not_found
      else:
          return data
docs: Gets variable value from data dictionary.