code: def path_data(self, variable_data, path):
          
          # NOTE: tcex does include the jmespath library as a dependencies since it is only
          # required for local testing.
          try:
              import jmespath
          except ImportError:
              print('Could not import jmespath module (try "pip install jmespath").')
              sys.exit(1)
  
          if isinstance(variable_data, string_types):
              # try to convert string into list/dict before using expression
              try:
                  variable_data = json.loads(variable_data)
              except Exception:
                  self.log.debug('String value ({}) could not JSON serialized.'.format(variable_data))
          if path is not None and isinstance(variable_data, (dict, list)):
              expression = jmespath.compile(path)
              variable_data = expression.search(
                  variable_data, jmespath.Options(dict_cls=collections.OrderedDict)
              )
          return variable_data
docs: Return JMESPath data.
  
          Args:
              variable_data (str): The JSON data to run path expression.
              path (str): The JMESPath expression.
  
          Returns:
              dict: The resulting data from JMESPath.