def request_from_dict(d, spider=None):
 cb = d['callback']
 if (cb and spider):
  cb = _get_method(spider, cb)
 eb = d['errback']
 if (eb and spider):
  eb = _get_method(spider, eb)
 return Request(url=d['url'].encode('ascii'), 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'])

def request_from_dict ( d , spider = None ) : cb = d [ 'callback' ] if ( cb and spider ) : cb = _get_method ( spider , cb ) eb = d [ 'errback' ] if ( eb and spider ) : eb = _get_method ( spider , eb ) return Request ( url = d [ 'url' ] . encode ( 'ascii' ) , 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' ] )
create request object from a dict .