# Path: nba_data/data/players.py
# class DetailedPlayer(TeamPlayer):
# 
#     def __init__(self, name, team, id, birth_date, height, weight, jersey, position):
#         self.birth_date = birth_date
#         self.height = height
#         self.weight = weight
#         self.jersey = jersey
#         self.position = position
#         self.jersey = jersey
#         TeamPlayer.__init__(self, name=name, id=id, team=team)
# 
#     def get_additional_unicode(self):
#         return 'birth date: {birth_date} | height: {height} | weight: {weight} | ' 'jersey: {jersey} | ' \
#                'position: {position}'.format(birth_data=self.birth_date, height=self.height, weight=self.weight,
#                                              jersey=self.jersey, position=self.position)
# 
# Path: nba_data/data/position.py
# class Position(Enum):
#     guard = "GUARD"
#     guard_forward = "GUARD-FORWARD"
#     forward_guard = "FORWARD-GUARD"
#     forward = "FORWARD"
#     center = "CENTER"
#     forward_center = "FORWARD-CENTER"
# 
#     @staticmethod
#     def get_position_from_abbreviation(abbreviation):
#         return abbreviation_to_position_map.get(abbreviation.upper())
# 
#     @staticmethod
#     def get_position_from_name(name):
#         return name_to_position_map.get(name.upper())
# 
# Path: nba_data/data/team.py
# class Team(BaseQueryParameter, Enum):
#     atlanta_hawks = "Atlanta Hawks"
#     boston_celtics = "Boston Celtics"
#     brooklyn_nets = "Brooklyn Nets"
#     charlotte_hornets = "Charlotte Hornets"
#     chicago_bulls = "Chicago Bulls"
#     cleveland_cavaliers = "Cleveland Cavaliers"
#     dallas_mavericks = "Dallas Mavericks"
#     denver_nuggets = "Denver Nuggets"
#     detroit_pistons = "Detroit Pistons"
#     golden_state_warriors = "Golden State Warriors"
#     houston_rockets = "Houston Rockets"
#     indiana_pacers = "Indiana Pacers"
#     los_angeles_clippers = "Los Angeles Clippers"
#     los_angeles_lakers = "Los Angeles Lakers"
#     memphis_grizzlies = "Memphis Grizzlies"
#     miami_heat = "Miami Heat"
#     milwaukee_bucks = "Milwaukee Bucks"
#     minnesota_timberwolves = "Minnesota Timberwolves"
#     new_orleans_pelicans = "New Orleans Pelicans"
#     new_york_knicks = "New York Knicks"
#     oklahoma_city_thunder = "Oklahoma City Thunder"
#     orlando_magic = "Orlando Magic"
#     philadelphia_76ers = "Philadelphia 76ers"
#     phoenix_suns = "Phoenix Suns"
#     portland_trail_blazers = "Portland Trail Blazers"
#     sacramento_kings = "Sacramento Kings"
#     san_antonio_spurs = "San Antonio Spurs"
#     toronto_raptors = "Toronto Raptors"
#     utah_jazz = "Utah Jazz"
#     washington_wizards = "Washington Wizards"
# 
#     @staticmethod
#     def get_query_parameter_name():
#         return "TeamId"
# 
#     @staticmethod
#     def get_team_by_id(team_id):
#         assert isinstance(team_id, int)
# 
#         return team_id_map.get(team_id)
# 
#     @staticmethod
#     def get_id(team):
#         assert isinstance(team, Team)
# 
#         return team_to_id_map.get(team)
# 
#     @staticmethod
#     def get_team_by_abbreviation(abbreviation):
#         assert isinstance(abbreviation, basestring)
# 
#         team = team_abbreviation_map.get(abbreviation.upper())
# 
#         if team is None:
#             raise ValueError('Unknown team abbreviation: %s', abbreviation)
# 
#         return team_abbreviation_map.get(abbreviation.upper())
# 
#     @staticmethod
#     def get_team_by_name(name):
#         assert isinstance(name, basestring)
# 
#         team = team_name_map.get(name)
# 
#         if team is None:
#             raise ValueError('Unknown team name: %s', name)
# 
#         return team


from datetime import datetime
from nba_data.data.players import DetailedPlayer
from nba_data.data.position import Position
from nba_data.data.team import Team
        if CommonPlayerInfoDeserializer.row_set_field_name not in result_set:
            raise ValueError('Unable to parse results from %s', data)

        row_set = result_set[CommonPlayerInfoDeserializer.row_set_field_name]

        if len(row_set) < 1:
            raise ValueError('Unable to parse row set from %s', data)

        return row_set[CommonPlayerInfoDeserializer.row_set_index]

    @staticmethod
    def deserialize(data):
        result = CommonPlayerInfoDeserializer.parse_result(data=data)

        weight = result[CommonPlayerInfoDeserializer.weight_index]
        if weight is not None:
            weight = int(weight)

        height_value = result[CommonPlayerInfoDeserializer.height_index]
        if height_value is not None:
            height = CommonPlayerInfoDeserializer.parse_height(height_value=height_value)
        else:
            height = None

        jersey_number = result[CommonPlayerInfoDeserializer.jersey_number_index]
        if jersey_number is not None:
            jersey_number = int(jersey_number)

        id = int(result[CommonPlayerInfoDeserializer.nba_id_index])
        name = result[CommonPlayerInfoDeserializer.name_index]

# Path: nba_data/data/players.py
# class DetailedPlayer(TeamPlayer):
# 
#     def __init__(self, name, team, id, birth_date, height, weight, jersey, position):
#         self.birth_date = birth_date
#         self.height = height
#         self.weight = weight
#         self.jersey = jersey
#         self.position = position
#         self.jersey = jersey
#         TeamPlayer.__init__(self, name=name, id=id, team=team)
# 
#     def get_additional_unicode(self):
#         return 'birth date: {birth_date} | height: {height} | weight: {weight} | ' 'jersey: {jersey} | ' \
#                'position: {position}'.format(birth_data=self.birth_date, height=self.height, weight=self.weight,
#                                              jersey=self.jersey, position=self.position)
# 
# Path: nba_data/data/position.py
# class Position(Enum):
#     guard = "GUARD"
#     guard_forward = "GUARD-FORWARD"
#     forward_guard = "FORWARD-GUARD"
#     forward = "FORWARD"
#     center = "CENTER"
#     forward_center = "FORWARD-CENTER"
# 
#     @staticmethod
#     def get_position_from_abbreviation(abbreviation):
#         return abbreviation_to_position_map.get(abbreviation.upper())
# 
#     @staticmethod
#     def get_position_from_name(name):
#         return name_to_position_map.get(name.upper())
# 
# Path: nba_data/data/team.py
# class Team(BaseQueryParameter, Enum):
#     atlanta_hawks = "Atlanta Hawks"
#     boston_celtics = "Boston Celtics"
#     brooklyn_nets = "Brooklyn Nets"
#     charlotte_hornets = "Charlotte Hornets"
#     chicago_bulls = "Chicago Bulls"
#     cleveland_cavaliers = "Cleveland Cavaliers"
#     dallas_mavericks = "Dallas Mavericks"
#     denver_nuggets = "Denver Nuggets"
#     detroit_pistons = "Detroit Pistons"
#     golden_state_warriors = "Golden State Warriors"
#     houston_rockets = "Houston Rockets"
#     indiana_pacers = "Indiana Pacers"
#     los_angeles_clippers = "Los Angeles Clippers"
#     los_angeles_lakers = "Los Angeles Lakers"
#     memphis_grizzlies = "Memphis Grizzlies"
#     miami_heat = "Miami Heat"
#     milwaukee_bucks = "Milwaukee Bucks"
#     minnesota_timberwolves = "Minnesota Timberwolves"
#     new_orleans_pelicans = "New Orleans Pelicans"
#     new_york_knicks = "New York Knicks"
#     oklahoma_city_thunder = "Oklahoma City Thunder"
#     orlando_magic = "Orlando Magic"
#     philadelphia_76ers = "Philadelphia 76ers"
#     phoenix_suns = "Phoenix Suns"
#     portland_trail_blazers = "Portland Trail Blazers"
#     sacramento_kings = "Sacramento Kings"
#     san_antonio_spurs = "San Antonio Spurs"
#     toronto_raptors = "Toronto Raptors"
#     utah_jazz = "Utah Jazz"
#     washington_wizards = "Washington Wizards"
# 
#     @staticmethod
#     def get_query_parameter_name():
#         return "TeamId"
# 
#     @staticmethod
#     def get_team_by_id(team_id):
#         assert isinstance(team_id, int)
# 
#         return team_id_map.get(team_id)
# 
#     @staticmethod
#     def get_id(team):
#         assert isinstance(team, Team)
# 
#         return team_to_id_map.get(team)
# 
#     @staticmethod
#     def get_team_by_abbreviation(abbreviation):
#         assert isinstance(abbreviation, basestring)
# 
#         team = team_abbreviation_map.get(abbreviation.upper())
# 
#         if team is None:
#             raise ValueError('Unknown team abbreviation: %s', abbreviation)
# 
#         return team_abbreviation_map.get(abbreviation.upper())
# 
#     @staticmethod
#     def get_team_by_name(name):
#         assert isinstance(name, basestring)
# 
#         team = team_name_map.get(name)
# 
#         if team is None:
#             raise ValueError('Unknown team name: %s', name)
# 
#         return team


# Path: nba_data/deserializers/common_player_info.py
from datetime import datetime
from nba_data.data.players import DetailedPlayer
from nba_data.data.position import Position
from nba_data.data.team import Team

        if CommonPlayerInfoDeserializer.row_set_field_name not in result_set:
            raise ValueError('Unable to parse results from %s', data)

        row_set = result_set[CommonPlayerInfoDeserializer.row_set_field_name]

        if len(row_set) < 1:
            raise ValueError('Unable to parse row set from %s', data)

        return row_set[CommonPlayerInfoDeserializer.row_set_index]

    @staticmethod
    def deserialize(data):
        result = CommonPlayerInfoDeserializer.parse_result(data=data)

        weight = result[CommonPlayerInfoDeserializer.weight_index]
        if weight is not None:
            weight = int(weight)

        height_value = result[CommonPlayerInfoDeserializer.height_index]
        if height_value is not None:
            height = CommonPlayerInfoDeserializer.parse_height(height_value=height_value)
        else:
            height = None

        jersey_number = result[CommonPlayerInfoDeserializer.jersey_number_index]
        if jersey_number is not None:
            jersey_number = int(jersey_number)

        id = int(result[CommonPlayerInfoDeserializer.nba_id_index])
        name = result[CommonPlayerInfoDeserializer.name_index]

        team = Team.get_team_by_id(team_id=int(result[CommonPlayerInfoDeserializer.team_id_index]))