code: def search_wikidata(names, extras=None, describe=True, verbose=False):
      """Create DataFrame of Wikidata search results
  
      Args:
          names (list[str]): List of names to search for
          extras (dict(str: list)): Optional extra items to assign to results for corresponding name
          describe (bool): Optional flag to include description of entity
          verbose (bool): Optional flag to print out intermediate data
  
      Returns:
          pandas.DataFrame: Wikipedia results for all names with found entities
  
      """
  
      results = []
      for idx, name in enumerate(names):
          entity_id = find_wikidata_id(name)
          if verbose:
              print(
                  "name: {name}, entity_id: {id}".format(
                      name=name, id=entity_id
                  )
              )
  
          if entity_id == "entityNotFound":
              continue
  
          json_links = query_entity_links(entity_id)
          related_links = read_linked_entities(json_links)
          description = (
              query_entity_description(entity_id) if describe else ""
          )
  
          for related_entity, related_name in related_links:
              result = dict(
                  name=name,
                  original_entity=entity_id,
                  linked_entities=related_entity,
                  name_linked_entities=related_name,
              )
              if describe:
                  result["description"] = description
              if extras is not None:
                  for field, lst in extras.items():
                      result[field] = lst[idx]
              results.append(result)
  
      return pd.DataFrame(results)
  
file_path: recommenders/recommenders/datasets/wikidata.py
imports: import pandas
  import requests
  import logging
  from retrying import retry
label_desc: Use image node_id 6 for calling a global function with example usage: search_wikidata(names, extras, describe, verbose) and returns: pd