def encode_feedparser_dict(d):
 if (isinstance(d, feedparser.FeedParserDict) or isinstance(d, dict)):
  j = {}
  for k in d.keys():
   j[k] = encode_feedparser_dict(d[k])
  return j
 elif isinstance(d, list):
  l = []
  for k in d:
   l.append(encode_feedparser_dict(k))
  return l
 else:
  return d

def encode_feedparser_dict ( d ) : if ( isinstance ( d , feedparser . FeedParserDict ) or isinstance ( d , dict ) ) : j = { } for k in d . keys ( ) : j [ k ] = encode_feedparser_dict ( d [ k ] ) return j elif isinstance ( d , list ) : l = [ ] for k in d : l . append ( encode_feedparser_dict ( k ) ) return l else : return d
helper function to get rid of feedparser bs with a deep copy .