#NEWLINE# def request_from_dict( d , spider = None ) : #NEWLINE# #INDENT# 'Create Request object from a dict.\n\n    If a spider is given, it will try to resolve the callbacks looking at the\n    spider for methods with the same name.\n    ' #NEWLINE# cb = d [ 'callback' ] #NEWLINE# if ( cb and spider ) : #NEWLINE# #INDENT# cb = _get_method ( spider , cb ) #NEWLINE# #UNINDENT# eb = d [ 'errback' ] #NEWLINE# if ( eb and spider ) : #NEWLINE# #INDENT# eb = _get_method ( spider , eb ) #NEWLINE# #UNINDENT# return Request ( url = to_native_str ( d [ 'url' ] ) , callback = cb , errback = eb , method = d [ 'method' ] , headers = d [ 'headers' ] , body = d [ 'body' ] , cookies = d [ 'cookies' ] , meta = d [ 'meta' ] , encoding = d [ '_encoding' ] , priority = d [ 'priority' ] , dont_filter = d [ 'dont_filter' ] )