def get_league_scores(self, league, time, show_upcoming, use_12_hour_format):
time_frame = '<STR_LIT:n>' if show_upcoming else '<STR_LIT:p>'<EOL>if league:<EOL><INDENT>try:<EOL><INDENT>league_id = self.league_ids[league]<EOL>req = self._get('<STR_LIT>'.format(<EOL>id=league_id, time_frame=time_frame, time=str(time)))<EOL>fixtures_results = req.json()<EOL>if len(fixtures_results["<STR_LIT>"]) == <NUM_LIT:0>:<EOL><INDENT>click.secho("<STR_LIT>".format(league=league),<EOL>fg="<STR_LIT>", bold=True)<EOL>return<EOL><DEDENT>self.writer.league_scores(fixtures_results,<EOL>time, show_upcoming,<EOL>use_12_hour_format)<EOL><DEDENT>except APIErrorException:<EOL><INDENT>click.secho("<STR_LIT>", fg="<STR_LIT>", bold=True)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>req = self._get('<STR_LIT>'.format(<EOL>time_frame=time_frame, time=str(time)))<EOL>fixtures_results = req.json()<EOL>self.writer.league_scores(fixtures_results,<EOL>time,<EOL>show_upcoming,<EOL>use_12_hour_format)<EOL><DEDENT>except APIErrorException:<EOL><INDENT>click.secho("<STR_LIT>", fg="<STR_LIT>", bold=True)<EOL><DEDENT><DEDENT>
Queries the API and fetches the scores for fixtures
based upon the league and time parameter