async def get_departures(<EOL>self,<EOL>station_id: str,<EOL>direction_id: Optional[str] = None,<EOL>max_journeys: int = <NUM_LIT:20>,<EOL>products: Optional[List[str]] = None,<EOL>) -> Dict[str, Any]:
self.station_id: str = station_id<EOL>self.direction_id: str = direction_id<EOL>self.max_journeys: int = max_journeys<EOL>self.products_filter: str = _product_filter(products or ALL_PRODUCTS)<EOL>base_url: str = _base_url()<EOL>params: Dict[str, Union[str, int]] = {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:time>": "<STR_LIT>",<EOL>"<STR_LIT:input>": self.station_id,<EOL>"<STR_LIT>": self.max_journeys,<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": self.products_filter,<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:start>": "<STR_LIT:yes>",<EOL>}<EOL>if self.direction_id:<EOL><INDENT>params["<STR_LIT>"] = self.direction_id<EOL><DEDENT>url = base_url + urllib.parse.urlencode(params)<EOL>try:<EOL><INDENT>with async_timeout.timeout(self._timeout):<EOL><INDENT>async with self._session.get(url) as response:<EOL><INDENT>_LOGGER.debug(f"<STR_LIT>")<EOL>xml = await response.read()<EOL>_LOGGER.debug(xml)<EOL><DEDENT><DEDENT><DEDENT>except (asyncio.TimeoutError, aiohttp.ClientError):<EOL><INDENT>_LOGGER.error("<STR_LIT>")<EOL>raise RMVtransportApiConnectionError()<EOL><DEDENT>try:<EOL><INDENT>self.obj = objectify.fromstring(xml)<EOL><DEDENT>except (TypeError, etree.XMLSyntaxError):<EOL><INDENT>_LOGGER.debug(f"<STR_LIT>")<EOL>print(f"<STR_LIT>")<EOL>raise RMVtransportError()<EOL><DEDENT>try:<EOL><INDENT>self.now = self.current_time()<EOL>self.station = self._station()<EOL><DEDENT>except (TypeError, AttributeError):<EOL><INDENT>_LOGGER.debug(<EOL>f"<STR_LIT>"<EOL>)<EOL>raise RMVtransportError()<EOL><DEDENT>self.journeys.clear()<EOL>try:<EOL><INDENT>for journey in self.obj.SBRes.JourneyList.Journey:<EOL><INDENT>self.journeys.append(RMVJourney(journey, self.now))<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>_LOGGER.debug(f"<STR_LIT>")<EOL>raise RMVtransportError()<EOL><DEDENT>return self.data()<EOL>
Fetch data from rmv.de.