/*
 * File:                MultiReproducerTest.java
 * Authors:             Jonathan McClain
 * Company:             Sandia National Laboratories
 * Project:             Cognitive Framework Lite
 *
 * Copyright May 10, 2006, Sandia Corporation.  Under the terms of Contract
 * DE-AC04-94AL85000, there is a non-exclusive license for use of this work by
 * or on behalf of the U.S. Government. Export of this program may require a
 * license from the United States Government. See CopyrightHistory.txt for
 * complete details.
 *
 *
 */

package gov.sandia.cognition.learning.algorithm.genetic.reproducer;

import gov.sandia.cognition.learning.algorithm.genetic.DummyReproducer;
import gov.sandia.cognition.learning.algorithm.genetic.EvaluatedGenome;
import junit.framework.*;
import java.util.ArrayList;
import java.util.Collection;

/**
 * This class implements JUnit tests for the following classes:
 *
 *     MultiReproducerTest
 *
 * @author Jonathan McClain
 * @since 1.0
 */
public class MultiReproducerTest extends TestCase
{

    /**
     * Creates a new instance of MultiReproducerTest.
     */
    public MultiReproducerTest(String testName)
    {
        super(testName);
    }

    /**
     * Called before each test is run.
     */
    protected void setUp() throws Exception
    {
    }

    /**
     * Called after each test is run.
     */
    protected void tearDown() throws Exception
    {
    }

    /**
     * Returns the test.
     */
    public static Test suite()
    {
        TestSuite suite = new TestSuite(MultiReproducerTest.class);

        return suite;
    }

    /**
     * Test of reproduce method, of class
     * gov.sandia.isrc.learning.reinforcement.MultiReproducer.
     */
    public void testReproduce()
    {
        System.out.println("reproduce");

        ArrayList<Reproducer<Integer>> reproducers =
                new ArrayList<Reproducer<Integer>>(2);
        DummyReproducer reproducer1 = new DummyReproducer();
        DummyReproducer reproducer2 = new DummyReproducer();
        reproducers.add(reproducer1);
        reproducers.add(reproducer2);
        MultiReproducer<Integer> multiReproducer =
                new MultiReproducer<Integer>(reproducers);
        ArrayList<EvaluatedGenome<Integer>> population =
                new ArrayList<EvaluatedGenome<Integer>>(10);
        for(int i = 0; i < 10; i++)
        {
            EvaluatedGenome<Integer> genome =
                    new EvaluatedGenome<Integer>(0.0, 0);
            population.add(i, genome);
        }
        Collection<Integer> newPopulation =
                multiReproducer.reproduce(population);
        assertEquals(
                "Reproduce was called an incorrect number of times",
                1,
                reproducer1.getReproduceCount());
        assertEquals(
                "Reproduce was called an incorrect number of times",
                1,
                reproducer2.getReproduceCount());
        assertEquals(
                "New population was incorrect size",
                population.size() * 2, newPopulation.size());
    }

    /**
     * Test of getReproducers method, of class
     * gov.sandia.isrc.learning.reinforcement.MultiReproducer.
     */
    public void testGetReproducers()
    {
        System.out.println("getReproducers");

        MultiReproducer<Integer> multiReproducer =
                new MultiReproducer<Integer>(null);
        ArrayList<Reproducer<Integer>> expected =
                new ArrayList<Reproducer<Integer>>();
        multiReproducer.setReproducers(expected);
        Collection<Reproducer<Integer>> actual =
                multiReproducer.getReproducers();
        assertEquals(
                "getReproducers did not return the expected Collection",
                expected,
                actual);
    }

    /**
     * Test of setReproducers method, of class
     * gov.sandia.isrc.learning.reinforcement.MultiReproducer.
     */
    public void testSetReproducers()
    {
        System.out.println("setReproducers");

        MultiReproducer<Integer> multiReproducer =
                new MultiReproducer<Integer>(null);
        ArrayList<Reproducer<Integer>> expected =
                new ArrayList<Reproducer<Integer>>();
        multiReproducer.setReproducers(expected);
        Collection<Reproducer<Integer>> actual =
                multiReproducer.getReproducers();
        assertEquals(
                "setReproducers did not set the expected Collection",
                expected,
                actual);
    }

}

{'repo_name': 'algorithmfoundry/Foundry', 'stars': '124', 'repo_language': 'Java', 'file_name': 'nblibraries.properties', 'mime_type': 'text/plain', 'hash': 5766181054325227449, 'source_dataset': 'data'}


--TEST--
ReflectionExtension::__construct()
--CREDITS--
Gerrit "Remi" te Sligte <remi@wolerized.com>
Leon Luijkx <leon@phpgg.nl>
--FILE--
<?php
$obj = new ReflectionExtension('reflection');
$test = $obj instanceof ReflectionExtension;
var_dump($test);
?>
==DONE==
--EXPECT--
bool(true)
==DONE==

{'repo_name': 'Roave/BetterReflection', 'stars': '794', 'repo_language': 'PHP', 'file_name': 'ReflectionParameter_DefaultValueConstant_error.phpt', 'mime_type': 'text/plain', 'hash': 2652933947733549089, 'source_dataset': 'data'}


--[[

     Polaroids
     by alfunx (Alphonse Mariya)

     Polaroids Openbox theme: github.com/eti0/dots
     Gruvbox: github.com/morhetz/gruvbox/

--]]

local gears            = require("gears")
local lain             = require("lain")
local awful            = require("awful")
local wibox            = require("wibox")
local naughty          = require("naughty")
local os, math, string = os, math, string

local context          = require("config.context")
local util             = require("config.util")
local tags             = require("config.tags")
local taglist_binds    = require("config.bindings_taglist")
local tasklist_binds   = require("config.bindings_tasklist")

local colors = { }

colors.black_1          = "#282828"
colors.black_2          = "#928374"
colors.red_1            = "#cc241d"
colors.red_2            = "#fb4934"
colors.green_1          = "#98971a"
colors.green_2          = "#b8bb26"
colors.yellow_1         = "#d79921"
colors.yellow_2         = "#fabd2f"
colors.blue_1           = "#458588"
colors.blue_2           = "#83a598"
colors.purple_1         = "#b16286"
colors.purple_2         = "#d3869b"
colors.aqua_1           = "#689d6a"
colors.aqua_2           = "#8ec07c"
colors.white_1          = "#a89984"
colors.white_2          = "#ebdbb2"
colors.orange_1         = "#d65d0e"
colors.orange_2         = "#fe8019"

colors.bw_0_h           = "#1d2021"
colors.bw_0             = "#282828"
colors.bw_0_s           = "#32302f"
colors.bw_1             = "#3c3836"
colors.bw_2             = "#504945"
colors.bw_3             = "#665c54"
colors.bw_4             = "#7c6f64"
colors.bw_5             = "#928374"
colors.bw_6             = "#a89984"
colors.bw_7             = "#bdae93"
colors.bw_8             = "#d5c4a1"
colors.bw_9             = "#ebdbb2"
colors.bw_10            = "#fbf1c7"

context.colors = gears.table.join(colors, context.colors)
colors = context.colors

local bar_fg    = colors.bw_5
local bar_bg    = colors.bw_0 .. "00"

local theme = { }
theme.name = "polaroids"
theme.dir = string.format("%s/.config/awesome/themes/%s", os.getenv("HOME"), theme.name)

theme.wallpaper                                 = theme.dir .. "/wallpapers/wall.png"

-- theme.wallpaper                                 = theme.dir .. "/wallpapers/wall.png"
-- theme.wallpaper                                 = theme.dir .. "/wallpapers/escheresque.png"
-- theme.wallpaper_fn                              = gears.wallpaper.tiled

-- theme.wallpaper_original                        = theme.dir .. "/wallpapers/matterhorn.jpg"
-- theme.wallpaper                                 = theme.dir .. "/wallpapers/matterhorn_base.jpg"
-- theme.wallpaper_blur                            = theme.dir .. "/wallpapers/matterhorn_blur.jpg"

local font_name                                 = "blackjack"
local font_size                                 = "14"
theme.font                                      = font_name .. " " ..                         font_size
theme.font_bold                                 = font_name .. " " .. "Bold"        .. " " .. font_size
theme.font_italic                               = font_name .. " " .. "Italic"      .. " " .. font_size
theme.font_bold_italic                          = font_name .. " " .. "Bold Italic" .. " " .. font_size
theme.font_big                                  = font_name .. " " .. "Bold"        .. " 16"

theme.border_normal                             = colors.bw_8
theme.border_focus                              = colors.bw_10
theme.border_marked                             = colors.bw_10

theme.fg_normal                                 = colors.bw_9
theme.fg_focus                                  = colors.red_2
theme.fg_urgent                                 = colors.bw_0
theme.bg_normal                                 = colors.bw_0
theme.bg_focus                                  = colors.bw_2
theme.bg_urgent                                 = colors.red_2

theme.taglist_font                              = theme.font_bold
theme.taglist_fg_normal                         = colors.bw_5
theme.taglist_fg_occupied                       = colors.bw_5
theme.taglist_fg_empty                          = colors.bw_1
theme.taglist_fg_volatile                       = colors.aqua_2
theme.taglist_fg_focus                          = colors.bw_9
theme.taglist_fg_urgent                         = colors.red_2
theme.taglist_bg_normal                         = colors.bw_0 .. "00"
theme.taglist_bg_occupied                       = colors.bw_0 .. "00"
theme.taglist_bg_empty                          = colors.bw_0 .. "00"
theme.taglist_bg_volatile                       = colors.bw_0 .. "00"
theme.taglist_bg_focus                          = colors.bw_2 .. "00"
theme.taglist_bg_urgent                         = colors.bw_1 .. "00"

theme.tasklist_font_normal                      = theme.font
theme.tasklist_font_focus                       = theme.font_bold
theme.tasklist_font_urgent                      = theme.font_bold
theme.tasklist_fg_normal                        = colors.bw_5
theme.tasklist_fg_focus                         = colors.bw_8
theme.tasklist_fg_minimize                      = colors.bw_2
theme.tasklist_fg_urgent                        = colors.red_2
theme.tasklist_bg_normal                        = colors.bw_0 .. "00"
theme.tasklist_bg_focus                         = colors.bw_0 .. "00"
theme.tasklist_bg_urgent                        = colors.bw_0 .. "00"

theme.titlebar_positions                        = { "bottom" }
theme.titlebar_fg_normal                        = colors.bw_0
theme.titlebar_fg_focus                         = colors.bw_0
theme.titlebar_fg_marked                        = colors.bw_0
theme.titlebar_bg_normal                        = theme.border_normal
theme.titlebar_bg_focus                         = theme.border_focus
theme.titlebar_bg_marked                        = theme.border_marked

theme.hotkeys_border_width                      = 30
theme.hotkeys_border_color                      = colors.bw_0
theme.hotkeys_group_margin                      = 30
theme.hotkeys_shape                             = function(cr, width, height)
                                                      gears.shape.rounded_rect(cr, width, height, 20)
                                                  end

theme.prompt_bg                                 = colors.bw_0 .. "00"
theme.prompt_fg                                 = theme.fg_normal
theme.bg_systray                                = theme.tasklist_bg_normal

theme.border_width                              = 10
-- theme.border_radius                             = 8
theme.border_radius                             = 0
theme.menu_height                               = 20
theme.menu_width                                = 250
theme.tasklist_plain_task_name                  = true
theme.tasklist_disable_icon                     = true
theme.tasklist_spacing                          = 3
theme.useless_gap                               = 14
theme.systray_icon_spacing                      = 4

theme.snap_bg                                   = theme.border_focus
theme.snap_shape                                = function(cr, w, h)
                                                      gears.shape.rounded_rect(cr, w, h, theme.border_radius or 0)
                                                  end

theme.menu_submenu_icon                         = theme.dir .. "/icons/submenu.png"
theme.awesome_icon                              = theme.dir .. "/icons/awesome.png"
-- theme.taglist_squares_sel                       = theme.dir .. "/icons/square_sel.png"
-- theme.taglist_squares_unsel                     = theme.dir .. "/icons/square_unsel.png"
-- theme.taglist_squares_sel_empty                 = theme.dir .. "/icons/square_sel_empty.png"
-- theme.taglist_squares_unsel_empty               = theme.dir .. "/icons/square_unsel_empty.png"

theme.layout_cascadetile                        = theme.dir .. "/layouts/cascadetile.png"
theme.layout_centerwork                         = theme.dir .. "/layouts/centerwork.png"
theme.layout_cornerne                           = theme.dir .. "/layouts/cornerne.png"
theme.layout_cornernw                           = theme.dir .. "/layouts/cornernw.png"
theme.layout_cornerse                           = theme.dir .. "/layouts/cornerse.png"
theme.layout_cornersw                           = theme.dir .. "/layouts/cornersw.png"
theme.layout_dwindle                            = theme.dir .. "/layouts/dwindle.png"
theme.layout_fairh                              = theme.dir .. "/layouts/fairh.png"
theme.layout_fairv                              = theme.dir .. "/layouts/fairv.png"
theme.layout_floating                           = theme.dir .. "/layouts/floating.png"
theme.layout_fullscreen                         = theme.dir .. "/layouts/fullscreen.png"
theme.layout_magnifier                          = theme.dir .. "/layouts/magnifier.png"
theme.layout_max                                = theme.dir .. "/layouts/max.png"
theme.layout_spiral                             = theme.dir .. "/layouts/spiral.png"
theme.layout_tile                               = theme.dir .. "/layouts/tile.png"
theme.layout_tilebottom                         = theme.dir .. "/layouts/tilebottom.png"
theme.layout_tileleft                           = theme.dir .. "/layouts/tileleft.png"
theme.layout_tiletop                            = theme.dir .. "/layouts/tiletop.png"

theme.widget_ac                                 = theme.dir .. "/icons/ac.png"
theme.widget_battery                            = theme.dir .. "/icons/battery.png"
theme.widget_battery_low                        = theme.dir .. "/icons/battery_low.png"
theme.widget_battery_empty                      = theme.dir .. "/icons/battery_empty.png"
theme.widget_mem                                = theme.dir .. "/icons/mem.png"
theme.widget_cpu                                = theme.dir .. "/icons/cpu.png"
theme.widget_temp                               = theme.dir .. "/icons/temp.png"
theme.widget_pacman                             = theme.dir .. "/icons/pacman.png"
theme.widget_users                              = theme.dir .. "/icons/user.png"
theme.widget_net                                = theme.dir .. "/icons/net.png"
theme.widget_hdd                                = theme.dir .. "/icons/hdd.png"
theme.widget_music                              = theme.dir .. "/icons/note.png"
theme.widget_music_on                           = theme.dir .. "/icons/note_on.png"
theme.widget_music_pause                        = theme.dir .. "/icons/pause.png"
theme.widget_music_stop                         = theme.dir .. "/icons/stop.png"
theme.widget_vol                                = theme.dir .. "/icons/vol.png"
theme.widget_vol_low                            = theme.dir .. "/icons/vol_low.png"
theme.widget_vol_no                             = theme.dir .. "/icons/vol_no.png"
theme.widget_vol_mute                           = theme.dir .. "/icons/vol_mute.png"
theme.widget_mail                               = theme.dir .. "/icons/mail.png"
theme.widget_mail_on                            = theme.dir .. "/icons/mail_on.png"
theme.widget_task                               = theme.dir .. "/icons/task.png"
theme.widget_scissors                           = theme.dir .. "/icons/scissors.png"

theme.titlebar_close_button_focus               = theme.dir .. "/icons/titlebar_light/close_focus.png"
theme.titlebar_close_button_normal              = theme.dir .. "/icons/titlebar_light/close_normal.png"
theme.titlebar_ontop_button_focus_active        = theme.dir .. "/icons/titlebar_light/ontop_focus_active.png"
theme.titlebar_ontop_button_normal_active       = theme.dir .. "/icons/titlebar_light/ontop_normal_active.png"
theme.titlebar_ontop_button_focus_inactive      = theme.dir .. "/icons/titlebar_light/ontop_focus_inactive.png"
theme.titlebar_ontop_button_normal_inactive     = theme.dir .. "/icons/titlebar_light/ontop_normal_inactive.png"
theme.titlebar_sticky_button_focus_active       = theme.dir .. "/icons/titlebar_light/sticky_focus_active.png"
theme.titlebar_sticky_button_normal_active      = theme.dir .. "/icons/titlebar_light/sticky_normal_active.png"
theme.titlebar_sticky_button_focus_inactive     = theme.dir .. "/icons/titlebar_light/sticky_focus_inactive.png"
theme.titlebar_sticky_button_normal_inactive    = theme.dir .. "/icons/titlebar_light/sticky_normal_inactive.png"
theme.titlebar_floating_button_focus_active     = theme.dir .. "/icons/titlebar_light/floating_focus_active.png"
theme.titlebar_floating_button_normal_active    = theme.dir .. "/icons/titlebar_light/floating_normal_active.png"
theme.titlebar_floating_button_focus_inactive   = theme.dir .. "/icons/titlebar_light/floating_focus_inactive.png"
theme.titlebar_floating_button_normal_inactive  = theme.dir .. "/icons/titlebar_light/floating_normal_inactive.png"
theme.titlebar_minimize_button_focus_active     = theme.dir .. "/icons/titlebar_light/minimized_focus_active.png"
theme.titlebar_minimize_button_normal_active    = theme.dir .. "/icons/titlebar_light/minimized_normal_active.png"
theme.titlebar_minimize_button_focus_inactive   = theme.dir .. "/icons/titlebar_light/minimized_focus_inactive.png"
theme.titlebar_minimize_button_normal_inactive  = theme.dir .. "/icons/titlebar_light/minimized_normal_inactive.png"
theme.titlebar_maximized_button_focus_active    = theme.dir .. "/icons/titlebar_light/maximized_focus_active.png"
theme.titlebar_maximized_button_normal_active   = theme.dir .. "/icons/titlebar_light/maximized_normal_active.png"
theme.titlebar_maximized_button_focus_inactive  = theme.dir .. "/icons/titlebar_light/maximized_focus_inactive.png"
theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar_light/maximized_normal_inactive.png"

theme.tooltip_fg                                = theme.titlebar_fg_focus
theme.tooltip_bg                                = theme.titlebar_bg_normal
theme.tooltip_border_color                      = theme.border_normal
theme.tooltip_border_width                      = theme.border_width

theme.notification_fg                           = theme.fg_normal
theme.notification_bg                           = theme.bg_normal
theme.notification_border_color                 = theme.border_normal
theme.notification_border_width                 = theme.border_width
theme.notification_icon_size                    = 80
theme.notification_opacity                      = 1
theme.notification_max_width                    = 600
theme.notification_max_height                   = 400
theme.notification_margin                       = 20
theme.notification_shape                        = function(cr, width, height)
                                                      gears.shape.rounded_rect(cr, width, height, theme.border_radius or 0)
                                                  end

naughty.config.padding                          = 15
naughty.config.spacing                          = 10
naughty.config.defaults.timeout                 = 5
naughty.config.defaults.margin                  = theme.notification_margin
naughty.config.defaults.border_width            = theme.notification_border_width

naughty.config.presets.normal                   = {
                                                      font         = theme.font,
                                                      fg           = theme.notification_fg,
                                                      bg           = theme.notification_bg,
                                                      border_width = theme.notification_border_width,
                                                      margin       = theme.notification_margin,
                                                  }

naughty.config.presets.low                      = naughty.config.presets.normal
naughty.config.presets.ok                       = naughty.config.presets.normal
naughty.config.presets.info                     = naughty.config.presets.normal
naughty.config.presets.warn                     = naughty.config.presets.normal

naughty.config.presets.critical                 = {
                                                      font         = theme.font,
                                                      fg           = colors.red_2,
                                                      bg           = theme.notification_bg,
                                                      border_width = theme.notification_border_width,
                                                      margin       = theme.notification_margin,
                                                      timeout      = 0,
                                                  }

local markup = lain.util.markup
-- local separators = lain.util.separators

-- Textclock
-- local clockicon = wibox.widget.imagebox(theme.widget_clock)
local clock = awful.widget.watch(
    -- "date +'%a %d %b %R'", 60,
    "date +'%R'", 5,
    function(widget, stdout)
        widget:set_markup(markup.fontfg(theme.font_bold, colors.bw_8, stdout))
    end
)

local clock_widget = wibox.widget {
    clock,
    layout = wibox.layout.align.horizontal,
}

-- Calendar
theme.cal = lain.widget.cal {
    cal = "cal --color=always --monday",
    attach_to = { clock_widget },
    icons = "",
    notification_preset = naughty.config.presets.normal,
}

-- NET
--luacheck: push ignore widget net_now
local neticon = wibox.widget.imagebox(theme.widget_net)
local net = lain.widget.net {
    wifi_state = "on",
    iface = context.vars.net_iface,
    notify = "off",
    units = 1048576, -- in MB/s (1024^2)
    -- units = 131072, -- in Mbit/s / Mbps (1024^2/8)
    settings = function()
        local _color = bar_fg
        local _font = theme.font

        if not net_now.state or net_now.state == "down" then
            _color = colors.red_2
            _font = theme.font
            widget:set_markup(markup.fontfg(_font, _color, " N/A "))
        else
            widget:set_markup(markup.fontfg(_font, _color, net_now.received .. " ↓↑ " .. net_now.sent))
        end
    end,
}

local net_widget = wibox.widget {
    net.widget,
    layout = wibox.layout.align.horizontal,
}

net_widget:buttons(awful.button({ }, 1, function()
    awful.spawn.easy_async(context.vars.scripts_dir .. "/show-ip-address", function(stdout, stderr, reason, exit_code)
        if net_widget.notification then
            naughty.destroy(net_widget.notification)
        end
        net.update()
        net_widget.notification = naughty.notify {
            title = "Network",
            text = string.gsub(stdout, '\n*$', ''),
            timeout = 10,
        }

        awful.spawn.easy_async(context.vars.scripts_dir .. "/show-ip-address -f", function(stdout, stderr, reason, exit_code)
            if net_widget.notification then
                naughty.destroy(net_widget.notification)
            end
            net.update()
            net_widget.notification = naughty.notify {
                title = "Network",
                text = string.gsub(stdout, '\n*$', ''),
                timeout = 10,
            }
        end)
    end)
end))
--luacheck: pop

theme.titlebar_fn = function(c)
    -- buttons for the titlebar
    local buttons = gears.table.join(
        awful.button({ }, 1, function()
            if c.focusable then client.focus = c end
            c:raise()
            awful.mouse.client.move(c)
        end),
        awful.button({ }, 3, function()
            if c.focusable then client.focus = c end
            c:raise()
            awful.mouse.client.resize(c)
        end)
    )

    awful.titlebar(c, {
        size = 40,
        position = "bottom",
    }):setup {
        {
            layout = wibox.layout.align.horizontal,
            { -- Left
                layout = wibox.layout.fixed.horizontal,
            },
            { -- Middle
                layout = wibox.layout.flex.horizontal,
                { -- Title
                    align = "center",
                    widget = awful.titlebar.widget.titlewidget(c),
                },
                buttons = buttons,
            },
            { -- Right
                layout = wibox.layout.fixed.horizontal,
            },
        },
        widget = wibox.container.margin,
        left = 5,
        right = 5,
        top = 8,
    }

    awful.titlebar(c, { }):setup {
        layout = wibox.layout.align.horizontal,
    }
    awful.titlebar.hide(c)
end

-- Separators
local vert_sep = wibox.widget {
    widget = wibox.widget.separator,
    orientation = "vertical",
    forced_width = 20,
    color = theme.border_normal .. "00",
}

-- Show only tags of current row (taggrid feature)
local function rowfilter(t)
    local index = t.index
    local selected = awful.screen.focused().selected_tag.index
    if not index or not selected then
        return false
    end
    local columns = tags.columns or #tags.names
    return math.floor((index - 1) / columns) == math.floor((selected - 1) / columns)
end

function theme.at_screen_connect(s)
    -- Quake application
    s.quake = lain.util.quake {
        app = context.vars.terminal,
    }

    -- If wallpaper is a function, call it with the screen
    local wallpaper = theme.wallpaper
    if type(wallpaper) == "function" then
        wallpaper = wallpaper(s)
    end
    -- gears.wallpaper.maximized(wallpaper, s, true)
    gears.wallpaper.tiled(wallpaper, s)

    -- Tags
    awful.tag(tags.names, s, tags.layouts)

    -- Create a promptbox for each screen
    s._promptbox = awful.widget.prompt()

    -- Create an imagebox widget which will contains an icon indicating which layout we're using.
    -- We need one layoutbox per screen.
    s._layoutbox = awful.widget.layoutbox(s)
    s._layoutbox:buttons(gears.table.join(
        awful.button({ }, 1, function() awful.layout.inc( 1) end),
        awful.button({ }, 3, function() awful.layout.inc(-1) end),
        awful.button({ }, 4, function() awful.layout.inc( 1) end),
        awful.button({ }, 5, function() awful.layout.inc(-1) end))
    )

    -- Create a taglist widget
    s._taglist = awful.widget.taglist(s, rowfilter, taglist_binds.buttons)

    -- Create a tasklist widget
    s._tasklist = awful.widget.tasklist(s,
    awful.widget.tasklist.filter.currenttags,
    tasklist_binds.buttons, {
        bg_focus = theme.tasklist_bg_focus,
        shape = function(cr, width, height)
                    gears.shape.rounded_rect(cr, width, height, theme.border_radius or 0)
                end,
        shape_border_width = 0,
        shape_border_color = theme.tasklist_bg_normal,
        align = "center" })

    -- Create the wibox
    s._wibox = awful.wibar {
        position = "top",
        screen = s,
        height = 30,
        fg = bar_fg,
        bg = bar_bg,
    }

    local systray_widget = wibox.widget {
        layout = wibox.layout.align.horizontal,
        vert_sep,
        {
            {
                layout = wibox.layout.align.horizontal,
                wibox.widget.systray(),
            },
            left = 8,
            right = 0,
            top = 4,
            bottom = 4,
            widget = wibox.container.margin,
        },
        visible = false,
    }
    util.show_on_mouse(s._wibox, systray_widget)

    -- Add widgets to the wibox
    s._wibox:setup {
        layout = wibox.layout.fixed.vertical,
        {
            layout = wibox.layout.align.horizontal,
            { -- Left widgets
                layout = wibox.layout.fixed.horizontal,

                { -- Layout box
                    {
                        {
                            layout = wibox.layout.align.horizontal,
                            s._layoutbox,
                        },
                        left = 8,
                        right = 3,
                        top = 8,
                        bottom = 8,
                        widget = wibox.container.margin,
                    },
                    bg = bar_bg,
                    widget = wibox.container.background,
                },

                { -- Taglist
                    {
                        {
                            layout = wibox.layout.align.horizontal,
                            s._taglist,
                        },
                        left = 3,
                        right = 8,
                        widget = wibox.container.margin,
                    },
                    bg = bar_bg,
                    widget = wibox.container.background,
                },

                vert_sep,

                { -- Prompt box
                    {
                        {
                            layout = wibox.layout.align.horizontal,
                            s._promptbox,
                        },
                        left = 6,
                        right = 6,
                        widget = wibox.container.margin,
                    },
                    bg = theme.prompt_bg,
                    widget = wibox.container.background,
                },

                vert_sep,
            },

            {
                layout = wibox.layout.flex.horizontal,
            },

            -- -- Middle widget
            -- { -- Tasklist
            --     {
            --         {
            --             layout = wibox.layout.flex.horizontal,
            --             s._tasklist,
            --         },
            --         left = 8,
            --         right = 0,
            --         widget = wibox.container.margin,
            --     },
            --     bg = bar_bg,
            --     widget = wibox.container.background,
            -- },

            { -- Right widgets
                layout = wibox.layout.fixed.horizontal,

                wibox.container.background(wibox.container.margin(systray_widget, 0, 8), bar_bg),

                vert_sep,
                wibox.container.background(wibox.container.margin(net_widget,     8, 10), bar_bg),

                vert_sep,
                wibox.container.background(wibox.container.margin(clock_widget,   8, 8),  bar_bg),
            },
        },
    }
end

return theme

{'repo_name': 'alfunx/.dotfiles', 'stars': '222', 'repo_language': 'Lua', 'file_name': 'dirvish.vim', 'mime_type': 'text/plain', 'hash': -5530368603434097362, 'source_dataset': 'data'}


/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
	"vscode.extension.contributes.themes": "Contributes textmate color themes.",
	"vscode.extension.contributes.themes.id": "ID del tema dell'icona usato nelle impostazioni utente.",
	"vscode.extension.contributes.themes.label": "Etichetta del tema colori visualizzata nell'interfaccia utente.",
	"vscode.extension.contributes.themes.uiTheme": "Tema di base che definisce i colori nell'editor: 'vs' è il tema colori chiaro, mentre 'vs-dark' è il tema colori scuro e 'hc-black' è il tema a contrasto elevato scuro.",
	"vscode.extension.contributes.themes.path": "Percorso del file tmTheme. È relativo alla cartella delle estensioni e corrisponde in genere a './themes/themeFile.tmTheme'.",
	"vscode.extension.contributes.iconThemes": "Contributes file icon themes.",
	"vscode.extension.contributes.iconThemes.id": "ID del tema dell'icona usato nelle impostazioni utente.",
	"vscode.extension.contributes.iconThemes.label": "Etichetta del tema dell'icona visualizzata nell'interfaccia utente.",
	"vscode.extension.contributes.iconThemes.path": "Percorso del file di definizione del tema dell'icona. È relativo alla cartella delle estensioni e corrisponde in genere a './icons/awesome-icon-theme.json'.",
	"migration.completed": "Sono state aggiunte nuove impostazioni tema alle impostazioni utente. Backup disponibile in {0}.",
	"error.cannotloadtheme": "Unable to load {0}: {1}",
	"reqarray": "Extension point `{0}` must be an array.",
	"reqpath": "È previsto un valore stringa in `contributes.{0}.path`. Valore specificato: {1}",
	"invalid.path.1": "Valore previsto di `contributes.{0}.path` ({1}) da includere nella cartella dell'estensione ({2}). L'estensione potrebbe non essere più portatile.",
	"reqid": "È previsto un valore stringa in `contributes.{0}.id`. Valore specificato: {1}",
	"error.cannotloadicontheme": "Unable to load {0}",
	"error.cannotparseicontheme": "Problems parsing file icons file: {0}",
	"colorTheme": "Specifies the color theme used in the workbench.",
	"colorThemeError": "Theme is unknown or not installed.",
	"iconTheme": "Specifies the icon theme used in the workbench.",
	"noIconThemeDesc": "No file icons",
	"iconThemeError": "File icon theme is unknown or not installed.",
	"workbenchColors": "Sostituisce i colori del tema colori attualmente selezionato.",
	"workbenchColors.deprecated": "L'impostazione non è più sperimentale ed è stata rinominata in 'workbench.colorCustomizations'",
	"workbenchColors.deprecatedDescription": "In alternativa, usare 'workbench.colorCustomizations'"
}

{'repo_name': 'TonyRobotics/RoboWare-Studio', 'stars': '173', 'repo_language': 'TypeScript', 'file_name': 'incrementDecrement.i18n.json', 'mime_type': 'text/plain', 'hash': 6574876278821096308, 'source_dataset': 'data'}


Bundle-Name: OpenEMS Edge Controller Ess Minimum Discharge Period
Bundle-Vendor: OpenEMS Association e.V.
Bundle-License: https://opensource.org/licenses/EPL-2.0
Bundle-Version: 1.0.0.${tstamp}

-buildpath: \
	${buildpath},\
	com.google.gson,\
	com.google.guava,\
	io.openems.common,\
	io.openems.edge.common,\
	io.openems.edge.controller.api,\
	io.openems.edge.ess.api;version=latest

-testpath: \
	${testpath}

{'repo_name': 'OpenEMS/openems', 'stars': '117', 'repo_language': 'Java', 'file_name': 'org.eclipse.core.resources.prefs', 'mime_type': 'text/plain', 'hash': -6301896277479641775, 'source_dataset': 'data'}


<?php
/**
 * Implement Custom Header functionality for Twenty Fourteen
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */

/**
 * Set up the WordPress core custom header settings.
 *
 * @since Twenty Fourteen 1.0
 *
 * @uses twentyfourteen_header_style()
 * @uses twentyfourteen_admin_header_style()
 * @uses twentyfourteen_admin_header_image()
 */
function twentyfourteen_custom_header_setup() {
	add_theme_support(
		'custom-header',
		/**
		 * Filters Twenty Fourteen custom-header support arguments.
		 *
		 * @since Twenty Fourteen 1.0
		 *
		 * @param array $args {
		 *     An array of custom-header support arguments.
		 *
		 *     @type bool   $header_text            Whether to display custom header text. Default false.
		 *     @type int    $width                  Width in pixels of the custom header image. Default 1260.
		 *     @type int    $height                 Height in pixels of the custom header image. Default 240.
		 *     @type bool   $flex_height            Whether to allow flexible-height header images. Default true.
		 *     @type string $admin_head_callback    Callback function used to style the image displayed in
		 *                                          the Appearance > Header screen.
		 *     @type string $admin_preview_callback Callback function used to create the custom header markup in
		 *                                          the Appearance > Header screen.
		 * }
		 */
		apply_filters(
			'twentyfourteen_custom_header_args',
			array(
				'default-text-color'     => 'fff',
				'width'                  => 1260,
				'height'                 => 240,
				'flex-height'            => true,
				'wp-head-callback'       => 'twentyfourteen_header_style',
				'admin-head-callback'    => 'twentyfourteen_admin_header_style',
				'admin-preview-callback' => 'twentyfourteen_admin_header_image',
			)
		)
	);
}
add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' );

if ( ! function_exists( 'twentyfourteen_header_style' ) ) :
	/**
	 * Styles the header image and text displayed on the blog
	 *
	 * @see twentyfourteen_custom_header_setup().
	 */
	function twentyfourteen_header_style() {
		$text_color = get_header_textcolor();

		// If no custom color for text is set, let's bail.
		if ( display_header_text() && get_theme_support( 'custom-header', 'default-text-color' ) === $text_color ) {
			return;
		}

		// If we get this far, we have custom styles.
		?>

		<?php
	}
endif; // twentyfourteen_header_style()

if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) :
	/**
	 * Style the header image displayed on the Appearance > Header screen.
	 *
	 * @see twentyfourteen_custom_header_setup()
	 *
	 * @since Twenty Fourteen 1.0
	 */
	function twentyfourteen_admin_header_style() {
		?>

		<?php
	}
endif; // twentyfourteen_admin_header_style()

if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) :
	/**
	 * Create the custom header image markup displayed on the Appearance > Header screen.
	 *
	 * @see twentyfourteen_custom_header_setup()
	 *
	 * @since Twenty Fourteen 1.0
	 */
	function twentyfourteen_admin_header_image() {
		?>

		<?php if ( get_header_image() ) : ?>
		<img src="<?php header_image(); ?>" alt="">
		<?php endif; ?>

<a id="name" style="<?php echo esc_attr( sprintf( 'color: #%s;', get_header_textcolor() ) ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?>

		<?php
	}
endif; // twentyfourteen_admin_header_image()

{'repo_name': 'WordPress/WordPress', 'stars': '14056', 'repo_language': 'PHP', 'file_name': 'media-widgets.js', 'mime_type': 'text/plain', 'hash': 8443796148096812555, 'source_dataset': 'data'}


// Python Tools for Visual Studio
// Copyright(c) Microsoft Corporation
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the License); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABILITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.

using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Microsoft.PythonTools.Analysis;
using Microsoft.PythonTools.Infrastructure;
using Microsoft.PythonTools.Interpreter;
using Microsoft.PythonTools.Logging;
using Microsoft.PythonTools.Project;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;

namespace Microsoft.PythonTools {
    class WorkspaceInfoBarManager : IVsRunningDocTableEvents, IDisposable {
        private readonly IServiceProvider _serviceProvider;
        private readonly IPythonWorkspaceContextProvider _pythonWorkspaceService;
        private readonly IVsRunningDocumentTable _docTable;

        private PackageInstallInfoBar _packageInstallInfoBar;
        private CondaEnvCreateInfoBar _condaEnvCreateInfoBar;
        private VirtualEnvCreateInfoBar _virtualEnvCreateInfoBar;
        private TestFrameworkWorkspaceInfoBar _testFrameworkInfoBar;
        private PythonNotSupportedInfoBar _pythonVersionNotSupportedInfoBar;
        private bool _infoBarCheckTriggered;

        public WorkspaceInfoBarManager(IServiceProvider serviceProvider) {
            _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
            _pythonWorkspaceService = serviceProvider.GetComponentModel().GetService<IPythonWorkspaceContextProvider>();
            _pythonWorkspaceService.WorkspaceInitialized += OnWorkspaceInitialized;
            _docTable = _serviceProvider.GetService(typeof(SVsRunningDocumentTable)) as IVsRunningDocumentTable;
        }

        public void Dispose() {
            _pythonWorkspaceService.WorkspaceInitialized -= OnWorkspaceInitialized;
        }

        private void OnWorkspaceInitialized(object sender, PythonWorkspaceContextEventArgs e) {
            var workspace = e.Workspace;
            _infoBarCheckTriggered = false;

            _packageInstallInfoBar = new PackageInstallWorkspaceInfoBar(_serviceProvider, workspace);
            _condaEnvCreateInfoBar = new CondaEnvCreateWorkspaceInfoBar(_serviceProvider, workspace);
            _virtualEnvCreateInfoBar = new VirtualEnvCreateWorkspaceInfoBar(_serviceProvider, workspace);
            _testFrameworkInfoBar = new TestFrameworkWorkspaceInfoBar(_serviceProvider, workspace);
            _pythonVersionNotSupportedInfoBar = new PythonNotSupportedInfoBar(_serviceProvider, InfoBarContexts.Workspace, () => workspace.CurrentFactory);

            workspace.AddActionOnClose(_packageInstallInfoBar, (obj => ((PythonInfoBar)obj).Dispose()));
            workspace.AddActionOnClose(_condaEnvCreateInfoBar, (obj => ((PythonInfoBar)obj).Dispose()));
            workspace.AddActionOnClose(_virtualEnvCreateInfoBar, (obj => ((PythonInfoBar)obj).Dispose()));
            workspace.AddActionOnClose(_testFrameworkInfoBar, (obj => ((PythonInfoBar)obj).Dispose()));
            workspace.AddActionOnClose(
                _pythonVersionNotSupportedInfoBar,
                 obj => { ((PythonInfoBar)obj).Dispose(); workspace.ActiveInterpreterChanged -= TriggerPythonNotSupportedInforBar; }
            );

            workspace.ActiveInterpreterChanged += TriggerPythonNotSupportedInforBar;

            // When we see a Python file opened in the workspace, we trigger info bar checks.
            // Python files may have already been opened by the time this runs, so we'll check
            // the already loaded files first. If there are no Python file that trigger info bar
            // checks, then we'll register to be notified when files are opened.
            if (ErrorHandler.Succeeded(_docTable.GetRunningDocumentsEnum(out var pEnumRdt))) {
                if (ErrorHandler.Succeeded(pEnumRdt.Reset())) {
                    uint[] cookie = new uint[1];
                    while (VSConstants.S_OK == pEnumRdt.Next(1, cookie, out _)) {
                        var docFilePath = GetDocumentFilePath(cookie[0]);
                        if (IsWorkspacePythonFile(docFilePath)) {
                            TriggerInfoBar();
                            break;
                        }
                    }
                }
            }

            if (!_infoBarCheckTriggered) {
                if (ErrorHandler.Succeeded(_docTable.AdviseRunningDocTableEvents(this, out uint eventCookie))) {
                    workspace.AddActionOnClose(_docTable, obj => _docTable.UnadviseRunningDocTableEvents(eventCookie));
                }
            }
        }

        private string GetDocumentFilePath(uint docCookie) {
            var hr = _docTable.GetDocumentInfo(
                docCookie,
                out _,
                out _,
                out _,
                out string docFilePath,
                out _,
                out _,
                out IntPtr ppunkDocData
            );

            if (ErrorHandler.Succeeded(hr)) {
                if (ppunkDocData != IntPtr.Zero) {
                    Marshal.Release(ppunkDocData);
                }

                return docFilePath;
            }

            return null;
        }

        private bool IsWorkspacePythonFile(string filePath) {
            return !string.IsNullOrEmpty(filePath) &&
                   PathUtils.IsValidPath(filePath) &&
                   File.Exists(filePath) &&
                   ModulePath.IsPythonSourceFile(filePath) &&
                   _pythonWorkspaceService.Workspace != null &&
                   PathUtils.IsSubpathOf(_pythonWorkspaceService.Workspace.Location, filePath);
        }

        private void TriggerInfoBar() {
            _infoBarCheckTriggered = true;
            TriggerInfoBarsAsync().HandleAllExceptions(_serviceProvider, typeof(WorkspaceInfoBarManager)).DoNotWait();
        }

        private async Task TriggerInfoBarsAsync() {
            await Task.WhenAll(
                _condaEnvCreateInfoBar.CheckAsync(),
                _virtualEnvCreateInfoBar.CheckAsync(),
                _packageInstallInfoBar.CheckAsync(),
                _testFrameworkInfoBar.CheckAsync(),
                _pythonVersionNotSupportedInfoBar.CheckAsync()
            );
        }

        private void TriggerPythonNotSupportedInforBar(object sender, EventArgs e) {
            TriggerPythonNotSupportedInforBarAsync().HandleAllExceptions(_serviceProvider, GetType()).DoNotWait();
        }

        private Task TriggerPythonNotSupportedInforBarAsync() {
            return _pythonVersionNotSupportedInfoBar.CheckAsync();
        }

        public int OnAfterFirstDocumentLock(uint docCookie, uint dwRDTLockType, uint dwReadLocksRemaining, uint dwEditLocksRemaining) {
            return VSConstants.S_OK;
        }

        public int OnBeforeLastDocumentUnlock(uint docCookie, uint dwRDTLockType, uint dwReadLocksRemaining, uint dwEditLocksRemaining) {
            return VSConstants.S_OK;
        }

        public int OnAfterSave(uint docCookie) {
            return VSConstants.S_OK;
        }

        public int OnAfterAttributeChange(uint docCookie, uint grfAttribs) {
            return VSConstants.S_OK;
        }

        public int OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame) {
            if (!_infoBarCheckTriggered && fFirstShow != 0) {
                if (IsWorkspacePythonFile(GetDocumentFilePath(docCookie))) {
                    TriggerInfoBar();
                }
            }

            return VSConstants.S_OK;
        }

        public int OnAfterDocumentWindowHide(uint docCookie, IVsWindowFrame pFrame) {
            return VSConstants.S_OK;
        }
    }
}

{'repo_name': 'microsoft/PTVS', 'stars': '2276', 'repo_language': 'C#', 'file_name': 'LaunchConditions.wxs', 'mime_type': 'text/xml', 'hash': 284256675065758610, 'source_dataset': 'data'}


/*
 * Copyright 2016-2020 Crown Copyright
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package uk.gov.gchq.gaffer.accumulostore.integration;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.rules.TemporaryFolder;

import uk.gov.gchq.gaffer.accumulostore.AccumuloProperties;
import uk.gov.gchq.gaffer.accumulostore.AccumuloStore;
import uk.gov.gchq.gaffer.accumulostore.MiniAccumuloClusterManager;
import uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsBetweenSets;
import uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsInRanges;
import uk.gov.gchq.gaffer.accumulostore.operation.impl.GetElementsWithinSet;
import uk.gov.gchq.gaffer.commonutil.CommonTestConstants;
import uk.gov.gchq.gaffer.commonutil.StreamUtil;
import uk.gov.gchq.gaffer.commonutil.pair.Pair;
import uk.gov.gchq.gaffer.data.element.Edge;
import uk.gov.gchq.gaffer.graph.Graph;
import uk.gov.gchq.gaffer.integration.graph.SchemaHidingIT;
import uk.gov.gchq.gaffer.operation.OperationException;
import uk.gov.gchq.gaffer.operation.data.EntitySeed;

import java.util.List;

public class AccumuloSchemaHidingIT extends SchemaHidingIT {
    private static final AccumuloProperties PROPERTIES = AccumuloProperties.loadStoreProperties(StreamUtil.openStream(AccumuloSchemaHidingIT.class, "miniAccumuloStore.properties"));
    private static MiniAccumuloClusterManager miniAccumuloClusterManager;

    @ClassRule
    public static TemporaryFolder storeBaseFolder = new TemporaryFolder(CommonTestConstants.TMP_DIRECTORY);

    @BeforeClass
    public static void setUpStore() {
        miniAccumuloClusterManager = new MiniAccumuloClusterManager(PROPERTIES, storeBaseFolder.getRoot().getAbsolutePath());
    }

    @AfterClass
    public static void tearDownStore() {
        miniAccumuloClusterManager.close();
    }

    public AccumuloSchemaHidingIT() {
        super(PROPERTIES);
    }

    @Override
    protected void cleanUp() {
        final AccumuloStore store;
        try {
            store = Class.forName(PROPERTIES.getStoreClass()).asSubclass(AccumuloStore.class).newInstance();
        } catch (final InstantiationException | IllegalAccessException | ClassNotFoundException e) {
            throw new IllegalArgumentException("Could not create store of type: " + PROPERTIES.getStoreClass(), e);
        }

        try {
            store.preInitialise(
                    "graphId",
                    createFullSchema(),
                    PROPERTIES
            );
            store.getConnection().tableOperations().delete(store.getTableName());
        } catch (final Exception e) {
            // ignore exceptions
        }
    }

    @Override
    protected void testOperations(final Graph fullGraph, final Graph filteredGraph, final List<Edge> fullExpectedResults, final List<Edge> filteredExpectedResults) throws OperationException {
        super.testOperations(fullGraph, filteredGraph, fullExpectedResults, filteredExpectedResults);

        final GetElementsInRanges getElementsInRange = new GetElementsInRanges.Builder()
                .input(new Pair<>(new EntitySeed("a"), new EntitySeed("z")))
                .build();
        testOperation(fullGraph, filteredGraph, getElementsInRange, fullExpectedResults, filteredExpectedResults);

        final GetElementsBetweenSets getElementsBetweenSets = new GetElementsBetweenSets.Builder()
                .input(new EntitySeed("source1a"),
                        new EntitySeed("source1b"),
                        new EntitySeed("source2"))
                .inputB(new EntitySeed("dest1a"),
                        new EntitySeed("dest1b"),
                        new EntitySeed("dest2"))
                .build();
        testOperation(fullGraph, filteredGraph, getElementsBetweenSets, fullExpectedResults, filteredExpectedResults);

        final GetElementsWithinSet getElementsWithinSet = new GetElementsWithinSet.Builder()
                .input(new EntitySeed("source1a"),
                        new EntitySeed("source1b"),
                        new EntitySeed("source2"),
                        new EntitySeed("dest1a"),
                        new EntitySeed("dest1b"),
                        new EntitySeed("dest2"))
                .build();
        testOperation(fullGraph, filteredGraph, getElementsWithinSet, fullExpectedResults, filteredExpectedResults);
    }
}

{'repo_name': 'gchq/Gaffer', 'stars': '1584', 'repo_language': 'Java', 'file_name': 'DomainObject.java', 'mime_type': 'text/x-java', 'hash': 8628515784146146471, 'source_dataset': 'data'}


# See utils/checkpackagelib/readme.txt before editing this file.
# The format of the patch files is tested during the build, so below check
# functions don't need to check for things already checked by running
# "make package-dirclean package-patch".

import os
import re

from checkpackagelib.base import _CheckFunction
from checkpackagelib.lib import NewlineAtEof           # noqa: F401

class ApplyOrder(_CheckFunction):
    APPLY_ORDER = re.compile("\d{1,4}-[^/]*$")

    def before(self):
        if not self.APPLY_ORDER.match(os.path.basename(self.filename)):
            return ["{}:0: use name <number>-<description>.patch "
                    "({}#_providing_patches)"
                    .format(self.filename, self.url_to_manual)]

class NumberedSubject(_CheckFunction):
    NUMBERED_PATCH = re.compile("Subject:\s*\[PATCH\s*\d+/\d+\]")

    def before(self):
        self.git_patch = False
        self.lineno = 0
        self.text = None

    def check_line(self, lineno, text):
        if text.startswith("diff --git"):
            self.git_patch = True
            return
        if self.NUMBERED_PATCH.search(text):
            self.lineno = lineno
            self.text = text

    def after(self):
        if self.git_patch and self.text:
            return ["{}:{}: generate your patches with 'git format-patch -N'"
                    .format(self.filename, self.lineno),
                    self.text]

class Sob(_CheckFunction):
    SOB_ENTRY = re.compile("^Signed-off-by: .*$")

    def before(self):
        self.found = False

    def check_line(self, lineno, text):
        if self.found:
            return
        if self.SOB_ENTRY.search(text):
            self.found = True

    def after(self):
        if not self.found:
            return ["{}:0: missing Signed-off-by in the header "
                    "({}#_format_and_licensing_of_the_package_patches)"
                    .format(self.filename, self.url_to_manual)]

{'repo_name': 'hi35xx/hi35xx-buildroot', 'stars': '109', 'repo_language': 'C', 'file_name': 'si_drv_common.c', 'mime_type': 'text/x-c', 'hash': 7636674030532061221, 'source_dataset': 'data'}


# Copyright 2016 The Rook Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# ====================================================================================
# Makefile helper functions for golang
#

ifeq ($(GO_PROJECT),)
$(error the variable GO_PROJECT must be set prior to including golang.mk)
endif

# These targets will be statically linked.
GO_STATIC_PACKAGES ?=

ifeq ($(GO_STATIC_PACKAGES),)
$(error please set GO_STATIC_PACKAGES prior to including golang.mk)
endif

# These are the static test packages
GO_STATIC_PACKAGES ?=

# Optional. These are subdirs that we look for all go files to test, vet, and fmt
GO_SUBDIRS ?= cmd pkg

# Optional. Additional subdirs used for integration or e2e testings
GO_INTEGRATION_TESTS_SUBDIRS ?= tests

# Optional directories (relative to CURDIR)
GO_PKG_DIR ?= $(WORK_DIR)/pkg

# Optional build flags passed to go tools
GO_BUILDFLAGS ?=
GO_LDFLAGS ?=
GO_TAGS ?=
GO_TEST_FLAGS ?=

# ====================================================================================
# Setup go environment

GO_SUPPORTED_VERSIONS ?= 1.13|1.14|1.15

GO_PACKAGES := $(foreach t,$(GO_SUBDIRS),$(GO_PROJECT)/$(t)/...)
GO_INTEGRATION_TEST_PACKAGES := $(foreach t,$(GO_INTEGRATION_TESTS_SUBDIRS),$(GO_PROJECT)/$(t)/integration)

ifneq ($(GO_TEST_SUITE),)
GO_TEST_FLAGS += -run '$(GO_TEST_SUITE)'
endif

ifneq ($(GO_TEST_FILTER),)
TEST_FILTER_PARAM := -testify.m '$(GO_TEST_FILTER)'
endif

GOPATH := $(shell go env GOPATH)

# setup tools used during the build
GOLINT := $(TOOLS_HOST_DIR)/golint
GOJUNIT := $(TOOLS_HOST_DIR)/go-junit-report

GO := go
GOHOST := GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go
GO_VERSION := $(shell $(GO) version | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p')

# we use a consistent version of gofmt even while running different go compilers.
# see https://github.com/golang/go/issues/26397 for more details
GOFMT_VERSION := 1.11
ifneq ($(findstring $(GOFMT_VERSION),$(GO_VERSION)),)
GOFMT := $(shell which gofmt)
else
GOFMT := $(TOOLS_HOST_DIR)/gofmt$(GOFMT_VERSION)
endif

GO_OUT_DIR := $(abspath $(OUTPUT_DIR)/bin/$(PLATFORM))
GO_TEST_OUTPUT := $(abspath $(OUTPUT_DIR)/tests/$(PLATFORM))

ifeq ($(GOOS),windows)
GO_OUT_EXT := .exe
endif

# NOTE: the install suffixes are matched with the build container to speed up the
# the build. Please keep them in sync.

# we run go build with -i which on most system's would want to install packages
# into the system's root dir. using our own pkg dir avoid thats
ifneq ($(GO_PKG_DIR),)
GO_PKG_BASE_DIR := $(abspath $(GO_PKG_DIR)/$(PLATFORM))
GO_PKG_STATIC_FLAGS := -pkgdir $(GO_PKG_BASE_DIR)_static
endif

GO_COMMON_FLAGS = $(GO_BUILDFLAGS) -tags '$(GO_TAGS)'
GO_STATIC_FLAGS = $(GO_COMMON_FLAGS) $(GO_PKG_STATIC_FLAGS) -installsuffix static  -ldflags '$(GO_LDFLAGS)'

# ====================================================================================
# Targets

ifeq ($(filter help clean distclean prune go.clean, $(MAKECMDGOALS)),)
.PHONY: go.check
go.check:
ifneq ($(shell $(GO) version | grep -q -E '\bgo($(GO_SUPPORTED_VERSIONS))\b' && echo 0 || echo 1), 0)
	$(error unsupported go version. Please make install one of the following supported version: '$(GO_SUPPORTED_VERSIONS)')
endif

-include go.check
endif

.PHONY: go.init
go.init:
	@:

.PHONY: go.build
go.build:
	@echo === go build $(PLATFORM)
	$(foreach p,$(GO_STATIC_PACKAGES),@CGO_ENABLED=0 $(GO) build -v -i -o $(GO_OUT_DIR)/$(lastword $(subst /, ,$(p)))$(GO_OUT_EXT) $(GO_STATIC_FLAGS) $(p)${\n})
	$(foreach p,$(GO_TEST_PACKAGES),@CGO_ENABLED=0 $(GO) test -v -i -c -o $(GO_TEST_OUTPUT)/$(lastword $(subst /, ,$(p)))$(GO_OUT_EXT) $(GO_STATIC_FLAGS) $(p)${\n})

.PHONY: go.install
go.install:
	@echo === go install $(PLATFORM)
	$(foreach p,$(GO_STATIC_PACKAGES),@CGO_ENABLED=0 $(GO) install -v $(GO_STATIC_FLAGS) $(p)${\n})

.PHONY: go.test.unit
go.test.unit: $(GOJUNIT)
	@echo === go test unit-tests
	@mkdir -p $(GO_TEST_OUTPUT)
	CGO_ENABLED=0 $(GOHOST) test -v -i -cover $(GO_STATIC_FLAGS) $(GO_PACKAGES)
	CGO_ENABLED=0 $(GOHOST) test -v -cover $(GO_TEST_FLAGS) $(GO_STATIC_FLAGS) $(GO_PACKAGES) 2>&1 | tee $(GO_TEST_OUTPUT)/unit-tests.log
	@cat $(GO_TEST_OUTPUT)/unit-tests.log | $(GOJUNIT) -set-exit-code > $(GO_TEST_OUTPUT)/unit-tests.xml

.PHONY:
go.test.integration: $(GOJUNIT)
	@echo === go test integration-tests
	@mkdir -p $(GO_TEST_OUTPUT)
	CGO_ENABLED=0 $(GOHOST) test -v -i $(GO_STATIC_FLAGS) $(GO_INTEGRATION_TEST_PACKAGES)
	CGO_ENABLED=0 $(GOHOST) test -v -timeout 7200s $(GO_TEST_FLAGS) $(GO_STATIC_FLAGS) $(GO_INTEGRATION_TEST_PACKAGES) $(TEST_FILTER_PARAM) 2>&1 | tee $(GO_TEST_OUTPUT)/integration-tests.log
	@cat $(GO_TEST_OUTPUT)/integration-tests.log | $(GOJUNIT) -set-exit-code > $(GO_TEST_OUTPUT)/integration-tests.xml

.PHONY: go.lint
go.lint: $(GOLINT)
	@echo === go lint
	@$(GOLINT) -set_exit_status=true $(GO_PACKAGES) $(GO_INTEGRATION_TEST_PACKAGES)

.PHONY: go.vet
go.vet:
	@echo === go vet
	@CGO_ENABLED=0 $(GOHOST) vet $(GO_COMMON_FLAGS) $(GO_PACKAGES) $(GO_INTEGRATION_TEST_PACKAGES)

.PHONY: go.fmt
go.fmt: $(GOFMT)
	@gofmt_out=$$($(GOFMT) -s -d -e $(GO_SUBDIRS) $(GO_INTEGRATION_TESTS_SUBDIRS) 2>&1) && [ -z "$${gofmt_out}" ] || (echo "$${gofmt_out}" 1>&2; exit 1)

go.validate: go.vet go.fmt

.PHONY: go.mod.update
go.mod.update:
	@echo === updating modules
	@$(GOHOST) get -u ./...

.PHONY: go.mod.check
go.mod.check:
	@echo === ensuring modules are tidied
	@$(GOHOST) mod tidy

.PHONY: go.mod.clean
go.mod.clean:
	@echo === cleaning modules cache
	@sudo rm -fr $(WORK_DIR)/cross_pkg
	@$(GOHOST) clean -modcache

$(GOLINT):
	@echo === installing golint
	@mkdir -p $(TOOLS_HOST_DIR)/tmp
	@GOPATH=$(TOOLS_HOST_DIR)/tmp GOBIN=$(TOOLS_HOST_DIR) $(GOHOST) get github.com/golang/lint/golint
	@rm -fr $(TOOLS_HOST_DIR)/tmp

$(GOFMT):
	@echo === installing gofmt$(GOFMT_VERSION)
	@mkdir -p $(TOOLS_HOST_DIR)/tmp
	@curl -sL https://dl.google.com/go/go$(GOFMT_VERSION).$(GOHOSTOS)-$(GOHOSTARCH).tar.gz | tar -xz -C $(TOOLS_HOST_DIR)/tmp
	@mv $(TOOLS_HOST_DIR)/tmp/go/bin/gofmt $(GOFMT)
	@rm -fr $(TOOLS_HOST_DIR)/tmp

$(GOJUNIT):
	@echo === installing go-junit-report
	@mkdir -p $(TOOLS_HOST_DIR)/tmp
	@GOPATH=$(TOOLS_HOST_DIR)/tmp GOBIN=$(TOOLS_HOST_DIR) $(GOHOST) get github.com/jstemmer/go-junit-report
	@$(GOHOST) clean -modcache

{'repo_name': 'rook/rook', 'stars': '7383', 'repo_language': 'Go', 'file_name': 'cluster-creation.md', 'mime_type': 'text/plain', 'hash': 38351117117329083, 'source_dataset': 'data'}


/**
 * Copyright 2014-2015, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @providesModule LocalEventTrapMixin
 */

'use strict';

var ReactBrowserEventEmitter = require('ReactBrowserEventEmitter');

var accumulateInto = require('accumulateInto');
var forEachAccumulated = require('forEachAccumulated');
var invariant = require('invariant');

function remove(event) {
  event.remove();
}

var LocalEventTrapMixin = {
  trapBubbledEvent(topLevelType, handlerBaseName) {
    invariant(this.isMounted(), 'Must be mounted to trap events');
    // If a component renders to null or if another component fatals and causes
    // the state of the tree to be corrupted, `node` here can be null.
    var node = this.getDOMNode();
    invariant(
      node,
      'LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered.'
    );
    var listener = ReactBrowserEventEmitter.trapBubbledEvent(
      topLevelType,
      handlerBaseName,
      node
    );
    this._localEventListeners =
      accumulateInto(this._localEventListeners, listener);
  },

  // trapCapturedEvent would look nearly identical. We don't implement that
  // method because it isn't currently needed.

  componentWillUnmount() {
    if (this._localEventListeners) {
      forEachAccumulated(this._localEventListeners, remove);
    }
  }
};

module.exports = LocalEventTrapMixin;

{'repo_name': 'mjibson/moggio', 'stars': '350', 'repo_language': 'JavaScript', 'file_name': 'fetch.js', 'mime_type': 'text/plain', 'hash': 2220545996008631015, 'source_dataset': 'data'}


// { dg-do compile }

// 2007-03-03  Paolo Carlini  <pcarlini@suse.de>
//
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.

#include <sstream>

class MyClass
{
  double x;

public:
  MyClass(double X) : x(X) {}
  friend bool operator&&(int i, const MyClass& Z);
};

inline bool
operator&&(int i, const MyClass& Z)
{ return int(Z.x) == i; }

// libstdc++/31031
void test01()
{
  int k =3;
  MyClass X(3.1);
  std::wostringstream oss;

  oss << (k && X);
}

int main()
{
  test01();
  return 0;
}

{'repo_name': 'gcc-mirror/gcc', 'stars': '3986', 'repo_language': 'C', 'file_name': 'epiphany.opt', 'mime_type': 'text/plain', 'hash': 4339536796789613305, 'source_dataset': 'data'}


from collections import namedtuple
from typing import NamedTuple, Optional, Sequence

class TopicPartition(NamedTuple):
    topic: str
    partition: int

class BrokerMetadata(NamedTuple):
    nodeId: int
    host: str
    port: int
    rack: str

class PartitionMetadata(NamedTuple):
    topic: str
    partition: int
    leader: int
    replicas: Sequence[int]
    isr: Sequence[int]
    error: int

class OffsetAndMetadata(NamedTuple):
    offset: int
    metadata: str

class OffsetAndTimestamp(NamedTuple):
    offset: int
    timestamp: Optional[int]  # Only None if used with old broker version

# Deprecated part
RetryOptions = namedtuple('RetryOptions', ['limit', 'backoff_ms', 'retry_on_timeouts'])

{'repo_name': 'aio-libs/aiokafka', 'stars': '458', 'repo_language': 'Python', 'file_name': 'new_topic.pyi', 'mime_type': 'text/x-python', 'hash': 1697688408531887407, 'source_dataset': 'data'}


#!/usr/bin/perl
# Takes a mesh and creates an obj file
# Does not deal with any info on vertices, faces, or edges.

use strict;

binmode(STDOUT);

my $gid;

while (<>) {
  if (/^\#/) { print; next; }
  if (/^Vertex /) {
    my ($n,$x,$y,$z,$info)=/^Vertex (\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(\{.*\})?\s*$/ or die "?";
    die "not renumbered?" unless $n=++$gid;
    printf("v %g %g %g\n",$x,$y,$z);
    # $mvv{$n}=$vnum++;
    next;
  }
  if (/^Face /) {
    my ($verts,$info)=/^Face \d+\s+(\d[\d\s]*\d)\s*(\{.*\})?\s*$/ or die "?";
    # warn "verts='$verts' info='$info'\n";
    my @verts=split(' ',$verts);
    print "f";
    for (@verts) { printf(" %d",$_); } # $mvv{$_}
    print "\n";
    next;
  }
}

{'repo_name': 'hhoppe/Mesh-processing-library', 'stars': '322', 'repo_language': 'C++', 'file_name': 'FilterPM.vcxproj', 'mime_type': 'text/xml', 'hash': -126139366331100550, 'source_dataset': 'data'}


/*
 * LiquidBounce Hacked Client
 * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
 * https://github.com/CCBlueX/LiquidBounce/
 */

package net.ccbluex.liquidbounce.injection.backend

import net.ccbluex.liquidbounce.api.minecraft.network.play.client.ICPacketChatMessage
import net.minecraft.network.play.client.CPacketChatMessage

class CPacketChatMessageImpl<T : CPacketChatMessage>(wrapped: T) : PacketImpl<T>(wrapped), ICPacketChatMessage {
    override var message: String
        get() = wrapped.message
        set(value) {
            wrapped.message = value
        }
}

inline fun ICPacketChatMessage.unwrap(): CPacketChatMessage = (this as CPacketChatMessageImpl<*>).wrapped
inline fun CPacketChatMessage.wrap(): ICPacketChatMessage = CPacketChatMessageImpl(this)

{'repo_name': 'CCBlueX/LiquidBounce', 'stars': '163', 'repo_language': 'Java', 'file_name': 'OutlineUtils.java', 'mime_type': 'text/x-java', 'hash': -6129039211573418166, 'source_dataset': 'data'}


// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <array>
#include <atomic>
#include <cstddef>
#include <map>
#include <memory>
#include <optional>
#include <tuple>
#include <utility>

#include <glad/glad.h>

#include "common/common_types.h"
#include "video_core/engines/const_buffer_info.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/rasterizer_accelerated.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/renderer_opengl/gl_buffer_cache.h"
#include "video_core/renderer_opengl/gl_device.h"
#include "video_core/renderer_opengl/gl_fence_manager.h"
#include "video_core/renderer_opengl/gl_framebuffer_cache.h"
#include "video_core/renderer_opengl/gl_query_cache.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/renderer_opengl/gl_sampler_cache.h"
#include "video_core/renderer_opengl/gl_shader_cache.h"
#include "video_core/renderer_opengl/gl_shader_decompiler.h"
#include "video_core/renderer_opengl/gl_shader_manager.h"
#include "video_core/renderer_opengl/gl_state_tracker.h"
#include "video_core/renderer_opengl/gl_texture_cache.h"
#include "video_core/renderer_opengl/utils.h"
#include "video_core/shader/async_shaders.h"
#include "video_core/textures/texture.h"

namespace Core::Memory {
class Memory;
}

namespace Core::Frontend {
class EmuWindow;
}

namespace Tegra {
class MemoryManager;
}

namespace OpenGL {

struct ScreenInfo;
struct DrawParameters;

class RasterizerOpenGL : public VideoCore::RasterizerAccelerated {
public:
    explicit RasterizerOpenGL(Core::Frontend::EmuWindow& emu_window, Tegra::GPU& gpu,
                              Core::Memory::Memory& cpu_memory, const Device& device,
                              ScreenInfo& screen_info, ProgramManager& program_manager,
                              StateTracker& state_tracker);
    ~RasterizerOpenGL() override;

    void Draw(bool is_indexed, bool is_instanced) override;
    void Clear() override;
    void DispatchCompute(GPUVAddr code_addr) override;
    void ResetCounter(VideoCore::QueryType type) override;
    void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) override;
    void FlushAll() override;
    void FlushRegion(VAddr addr, u64 size) override;
    bool MustFlushRegion(VAddr addr, u64 size) override;
    void InvalidateRegion(VAddr addr, u64 size) override;
    void OnCPUWrite(VAddr addr, u64 size) override;
    void SyncGuestHost() override;
    void SignalSemaphore(GPUVAddr addr, u32 value) override;
    void SignalSyncPoint(u32 value) override;
    void ReleaseFences() override;
    void FlushAndInvalidateRegion(VAddr addr, u64 size) override;
    void WaitForIdle() override;
    void FlushCommands() override;
    void TickFrame() override;
    bool AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src,
                               const Tegra::Engines::Fermi2D::Regs::Surface& dst,
                               const Tegra::Engines::Fermi2D::Config& copy_config) override;
    bool AccelerateDisplay(const Tegra::FramebufferConfig& config, VAddr framebuffer_addr,
                           u32 pixel_stride) override;
    void LoadDiskResources(u64 title_id, const std::atomic_bool& stop_loading,
                           const VideoCore::DiskResourceLoadCallback& callback) override;

    /// Returns true when there are commands queued to the OpenGL server.
    bool AnyCommandQueued() const {
        return num_queued_commands > 0;
    }

    VideoCommon::Shader::AsyncShaders& GetAsyncShaders() {
        return async_shaders;
    }

    const VideoCommon::Shader::AsyncShaders& GetAsyncShaders() const {
        return async_shaders;
    }

private:
    /// Configures the color and depth framebuffer states.
    void ConfigureFramebuffers();

    /// Configures the color and depth framebuffer for clearing.
    void ConfigureClearFramebuffer(bool using_color, bool using_depth_stencil);

    /// Configures the current constbuffers to use for the draw command.
    void SetupDrawConstBuffers(std::size_t stage_index, Shader* shader);

    /// Configures the current constbuffers to use for the kernel invocation.
    void SetupComputeConstBuffers(Shader* kernel);

    /// Configures a constant buffer.
    void SetupConstBuffer(GLenum stage, u32 binding, const Tegra::Engines::ConstBufferInfo& buffer,
                          const ConstBufferEntry& entry, bool use_unified,
                          std::size_t unified_offset);

    /// Configures the current global memory entries to use for the draw command.
    void SetupDrawGlobalMemory(std::size_t stage_index, Shader* shader);

    /// Configures the current global memory entries to use for the kernel invocation.
    void SetupComputeGlobalMemory(Shader* kernel);

    /// Configures a global memory buffer.
    void SetupGlobalMemory(u32 binding, const GlobalMemoryEntry& entry, GPUVAddr gpu_addr,
                           std::size_t size, GLuint64EXT* pointer);

    /// Configures the current textures to use for the draw command.
    void SetupDrawTextures(std::size_t stage_index, Shader* shader);

    /// Configures the textures used in a compute shader.
    void SetupComputeTextures(Shader* kernel);

    /// Configures a texture.
    void SetupTexture(u32 binding, const Tegra::Texture::FullTextureInfo& texture,
                      const SamplerEntry& entry);

    /// Configures images in a graphics shader.
    void SetupDrawImages(std::size_t stage_index, Shader* shader);

    /// Configures images in a compute shader.
    void SetupComputeImages(Shader* shader);

    /// Configures an image.
    void SetupImage(u32 binding, const Tegra::Texture::TICEntry& tic, const ImageEntry& entry);

    /// Syncs the viewport and depth range to match the guest state
    void SyncViewport();

    /// Syncs the depth clamp state
    void SyncDepthClamp();

    /// Syncs the clip enabled status to match the guest state
    void SyncClipEnabled(u32 clip_mask);

    /// Syncs the clip coefficients to match the guest state
    void SyncClipCoef();

    /// Syncs the cull mode to match the guest state
    void SyncCullMode();

    /// Syncs the primitve restart to match the guest state
    void SyncPrimitiveRestart();

    /// Syncs the depth test state to match the guest state
    void SyncDepthTestState();

    /// Syncs the stencil test state to match the guest state
    void SyncStencilTestState();

    /// Syncs the blend state to match the guest state
    void SyncBlendState();

    /// Syncs the LogicOp state to match the guest state
    void SyncLogicOpState();

    /// Syncs the the color clamp state
    void SyncFragmentColorClampState();

    /// Syncs the alpha coverage and alpha to one
    void SyncMultiSampleState();

    /// Syncs the scissor test state to match the guest state
    void SyncScissorTest();

    /// Syncs the point state to match the guest state
    void SyncPointState();

    /// Syncs the line state to match the guest state
    void SyncLineState();

    /// Syncs the rasterizer enable state to match the guest state
    void SyncRasterizeEnable();

    /// Syncs polygon modes to match the guest state
    void SyncPolygonModes();

    /// Syncs Color Mask
    void SyncColorMask();

    /// Syncs the polygon offsets
    void SyncPolygonOffset();

    /// Syncs the alpha test state to match the guest state
    void SyncAlphaTest();

    /// Syncs the framebuffer sRGB state to match the guest state
    void SyncFramebufferSRGB();

    /// Syncs transform feedback state to match guest state
    /// @note Only valid on assembly shaders
    void SyncTransformFeedback();

    /// Begin a transform feedback
    void BeginTransformFeedback(GLenum primitive_mode);

    /// End a transform feedback
    void EndTransformFeedback();

    /// Check for extension that are not strictly required but are needed for correct emulation
    void CheckExtensions();

    std::size_t CalculateVertexArraysSize() const;

    std::size_t CalculateIndexBufferSize() const;

    /// Updates the current vertex format
    void SetupVertexFormat();

    void SetupVertexBuffer();
    void SetupVertexInstances();

    GLintptr SetupIndexBuffer();

    void SetupShaders(GLenum primitive_mode);

    Tegra::GPU& gpu;
    Tegra::Engines::Maxwell3D& maxwell3d;
    Tegra::Engines::KeplerCompute& kepler_compute;
    Tegra::MemoryManager& gpu_memory;

    const Device& device;
    ScreenInfo& screen_info;
    ProgramManager& program_manager;
    StateTracker& state_tracker;

    TextureCacheOpenGL texture_cache;
    ShaderCacheOpenGL shader_cache;
    SamplerCacheOpenGL sampler_cache;
    FramebufferCacheOpenGL framebuffer_cache;
    QueryCache query_cache;
    OGLBufferCache buffer_cache;
    FenceManagerOpenGL fence_manager;

    VideoCommon::Shader::AsyncShaders async_shaders;

    static constexpr std::size_t STREAM_BUFFER_SIZE = 128 * 1024 * 1024;

    GLint vertex_binding = 0;

    std::array<OGLBuffer, Tegra::Engines::Maxwell3D::Regs::NumTransformFeedbackBuffers>
        transform_feedback_buffers;
    std::bitset<Tegra::Engines::Maxwell3D::Regs::NumTransformFeedbackBuffers>
        enabled_transform_feedback_buffers;

    static constexpr std::size_t NUM_CONSTANT_BUFFERS =
        Tegra::Engines::Maxwell3D::Regs::MaxConstBuffers *
        Tegra::Engines::Maxwell3D::Regs::MaxShaderProgram;
    std::array<GLuint, NUM_CONSTANT_BUFFERS> staging_cbufs{};
    std::size_t current_cbuf = 0;
    OGLBuffer unified_uniform_buffer;

    /// Number of commands queued to the OpenGL driver. Reseted on flush.
    std::size_t num_queued_commands = 0;

    u32 last_clip_distance_mask = 0;
};

} // namespace OpenGL

{'repo_name': 'yuzu-emu/yuzu-canary', 'stars': '261', 'repo_language': 'C++', 'file_name': 'LUrlParser.cpp', 'mime_type': 'text/x-c', 'hash': 7434704188074085917, 'source_dataset': 'data'}