(self, structure, my_layer_id="")
return found
Find the id of the top layer of a given image tag in a
        structure produced by _load_structure()
Find the id of the top layer of a given image tag in a
        structure produced by _load_structure()
Find the id of the top layer of a given image tag in a structure produced by _load_structure ()
def _find_top_layer_id(self, structure, my_layer_id=""):
        """Find the id of the top layer of a given image tag in a
        structure produced by _load_structure()
        """
        if "repolayers" not in structure:
            return ""

        if not my_layer_id:
            if sys.version_info[0] >= 3:
                my_layer_id = list(structure["repolayers"].keys())[0]
            else:
                my_layer_id = structure["repolayers"].keys()[0]

        found = ""
        for layer_id in structure["repolayers"]:
            if "json" not in structure["repolayers"][layer_id]:   # v2
                continue
            if "parent" not in structure["repolayers"][layer_id]["json"]:
                continue
            if (my_layer_id ==
                    structure["repolayers"][layer_id]["json"]["parent"]):
                found = self._find_top_layer_id(structure, layer_id)
                break

        if not found:
            return my_layer_id

        return found
def _find_top_layer_id ( self , structure , my_layer_id = "" ) : if "repolayers" not in structure : return "" if not my_layer_id : if sys . version_info [ 0 ] >= 3 : my_layer_id = list ( structure [ "repolayers" ] . keys ( ) ) [ 0 ] else : my_layer_id = structure [ "repolayers" ] . keys ( ) [ 0 ] found = "" for layer_id in structure [ "repolayers" ] : if "json" not in structure [ "repolayers" ] [ layer_id ] : # v2 continue if "parent" not in structure [ "repolayers" ] [ layer_id ] [ "json" ] : continue if ( my_layer_id == structure [ "repolayers" ] [ layer_id ] [ "json" ] [ "parent" ] ) : found = self . _find_top_layer_id ( structure , layer_id ) break if not found : return my_layer_id return found