get inter league flg
        :param home_team_lg: home team league
        :param away_team_lg: away team league
        :return: inter league flg(T or F or U)
490984
def _get_interleague_fl(cls, home_team_lg, away_team_lg):
        
        if (home_team_lg == MlbamConst.UNKNOWN_SHORT) or (away_team_lg == MlbamConst.UNKNOWN_SHORT):
            return MlbamConst.UNKNOWN_SHORT
        elif home_team_lg != away_team_lg:
            return MlbamConst.FLG_TRUE
        return MlbamConst.FLG_FALSE
796941
def get_batters(home_or_away)
      if self.gid
        bs = get_boxscore
        if home_or_away == 'away'
        	bs.batters[0]
        else
          bs.batters[1]
        end
      else
        puts "No data for input specified"
      end
    end
1197304
def create_match(home_team, away_team)
      home_team, away_team = away_team, home_team unless home_team
      raise 'Invalid match' unless home_team

      build_match(home_team, away_team)
    end
1101987
def football_data(season='1617', data_set='football_data'):
    
    league_dict = {'E0':0, 'E1':1, 'E2': 2, 'E3': 3, 'EC':4}
    def league2num(string):
        if isinstance(string, bytes):
            string = string.decode('utf-8')
        return league_dict[string]

    def football2num(string):
        if isinstance(string, bytes):
            string = string.decode('utf-8')
        if string in football_dict:
            return football_dict[string]
        else:
            football_dict[string] = len(football_dict)+1
            return len(football_dict)+1

    def datestr2num(s):
        import datetime
        from matplotlib.dates import date2num
        return date2num(datetime.datetime.strptime(s.decode('utf-8'),'%d/%m/%y'))
    data_set_season = data_set + '_' + season
    data_resources[data_set_season] = copy.deepcopy(data_resources[data_set])
    data_resources[data_set_season]['urls'][0]+=season + '/'
    start_year = int(season[0:2])
    end_year = int(season[2:4])
    files = ['E0.csv', 'E1.csv', 'E2.csv', 'E3.csv']
    if start_year>4 and start_year < 93:
        files += ['EC.csv']
    data_resources[data_set_season]['files'] = [files]
    if not data_available(data_set_season):
        download_data(data_set_season)
    start = True
    for file in reversed(files):
        filename = os.path.join(data_path, data_set_season, file)
        # rewrite files removing blank rows.
        writename = os.path.join(data_path, data_set_season, 'temp.csv')
        input = open(filename, encoding='ISO-8859-1')
        output = open(writename, 'w')
        writer = csv.writer(output)
        for row in csv.reader(input):
            if any(field.strip() for field in row):
                writer.writerow(row)
        input.close()
        output.close()
        table = np.loadtxt(writename,skiprows=1, usecols=(0, 1, 2, 3, 4, 5), converters = {0: league2num, 1: datestr2num, 2:football2num, 3:football2num}, delimiter=',')
        if start:
            X = table[:, :4]
            Y = table[:, 4:]
            start=False
        else:
            X = np.append(X, table[:, :4], axis=0)
            Y = np.append(Y, table[:, 4:], axis=0)
    return data_details_return({'X': X, 'Y': Y, 'covariates': [discrete(league_dict, 'league'), datenum('match_day'), discrete(football_dict, 'home team'), discrete(football_dict, 'away team')], 'response': [integer('home score'), integer('away score')]}, data_set)
1239214
def get_projected_player_game_stats_by_team(self, season, week, team_id):
        
        result = self._method_call("PlayerGameProjectionStatsByTeam/{season}/{week}/{team_id}", "projections", season=season, week=week, team_id=team_id)
        return result
785686
def league_scores(self, total_data, time, show_upcoming, use_12_hour_format):
        """"""
        headers = ['League', 'Home Team Name', 'Home Team Goals',
                   'Away Team Goals', 'Away Team Name']
        result = [headers]
        league = total_data['competition']['name']
        result.extend([league,
                       score['homeTeam']['name'],
                       score['score']['fullTime']['homeTeam'],
                       score['score']['fullTime']['awayTeam'],
                        score['awayTeam']['name']]
                       for score in total_data['matches'])
        self.generate_output(result)
1125916
def team_totals(self):
        
        if self.__team_tots is None:
            self.__team_tots = self.__comp_tot()
        
        return {
            t: self.__team_tots[t]['all']
            for t in [ 'home', 'away' ]
        }
323482
def _create_ids(self, home_teams, away_teams):
        
        categories = pd.Categorical(np.append(home_teams,away_teams))
        home_id, away_id = categories.codes[0:int(len(categories)/2)], categories.codes[int(len(categories)/2):len(categories)+1]
        return home_id, away_id
77462
def type(self):
        
        if self._type.lower() == 'reg':
            return REGULAR_SEASON
        if self._type.lower() == 'ctourn':
            return CONFERENCE_TOURNAMENT
        if self._type.lower() == 'ncaa':
            return NCAA_TOURNAMENT
        if self._type.lower() == 'nit':
            return NIT_TOURNAMENT
        if self._type.lower() == 'cbi':
            return CBI_TOURNAMENT
        if self._type.lower() == 'cit':
            return CIT_TOURNAMENT
1087281
def get_tournament_prize_pool(self, leagueid=None, **kwargs):
        
        if 'leagueid' not in kwargs:
            kwargs['leagueid'] = leagueid
        url = self.__build_url(urls.GET_TOURNAMENT_PRIZE_POOL, **kwargs)
        req = self.executor(url)
        if self.logger:
            self.logger.info('URL: {0}'.format(url))
        if not self.__check_http_err(req.status_code):
            return response.build(req, url, self.raw_mode)
1090074
def get_or_else(val_or_lam = nil, &blk)
      v_or_f = val_or_lam || blk
      if !empty? then value else (v_or_f.respond_to?(:call) ? v_or_f.call : v_or_f) end
    end
1190879
def _get_retro_id(cls, home_team_id, timestamp, game_number):
        
        return '{home_team_id}{year}{month}{day}{game_number}'.format(
            **{
                'home_team_id': home_team_id.upper(),
                'year': timestamp.year,
                'month': timestamp.strftime('%m'),
                'day': timestamp.strftime('%d'),
                'game_number': int(game_number)-1,
            }
        )
1024313
def dataframe(self):
        
        if self._away_points is None and self._home_points is None:
            return None
        fields_to_include = {
            'away_assist_percentage': self.away_assist_percentage,
            'away_assists': self.away_assists,
            'away_block_percentage': self.away_block_percentage,
            'away_blocks': self.away_blocks,
            'away_defensive_rating': self.away_defensive_rating,
            'away_defensive_rebound_percentage':
            self.away_defensive_rebound_percentage,
            'away_defensive_rebounds': self.away_defensive_rebounds,
            'away_effective_field_goal_percentage':
            self.away_effective_field_goal_percentage,
            'away_field_goal_attempts': self.away_field_goal_attempts,
            'away_field_goal_percentage': self.away_field_goal_percentage,
            'away_field_goals': self.away_field_goals,
            'away_free_throw_attempt_rate': self.away_free_throw_attempt_rate,
            'away_free_throw_attempts': self.away_free_throw_attempts,
            'away_free_throw_percentage': self.away_free_throw_percentage,
            'away_free_throws': self.away_free_throws,
            'away_losses': self.away_losses,
            'away_minutes_played': self.away_minutes_played,
            'away_offensive_rating': self.away_offensive_rating,
            'away_offensive_rebound_percentage':
            self.away_offensive_rebound_percentage,
            'away_offensive_rebounds': self.away_offensive_rebounds,
            'away_personal_fouls': self.away_personal_fouls,
            'away_points': self.away_points,
            'away_ranking': self.away_ranking,
            'away_steal_percentage': self.away_steal_percentage,
            'away_steals': self.away_steals,
            'away_three_point_attempt_rate':
            self.away_three_point_attempt_rate,
            'away_three_point_field_goal_attempts':
            self.away_three_point_field_goal_attempts,
            'away_three_point_field_goal_percentage':
            self.away_three_point_field_goal_percentage,
            'away_three_point_field_goals': self.away_three_point_field_goals,
            'away_total_rebound_percentage':
            self.away_total_rebound_percentage,
            'away_total_rebounds': self.away_total_rebounds,
            'away_true_shooting_percentage':
            self.away_true_shooting_percentage,
            'away_turnover_percentage': self.away_turnover_percentage,
            'away_turnovers': self.away_turnovers,
            'away_two_point_field_goal_attempts':
            self.away_two_point_field_goal_attempts,
            'away_two_point_field_goal_percentage':
            self.away_two_point_field_goal_percentage,
            'away_two_point_field_goals': self.away_two_point_field_goals,
            'away_win_percentage': self.away_win_percentage,
            'away_wins': self.away_wins,
            'date': self.date,
            'home_assist_percentage': self.home_assist_percentage,
            'home_assists': self.home_assists,
            'home_block_percentage': self.home_block_percentage,
            'home_blocks': self.home_blocks,
            'home_defensive_rating': self.home_defensive_rating,
            'home_defensive_rebound_percentage':
            self.home_defensive_rebound_percentage,
            'home_defensive_rebounds': self.home_defensive_rebounds,
            'home_effective_field_goal_percentage':
            self.home_effective_field_goal_percentage,
            'home_field_goal_attempts': self.home_field_goal_attempts,
            'home_field_goal_percentage': self.home_field_goal_percentage,
            'home_field_goals': self.home_field_goals,
            'home_free_throw_attempt_rate': self.home_free_throw_attempt_rate,
            'home_free_throw_attempts': self.home_free_throw_attempts,
            'home_free_throw_percentage': self.home_free_throw_percentage,
            'home_free_throws': self.home_free_throws,
            'home_losses': self.home_losses,
            'home_minutes_played': self.home_minutes_played,
            'home_offensive_rating': self.home_offensive_rating,
            'home_offensive_rebound_percentage':
            self.home_offensive_rebound_percentage,
            'home_offensive_rebounds': self.home_offensive_rebounds,
            'home_personal_fouls': self.home_personal_fouls,
            'home_points': self.home_points,
            'home_ranking': self.home_ranking,
            'home_steal_percentage': self.home_steal_percentage,
            'home_steals': self.home_steals,
            'home_three_point_attempt_rate':
            self.home_three_point_attempt_rate,
            'home_three_point_field_goal_attempts':
            self.home_three_point_field_goal_attempts,
            'home_three_point_field_goal_percentage':
            self.home_three_point_field_goal_percentage,
            'home_three_point_field_goals': self.home_three_point_field_goals,
            'home_total_rebound_percentage':
            self.home_total_rebound_percentage,
            'home_total_rebounds': self.home_total_rebounds,
            'home_true_shooting_percentage':
            self.home_true_shooting_percentage,
            'home_turnover_percentage': self.home_turnover_percentage,
            'home_turnovers': self.home_turnovers,
            'home_two_point_field_goal_attempts':
            self.home_two_point_field_goal_attempts,
            'home_two_point_field_goal_percentage':
            self.home_two_point_field_goal_percentage,
            'home_two_point_field_goals': self.home_two_point_field_goals,
            'home_win_percentage': self.home_win_percentage,
            'home_wins': self.home_wins,
            'location': self.location,
            'losing_abbr': self.losing_abbr,
            'losing_name': self.losing_name,
            'pace': self.pace,
            'winner': self.winner,
            'winning_abbr': self.winning_abbr,
            'winning_name': self.winning_name
        }
        return pd.DataFrame([fields_to_include], index=[self._uri])
509547
def nLLevalAllY(ldelta, UY, UX, S):
    
    return _core.nLLevalAllY(ldelta, UY, UX, S)
1359632
def get_players(self, team):
        
        team_id = self.__get_team_id(team)
        self.logger.debug(f'Getting players of team {team_id}.')
        return self._request('teams', team_id, 'players')
490022
def parse_home_face_offs(self):
        
        self.__set_team_docs()
        self.face_offs['home'] = FaceOffRep.__read_team_doc(self.__home_doc)
        return self
1283071
def get_score
      results = []
      ls = get_boxscore.linescore
      results << ls.away_team_runs
      results << ls.home_team_runs
      results
    end