#NEWLINE# @ classmethod #NEWLINE# def fromapi( _class , api , apiresponse ) : #NEWLINE# #INDENT# '\n        Return a Bus object from an API response dict.\n        ' #NEWLINE# bus = apiresponse #NEWLINE# return _class ( api = api , vid = bus [ 'vid' ] , timeupdated = datetime . strptime ( bus [ 'tmstmp' ] , api . STRPTIME ) , lat = float ( bus [ 'lat' ] ) , lng = float ( bus [ 'lon' ] ) , heading = bus [ 'hdg' ] , pid = bus [ 'pid' ] , intotrip = bus [ 'pdist' ] , route = bus [ 'rt' ] , destination = bus [ 'des' ] , speed = bus [ 'spd' ] , delay = ( bus . get ( 'dly' ) or False ) )