<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def str_to_datetime(self,format="%Y-%m-%dT%H:%M:%S%ZP"):
 """ Create a new SArray with all the values cast to datetime. The string format is specified by the 'format' parameter. Parameters format : str The string format of the input SArray. Default format is "%Y-%m-%dT%H:%M:%S%ZP". If format is "ISO", the the format is "%Y%m%dT%H%M%S%F%q" Returns ------- out : SArray[datetime.datetime] The SArray converted to the type 'datetime'. Examples -------- dtype: datetime Rows: 1 datetime.datetime(2011, 10, 20, 9, 30, 10, tzinfo=GMT(-5.5)) See Also datetime_to_str References [1] boost date time to string conversion guide (http://www.boost.org/doc/libs/1_48_0/doc/html/date_time/date_time_io.html) """

        if(self.dtype != str):
            raise TypeError("str_to_datetime expects SArray of str as input SArray")

        with cython_context():
            return SArray(_proxy=self.__proxy__.str_to_datetime(format))