def get_value(key, obj, default=None):
if isinstance(key, int):<EOL><INDENT>return _get_value_for_key(key, obj, default)<EOL><DEDENT>elif callable(key):<EOL><INDENT>return key(obj)<EOL><DEDENT>else:<EOL><INDENT>return _get_value_for_keys(key.split('<STR_LIT:.>'), obj, default)<EOL><DEDENT>
Helper for pulling a keyed value off various types of objects