code: def findkey(d, *keys):
      
      if keys:
          keys = list(keys)
          key = keys.pop(0)
          return findkey(d[key], *keys)
      else:
          return d
docs: Get a value from a dictionary based on a list of keys and/or list indexes.
  
      Parameters
      ----------
  
      d: dict
          A Python dictionary
      keys: list
          A list of key names, or list indexes
  
      Returns
      -------
  
      dict
          The composite dictionary object at the path specified by the keys
  
      Example
      -------
  
      To return the value of the first class of the first layer in a Mapfile::
  
          s = '''
          MAP
              LAYER
                  NAME "Layer1"
                  TYPE POLYGON
                  CLASS
                      NAME "Class1"
                      COLOR 0 0 255
                  END
              END
          END
          '''
  
          d = mappyfile.loads(s)
  
          pth = ["layers", 0, "classes", 0]
          cls1 = mappyfile.findkey(d, *pth)
          assert cls1["name"] == "Class1"