code: def load_player_suggestions(input):
      if not input:
          return []
      search_url = build_baseball_ref_endpoint(
          "/search/search.fcgi?{}".format(
              urllib.parse.urlencode(dict(search=input))
          )
      )
      content = load_content(search_url)
      if content.find(id="div_batting_standard") is not None:
          # if the search matches a player directly in baseball-reference it will redirect directly to the data page
          raise PlayerPageRedirectException(content)
      mlb_players = content.find(id="players")
      players_found = mlb_players.find_all("div", class_="search-item")
      parsed_players = []
      for player in players_found:
          link = player.find("div", class_="search-item-name").find("a")
          name, years = link.text.split("\n")
          parsed_players.append(
              dict(
                  href=link.attrs["href"],
                  name=name.strip(),
                  years=years.strip(),
              )
          )
      if len(players_found) == 1:
          # if we only have one player to select to jump directly to data loading
          player_stats_url = build_baseball_ref_endpoint(
              parsed_players[0]["href"]
          )
          raise PlayerPageRedirectException(
              load_content(player_stats_url)
          )
      return parsed_players
  
imports: import json
  import pandas
  import requests
  import streamlit
  import urllib
  import uuid
  from bs4 import BeautifulSoup
  from logging import getLogger
  from dtale.app import get_instance
  from dtale.global_state import cleanup
  from dtale.views import startup
label_desc: Use image node_id 3 for calling a global function with example usage: load_player_suggestions(input) and returns: parsed_players, list