parameters: (future_pt_journey, has_valid_direct_paths)
return_statement: return pt_journeys
docstring: block until the pt_journeys are computed
  
      :return: The list of journeys computed by the planner
docstring_summary: block until the pt_journeys are computed
docstring_tokens: block until the pt_journeys are computed
function: def wait_and_get_pt_journeys(future_pt_journey, has_valid_direct_paths):
      """
      block until the pt_journeys are computed
  
      :return: The list of journeys computed by the planner
      """
      pt_journeys = future_pt_journey.wait_and_get()
  
      if (
          pt_journeys
          and pt_journeys.HasField(str("error"))
          and pt_journeys.error.id != response_pb2.Error.error_id.Value('bad_format')
      ):
          if pt_journeys.error.id == response_pb2.Error.error_id.Value('no_solution') and has_valid_direct_paths:
              pt_journeys.ClearField(str("error"))
          elif pt_journeys.error.id == response_pb2.Error.error_id.Value('date_out_of_bounds'):
              raise InvalidDateBoundException(pt_journeys)
          else:
              return None
  
      return pt_journeys
function_tokens: def wait_and_get_pt_journeys ( future_pt_journey , has_valid_direct_paths ) : pt_journeys = future_pt_journey . wait_and_get ( ) if ( pt_journeys and pt_journeys . HasField ( str ( "error" ) ) and pt_journeys . error . id != response_pb2 . Error . error_id . Value ( 'bad_format' ) ) : if pt_journeys . error . id == response_pb2 . Error . error_id . Value ( 'no_solution' ) and has_valid_direct_paths : pt_journeys . ClearField ( str ( "error" ) ) elif pt_journeys . error . id == response_pb2 . Error . error_id . Value ( 'date_out_of_bounds' ) : raise InvalidDateBoundException ( pt_journeys ) else : return None return pt_journeys