def job(func_or_queue, connection=None, *args, **kwargs):
if callable(func_or_queue):<EOL><INDENT>func = func_or_queue<EOL>queue = '<STR_LIT:default>'<EOL><DEDENT>else:<EOL><INDENT>func = None<EOL>queue = func_or_queue<EOL><DEDENT>if isinstance(queue, six.string_types):<EOL><INDENT>try:<EOL><INDENT>queue = get_queue(queue)<EOL>if connection is None:<EOL><INDENT>connection = queue.connection<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>RQ = getattr(settings, '<STR_LIT>', {})<EOL>default_result_ttl = RQ.get('<STR_LIT>')<EOL>if default_result_ttl:<EOL><INDENT>kwargs.setdefault('<STR_LIT>', default_result_ttl)<EOL><DEDENT>decorator = _rq_job(queue, connection=connection, *args, **kwargs)<EOL>if func:<EOL><INDENT>return decorator(func)<EOL><DEDENT>return decorator<EOL>
The same as RQ's job decorator, but it automatically works out
the ``connection`` argument from RQ_QUEUES.

And also, it allows simplified ``@job`` syntax to put job into
default queue.

If RQ.DEFAULT_RESULT_TTL setting is set, it is used as default
for ``result_ttl`` kwarg.