Train tickets query options.
15578
def options(self):
        """"""
        arg = self.get(0)
        if arg.startswith('-') and not self.is_asking_for_help:
            return arg[1:]
        return ''.join(x for x in arg if x in 'dgktz')
595922
def stationboard(parameters)
      allowed_parameters = %w(station id limit transportations datetime)

      query = create_query(parameters, allowed_parameters)
      locations = perform('stationboard', query)

      locations['stationboard']
    end
803445
def passengers(self) -> Set["PassengerUnit"]:
        
        return {PassengerUnit(unit, self._game_data) for unit in self._proto.passengers}
494249
def tags(self, ticket_id):
        
        return self._query_zendesk(self.endpoint.tags, 'tag', id=ticket_id)
69638
def requested(self, user, include=None):
        
        return self._query_zendesk(self.endpoint.requested, 'ticket', id=user, include=include)
697083
def tickets(self, extra_params=None):
        
        return filter(
            lambda ticket: ticket.get('milestone_id', None) == self['id'],
            self.space.tickets(extra_params=extra_params)
        )
638100
def trips(self, val):
        
        self._trips = val
        if val is not None and not val.empty:
            self._trips_i = self._trips.set_index("trip_id")
        else:
            self._trips_i = None
548359
def output(self) -> None:
        """"""
        print("%s - %s" % (self.station, self.now))
        print(self.products_filter)

        for j in sorted(self.journeys, key=lambda k: k.real_departure)[
            : self.max_journeys
        ]:
            print("-------------")
            print(f"{j.product}: {j.number} ({j.train_id})")
            print(f"Richtung: {j.direction}")
            print(f"Abfahrt in {j.real_departure} min.")
            print(f"Abfahrt {j.departure.time()} (+{j.delay})")
            print(f"Nächste Haltestellen: {([s['station'] for s in j.stops])}")
            if j.info:
                print(f"Hinweis: {j.info}")
                print(f"Hinweis (lang): {j.info_long}")
            print(f"Icon: {j.icon}")
386152
def create_ticket(self, subject, **kwargs):
        

        url = 'tickets'
        status = kwargs.get('status', 2)
        priority = kwargs.get('priority', 1)
        data = {
            'subject': subject,
            'status': status,
            'priority': priority,
        }
        data.update(kwargs)
        if 'attachments' in data:
            ticket = self._create_ticket_with_attachment(url, data)
            return Ticket(**ticket)

        ticket = self._api._post(url, data=json.dumps(data))
        return Ticket(**ticket)
1320017
def show(self, ticket_field, custom_field_option):
        
        return self._query_zendesk(self.endpoint.show, 'custom_field_option', ticket_field, custom_field_option)
1349017
public function index()
    {
        $tickets = $this->paginate($this->Tickets);

        $this->set(compact('tickets'));
        $this->set('_serialize', ['tickets']);
    }
323701
def collection_choices():
    """"""
    from invenio_collections.models import Collection
    return [(0, _('-None-'))] + [
        (c.id, c.name) for c in Collection.query.all()
    ]
183745
def departures(station: str) -> snug.Query[t.List[Departure]]:
    """"""
    return snug.GET('avt', params={'station': station})
787108
def await_reservations(self):
    """"""
    done = False
    while not done:
      done = self._request('QUERY')
      time.sleep(1)
    return self.get_reservations()
1011172
function queryTransport(transport, next) {
        if (options.query) {
            options.query = transport.formatQuery(query);
        }

        transport.query(options, function (err, results) {
            if (err) {
                return next(err);
            }

            next(null, transport.formatResults(results, options.format));
        });
    }
695307
function extractTravelPlan(data) {
  let tickets = data.fullJourneys[0].cheapestTickets
  if (!tickets || tickets.length === 0) { return [] }
  let secondClass = tickets[0].tickets
  let firstClass = tickets[1].tickets
  let journeys = data.fullJourneys[0].journeys
  let date = data.fullJourneys[0].date  // "25 Sep 2016"

  let journeyFromId = []
  journeys.forEach(journey => journeyFromId[journey.id] = journey)

  let plans = []
  let getPlan = (from, to, departure, arrival) => {
    return plans.find(plan =>
      (plan.legs[0].from === from) && (plan.legs[0].to === to) &&
      (plan.legs[0].departure === departure) && (plan.legs[0].arrival === arrival))
  }

  let mkticket = (ticket, travelClass) => {
    let journey = journeyFromId[ticket.journeyId]
    let price = ticket.price  // "81.40"
    if (!journey || !price) { return }
    let origin = station.name(journey.departureName)
    let destination = station.name(journey.arrivalName)

    let from = origin ? origin.id : journey.departureName
    let to = destination ? destination.id : journey.arrivalName
    let departure = String(parseTime(date, journey.departureTime))
    let arrival = String(parseTime(date, journey.arrivalTime))
    let plan = getPlan(from, to, departure, arrival)
    if (plan === undefined) {
      plan = {
        fares: [],
        legs: [{from, to, departure, arrival}],
      }
      plans.push(plan)
    }

    plan.fares.push({
      class: travelClass,
      flexibility: 1,
      price: [{ cents: parsePrice(ticket.price), currency: 'GBP' }],
    })
  }
  secondClass.map(ticket => mkticket(ticket, 2))
  firstClass.map(ticket => mkticket(ticket, 1))
  return plans
}
219562
def tickets(self, extra_params=None):
        
        tickets = []
        for space in self.api.spaces():
            tickets += filter(
                lambda ticket: ticket.get('assigned_to_id', None) == self['id'],
                space.tickets(extra_params=extra_params)
            )
        return tickets