nodes: 0, module; 1, function_definition; 2, function_name:create_pickled_data; 3, parameters; 4, block; 5, identifier:idevice; 6, identifier:filename; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, comment:"""This helper will output the idevice to a pickled file named
      after the passed filename.
  
      This allows the data to be used without resorting to screen / pipe
      scrapping.  """; 15, assignment; 16, identifier:x; 17, attribute; 18, block; 19, assignment; 20, assignment; 21, call; 22, call; 23, identifier:data; 24, dictionary; 25, identifier:idevice; 26, identifier:content; 27, expression_statement; 28, identifier:location; 29, identifier:filename; 30, identifier:pickle_file; 31, call; 32, attribute; 33, argument_list; 34, attribute; 35, argument_list; 36, assignment; 37, identifier:open; 38, argument_list; 39, identifier:pickle; 40, identifier:dump; 41, identifier:data; 42, identifier:pickle_file; 43, keyword_argument; 44, identifier:pickle_file; 45, identifier:close; 46, subscript; 47, subscript; 48, identifier:location; 49, string; 50, identifier:protocol; 51, attribute; 52, identifier:data; 53, identifier:x; 54, attribute; 55, identifier:x; 56, string_content:wb; 57, identifier:pickle; 58, identifier:HIGHEST_PROTOCOL; 59, identifier:idevice; 60, identifier:content
code: def create_pickled_data(idevice, filename):
      """This helper will output the idevice to a pickled file named
      after the passed filename.
  
      This allows the data to be used without resorting to screen / pipe
      scrapping.  """
      data = {}
      for x in idevice.content:
          data[x] = idevice.content[x]
      location = filename
      pickle_file = open(location, 'wb')
      pickle.dump(data, pickle_file, protocol=pickle.HIGHEST_PROTOCOL)
      pickle_file.close()