code: def sample_movies():
      endpoint_url = "https://query.wikidata.org/sparql"
  
      query = """
      SELECT ?movie ?movieLabel ?directorLabel ?popularity WHERE {{
        ?movie wdt:P31 wd:Q11424;                 # <- instance of film
              wdt:P57 ?director;                  # <- director
              wikibase:sitelinks ?popularity.     # <- popularity (site links)
        FILTER(?popularity >= 15)                    # <- filter by popularity > 5
        SERVICE wikibase:label {{
          bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
        }}
      }}
      """
  
      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", [])
      movies_info = [
          {
              "movie_name": result.get("movieLabel", {}).get(
                  "value", ""
              ),
              "director_name": result.get("directorLabel", {}).get(
                  "value", ""
              ),
              "popularity": int(
                  result.get("popularity", {}).get("value", "0")
              )
              if result.get("popularity")
              else None,
          }
          for result in results
      ]
  
      return movies_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 18 for calling a global function with example usage: sample_movies() and returns: movies_info