def parse_player_definition(definition):
  """Parses player definition.

  An example of player definition is: "agent:players=4" or "replay:path=...".

  Args:
    definition: a string defining a player

  Returns:
    A tuple (name, dict).
  """
  name = definition
  d = {'left_players': 0,
       'right_players': 0}
  if ':' in definition:
    # Windows requires special handling of replays, because path may contain ':'
    if platform.system() == 'Windows' and definition.startswith('replay:') \
        and len(definition.split(':')) > 2:
      (name, params) = 'replay', definition.split('replay:')[-1]
    else:
      (name, params) = definition.split(':')
    for param in params.split(','):
      (key, value) = param.split('=')
      d[key] = value
  if d['left_players'] == 0 and d['right_players'] == 0:
    d['left_players'] = 1
  return name, d
Parses player definition.

  An example of player definition is: "agent:players=4" or "replay:path=...".

  Args:
    definition: a string defining a player

  Returns:
    A tuple (name, dict).
  
gfootball/env/config.py