nodes: 0, module; 1, function_definition; 2, function_name:get_resource_id; 3, parameters; 4, block; 5, identifier:prefix; 6, list_splat_pattern; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, identifier:data; 12, comment:"""Returns a unique ID based on the SHA256 hash of the provided data. The input data is flattened and sorted to
      ensure identical hashes are generated regardless of the order of the input. Values must be of types `str`, `int` or
      `float`, any other input type will raise a `ValueError`
  
      >>> get_resource_id('ec2', 'lots', 'of', 'data')
      'ec2-1d21940125214123'
      >>> get_resource_id('ecs', 'foo', ['more', 'data', 'here', 2, 3])
      'ecs-e536b036ea6fd463'
      >>> get_resource_id('ecs', ['more'], 'data', 'here', [[2], 3], 'foo')
      'ecs-e536b036ea6fd463'
  
      Args:
          prefix (`str`): Key prefix
          *data (`str`, `int`, `float`, `list`, `tuple`): Data used to generate a unique ID
  
      Returns:
          `str`
      """; 13, assignment; 14, identifier:part; 15, identifier:parts; 16, block; 17, call; 18, identifier:parts; 19, call; 20, if_statement; 21, attribute; 22, argument_list; 23, identifier:flatten; 24, argument_list; 25, comparison_operator:type(part) not in (str, int, float); 26, block; 27, string; 28, identifier:format; 29, identifier:prefix; 30, subscript; 31, identifier:data; 32, call; 33, tuple; 34, raise_statement; 35, string_content:{}-{}; 36, call; 37, slice; 38, identifier:type; 39, argument_list; 40, identifier:str; 41, identifier:int; 42, identifier:float; 43, call; 44, identifier:get_hash; 45, argument_list; 46, unary_operator; 47, identifier:part; 48, identifier:ValueError; 49, argument_list; 50, call; 51, integer:16; 52, call; 53, attribute; 54, argument_list; 55, attribute; 56, argument_list; 57, string; 58, identifier:join; 59, call; 60, string; 61, identifier:format; 62, call; 63, string_content:-; 64, identifier:sorted; 65, argument_list; 66, string_content:Supported data types: int, float, list, tuple, str. Got: {}; 67, identifier:type; 68, argument_list; 69, call; 70, identifier:part; 71, identifier:map; 72, argument_list; 73, identifier:str; 74, identifier:parts
code: def get_resource_id(prefix, *data):
      """Returns a unique ID based on the SHA256 hash of the provided data. The input data is flattened and sorted to
      ensure identical hashes are generated regardless of the order of the input. Values must be of types `str`, `int` or
      `float`, any other input type will raise a `ValueError`
  
      >>> get_resource_id('ec2', 'lots', 'of', 'data')
      'ec2-1d21940125214123'
      >>> get_resource_id('ecs', 'foo', ['more', 'data', 'here', 2, 3])
      'ecs-e536b036ea6fd463'
      >>> get_resource_id('ecs', ['more'], 'data', 'here', [[2], 3], 'foo')
      'ecs-e536b036ea6fd463'
  
      Args:
          prefix (`str`): Key prefix
          *data (`str`, `int`, `float`, `list`, `tuple`): Data used to generate a unique ID
  
      Returns:
          `str`
      """
      parts = flatten(data)
      for part in parts:
          if type(part) not in (str, int, float):
              raise ValueError('Supported data types: int, float, list, tuple, str. Got: {}'.format(type(part)))
  
      return '{}-{}'.format(
          prefix,
          get_hash('-'.join(sorted(map(str, parts))))[-16:]
      )