code: def geocode(
      level=None,
      names=None,
      countries=None,
      states=None,
      counties=None,
      scope=None,
  ) -> NamesGeocoder:
      """
      Create a `NamesGeocoder`. Allow to refine ambiguous request with `where()` method,
      scope that limits area of geocoding or with parents.
  
      Parameters
      ----------
      level : {'country', 'state', 'county', 'city'}
          The level of administrative division. Autodetection by default.
      names : list or str
          Names of objects to be geocoded.
          For 'state' level: 'US-48' returns continental part of United States (48 states)
          in a compact form.
      countries : list
          Parent countries. Should have same size as names. Can contain strings or `Geocoder` objects.
      states : list
          Parent states. Should have same size as names. Can contain strings or `Geocoder` objects.
      counties : list
          Parent counties. Should have same size as names. Can contain strings or `Geocoder` objects.
      scope : str or `Geocoder`
          Limits area of geocoding. If parent country is set then error will be generated.
          If type is a string - geoobject should have geocoded scope in parents.
          If type is a `Geocoder` - geoobject should have geocoded scope in parents.
          Scope should contain only one entry.
  
      Returns
      -------
      `NamesGeocoder`
          Geocoder object specification.
  
      Examples
      --------
      .. jupyter-execute::
          :linenos:
          :emphasize-lines: 5
  
          from IPython.display import display
          from lets_plot import *
          from lets_plot.geo_data import *
          LetsPlot.setup_html()
          states = geocode('state').scope('Italy').get_boundaries(6)
          display(states.head())
          ggplot() + geom_map(data=states)
  
      |
  
      .. jupyter-execute::
          :linenos:
          :emphasize-lines: 5, 8
  
          from IPython.display import display
          from lets_plot import *
          from lets_plot.geo_data import *
          LetsPlot.setup_html()
          states = geocode(level='state', scope='US').get_geocodes()
          display(states.head())
          names = ['York'] * len(states.state)
          cities = geocode(names=names, states=states.state).ignore_not_found().get_centroids()
          display(cities.head())
          ggplot() + \\
              geom_livemap() + \\
              geom_point(data=cities, tooltips=layer_tooltips().line('@{found name}'))
  
      """
      return (
          NamesGeocoder(level, names)
          .scope(scope)
          .countries(countries)
          .states(states)
          .counties(counties)
      )
  
file_path: lets-plot/python-package/lets_plot/geo_data/core.py
imports: from typing import Any
  import numpy
  from .geocoder import Geocoder, ReverseGeocoder, NamesGeocoder
label_desc: Use image node_id 1 for calling a global function with example usage: geocode(level, names, countries, states, counties, scope) and returns: NamesGeocoder