returns all the parent sprites up until scene
481388
def get_parents(self):
        """"""
        res = []
        parent = self.parent
        while parent and isinstance(parent, Scene) == False:
            res.insert(0, parent)
            parent = parent.parent

        return res
1281578
def inspect
      img = []
      @images.each { |image| img << image.inspect }
      img = '[' + img.join(",\n") + "]\nscene=#{@scene}"
    end
373140
def get_tiles(self):
        """"""
        for x, y in griditer(self.root_tile.x, self.root_tile.y, ncol=self.tiles_per_row):
            yield TileCoordinate(self.root_tile.zoom, x, y)
324597
def _render(self):
        """"""
        return list(self._parent)[self._start:self._stop:self._step]
698591
def tiles(self):
        
        images = self.parent.images
        for x, y, gid in [i for i in self.iter_data() if i[2]]:
            yield x, y, images[gid]
550608
def render_scene(self):
        ""
        self.init_gl()
        glfw.MakeContextCurrent(self.window)
        self.renderer.render_scene()
        glfw.SwapBuffers(self.window)
        glfw.PollEvents()
1124636
def find_children(self):
        """"""
        for i in range(len(self.vertices)):
            self.vertices[i].children = []
        for i in range(len(self.vertices)):
            for parent in self.vertices[i].parents:
                if i not in self.vertices[parent].children:
                    self.vertices[parent].children.append(i)
1232323
def tile_sprite(self, out_format="sprite.json", out_folder=None):
        
        url = "{url}/resources/sprites/{f}".format(url=self._url,
                                                   f=out_format)
        if out_folder is None:
            out_folder = tempfile.gettempdir()
        return self._get(url=url,
                         param_dict={},
                         out_folder=out_folder,
                         securityHandler=self._securityHandler,
                         proxy_port=self._proxy_port,
                         proxy_url=self._proxy_host)
474769
def get_children(self):
        """"""
        if self.is_leaf():
            return get_result_class(self.__class__).objects.none()
        return get_result_class(self.__class__).objects.filter(
            depth=self.depth + 1,
            path__range=self._get_children_path_interval(self.path)
        ).order_by(
            'path'
        )
596783
def _get_ancestors_of(self, obs_nodes_list):
        
        if not obs_nodes_list:
            return set()
        return set(obs_nodes_list) | set(self.parent_node)
802582
function all(parent) {
  var self = this
  var children = parent.children
  var length = children.length
  var results = []
  var index = -1

  while (++index < length) {
    results[index] = self.visit(children[index], parent)
  }

  return results
}
1250724
def parent_images(self):
        
        parents = []
        for instr in self.structure:
            if instr['instruction'] != 'FROM':
                continue
            image, _ = image_from(instr['value'])
            if image is not None:
                parents.append(image)
        return parents
1333214
def until_any_child_in_state(self, state, timeout=None):
        """"""
        return until_any(*[r.until_state(state) for r in dict.values(self.children)],
                         timeout=timeout)
888028
def all_mouse_sprites(self):
        """"""
        def all_recursive(sprites):
            if not sprites:
                return

            for sprite in sprites:
                if sprite.visible:
                    yield sprite

                    for child in all_recursive(sprite.get_mouse_sprites()):
                        yield child

        return all_recursive(self.get_mouse_sprites())
912856
def draw_sprites
      0.step(SPRITES_COUNT - 1, 4) do |base_sprite_ram_address|
        y_for_sprite = read_from_sprite_ram(base_sprite_ram_address)
        pattern_index = read_from_sprite_ram(base_sprite_ram_address + 1)
        sprite_attribute_byte = read_from_sprite_ram(base_sprite_ram_address + 2)
        x_for_sprite = read_from_sprite_ram(base_sprite_ram_address + 3)

        palette_id = sprite_attribute_byte & 0b11
        reversed_horizontally = sprite_attribute_byte[6] == 1
        reversed_vertically = sprite_attribute_byte[7] == 1

        TILE_HEIGHT.times do |y_in_pattern|
          pattern_line_low_byte_address = TILE_HEIGHT * 2 * pattern_index + y_in_pattern
          pattern_line_low_byte = read_sprite_pattern_line(pattern_line_low_byte_address)
          pattern_line_high_byte = read_sprite_pattern_line(pattern_line_low_byte_address + TILE_HEIGHT)
          TILE_WIDTH.times do |x_in_pattern|
            index_in_pattern_line_byte = TILE_WIDTH - 1 - x_in_pattern
            sprite_palette_index = pattern_line_low_byte[index_in_pattern_line_byte] | (pattern_line_high_byte[index_in_pattern_line_byte] << 1) | (palette_id << 2)
            if sprite_palette_index % 4 != 0
              color_id = read_color_id(sprite_palette_index)
              y_in_pattern = TILE_HEIGHT - 1 - y_in_pattern if reversed_vertically
              x_in_pattern = TILE_WIDTH - 1 - x_in_pattern if reversed_horizontally
              @image.write(
                value: ::Rnes::Ppu::COLORS[color_id],
                x: x_for_sprite + x_in_pattern,
                y: y_for_sprite + y_in_pattern,
              )
            end
          end
        end
      end
    end
30947
@Override
    public Scene getScene()
    {
        final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Scene, and Scene returns itself, CYCLES!!!

        if (null != parent)
        {
            return parent.getScene();
        }
        return null;
    }
205011
def _add(self, sprite, index = None):
        """"""
        if sprite == self:
            raise Exception("trying to add sprite to itself")

        if sprite.parent:
            sprite.x, sprite.y = self.from_scene_coords(*sprite.to_scene_coords())
            sprite.parent.remove_child(sprite)

        if index is not None:
            self.sprites.insert(index, sprite)
        else:
            self.sprites.append(sprite)
        sprite.parent = self