code: def get_league_scores(self, league, time, show_upcoming, use_12_hour_format):
  
          
          time_frame = 'n' if show_upcoming else 'p'
          if league:
              try:
                  league_id = self.league_ids[league]
                  req = self._get('competitions/{id}/matches?timeFrame={time_frame}{time}'.format(
                       id=league_id, time_frame=time_frame, time=str(time)))
                  fixtures_results = req.json()
                  # no fixtures in the past week. display a help message and return
                  if len(fixtures_results["matches"]) == 0:
                      click.secho("No {league} matches in the past week.".format(league=league),
                                  fg="red", bold=True)
                      return
                  self.writer.league_scores(fixtures_results,
                                            time, show_upcoming,
                                            use_12_hour_format)
              except APIErrorException:
                  click.secho("No data for the given league.", fg="red", bold=True)
          else:
              # When no league specified. Print all available in time frame.
              try:
                  req = self._get('matches?timeFrame={time_frame}{time}'.format(
                       time_frame=time_frame, time=str(time)))
                  fixtures_results = req.json()
                  self.writer.league_scores(fixtures_results,
                                            time,
                                            show_upcoming,
                                            use_12_hour_format)
              except APIErrorException:
                  click.secho("No data available.", fg="red", bold=True)
docs: Queries the API and fetches the scores for fixtures
          based upon the league and time parameter