def __init__(self,<EOL>middleware: typing.Union[typing.Iterable, Middleware] = None,<EOL>loop=None,<EOL>is_async_start: bool = False):
if not self.start_urls or not isinstance(self.start_urls,<EOL>collections.Iterable):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>self.callback_result_map = self.callback_result_map or {}<EOL>self.request_config = self.request_config or {}<EOL>self.headers = self.headers or {}<EOL>self.metadata = self.metadata or {}<EOL>self.kwargs = self.kwargs or {}<EOL>self.request_config = self.request_config or {}<EOL>self.is_async_start = is_async_start<EOL>self.loop = loop<EOL>asyncio.set_event_loop(self.loop)<EOL>if isinstance(middleware, list):<EOL><INDENT>self.middleware = reduce(lambda x, y: x + y, middleware)<EOL><DEDENT>else:<EOL><INDENT>self.middleware = middleware or Middleware()<EOL><DEDENT>self.request_queue = asyncio.Queue()<EOL>self.sem = asyncio.Semaphore(self.concurrency)<EOL>
Init spider object.
:param middleware: a list of or a single Middleware
:param loop:
:param is_async_start: