def _lookup_user_data(self,*args,**kwargs):
user_data = self.get_user_data()<EOL>data_kind = kwargs.get('<STR_LIT>','<STR_LIT>')<EOL>try:<EOL><INDENT>del(kwargs['<STR_LIT>'])<EOL><DEDENT>except KeyError as err:<EOL><INDENT>pass<EOL><DEDENT>default_value = kwargs['<STR_LIT:default>']<EOL>result =  get_dict(user_data,data_kind,*args,**kwargs)<EOL>try:<EOL><INDENT>result = int(result)<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>if not isinstance(result,default_value.__class__):<EOL><INDENT>return default_value<EOL><DEDENT>else:<EOL><INDENT>return result<EOL><DEDENT>
Generic function for looking up values in
a user-specific dictionary. Use as follows::

   _lookup_user_data('path','to','desired','value','in','dictionary',
                     default = <default value>,
                     data_kind = 'customization'/'saved_searches')