code: def sample_football_teams():
      endpoint_url = "https://query.wikidata.org/sparql"
  
      query = """SELECT DISTINCT ?team ?teamLabel (SAMPLE(?f_year) AS ?founding_year)
      (SAMPLE(?stadiumLabel) AS ?stadium_name) (SAMPLE(?cityLabel) AS ?city) (SAMPLE(?popularity) AS ?popularity_count)
      WHERE {{
        ?team wdt:P31 wd:Q476028. # Instance of football club
        OPTIONAL {{ ?team wdt:P571 ?founding_date. BIND(YEAR(?founding_date) AS ?f_year) }}
        OPTIONAL {{ ?team wdt:P115 ?stadium. }}
        OPTIONAL {{ ?team wdt:P131 ?city. }}
        OPTIONAL {{ ?team wikibase:sitelinks ?popularity. }}
        SERVICE wikibase:label {{ bd:serviceParam wikibase:language "en". }}
      }}
      GROUP BY ?team ?teamLabel
      HAVING (SAMPLE(?popularity) >= 5)
      """
  
      headers = {"Accept": "application/json"}
      response = requests.get(
          endpoint_url, params={"query": query}, headers=headers
      )
  
      if response.status_code != 200:
          raise Exception(
              f"Error: {response.status_code} - {response.reason}"
          )
  
      results = response.json().get("results", {}).get("bindings", [])
      teams_info = []
  
      for result in results:
          team_info = {
              "team_name": result.get("teamLabel", {}).get("value", ""),
              "founding_year": int(
                  result.get("founding_year", {}).get("value", "0")
              )
              if result.get("founding_year")
              else None,
              "stadium_name": result.get("stadium_name", {}).get(
                  "value", ""
              )
              if result.get("stadium_name")
              else None,
              "city": result.get("city", {}).get("value", "")
              if result.get("city")
              else None,
              "popularity": int(
                  result.get("popularity_count", {}).get("value", "0")
              )
              if result.get("popularity_count")
              else None,
          }
          teams_info.append(team_info)
  
      return teams_info
  
imports: import requests
  import os
  import pickle
  import random
  from tqdm import tqdm
  from nltk.corpus import words
label_desc: Use image node_id 4 for calling a global function with example usage: sample_football_teams() and returns: teams_info