/*
 * OHCI HCD (Host Controller Driver) for USB.
 *
 * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
 * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
 * (C) Copyright 2002 Hewlett-Packard Company
 * (C) Copyright 2006 Sylvain Munaut <tnt@246tNt.com>
 *
 * Bus glue for OHCI HC on the of_platform bus
 *
 * Modified for of_platform bus from ohci-sa1111.c
 *
 * This file is licenced under the GPL.
 */

#include <linux/signal.h>

#include <asm/of_platform.h>
#include <asm/prom.h>

static int __devinit
ohci_ppc_of_start(struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
	int		ret;

	if ((ret = ohci_init(ohci)) < 0)
		return ret;

	if ((ret = ohci_run(ohci)) < 0) {
		err("can't start %s", ohci_to_hcd(ohci)->self.bus_name);
		ohci_stop(hcd);
		return ret;
	}

	return 0;
}

static const struct hc_driver ohci_ppc_of_hc_driver = {
	.description =		hcd_name,
	.product_desc =		"OF OHCI",
	.hcd_priv_size =	sizeof(struct ohci_hcd),

	/*
	 * generic hardware linkage
	 */
	.irq =			ohci_irq,
	.flags =		HCD_USB11 | HCD_MEMORY,

	/*
	 * basic lifecycle operations
	 */
	.start =		ohci_ppc_of_start,
	.stop =			ohci_stop,
	.shutdown = 		ohci_shutdown,

	/*
	 * managing i/o requests and associated device resources
	 */
	.urb_enqueue =		ohci_urb_enqueue,
	.urb_dequeue =		ohci_urb_dequeue,
	.endpoint_disable =	ohci_endpoint_disable,

	/*
	 * scheduling support
	 */
	.get_frame_number =	ohci_get_frame,

	/*
	 * root hub support
	 */
	.hub_status_data =	ohci_hub_status_data,
	.hub_control =		ohci_hub_control,
	.hub_irq_enable =	ohci_rhsc_enable,
#ifdef	CONFIG_PM
	.bus_suspend =		ohci_bus_suspend,
	.bus_resume =		ohci_bus_resume,
#endif
	.start_port_reset =	ohci_start_port_reset,
};

static int __devinit
ohci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
{
	struct device_node *dn = op->node;
	struct usb_hcd *hcd;
	struct ohci_hcd	*ohci;
	struct resource res;
	int irq;

	int rv;
	int is_bigendian;

	if (usb_disabled())
		return -ENODEV;

	is_bigendian =
		of_device_is_compatible(dn, "ohci-bigendian") ||
		of_device_is_compatible(dn, "ohci-be");

	dev_dbg(&op->dev, "initializing PPC-OF USB Controller\n");

	rv = of_address_to_resource(dn, 0, &res);
	if (rv)
		return rv;

	hcd = usb_create_hcd(&ohci_ppc_of_hc_driver, &op->dev, "PPC-OF USB");
	if (!hcd)
		return -ENOMEM;

	hcd->rsrc_start = res.start;
	hcd->rsrc_len = res.end - res.start + 1;

	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
		printk(KERN_ERR __FILE__ ": request_mem_region failed\n");
		rv = -EBUSY;
		goto err_rmr;
	}

	irq = irq_of_parse_and_map(dn, 0);
	if (irq == NO_IRQ) {
		printk(KERN_ERR __FILE__ ": irq_of_parse_and_map failed\n");
		rv = -EBUSY;
		goto err_irq;
	}

	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
	if (!hcd->regs) {
		printk(KERN_ERR __FILE__ ": ioremap failed\n");
		rv = -ENOMEM;
		goto err_ioremap;
	}

	ohci = hcd_to_ohci(hcd);
	if (is_bigendian)
		ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC;

	ohci_hcd_init(ohci);

	rv = usb_add_hcd(hcd, irq, IRQF_DISABLED);
	if (rv == 0)
		return 0;

	iounmap(hcd->regs);
err_ioremap:
	irq_dispose_mapping(irq);
err_irq:
	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
err_rmr:
 	usb_put_hcd(hcd);

	return rv;
}

static int ohci_hcd_ppc_of_remove(struct of_device *op)
{
	struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
	dev_set_drvdata(&op->dev, NULL);

	dev_dbg(&op->dev, "stopping PPC-OF USB Controller\n");

	usb_remove_hcd(hcd);

	iounmap(hcd->regs);
	irq_dispose_mapping(hcd->irq);
	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);

	usb_put_hcd(hcd);

	return 0;
}

static int ohci_hcd_ppc_of_shutdown(struct of_device *op)
{
	struct usb_hcd *hcd = dev_get_drvdata(&op->dev);

        if (hcd->driver->shutdown)
                hcd->driver->shutdown(hcd);

	return 0;
}

static struct of_device_id ohci_hcd_ppc_of_match[] = {
#ifdef CONFIG_USB_OHCI_HCD_PPC_OF_BE
	{
		.name = "usb",
		.compatible = "ohci-bigendian",
	},
	{
		.name = "usb",
		.compatible = "ohci-be",
	},
#endif
#ifdef CONFIG_USB_OHCI_HCD_PPC_OF_LE
	{
		.name = "usb",
		.compatible = "ohci-littledian",
	},
	{
		.name = "usb",
		.compatible = "ohci-le",
	},
#endif
	{},
};
MODULE_DEVICE_TABLE(of, ohci_hcd_ppc_of_match);

#if	!defined(CONFIG_USB_OHCI_HCD_PPC_OF_BE) && \
	!defined(CONFIG_USB_OHCI_HCD_PPC_OF_LE)
#error "No endianess selected for ppc-of-ohci"
#endif

static struct of_platform_driver ohci_hcd_ppc_of_driver = {
	.name		= "ppc-of-ohci",
	.match_table	= ohci_hcd_ppc_of_match,
	.probe		= ohci_hcd_ppc_of_probe,
	.remove		= ohci_hcd_ppc_of_remove,
	.shutdown 	= ohci_hcd_ppc_of_shutdown,
#ifdef CONFIG_PM
	/*.suspend	= ohci_hcd_ppc_soc_drv_suspend,*/
	/*.resume	= ohci_hcd_ppc_soc_drv_resume,*/
#endif
	.driver		= {
		.name	= "ppc-of-ohci",
		.owner	= THIS_MODULE,
	},
};

{'repo_name': 'wl500g/wl500g', 'stars': '129', 'repo_language': 'C', 'file_name': 'xirc2ps_cs.c', 'mime_type': 'text/x-c', 'hash': 325856669507116024, 'source_dataset': 'data'}


# Publicly visible junit extensions for Android

licenses(["notice"])  # Apache License 2.0

android_library(
    name = "junit",
    visibility = ["//visibility:public"],
    exports = ["//ext/junit/java/androidx/test/ext/junit"],
)

{'repo_name': 'android/android-test', 'stars': '738', 'repo_language': 'Java', 'file_name': 'ActivityScenario.kt', 'mime_type': 'text/plain', 'hash': -2396999877339980302, 'source_dataset': 'data'}


# cra-template for UI5 Web Components for React

### Usage
```shell script
npx create-react-app my-app --template @ui5/cra-template-webcomponents-react

# or if you prefer to use yarn

yarn create react-app my-app --template @ui5/cra-template-webcomponents-react
```

For more information, please refer to:

- [Getting Started](https://create-react-app.dev/docs/getting-started) – How to create a new app.
- [User Guide](https://create-react-app.dev) – How to develop apps bootstrapped with Create React App.
- [UI5 Web Components for React Github Project](https://github.com/SAP/ui5-webcomponents-react)
- [UI5 Web Components for React Documentation](https://sap.github.io/ui5-webcomponents-react/)

{'repo_name': 'SAP/ui5-webcomponents-react', 'stars': '169', 'repo_language': 'TypeScript', 'file_name': 'content-loader-serializer.js', 'mime_type': 'text/plain', 'hash': 8194451915343113718, 'source_dataset': 'data'}


// Copyright (C) 2007  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.

#include <sstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <dlib/string.h>

#include "tester.h"

namespace
{
    using namespace test;
    using namespace dlib;
    using namespace std;

    logger dlog("test.string");

    void string_test (
    )
    /*!
        ensures
            - runs tests on string functions for compliance with the specs
    !*/
    {

        print_spinner();

        string a = "  davis  ";
        string A = "  DAVIS  ";
        string empty = "    ";

        dlog << LTRACE << 1;

        double dval;
        int ival;
        bool bval;

        DLIB_TEST_MSG(string_cast<int>("5") == 5,string_cast<int>("5"));
        DLIB_TEST_MSG(string_cast<int>("0x5") == 5,string_cast<int>("0x5"));
        DLIB_TEST_MSG(string_cast<int>("0xA") == 10,string_cast<int>("0xA"));
        DLIB_TEST(string_cast<float>("0.5") == 0.5);
        DLIB_TEST((dval = sa ="0.5") == 0.5);
        DLIB_TEST(string_cast<std::string>("0.5 !") == "0.5 !");
        DLIB_TEST(string_cast<bool>("true") == true);
        DLIB_TEST((bval = sa = "true") == true);
        DLIB_TEST(string_cast<bool>("false") == false);
        DLIB_TEST(string_cast<bool>("TRUE") == true);
        DLIB_TEST(string_cast<bool>("FALSE") == false);
        DLIB_TEST((bval = sa = "FALSE") == false);

        dlog << LTRACE << 2;

        DLIB_TEST_MSG(string_cast<int>(L"5") == 5,string_cast<int>("5"));
        DLIB_TEST_MSG((ival = sa = L"5") == 5,string_cast<int>("5"));
        dlog << LTRACE << 2.1;
        DLIB_TEST_MSG(string_cast<int>(L"0x5") == 5,string_cast<int>("0x5"));
        DLIB_TEST_MSG(string_cast<int>(L"0xA") == 10,string_cast<int>("0xA"));
        DLIB_TEST(string_cast<float>(L"0.5") == 0.5);
        DLIB_TEST(string_cast<std::string>(L"0.5 !") == "0.5 !");
        DLIB_TEST(string_cast<bool>(L"true") == true);
        DLIB_TEST(string_cast<bool>(L"false") == false);
        DLIB_TEST(string_cast<bool>(L"TRUE") == true);
        DLIB_TEST((bval = sa = L"TRUE") == true);
        DLIB_TEST(string_cast<bool>(L"FALSE") == false);

        dlog << LTRACE << 3;

        DLIB_TEST(cast_to_string(5) == "5");
        DLIB_TEST(cast_to_string(5.5) == "5.5");

        dlog << LTRACE << 4;
        DLIB_TEST(cast_to_wstring(5) == L"5");
        DLIB_TEST(cast_to_wstring(5.5) == L"5.5");
        dlog << LTRACE << 5;
        DLIB_TEST(toupper(a) == A);
        DLIB_TEST(toupper(A) == A);
        DLIB_TEST(tolower(a) == a);
        DLIB_TEST(tolower(A) == a);
        DLIB_TEST(trim(a) == "davis");
        DLIB_TEST(ltrim(a) == "davis  ");
        DLIB_TEST(rtrim(a) == "  davis");
        DLIB_TEST(trim(string_cast<wstring>(a)) == L"davis");
        DLIB_TEST(ltrim(string_cast<wstring>(a)) == L"davis  ");
        DLIB_TEST(rtrim(string_cast<wstring>(a)) == L"  davis");
        DLIB_TEST(trim(a, " ") == "davis");
        DLIB_TEST(ltrim(a, " ") == "davis  ");
        DLIB_TEST(rtrim(a, " ") == "  davis");
        DLIB_TEST(trim(empty) == "");
        DLIB_TEST(ltrim(empty) == "");
        DLIB_TEST(rtrim(empty) == "");
        DLIB_TEST(trim(string_cast<wstring>(empty)) == L"");
        DLIB_TEST(ltrim(string_cast<wstring>(empty)) == L"");
        DLIB_TEST(rtrim(string_cast<wstring>(empty)) == L"");
        DLIB_TEST(trim(empty, " ") == "");
        DLIB_TEST(ltrim(empty, " ") == "");
        DLIB_TEST(rtrim(empty, " ") == "");

        dlog << LTRACE << 6;
        DLIB_TEST( (lpad(wstring(L"davis"), 10) == L"     davis"));
        DLIB_TEST( (rpad(wstring(L"davis"), 10) == L"davis     "));
        DLIB_TEST( (pad(wstring(L"davis"), 10) ==  L"  davis   "));

        DLIB_TEST( (lpad(string("davis"), -10) == "davis"));
        DLIB_TEST( (rpad(string("davis"), -10) == "davis"));
        DLIB_TEST( (pad(string("davis"), -10) == "davis"));
        DLIB_TEST( (lpad(string("davis"), 10) == "     davis"));
        DLIB_TEST( (rpad(string("davis"), 10) == "davis     "));
        DLIB_TEST( (pad(string("davis"), 10) ==  "  davis   "));
        DLIB_TEST( (lpad(string("davis"), 10, string("*")) == "*****davis"));
        DLIB_TEST( (rpad(string("davis"), 10, string("*")) == "davis*****"));
        DLIB_TEST( (pad(string("davis"), 10, string("*")) == "**davis***"));
        DLIB_TEST( (lpad(string("davis"), 10, string("_-")) == "_-_-_davis"));
        DLIB_TEST( (rpad(string("davis"), 10, string("_-")) == "davis_-_-_"));
        DLIB_TEST( (pad(string("davis"), 10, string("_-")) == "_-davis_-_"));
        DLIB_TEST( (lpad(string("davis"), 10, string("willy wanka")) == "willydavis"));
        DLIB_TEST( (rpad(string("davis"), 10, string("willy wanka")) == "daviswilly"));
        DLIB_TEST( (pad(string("davis"), 10, string("willy wanka")) == "widaviswil"));
        DLIB_TEST( (lpad(string("davis"), 10, "*")) == "*****davis");
        DLIB_TEST( (rpad(string("davis"), 10, "*") == "davis*****"));
        DLIB_TEST( (pad(string("davis"), 10, "*") == "**davis***"));
        DLIB_TEST( (lpad(string("davis"), 10, "_-") == "_-_-_davis"));
        DLIB_TEST( (rpad(string("davis"), 10, "_-") == "davis_-_-_"));
        DLIB_TEST( (pad(string("davis"), 10, "_-") == "_-davis_-_"));
        DLIB_TEST( (lpad(string("davis"), 10, "willy wanka") == "willydavis"));
        DLIB_TEST( (rpad(string("davis"), 10, "willy wanka") == "daviswilly"));
        DLIB_TEST( (pad(string("davis"), 10, "willy wanka") == "widaviswil"));
        dlog << LTRACE << 7;

        a = "file.txt";
        DLIB_TEST( (left_substr(a,string(".")) == "file"));
        DLIB_TEST( (left_substr(a,".") == "file"));
        DLIB_TEST( (right_substr(a,string(".")) == "txt"));
        DLIB_TEST( (right_substr(a,".") == "txt"));

        DLIB_TEST( (left_substr(a," ") == "file.txt"));
        DLIB_TEST( (right_substr(a," ") == ""));

        DLIB_TEST( (left_substr(a,"") == "file.txt"));
        DLIB_TEST( (right_substr(a,"") == ""));

        wstring ws = L"file.txt";
        DLIB_TEST( (left_substr(ws,wstring(L".")) == L"file"));
        DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), L"");
        DLIB_TEST( (right_substr(ws,wstring(L".")) == L"txt"));
        DLIB_TEST_MSG( (right_substr(ws,L".") == L"txt"), L"");

        dlog << LTRACE << 8;
        {
            ostringstream sout;
            wchar_t w = 85;
            char c = 4;
            serialize(w,sout);
            serialize(c,sout);
            w = static_cast<wchar_t>(-1);
            serialize(w,sout);
            c = static_cast<char>(-1);
            serialize(c,sout);

            istringstream sin(sout.str());
            w = 0;
            c = 0;
            deserialize(w,sin);
            deserialize(c,sin);
            DLIB_TEST(w == 85);
            DLIB_TEST(c == 4);
            deserialize(w,sin);
            deserialize(c,sin);
            DLIB_TEST(w == static_cast<wchar_t>(-1));
            DLIB_TEST(c == static_cast<char>(-1));

            wstring str = L"test string";

            sout.str("");
            serialize(str, sout);
            sin.clear();
            sin.str(sout.str());
            str = L"something else";
            deserialize(str,sin);
            DLIB_TEST(str == L"test string");
        }
    }

    void test_split()
    {
        std::vector<string> v;

        string str;
        string delim = " , ";

        v = split(string("one, two,three four")," ,");
        DLIB_TEST(v.size() == 4);
        DLIB_TEST(v[0] == "one");
        DLIB_TEST(v[1] == "two");
        DLIB_TEST(v[2] == "three");
        DLIB_TEST(v[3] == "four");

        v = split(string("one, two,three four"),delim);
        DLIB_TEST(v.size() == 4);
        DLIB_TEST(v[0] == "one");
        DLIB_TEST(v[1] == "two");
        DLIB_TEST(v[2] == "three");
        DLIB_TEST(v[3] == "four");

        v = split(string(""));
        DLIB_TEST(v.size() == 0);

        v = split(string("   "));
        DLIB_TEST(v.size() == 0);

        v = split(string(" one two  "));
        DLIB_TEST(v.size() == 2);
        DLIB_TEST(v[0] == "one");
        DLIB_TEST(v[1] == "two");

        v = split(string(" one   "));
        DLIB_TEST(v.size() == 1);
        DLIB_TEST(v[0] == "one");

        v = split(string("one"));
        DLIB_TEST(v.size() == 1);
        DLIB_TEST(v[0] == "one");

        v = split(string("o"));
        DLIB_TEST(v.size() == 1);
        DLIB_TEST(v[0] == "o");

        std::vector<wstring> wv;
        wstring wstr = L"test string";
        wv = split(wstr);
        DLIB_TEST(wv.size() == 2);
        DLIB_TEST(wv[0] == L"test");
        DLIB_TEST(wv[1] == L"string");
        wv = split(wstr,L" ");
        DLIB_TEST(wv.size() == 2);
        DLIB_TEST(wv[0] == L"test");
        DLIB_TEST(wv[1] == L"string");

        wstr = L"test string hah";
        DLIB_TEST(split_on_first(wstr).first == L"test");
        DLIB_TEST(split_on_first(wstr).second == L"string hah");
        DLIB_TEST(split_on_first(wstr,L"#").first == L"test string hah");
        DLIB_TEST(split_on_first(wstr,L"#").second == L"");
        DLIB_TEST(split_on_last(wstr).first == L"test string");
        DLIB_TEST(split_on_last(wstr).second == L"hah");
        DLIB_TEST(split_on_last(wstr,L"#").first == L"test string hah");
        DLIB_TEST(split_on_last(wstr,L"#").second == L"");
        wstr = L"";
        DLIB_TEST(split_on_first(wstr).first == L"");
        DLIB_TEST(split_on_first(wstr).second == L"");

        str = "test string hah";
        DLIB_TEST(split_on_first(str).first == "test");
        DLIB_TEST(split_on_first(str).second == "string hah");
        DLIB_TEST(split_on_first(str,"#").first == "test string hah");
        DLIB_TEST(split_on_first(str,"#").second == "");
        DLIB_TEST(split_on_last(str).first == "test string");
        DLIB_TEST(split_on_last(str).second == "hah");
        DLIB_TEST(split_on_last(str,"#").first == "test string hah");
        DLIB_TEST(split_on_last(str,"#").second == "");
        str = "";
        DLIB_TEST(split_on_first(str).first == "");
        DLIB_TEST(split_on_first(str).second == "");

        wstr = L"test.string.hah";
        DLIB_TEST(split_on_first(wstr,L".").first == L"test");
        DLIB_TEST(split_on_first(wstr,L".").second == L"string.hah");
        DLIB_TEST(split_on_first(wstr).first == L"test.string.hah");
        DLIB_TEST(split_on_first(wstr).second == L"");
        DLIB_TEST(split_on_last(wstr,L".").first == L"test.string");
        DLIB_TEST(split_on_last(wstr,L".").second == L"hah");
        DLIB_TEST(split_on_last(wstr).first == L"test.string.hah");
        DLIB_TEST(split_on_last(wstr).second == L"");
        wstr = L"";
        DLIB_TEST(split_on_first(wstr).first == L"");
        DLIB_TEST(split_on_first(wstr).second == L"");

        str = "test.string.hah";
        DLIB_TEST(split_on_first(str,".").first == "test");
        DLIB_TEST(split_on_first(str,".").second == "string.hah");
        DLIB_TEST(split_on_first(str).first == "test.string.hah");
        DLIB_TEST(split_on_first(str).second == "");
        DLIB_TEST(split_on_last(str,".").first == "test.string");
        DLIB_TEST(split_on_last(str,".").second == "hah");
        DLIB_TEST(split_on_last(str).first == "test.string.hah");
        DLIB_TEST(split_on_last(str).second == "");
        str = "";
        DLIB_TEST(split_on_first(str).first == "");
        DLIB_TEST(split_on_first(str).second == "");
    }

    class string_tester : public tester
    {
    public:
        string_tester (
        ) :
            tester ("test_string",
                    "Runs tests on the string objects and functions.")
        {}

        void perform_test (
        )
        {
            string_test();
            test_split();
        }
    } a;

}

{'repo_name': 'mit-nlp/MITIE', 'stars': '2484', 'repo_language': 'C++', 'file_name': 'server_http.cpp', 'mime_type': 'text/x-c++', 'hash': 3214993300372913181, 'source_dataset': 'data'}


#ifdef OPENGL_ES
precision mediump float;
#endif

uniform sampler2D u_texture;

varying vec2 v_texCoord;

void main()
{
	gl_FragColor = texture2D(u_texture,v_texCoord);

}

{'repo_name': 'walzer/deprecated-3d-engine-prototype', 'stars': '124', 'repo_language': 'C++', 'file_name': 'RigidBody.h', 'mime_type': 'text/x-c++', 'hash': -1061863795765960411, 'source_dataset': 'data'}


/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * 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 com.android.systemui.statusbar.notification.row;

import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME;
import static com.android.systemui.statusbar.NotificationRemoteInputManager.ENABLE_REMOTE_INPUT;

import android.view.View;
import android.view.ViewGroup;

import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shared.plugins.PluginManager;
import com.android.systemui.statusbar.NotificationMediaManager;
import com.android.systemui.statusbar.notification.logging.NotificationLogger;
import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier;
import com.android.systemui.statusbar.notification.row.dagger.AppName;
import com.android.systemui.statusbar.notification.row.dagger.DismissRunnable;
import com.android.systemui.statusbar.notification.row.dagger.NotificationKey;
import com.android.systemui.statusbar.notification.row.dagger.NotificationRowScope;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.util.time.SystemClock;

import javax.inject.Inject;
import javax.inject.Named;

/**
 * Controller for {@link ExpandableNotificationRow}.
 */
@NotificationRowScope
public class ExpandableNotificationRowController {
    private final ExpandableNotificationRow mView;
    private final ActivatableNotificationViewController mActivatableNotificationViewController;
    private final NotificationMediaManager mMediaManager;
    private final PluginManager mPluginManager;
    private final SystemClock mClock;
    private final String mAppName;
    private final String mNotificationKey;
    private final KeyguardBypassController mKeyguardBypassController;
    private final NotificationGroupManager mNotificationGroupManager;
    private final RowContentBindStage mRowContentBindStage;
    private final NotificationLogger mNotificationLogger;
    private final HeadsUpManager mHeadsUpManager;
    private final ExpandableNotificationRow.OnExpandClickListener mOnExpandClickListener;
    private final StatusBarStateController mStatusBarStateController;

    private final ExpandableNotificationRow.ExpansionLogger mExpansionLogger =
            this::logNotificationExpansion;
    private final ExpandableNotificationRow.OnAppOpsClickListener mOnAppOpsClickListener;
    private final NotificationGutsManager mNotificationGutsManager;
    private Runnable mOnDismissRunnable;
    private final FalsingManager mFalsingManager;
    private final boolean mAllowLongPress;
    private final PeopleNotificationIdentifier mPeopleNotificationIdentifier;

    @Inject
    public ExpandableNotificationRowController(ExpandableNotificationRow view,
            ActivatableNotificationViewController activatableNotificationViewController,
            NotificationMediaManager mediaManager, PluginManager pluginManager,
            SystemClock clock, @AppName String appName, @NotificationKey String notificationKey,
            KeyguardBypassController keyguardBypassController,
            NotificationGroupManager notificationGroupManager,
            RowContentBindStage rowContentBindStage,
            NotificationLogger notificationLogger, HeadsUpManager headsUpManager,
            ExpandableNotificationRow.OnExpandClickListener onExpandClickListener,
            StatusBarStateController statusBarStateController,
            NotificationGutsManager notificationGutsManager,
            @Named(ALLOW_NOTIFICATION_LONG_PRESS_NAME) boolean allowLongPress,
            @DismissRunnable Runnable onDismissRunnable, FalsingManager falsingManager,
            PeopleNotificationIdentifier peopleNotificationIdentifier) {
        mView = view;
        mActivatableNotificationViewController = activatableNotificationViewController;
        mMediaManager = mediaManager;
        mPluginManager = pluginManager;
        mClock = clock;
        mAppName = appName;
        mNotificationKey = notificationKey;
        mKeyguardBypassController = keyguardBypassController;
        mNotificationGroupManager = notificationGroupManager;
        mRowContentBindStage = rowContentBindStage;
        mNotificationLogger = notificationLogger;
        mHeadsUpManager = headsUpManager;
        mOnExpandClickListener = onExpandClickListener;
        mStatusBarStateController = statusBarStateController;
        mNotificationGutsManager = notificationGutsManager;
        mOnDismissRunnable = onDismissRunnable;
        mOnAppOpsClickListener = mNotificationGutsManager::openGuts;
        mAllowLongPress = allowLongPress;
        mFalsingManager = falsingManager;
        mPeopleNotificationIdentifier = peopleNotificationIdentifier;
    }

    /**
     * Initialize the controller.
     */
    public void init() {
        mActivatableNotificationViewController.init();
        mView.initialize(
                mAppName,
                mNotificationKey,
                mExpansionLogger,
                mKeyguardBypassController,
                mNotificationGroupManager,
                mHeadsUpManager,
                mRowContentBindStage,
                mOnExpandClickListener,
                mMediaManager,
                mOnAppOpsClickListener,
                mFalsingManager,
                mStatusBarStateController,
                mPeopleNotificationIdentifier
        );
        mView.setOnDismissRunnable(mOnDismissRunnable);
        mView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
        if (mAllowLongPress) {
            mView.setLongPressListener((v, x, y, item) -> {
                if (mView.isSummaryWithChildren()) {
                    mView.expandNotification();
                    return true;
                }
                return mNotificationGutsManager.openGuts(v, x, y, item);
            });
        }
        if (ENABLE_REMOTE_INPUT) {
            mView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
        }

        mView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
            @Override
            public void onViewAttachedToWindow(View v) {
                mView.getEntry().setInitializationTime(mClock.elapsedRealtime());
                mPluginManager.addPluginListener(mView,
                        NotificationMenuRowPlugin.class, false /* Allow multiple */);
            }

            @Override
            public void onViewDetachedFromWindow(View v) {
                mPluginManager.removePluginListener(mView);
            }
        });
    }

    private void logNotificationExpansion(String key, boolean userAction, boolean expanded) {
        mNotificationLogger.onExpansionChanged(key, userAction, expanded);
    }

    /** */
    public void setOnDismissRunnable(Runnable onDismissRunnable) {
        mOnDismissRunnable = onDismissRunnable;
        mView.setOnDismissRunnable(onDismissRunnable);
    }
}

{'repo_name': 'aosp-mirror/platform_frameworks_base', 'stars': '9245', 'repo_language': 'Java', 'file_name': 'DatabaseCursorTest.java', 'mime_type': 'text/x-java', 'hash': -2869755276581519428, 'source_dataset': 'data'}


{'repo_name': 'cooperhewitt/collection', 'stars': '207', 'repo_language': 'None', 'file_name': '35350755.json', 'mime_type': 'text/plain', 'hash': -6468165888139550715, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="16C68" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
    <device id="retina4_7" orientation="portrait">
        <adaptation id="fullscreen"/>
    </device>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="72" id="KGk-i7-Jjw" customClass="ChangeSourceCell" customModule="zhuishushenqi" customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="320" height="72"/>
            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
                <rect key="frame" x="0.0" y="0.0" width="320" height="71"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="zhuishuvip" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="s37-S5-xyE">
                        <rect key="frame" x="49" y="11" width="57" height="21"/>
                        <constraints>
                            <constraint firstAttribute="height" constant="21" id="D5o-Mz-et8"/>
                            <constraint firstAttribute="width" constant="57" id="HCP-HS-y0V"/>
                        </constraints>
                        <fontDescription key="fontDescription" type="system" pointSize="11"/>
                        <color key="textColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="第1503章 龙凰斗" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tr7-AR-ta4">
                        <rect key="frame" x="49" y="37" width="176" height="21"/>
                        <constraints>
                            <constraint firstAttribute="height" constant="21" id="vw7-f4-bHL"/>
                        </constraints>
                        <fontDescription key="fontDescription" type="system" pointSize="11"/>
                        <color key="textColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="当前选择" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rWf-Qq-HYI">
                        <rect key="frame" x="233" y="25" width="50" height="21"/>
                        <constraints>
                            <constraint firstAttribute="width" constant="50" id="Frv-eP-MWc"/>
                            <constraint firstAttribute="height" constant="21" id="hvm-Uw-YEI"/>
                        </constraints>
                        <fontDescription key="fontDescription" type="system" pointSize="11"/>
                        <color key="textColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="rp_arrow" translatesAutoresizingMaskIntoConstraints="NO" id="ZSx-E7-uyc">
                        <rect key="frame" x="297" y="29" width="8" height="13"/>
                        <constraints>
                            <constraint firstAttribute="width" constant="8" id="LLf-lr-KNh"/>
                            <constraint firstAttribute="height" constant="13" id="SgO-Sl-9eN"/>
                        </constraints>
                    </imageView>
                    <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="TGp-KI-yeK">
                        <rect key="frame" x="8" y="19" width="33" height="33"/>
                        <constraints>
                            <constraint firstAttribute="width" constant="33" id="9ML-iK-5Xh"/>
                            <constraint firstAttribute="height" constant="33" id="JHf-Ya-S8S"/>
                        </constraints>
                    </imageView>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="22小时前" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NYL-VD-aeV">
                        <rect key="frame" x="109" y="11" width="88" height="21"/>
                        <constraints>
                            <constraint firstAttribute="height" constant="21" id="Mtc-5G-4vc"/>
                        </constraints>
                        <fontDescription key="fontDescription" type="system" pointSize="11"/>
                        <color key="textColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                </subviews>
                <constraints>
                    <constraint firstItem="TGp-KI-yeK" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="19" id="9If-37-odS"/>
                    <constraint firstItem="Tr7-AR-ta4" firstAttribute="top" secondItem="s37-S5-xyE" secondAttribute="bottom" constant="5" id="CUG-lh-zpz"/>
                    <constraint firstItem="ZSx-E7-uyc" firstAttribute="leading" secondItem="rWf-Qq-HYI" secondAttribute="trailing" constant="14" id="Cbm-ab-Czv"/>
                    <constraint firstItem="NYL-VD-aeV" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="11" id="L39-dp-Sfl"/>
                    <constraint firstItem="Tr7-AR-ta4" firstAttribute="leading" secondItem="TGp-KI-yeK" secondAttribute="trailing" constant="8" id="RSI-kd-avR"/>
                    <constraint firstItem="NYL-VD-aeV" firstAttribute="leading" secondItem="s37-S5-xyE" secondAttribute="trailing" constant="3" id="UZ8-dE-Dij"/>
                    <constraint firstItem="rWf-Qq-HYI" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="25" id="Uix-Pb-0hn"/>
                    <constraint firstAttribute="trailing" secondItem="ZSx-E7-uyc" secondAttribute="trailing" constant="15" id="VZh-FF-XJp"/>
                    <constraint firstItem="TGp-KI-yeK" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="8" id="Vez-0q-IAY"/>
                    <constraint firstItem="rWf-Qq-HYI" firstAttribute="leading" secondItem="NYL-VD-aeV" secondAttribute="trailing" constant="36" id="ZdT-Yw-75n"/>
                    <constraint firstItem="ZSx-E7-uyc" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="29" id="cTA-79-CoY"/>
                    <constraint firstItem="rWf-Qq-HYI" firstAttribute="leading" secondItem="Tr7-AR-ta4" secondAttribute="trailing" constant="8" id="gxQ-yN-wCC"/>
                    <constraint firstItem="s37-S5-xyE" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="11" id="jJ0-Ij-sO7"/>
                    <constraint firstItem="s37-S5-xyE" firstAttribute="leading" secondItem="TGp-KI-yeK" secondAttribute="trailing" constant="8" id="qPF-4R-mER"/>
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="currentSelect" destination="rWf-Qq-HYI" id="DXK-ms-giV"/>
                <outlet property="icon" destination="TGp-KI-yeK" id="kpT-tF-zEA"/>
                <outlet property="novelInfo" destination="Tr7-AR-ta4" id="idX-v2-TB1"/>
                <outlet property="sourceWidth" destination="HCP-HS-y0V" id="3Ke-IF-m2O"/>
                <outlet property="updated" destination="NYL-VD-aeV" id="KVV-tZ-t49"/>
                <outlet property="website" destination="s37-S5-xyE" id="lbN-ac-TBD"/>
            </connections>
            <point key="canvasLocation" x="34" y="174"/>
        </tableViewCell>
    </objects>
    <resources>
        <image name="rp_arrow" width="8" height="13"/>
    </resources>
</document>

{'repo_name': 'Noah37/zhuishushenqi', 'stars': '179', 'repo_language': 'Swift', 'file_name': 'Localizable.strings', 'mime_type': 'text/plain', 'hash': -382582595330934529, 'source_dataset': 'data'}


// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:analyzer/dart/element/element.dart';

/// The result of attempting to resolve an identifier to elements.
class ResolutionResult {
  /// An instance that can be used anywhere that no element was found.
  static const ResolutionResult none =
      ResolutionResult._(_ResolutionResultState.none);

  /// An instance that can be used anywhere that multiple elements were found.
  static const ResolutionResult ambiguous =
      ResolutionResult._(_ResolutionResultState.ambiguous);

  /// The state of the result.
  final _ResolutionResultState state;

  /// Return the element that is invoked for reading.
  final ExecutableElement getter;

  /// If `true`, then the [getter] is `null`, and this is an error that has
  /// not yet been reported, and the client should report it.
  ///
  /// If `false`, then the [getter] is valid. Usually this means that the
  /// correct target has been found. But the [getter] still might be `null`,
  /// when there was an error, and it has already been reported (e.g. when
  /// ambiguous extension);  or when `null` is the only possible result (e.g.
  /// when `dynamicTarget.foo`, or `functionTyped.call`).
  final bool needsGetterError;

  /// Return the element that is invoked for writing.
  final ExecutableElement setter;

  /// If `true`, then the [setter] is `null`, and this is an error that has
  /// not yet been reported, and the client should report it.
  ///
  /// If `false`, then the [setter] is valid. Usually this means that the
  /// correct target has been found. But the [setter] still might be `null`,
  /// when there was an error, and it has already been reported (e.g. when
  /// ambiguous extension);  or when `null` is the only possible result (e.g.
  /// when `dynamicTarget.foo`).
  final bool needsSetterError;

  /// Initialize a newly created result to represent resolving a single
  /// reading and / or writing result.
  ResolutionResult({
    this.getter,
    this.needsGetterError,
    this.setter,
    this.needsSetterError,
  }) : state = _ResolutionResultState.single;

  /// Initialize a newly created result with no elements and the given [state].
  const ResolutionResult._(this.state)
      : getter = null,
        needsGetterError = true,
        setter = null,
        needsSetterError = true;

  /// Return `true` if this result represents the case where multiple ambiguous
  /// elements were found.
  bool get isAmbiguous => state == _ResolutionResultState.ambiguous;
}

/// The state of a [ResolutionResult].
enum _ResolutionResultState {
  /// Indicates that no element was found.
  none,

  /// Indicates that a single element was found.
  single,

  /// Indicates that multiple ambiguous elements were found.
  ambiguous
}

{'repo_name': 'dart-lang/sdk', 'stars': '5656', 'repo_language': 'Dart', 'file_name': 'value_mixin_error.dart', 'mime_type': 'text/x-c++', 'hash': -2659504766397908046, 'source_dataset': 'data'}


package org.opencv.osgi;

/**
 * Dummy interface to allow some integration testing within OSGi implementation.
 */
public interface OpenCVInterface
{
}

{'repo_name': 'ma-pe/react-native-opencv', 'stars': '146', 'repo_language': 'C++', 'file_name': 'Info.plist', 'mime_type': 'text/xml', 'hash': -5228452843711935619, 'source_dataset': 'data'}


------------------------------------------------------------------------------
--                                                                          --
--                        Copyright (C) 2020, AdaCore                       --
--           Copyright (C) 2020, Simon Wright (simon@pushface.org)          --
--                                                                          --
--  Redistribution and use in source and binary forms, with or without      --
--  modification, are permitted provided that the following conditions are  --
--  met:                                                                    --
--     1. Redistributions of source code must retain the above copyright    --
--        notice, this list of conditions and the following disclaimer.     --
--     2. Redistributions in binary form must reproduce the above copyright --
--        notice, this list of conditions and the following disclaimer in   --
--        the documentation and/or other materials provided with the        --
--        distribution.                                                     --
--     3. Neither the name of the copyright holder nor the names of its     --
--        contributors may be used to endorse or promote products derived   --
--        from this software without specific prior written permission.     --
--                                                                          --
--   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS    --
--   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT      --
--   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  --
--   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT   --
--   HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
--   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT       --
--   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  --
--   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  --
--   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT    --
--   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE  --
--   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   --
--                                                                          --
------------------------------------------------------------------------------

--  The algorithms used here are derived from Pimoroni's code at
--  https://github.com/pimoroni/pmw3901-python.

with Ada.Unchecked_Conversion;

package body PMW3901 is

   --  Some registers
   Reg_ID             : constant := 16#00#;
   Reg_ID_Inverted    : constant := 16#5f#;
   Reg_Data_Ready     : constant := 16#02#;
   Reg_Motion_Burst   : constant := 16#16#;
   Reg_Power_Up_Reset : constant := 16#3a#;
   --  Reg_Orientation    : constant := 16#5b#;

   Power_Up_Reset_Key : constant := 16#5a#;

   function Read (This     : in out PMW3901_Flow_Sensor;
                  Register :        HAL.UInt8) return HAL.UInt8;

   procedure Write (This     : in out PMW3901_Flow_Sensor;
                    Register :        HAL.UInt8;
                    Value    :        HAL.UInt8);

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid (M : Motion) return Boolean
   is
      use type HAL.UInt8;
   begin
      return M.Motion_Occurred
        and not (M.S_Qual < 19 and M.Shutter_Upper = 16#1f#);
   end Is_Valid;

   ----------------
   -- Initialize --
   ----------------

   procedure Initialize (This : in out PMW3901_Flow_Sensor)
   is
   begin
      This.CS.Clear;
      This.Timing.Delay_Milliseconds (50);
      This.CS.Set;

      declare
         Chip_ID          : HAL.UInt8;
         Revision         : HAL.UInt8;
         Inverted_Chip_ID : HAL.UInt8;
         use type HAL.UInt8;
      begin
         Chip_ID := Read (This, Reg_ID);
         Revision := Read (This, Reg_ID + 1);
         Inverted_Chip_ID := Read (This, Reg_ID_Inverted);
         if Chip_ID /= 16#49#
           or Revision /= 16#00#
           or Inverted_Chip_ID /= 16#b6#
         then
            --  Can't initialize the wrong sort of chip!
            raise SPI_Error with "no PMW3901 found";
         end if;
      end;

      Write (This, Reg_Power_Up_Reset, Power_Up_Reset_Key);
      This.Timing.Delay_Milliseconds (20);

      --  Read the registers once
      declare
         Buff : HAL.SPI.SPI_Data_8b (0 .. 4);
         use type HAL.UInt8;
      begin
         for J in Buff'Range loop
            Buff (J) := Read (This, Reg_Data_Ready + HAL.UInt8 (J));
         end loop;
      end;

      This.Initialized := True;
   end Initialize;

   ---------------
   -- Calibrate --
   ---------------

   procedure Calibrate (This : in out PMW3901_Flow_Sensor)
   is
      type Magic is record
         Register : HAL.UInt8;
         Value : HAL.UInt8;
      end record;
      type Magics is array (Natural range <>) of Magic;
      procedure Write_Magics (Data : Magics);
      procedure Write_Magics (Data : Magics) is
      begin
         for J in Data'Range loop
            Write (This, Data (J).Register, Data (J).Value);
         end loop;
      end Write_Magics;
      use type HAL.UInt8;
   begin
      Write_Magics (((16#7f#, 16#00#),
                     (16#55#, 16#01#),
                     (16#50#, 16#07#),
                     (16#7f#, 16#0e#),
                     (16#43#, 16#10#)));
      declare
         Check : constant HAL.UInt8 := Read (This, 16#67#);
      begin
         if (Check and 2#1000_0000#) /= 0 then
            Write (This, 16#48#, 16#04#);
         else
            Write (This, 16#48#, 16#02#);
         end if;
      end;
      if Read (This, 16#73#) = 0 then
         declare
            C1, C2 : HAL.UInt8;
         begin
            C1 := Read (This, 16#70#);
            C2 := Read (This, 16#71#);
            if C1 <= 28 then
               C1 := C1 + 14;
            end if;
            if C1 > 28 then
               C1 := C1 + 11;
            end if;
            C2 := (C2 * 45) / 100;
            Write_Magics (((16#7f#, 16#00#),
                           (16#51#, 16#7b#),
                           (16#50#, 16#00#),
                           (16#55#, 16#00#),
                           (16#7f#, 16#0E#),
                           (16#70#, C1),
                           (16#71#, C2)));
         end;
      end if;
      Write_Magics (((16#7f#, 16#00#),
                     (16#61#, 16#ad#),
                     (16#7f#, 16#03#),
                     (16#40#, 16#00#),
                     (16#7f#, 16#05#),
                     (16#41#, 16#b3#),
                     (16#43#, 16#f1#),
                     (16#45#, 16#14#),
                     (16#5b#, 16#32#),
                     (16#5f#, 16#34#),
                     (16#7b#, 16#08#),
                     (16#7f#, 16#06#),
                     (16#44#, 16#1b#),
                     (16#40#, 16#bf#),
                     (16#4e#, 16#3f#),
                     (16#7f#, 16#08#),
                     (16#65#, 16#20#),
                     (16#6a#, 16#18#),
                     (16#7f#, 16#09#),
                     (16#4f#, 16#af#),
                     (16#5f#, 16#40#),
                     (16#48#, 16#80#),
                     (16#49#, 16#80#),
                     (16#57#, 16#77#),
                     (16#60#, 16#78#),
                     (16#61#, 16#78#),
                     (16#62#, 16#08#),
                     (16#63#, 16#50#),
                     (16#7f#, 16#0a#),
                     (16#45#, 16#60#),
                     (16#7f#, 16#00#),
                     (16#4d#, 16#11#),
                     (16#55#, 16#80#),
                     (16#74#, 16#21#),
                     (16#75#, 16#1f#),
                     (16#4a#, 16#78#),
                     (16#4b#, 16#78#),
                     (16#44#, 16#08#),
                     (16#45#, 16#50#),
                     (16#64#, 16#ff#),
                     (16#65#, 16#1f#),
                     (16#7f#, 16#14#),
                     (16#65#, 16#67#),
                     (16#66#, 16#08#),
                     (16#63#, 16#70#),
                     (16#7f#, 16#15#),
                     (16#48#, 16#48#),
                     (16#7f#, 16#07#),
                     (16#41#, 16#0d#),
                     (16#43#, 16#14#),
                     (16#4b#, 16#0e#),
                     (16#45#, 16#0f#),
                     (16#44#, 16#42#),
                     (16#4c#, 16#80#),
                     (16#7f#, 16#10#),
                     (16#5b#, 16#02#),
                     (16#7f#, 16#07#),
                     (16#40#, 16#41#),
                     (16#70#, 16#00#)));
      This.Timing.Delay_Milliseconds (16#0a#);
      Write_Magics (((16#32#, 16#44#),
                     (16#7f#, 16#07#),
                     (16#40#, 16#40#),
                     (16#7f#, 16#06#),
                     (16#62#, 16#f0#),
                     (16#63#, 16#00#),
                     (16#7f#, 16#0d#),
                     (16#48#, 16#c0#),
                     (16#6f#, 16#d5#),
                     (16#7f#, 16#00#),
                     (16#5b#, 16#a0#),
                     (16#4e#, 16#a8#),
                     (16#5a#, 16#50#),
                     (16#40#, 16#80#)));
      This.Timing.Delay_Milliseconds (16#f0#);
      --  enable LED pulsing??? what LED?
      Write_Magics (((16#7f#, 16#14#),
                     (16#6f#, 16#1c#),
                     (16#7f#, 16#00#)));
   end Calibrate;

   -----------------
   -- Read_Motion --
   -----------------

   function Read_Motion  (This : in out PMW3901_Flow_Sensor) return Motion is
      subtype Buffer is HAL.SPI.SPI_Data_8b (1 .. 12);
      function Convert is new Ada.Unchecked_Conversion (Buffer, Motion);
      Buff : Buffer := (others => 0);
      Status : HAL.SPI.SPI_Status;
      use all type HAL.SPI.SPI_Status;
   begin
      This.CS.Clear;
      This.Port.Transmit (HAL.SPI.SPI_Data_8b'((1 => Reg_Motion_Burst)),
                          Status);
      if Status /= Ok then
         raise SPI_Error with "PMW3901 SPI transmit failure";
      end if;
      This.Port.Receive (Buff, Status);
      if Status /= Ok then
         raise SPI_Error with "PMW3901 SPI receive burst failure";
      end if;
      This.CS.Set;
      return Convert (Buff);
   end Read_Motion;

   ----------
   -- Read --
   ----------

   function Read (This     : in out PMW3901_Flow_Sensor;
                  Register : HAL.UInt8) return HAL.UInt8
   is
      use type HAL.UInt8;
      Register_For_Read : constant HAL.UInt8 := Register and 16#7f#;
      Data   : HAL.SPI.SPI_Data_8b (0 .. 0);
      Status : HAL.SPI.SPI_Status;
      use all type HAL.SPI.SPI_Status;
   begin
      This.CS.Clear;
      This.Port.Transmit (HAL.SPI.SPI_Data_8b'(1 => Register_For_Read),
                          Status);
      if Status /= Ok then
         raise SPI_Error with "PMW3901 SPI transmit failure";
      end if;
      This.Port.Receive (Data, Status);
      if Status /= Ok then
         raise SPI_Error with "PMW3901 SPI receive failure";
      end if;
      This.CS.Set;
      return Data (Data'First);
   end Read;

   -----------
   -- Write --
   -----------

   procedure Write (This     : in out PMW3901_Flow_Sensor;
                    Register :        HAL.UInt8;
                    Value    :        HAL.UInt8)
   is
      use type HAL.UInt8;
      Register_For_Write : constant HAL.UInt8 := Register or 16#80#;
      Status : HAL.SPI.SPI_Status;
      use all type HAL.SPI.SPI_Status;
   begin
      This.CS.Clear;
      This.Port.Transmit (HAL.SPI.SPI_Data_8b'(1 => Register_For_Write),
                          Status);
      if Status /= Ok then
         raise SPI_Error with "PMW3901 SPI transmit failure";
      end if;
      This.Port.Transmit (HAL.SPI.SPI_Data_8b'(1 => Value),
                          Status);
      if Status /= Ok then
         raise SPI_Error with "PMW3901 SPI transmit failure";
      end if;
      This.CS.Set;
   end Write;

end PMW3901;

{'repo_name': 'AdaCore/Ada_Drivers_Library', 'stars': '147', 'repo_language': 'Ada', 'file_name': 'dummy_block_driver.ads', 'mime_type': 'text/plain', 'hash': 2888512051553323603, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project

     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.
-->

<resources>
    <bool name="show_as_dialog">true</bool>
    <bool name="always_show_summary">true</bool>

    <dimen name="list_item_height">64dp</dimen>
    <dimen name="list_item_padding">16dp</dimen>

    <dimen name="list_divider_inset">72dp</dimen>
    <integer name="recycler_type">1</integer>
</resources>

{'repo_name': '1hakr/AnExplorer', 'stars': '1320', 'repo_language': 'Java', 'file_name': 'WearableDrawerControllerCompat.java', 'mime_type': 'text/plain', 'hash': -5523056980134326615, 'source_dataset': 'data'}


require 'test_helper'

class StatusHistoryTest < ActiveSupport::TestCase
  def setup
    StatusHistory.delete_all
  end

  def teardown
    Timecop.return
  end

  test 'history_by_key_and_hours' do
    Timecop.freeze(2010, 7, 12) do
      day_before_yesterday = Time.now.to_i - 2.days
      yesterday = Time.now.to_i - 1.day
      StatusHistory.transaction do
        10.times do |i|
          StatusHistory.create(time: day_before_yesterday + i, key: 'squeue_low_aarch64', value: i)
        end
        5.times do |i|
          StatusHistory.create(time: yesterday + i, key: 'squeue_low_aarch64', value: i)
        end
      end
      assert_equal 5, StatusHistory.history_by_key_and_hours('squeue_low_aarch64', 25).count
      assert_equal 15, StatusHistory.history_by_key_and_hours('squeue_low_aarch64', 49).count
    end
  end
end

{'repo_name': 'openSUSE/open-build-service', 'stars': '537', 'repo_language': 'Ruby', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -4611555073954030020, 'source_dataset': 'data'}


/**
 * purpose：     ajax通用解决方案
 * author：      仲强
 * version:      1.9.2
 * date:         2019-04-18
 * email:        gerry.zhong@outlook.com
 * update:          --1.1   去除跨域请求头部设置   ==> author: keepfool (cnblogs)
 *                  --1.2   更新tool方法，完善结构  ==> author: pod4g  (github)
 *                    --1.3   去除参数中的跨域设置，post方法已经支持跨域   ==>author: wYhooo  (github)
 *                    --1.4   集成ajax的轮询技术
 *                    --1.5.0 集成ajax level2的文件上传 新增tool.is对象，判断数据类型，支持formData数据类型发送
 *                  --1.5.1 集成ajax大文件切割上传，upload_big方法，新增文件切割方法tool.cutFile 返回值为切割好的数组对象
 *                  --1.5.2 更新bug，更细ajax默认值相互影响问题，调试ajax长轮询bug
 *                  --1.6   集成promise规范，更优雅的操作异步
 *                  --1.7   新增ajax的全局配置、对请求参数拓展和重构、对初始化参数类型检查（非正确格式则恢复默认）、增加浏览器错误回收机制、增加请求blob类型、增加跨域传递凭证配置
 *                  --1.8   增加请求错误监控、前端负载均衡、宕机切换、以及迭代问题修复
 *                  --1.9   设计请求池，复用请求，让前端通信快、更快、再快一点
 *                    --1.9.1   完善api文档，upload和upload_big中fileSelector换成file，直接使用文件，而不是去获取
 *                    --1.9.2   完全实现Promise A+模型，增加mock数据功能
 */
(function () {

  var root = this
  //默认参数
  var initParam = {
    url: "",
    type: "post",
    baseURL: '',
    data: {},
    async: true,
    requestHeader: {},
    publicData: {},
    timeout: 5000,
    responseType: 'json',
    contentType: '',
    withCredentials: false,
    // 错误搜集
    errStatus: {
      isOpenErr: false,
      errURL: '',
    },
    // 负载均衡
    loadBalancing: {
      isOpen: false,
      cluster: []
    },
    // 宕机切换
    serviceSwitching: {
      isOpen: false,
      // 切换策略
      strategies: function () {
      },
      backupUrl: '',
    },
    // 请求池
    pool: {
      isOpen: true,
      requestNumber: 6,
    },
    // mock功能
    mock: {
      isOpen: true,
      mockData: {}
    },

    transformRequest: function (data) {
      return data;
    },
    transformResponse: function (data) {
      return data;
    },
    successEvent: function (data) {
    },
    errorEvent: function (x, xx, xxx) {
    },
    timeoutEvent: function (code, e) {
    }
  };

  //初始化参数固定类型检查
  var initParamType = {
    url: "String",
    type: "String",
    baseURL: 'String',
    data: ['Object', 'FormData'],
    async: 'Boolean',
    requestHeader: 'Object',
    publicData: 'Object',
    timeout: 'Number',
    responseType: 'String',
    contentType: 'String',
    withCredentials: 'Boolean',
    errStatus: 'Object',
    loadBalancing: 'Object',
    serviceSwitching: 'Object',
    pool: 'Object',
    mock: 'Object',
    transformRequest: 'function',
    transformResponse: 'function',
    successEvent: 'function',
    errorEvent: 'function',
    timeoutEvent: 'function'
  };

  // 内部使用数据
  var selfData = {
    errAjax: {},
    isNeedSwitching: false,
    requestPool: [],   // 请求池
    queuePool: [],
    xhr: {}
  }

  //内部使用工具
  var tool = {
    random: function (max, min) {
      return Math.floor(Math.random() * (max - min + 1) + min)
    },
    hasOwn: function (obj, key) {
      return Object.prototype.hasOwnProperty.call(obj, key)
    },
    //类型判断
    is: (function checkType() {
      var is = {
        types: ["Array", "Boolean", "Date", "Number", "Object", "RegExp", "String", "Window", "HTMLDocument", "function", "FormData"]
      };
      for (var i = 0, c; c = is.types[i++];) {
        is[c] = (function (type) {
          return function (obj) {
            var temp;
            if (type === "function") {
              temp = typeof obj == type
            } else {
              temp = Object.prototype.toString.call(obj) == "[object " + type + "]";
            }
            return temp;
          }
        })(c);
      }
      ;
      return is;
    })(),
    //获取对象的key
    keys: function (obj) {
      if (Object.keys) return Object.keys(obj);

      var keys = [];
      for (var key in obj) {
        if (this.hasOwn(obj, key)) keys.push(key);
      }
      ;
      return keys
    },
    //each循环
    each: function (obj, callback) {
      var keys = this.keys(obj);
      if (this.is.Array(obj) && [].forEach) {  //判断是否为数组且支持新特性
        obj.forEach(callback);
      } else {
        var i = 0, len = keys.length, key, item;
        while (i < len) {
          key = keys[i++];
          item = obj[key];
          callback.call(obj, item, key);
        }
      }
    },
    //判断对象是否为空
    isEmptyObject: function (e) {
      var t;
      for (t in e)
        return !1;
      return !0
    },
    //合并对象,将第二个合并到第一个对象上
    MergeObject: function (target, source) {
      if (Object.assign) {
        return Object.assign(target, source)
      }
      var sourceKeys = this.keys(source),
        i = 0
      var len = sourceKeys.length;
      while (i < len) {
        var key = sourceKeys[i++]
        target[key] = source[key];
      }
      return target;
    },
    // 深度拷贝对象
    deepClone: function (data) {
      var obj = null, originQueue = [data], visitQueue = [], copyVisitQueue = []
      tool.is.Array(originQueue[0]) ? obj = [] : obj = {}
      var copyQueue = [obj];
      while (originQueue.length > 0) {
        var _data = originQueue.shift();
        var _obj = copyQueue.shift();
        visitQueue.push(_data);
        copyVisitQueue.push(_obj);
        for (var key in _data) {
          var _value = _data[key]
          if (typeof _value !== 'object') {
            _obj[key] = _value;
          } else {
            var index = visitQueue.indexOf(_value)
            if (index > -1) {
              _obj[key] = copyVisitQueue[index];
            } else {
              originQueue.push(_value);
              tool.is.Array(_value) ? _obj[key] = [] : _obj[key] = {}
              copyQueue.push(_obj[key]);
            }
          }
        }
      }
      return obj;
    },
    //创建xhr对象
    createXhrObject: function () {
      var xhr;
      try {
        // IE7 已经有了XMLHttpRequest对象
        XMLHttpRequest ? (xhr = new XMLHttpRequest()) : (xhr = new ActiveXObject('Microsoft.XMLHTTP'));
      } catch (e) {
        throw new Error('ajax:Could not create an XHR object.')
      }
      ;
      return xhr;
    },
    //检查初始化参数
    checkParam: function (options) {
      // 升级深度拷贝丑陋的写法
      var temp = tool.deepClone(initParam);
      tool.MergeObject(temp, options);

      return tool.checkDataTypeBatch(temp, initParamType) ? temp : {};
    },
    /*
     * 判断是否为其他域的请求
     *
     * 改方法中处理负载均衡方案
     *    1. 对于前后端分离，直接请求域名的方案  支持
     *    2. 对于直接请求本服务器的请求，暂时不做处理，让ngx做负载均衡  不支持
     *
     *
     */
    checkRealUrl: function (url, that) {
      if (/http:\/\/|https:\/\//.test(url)) {
        // 针对请求，负载均衡到配置域名  PS:负载均衡优先级 > 宕机切换优先级
        if (initParam.errStatus.errURL !== url) { // 错误搜集接口都不走
          if (initParam.loadBalancing.isOpen) {  // 负载打开肯定走负载
            url = url.replace(/^(http:\/\/|https:\/\/)/, '')
              .replace(/^.*?\//, initParam.loadBalancing.cluster[tool.random(initParam.loadBalancing.cluster.length - 1, 0)] + '/$`')
          } else {
            // 如果负载没开，宕机切换打开，则走介个
            if (initParam.serviceSwitching.isOpen && selfData.isNeedSwitching) {
              url = url.replace(/^(http:\/\/|https:\/\/)/, '')
                .replace(/^.*?\//, initParam.serviceSwitching.backupUrl + '/$`')
            }
          }
        }
      } else {
        url = initParam.baseURL + url
        if (initParam.errStatus.errURL !== url) {
          if (initParam.loadBalancing.isOpen) {
            url = initParam.loadBalancing.cluster[tool.random(initParam.loadBalancing.cluster.length - 1, 0)] + initParam.baseURL + url
          } else {
            // 如果负载没开，宕机切换打开，宕机策略成功则走介个
            if (initParam.serviceSwitching.isOpen && selfData.isNeedSwitching) {
              url = initParam.serviceSwitching.backupUrl + initParam.baseURL + url
            }
          }
        }
      }
      if (!initParam.mock.isOpen) that.currentUrl = url
      return url;
    },
    //批量检查数据类型
    checkDataTypeBatch: function (obj, objType) {
      var temp = true;
      tool.each(obj, function (value, key) {
        // 去除用户在全局配置中额外的参数检测
        if (objType[key] === undefined) return

        var typeName = objType[key], tempOutput;
        if (tool.is.Array(typeName)) {
          tool.each(typeName, function (item) {
            tempOutput = tempOutput || tool.is[item](value);
          })
        } else {
          tempOutput = tool.is[typeName](value)
        }
        if (!tempOutput) {
          obj[key] = initParam[key]
        }
      })
      return temp;
    },
    //判断IE版本
    // 如果不是IE，返回 true
    // 若是IE，返回IE版本号
    getIEVersion: function () {
      return function () {
        // 能进到这里来，说明一定是IE
        if (window.VBArray) {
          // 取出IE的版本
          var mode = document.documentMode
          // IE6、IE7 不支持documentMode，那就使用XMLHttpRequest，支持的就是IE7，否则就是IE6
          // 至于支持documentMode的IE，则直接return
          return mode ? mode : window.XMLHttpRequest ? 7 : 6
        } else {
          return NaN
        }
      }()
    },
    //切割大文件
    cutFile: function (file, cutSize) {
      var count = file.size / cutSize | 0, fileArr = [];
      for (var i = 0; i < count; i++) {
        fileArr.push({
          name: file.name + ".part" + (i + 1),
          file: file.slice(cutSize * i, cutSize * (i + 1))
        });
      }
      ;
      fileArr.push({
        name: file.name + ".part" + (count + 1),
        file: file.slice(cutSize * count, file.size)
      });
      return fileArr;
    },
    //如果浏览器不支持Promise特性，将用简易的promise代替(IE11-都不支持ES6 Promise)
    createPromise: function () {
      var newPromise = function Promise(fn) {
        var self = this
        self.PromiseStatus = 'PENDING'

        var callbackArr = [], finallyCall

        this.then = function (resolveFun, rejectFun) {
          // 2.2.1 ✔
          var Promise2

          // pending 状态处理
          if (self.PromiseStatus === 'PENDING') {
            if (typeof resolveFun !== "function") {
              resolveFun = new Function()
            }
            if (typeof rejectFun !== "function") {
              rejectFun = new Function()
            }
            return Promise2 = new Promise(function (resolve, reject) {
              callbackArr.push({
                // 暂存resolveCall
                resolveCall: function (result) {
                  setTimeout(function () {
                    try {
                      var x = resolveFun(result)
                      resolvePromise(Promise2, x, resolve, reject)
                    } catch (e) {
                      reject(e)
                    }
                    if (finallyCall) finallyCall()
                  })
                },
                // 暂存rejectCall
                rejectCall: function (result) {
                  setTimeout(function () {
                    try {
                      var x = rejectFun(result)
                      resolvePromise(Promise2, x, resolve, reject)
                    } catch (e) {
                      reject(e)
                    }
                    if (finallyCall) finallyCall()
                  })
                }
              })
            })
          }

          // resolve 状态处理
          if (self.PromiseStatus === 'RESOLVE') {
            return Promise2 = new Promise(function (resolve, reject) {
              // 2.2.7.3 ✔
              if (typeof resolveFun !== 'function') {
                resolve(self.PromiseValue)
              } else {
                try {
                  setTimeout(function () {
                    var x = resolveFun(self.PromiseValue)
                    resolvePromise(Promise2, x, resolve, reject)
                  })
                } catch (e) {
                  reject(e)
                }
              }
            })
          }

          // reject 状态处理
          if (self.PromiseStatus === 'REJECT') {
            return Promise2 = new Promise(function (resolve, reject) {
              setTimeout(function () {
                // 2.2.7.4 ✔
                if (typeof rejectFun !== 'function') {
                  reject(rejectFun)
                } else {
                  try {
                    setTimeout(function () {
                      var x = rejectFun(self.PromiseValue)
                      resolvePromise(Promise2, x, resolve, reject)
                    })
                  } catch (e) {
                    reject(e)
                  }
                }
              })
            })
          }
        }

        // 由then方法实现catch方法
        this.catch = function (onRejected) {
          return this.then(null, onRejected)
        }

        // finally方法
        this.finally = function (callback) {
          finallyCall = callback
        }

        // 同步promise2和x状态
        function resolvePromise(promise2, x, resolve, reject) {
          // 2.3.1 ✔
          if (promise2 === x) {
            return reject(new TypeError('promise and x refer to the same object'))
          }

          if (x instanceof Promise) {
            // 2.3.2 ✔
            if (x.PromiseStatus === 'PENDING') {
              return x.then(resolve, reject)
            }
            if (x.PromiseStatus === 'RESOLVE') {
              return resolve(x.PromiseValue)
            }
            if (x.PromiseStatus === 'REJECT') {
              return reject(x.PromiseValue)
            }
          } else {
            if (typeof x === 'object' || typeof x === 'function') {
              var then;
              // 2.3.3.2 ✔
              try {
                then = x.then
              } catch (e) {
                return reject(e)
              }

              if (typeof then === 'function') {
                try {
                  then.call(x, function (y) {
                    return resolvePromise(promise2, y, resolve, reject)
                  }, function (r) {
                    return reject(r)
                  })
                } catch (e) {
                  return reject(e)
                }
              } else {
                return resolve(x)
              }
            } else {
              return resolve(x)
            }
          }
        }

        // resolve状态变化
        function resolveFun(result) {
          // 2.2.2 ✔
          setTimeout(function () {
            if (self.PromiseStatus === 'PENDING') {
              self.PromiseStatus = 'RESOLVE'
              self.PromiseValue = result
              // 2.2.2.3 ✔
              if (callbackArr[0]) {
                callbackArr[0].resolveCall(result)   // 2.2.5 ✔
              }
            }
          })
        }

        // reject状态变化
        function rejectFun(result) {
          // 2.2.3 ✔
          setTimeout(function () {
            if (self.PromiseStatus === 'PENDING') {
              self.PromiseStatus = 'REJECT'
              self.PromiseValue = result
              if (callbackArr[0]) {
                // 2.2.3.3 ✔
                callbackArr[0].rejectCall(result)    // 2.2.5 ✔
              }
            }
          })
        }

        // 2.2.4 执行平台代码 ✔
        fn(resolveFun, rejectFun)
      }
      Promise.all = function (arr) {
        var temp = []
        tool.each(arr, function (x) {
          temp.push(Promise.resolve(x))
        })

        return new Promise(function (res, rej) {
          var resValue = [], isReject = false
          tool.each(temp, function (x) {
            x.then(function (value) {
              resValue.push(value)
              if (resValue.length === temp.length) res(resValue)
            }, function (reason) {
              if (!isReject) {
                rej(reason)
                isReject = true
              }
            })
          })
        })
      }
      Promise.race = function (arr) {
        var temp = arr.map(x => {
          return Promise.resolve(x)
        })

        return new Promise(function (res, rej) {
          var isComplete = false
          tool.each(temp, function (x) {
            x.then(function (value) {
              if (!isComplete) {
                res(value)
                isComplete = true
              }
            }, function (reason) {
              if (!isComplete) {
                rej(reason)
                isComplete = true
              }
            })
          })
        })

      }
      Promise.resolve = function (param) {
        if (param instanceof Promise) {
          return param
        } else {
          if (param !== null && typeof param === 'object' && param.then && typeof param.then === "function") {
            return new Promise(param.then)
          } else {
            return new Promise(function (res, rej) {
              res(param)
            })
          }
        }
      }
      Promise.reject = function (param) {
        return new Promise(function (res, rej) {
          rej(param)
        })
      }
      window.Promise = newPromise;
    },
    //监控浏览器的错误日志
    setOnerror: function () {
      window.onerror = function (errInfo, errUrl, errLine) {
        tempObj.post(initParam.errStatus.errURL, {
          type: 'browser',
          errInfo: errInfo,
          errUrl: errUrl,
          errLine: errLine,
          Browser: navigator.userAgent
        })
      }
    },
    //监控ajax请求的错误日志
    uploadAjaxError: function (obj) {
      if (initParam.errStatus.isOpenErr) {
        if (obj.errUrl !== initParam.errStatus.errURL) {
          tempObj.post(initParam.errStatus.errURL, obj)
        }
      }
      // 记录错误信息，以便策略做判断
      if (selfData.errAjax[obj.errUrl] === undefined) {
        selfData.errAjax[obj.errUrl] = 1
      } else {
        selfData.errAjax[obj.errUrl] += 1
      }

      // 判断是否开启服务切换，以及验证策略切换
      if (initParam.serviceSwitching.isOpen) {
        // 验证策略
        selfData.isNeedSwitching = initParam.serviceSwitching.strategies(selfData.errAjax)
      }

    },
    // 拷贝xhr参数
    deepCloneXhr: function (data, requestNum) {
      var mapping = {
        currentUrl: true,
        onerror: true,
        onload: true,
        onreadystatechange: true,
        ontimeout: true,
        // responseType:true,
        timeout: true,               // IE系列只有open连接之后才支持覆盖
        withCredentials: true,
        xhr_ie8: true
      }
      var temp = {}

      for (var key in data) {
        if (mapping[key]) {
          if (isNaN(tool.getIEVersion()) && key !== 'timeout') {
            temp[key] = data[key]
          } else {
            var newKey = '_' + key
            temp[newKey] = data[key]
          }
        }
      }

      for (var i = 0; i < requestNum; i++) {
        var nullRequest = tool.createXhrObject()
        tool.MergeObject(nullRequest, temp)
        selfData.requestPool.push(nullRequest)
      }
    },
    // 创建请求池中链接
    createPool: function () {
      // IE 系列不支持发送请求传''，所以默认/
      tempObj.common({url: '/'}, true)
      tool.deepCloneXhr(selfData.xhr, initParam.pool.requestNumber)
    },
    // 请求池申请请求使用
    useRequestPool: function (param) {
      // mock数据校验
      var ajaxSetting = tool.checkParam(param)
      var urlMockValue = ajaxSetting.mock.mockData[ajaxSetting.url]
      if (ajaxSetting.mock.isOpen && urlMockValue) {
        ajaxSetting.successEvent(urlMockValue)
      } else {
        // 判断请求池中是否有可用请求
        if (selfData.requestPool.length !== 0) {
          var temp = selfData.requestPool.shift(), sendData = '', tempHeader = {}
          // 赋值操作,将数据捆绑到原型上
          temp.callback_success = ajaxSetting.successEvent
          temp.callback_error = ajaxSetting.errorEvent
          temp.callback_timeout = ajaxSetting.timeoutEvent
          temp.data = ajaxSetting.data

          // 处理参数
          switch (ajaxSetting.contentType) {
            case '':
              tool.each(tool.MergeObject(ajaxSetting.data, initParam.publicData), function (item, index) {
                sendData += (index + "=" + item + "&")
              });
              sendData = sendData.slice(0, -1);
              break
            case 'json':
              sendData = JSON.stringify(tool.MergeObject(ajaxSetting.data, initParam.publicData))
              break
            case 'form':
              if (!tool.isEmptyObject(initParam.publicData)) {
                tool.each(initParam.publicData, function (item, index) {
                  ajaxSetting.data.append(index, item)
                })
              }
              sendData = ajaxSetting.data
              break
          }

          //判断请求类型
          if (ajaxSetting.type === 'get') {
            temp.open(ajaxSetting.type, tool.checkRealUrl(ajaxSetting.url, temp) + (sendData === '' ? '' : ('?' + sendData)))
          } else {
            temp.open(ajaxSetting.type, tool.checkRealUrl(ajaxSetting.url, temp))
          }

          ajaxSetting.responseType ? (temp.responseType = ajaxSetting.responseType) : null

          if (!isNaN(tool.getIEVersion())) {
            temp.timeout = temp._timeout
          }

          switch (ajaxSetting.contentType) {
            case '':
              tempHeader['Content-Type'] = 'application/x-www-form-urlencoded'
              break
            case 'json':
              tempHeader['Content-Type'] = 'application/json'
              break
          }

          //设置http协议的头部
          tool.each(tool.MergeObject(tempHeader, initParam.requestHeader), function (item, index) {
            temp.setRequestHeader(index, item)
          });

          //发送请求
          temp.send(ajaxSetting.type === 'get' ? '' : sendData);
        } else {
          // 没有请求，加载到待发送队列中
          selfData.queuePool.push(ajaxSetting)
        }
      }
    },
    // 请求周期结束操作
    responseOver: function (xhr) {
      selfData.requestPool.push(xhr)
      if (selfData.queuePool.length > 0) {
        var tempData = selfData.queuePool.shift()
        tool.useRequestPool(tempData)
      }
    }
  };

  //抛出去给外部使用的方法
  var tempObj = {
    //通用ajax
    common: function (options, isCreatePoll) {
      //每次清空请求缓存,并重新合并对象
      var ajaxSetting = tool.checkParam(options),
        sendData = '';

      // mock数据校验
      var urlMockValue = ajaxSetting.mock.mockData[ajaxSetting.url]
      if (ajaxSetting.mock.isOpen && urlMockValue) {
        ajaxSetting.successEvent(urlMockValue)
      } else {
        //创建xhr对象
        var xhr = tool.createXhrObject();

        //针对某些特定版本的mozillar浏览器的BUG进行修正
        xhr.overrideMimeType ? (xhr.overrideMimeType("text/javascript")) : (null);

        //针对IE8的xhr做处理    PS：ie8下的xhr无xhr.onload事件，所以这里做判断
        xhr.onload === undefined ? (xhr.xhr_ie8 = true) : (xhr.xhr_ie8 = false);

        //参数处理（get和post）,包括xhr.open     get:拼接好url再open   post:先open，再设置其他参数
        if (ajaxSetting.data) {
          switch (ajaxSetting.contentType) {
            case '':
              tool.each(tool.MergeObject(ajaxSetting.data, ajaxSetting.publicData), function (item, index) {
                sendData += (index + "=" + item + "&")
              });
              sendData = sendData.slice(0, -1);
              ajaxSetting.requestHeader['Content-Type'] = 'application/x-www-form-urlencoded'
              break
            case 'json':
              sendData = JSON.stringify(tool.MergeObject(ajaxSetting.data, ajaxSetting.publicData))
              ajaxSetting.requestHeader['Content-Type'] = 'application/json'
              break
            case 'form':
              if (!tool.isEmptyObject(ajaxSetting.publicData)) {
                tool.each(ajaxSetting.publicData, function (item, index) {
                  ajaxSetting.data.append(index, item)
                })
              }
              sendData = ajaxSetting.data
              // ajaxSetting.requestHeader['Content-Type'] = 'multipart/form-data'
              break
          }
          //请求前处理参数
          sendData = ajaxSetting.transformRequest(sendData)

          //判断请求类型
          if (ajaxSetting.type === 'get') {
            xhr.open(ajaxSetting.type, tool.checkRealUrl(ajaxSetting.url, xhr) + '?' + sendData, ajaxSetting.async)
          } else {
            xhr.open(ajaxSetting.type, tool.checkRealUrl(ajaxSetting.url, xhr), ajaxSetting.async)
          }
        } else {
          xhr.open(ajaxSetting.type, ajaxSetting.baseURL + ajaxSetting.url, ajaxSetting.async)
        }

        /*
        * 同步请求注意事项
        *   xhr.timeout必须为0
        *   xhr.withCredentials必须为 false
        *   xhr.responseType必须为""（注意置为"text"也不允许）
        * */
        if (ajaxSetting.async) {
          xhr.timeout = ajaxSetting.timeout
          xhr.responseType = ajaxSetting.responseType;
          xhr.withCredentials = ajaxSetting.withCredentials;
        } else {
          //xhr.responseType = ""    // responseType在同步下。连设置都不允许
          // xhr.timeout = 0  // timeout在同步下。连设置都不允许
          xhr.withCredentials = false
        }

        //设置http协议的头部
        tool.each(ajaxSetting.requestHeader, function (item, index) {
          xhr.setRequestHeader(index, item)
        });

        //onload事件（IE8下没有该事件）
        xhr.onload = function (e) {
          if (this.readyState === 4 && (this.status == 200 || this.status == 304)) {
            /*
            *  ie浏览器全系列不支持responseType='json'和response取值，所以在ie下使用JSON.parse进行转换
            * */
            if (!isNaN(tool.getIEVersion())) {
              if (this.responseType === 'json') {
                this.callback_success ?
                  this.callback_success(ajaxSetting.transformResponse(JSON.parse(this.responseText))) :
                  ajaxSetting.successEvent(ajaxSetting.transformResponse(JSON.parse(this.responseText)));
              } else {
                this.callback_success ?
                  this.callback_success(ajaxSetting.transformResponse(this.responseText)) :
                  ajaxSetting.successEvent(ajaxSetting.transformResponse(this.responseText));
              }
            } else {
              this.callback_success ?
                this.callback_success(ajaxSetting.transformResponse(this.response)) :
                ajaxSetting.successEvent(ajaxSetting.transformResponse(this.response));
            }
          } else {
            /*
             *  这边为了兼容IE8、9的问题，以及请求完成而造成的其他错误，比如404等
             *   如果跨域请求在IE8、9下跨域失败不走onerror方法
             *       其他支持了Level 2 的版本 直接走onerror
             * */
            this.callback_error ?
              this.callback_error(e.currentTarget.status, e.currentTarget.statusText) :
              ajaxSetting.errorEvent(e.currentTarget.status, e.currentTarget.statusText);

            // 请求错误搜集
            tool.uploadAjaxError({
              type: 'request',
              errInfo: JSON.stringify(this.data ? this.data : ajaxSetting.data),
              errUrl: this.currentUrl,
              errLine: this.status,
              Browser: navigator.userAgent
            })
          }

          // 生命周期结束之后返回数据池，不绑定状态（是否为成功或失败状态）
          if (ajaxSetting.pool.isOpen) {
            tool.responseOver(this)
          }
        };

        //xmlhttprequest每次变化一个状态所监控的事件（可拓展）
        xhr.onreadystatechange = function () {
          switch (this.readyState) {
            case 1://打开
              //do something
              break;
            case 2://获取header
              //do something
              break;
            case 3://请求
              //do something
              break;
            case 4://完成
              //在ie8下面，无xhr的onload事件，只能放在此处处理回调结果
              if (this.xhr_ie8) {
                if (this.status === 200 || this.status === 304) {
                  if (this.responseType == "json") {
                    this.callback_success ?
                      this.callback_success(ajaxSetting.transformResponse(JSON.parse(this.responseText))) :
                      ajaxSetting.successEvent(ajaxSetting.transformResponse(JSON.parse(this.responseText)))
                  } else {
                    this.callback_success ?
                      this.callback_success(ajaxSetting.transformResponse(this.responseText)) :
                      ajaxSetting.successEvent(ajaxSetting.transformResponse(this.responseText))
                  }
                } else {
                  // 请求错误搜集
                  tool.uploadAjaxError({
                    type: 'request',
                    errInfo: JSON.stringify(this.data ? this.data : ajaxSetting.data),
                    errUrl: this.currentUrl,
                    errLine: this.status,
                    Browser: navigator.userAgent
                  })
                }
                // 针对IE8 请求池处理
                if (ajaxSetting.pool.isOpen) {
                  tool.responseOver(this)
                }
              } else {
                if (this.status === 0) {
                  // 发送不存在请求，将不会走onload，直接这里就挂了，请求归还请求池
                  if (ajaxSetting.pool.isOpen) {
                    tool.responseOver(this)
                  }
                }
              }
              break;
          }
          ;
        };

        //ontimeout超时事件
        xhr.ontimeout = function (e) {
          this.callback_timeout ?
            this.callback_timeout("000000", e ? (e.type) : ("timeoutEvent")) :
            ajaxSetting.timeoutEvent("000000", e ? (e.type) : ("timeoutEvent"));   //IE8 没有e参数
          this.abort();  //关闭请求
          // 请求错误搜集
          tool.uploadAjaxError({
            type: 'request',
            errInfo: JSON.stringify(this.data ? this.data : ajaxSetting.data),
            errUrl: this.currentUrl,
            errLine: 'timeout',
            Browser: navigator.userAgent
          })
        };

        //错误事件，直接ajax失败，而不走onload事件
        xhr.onerror = function (e, x, xx, xxx, xxxx) {
          this.callback_error ?
            this.callback_error(e) :
            ajaxSetting.errorEvent(e)

          // 请求错误搜集
          tool.uploadAjaxError({
            type: 'request',
            errInfo: JSON.stringify(this.data ? this.data : ajaxSetting.data),
            errUrl: this.currentUrl,
            errLine: 'RequestErr',
            Browser: navigator.userAgent
          })
        };

        if (!isCreatePoll) {
          //发送请求
          xhr.send(ajaxSetting.type === 'get' ? '' : sendData);
        } else {
          selfData.xhr = xhr
        }
      }
    },
    //设置ajax全局配置文件
    config: function (config) {
      // 深度拷贝且检查过没有错误的对象
      var temp = tool.checkParam(config)
      tool.MergeObject(initParam, temp)
      if (initParam.errStatus.isOpenErr) {
        tool.setOnerror();
      }

      if (initParam.pool.isOpen) {
        // 清空请求池+排队队列
        selfData.requestPool = []
        selfData.queuePool = []
        // 重新建立请求池
        tool.createPool()
      }
    },
    //异步get请求
    get: function (url, data) {
      return new Promise(function (res, rej) {
        var ajaxParam = {
          type: "get",
          url: url,
          data: data,
          contentType: '',
          successEvent: res,
          errorEvent: rej,
          timeoutEvent: rej
        };
        if (initParam.pool.isOpen) {
          tool.useRequestPool(ajaxParam)
        } else {
          tempObj.common(ajaxParam);
        }
      })
    },
    //异步post请求
    post: function (url, data) {
      return new Promise(function (res, rej) {
        var ajaxParam = {
          type: "post",
          url: url,
          data: data,
          contentType: 'json',
          successEvent: res,
          errorEvent: rej,
          timeoutEvent: rej
        };

        if (initParam.pool.isOpen) {
          tool.useRequestPool(ajaxParam)
        } else {
          tempObj.common(ajaxParam);
        }
      })
    },
    //异步post请求
    postFormData: function (url, formData) {
      return new Promise(function (res, rej) {
        var ajaxParam = {
          type: "post",
          url: url,
          data: formData,
          contentType: 'form',
          successEvent: res,
          errorEvent: rej,
          timeoutEvent: rej
        };
        if (initParam.pool.isOpen) {
          tool.useRequestPool(ajaxParam)
        } else {
          tempObj.common(ajaxParam);
        }
      })
    },
    //获取blob数据集
    obtainBlob: function (type, url, data) {
      return new Promise(function (res, rej) {
        var ajaxParam = {
          type: type,
          url: url,
          data: data,
          responseType: 'blob',
          successEvent: res,
          errorEvent: rej,
          timeoutEvent: rej
        };
        if (initParam.pool.isOpen) {
          tool.useRequestPool(ajaxParam)
        } else {
          tempObj.common(ajaxParam);
        }
      })
    },
    /*
     * 长轮询的实现
     *   param: type  请求类型
     *          url   请求接口地址
     *          data  请求参数
     *          successEvent(data,this)     成功事件处理  如果得到正确数据，则让轮询停止，则在第二个回调参数设置stop属性就好
     *          timeFrequency               每隔多少时间发送一次请求
     *          errorEvent                  错误事件
     *          timeoutEvent                超时处理
     * */
    longPolling: function (type, url, data, successEvent, timeFrequency, errorEvent, timeoutEvent) {
      var ajaxParam = {
        type: type,
        url: url,
        data: data,
        contentType: '',
        successEvent: function (dateCall) {
          successEvent(dateCall, this);
          if (!this.stop) {
            setTimeout(function () {
              tempObj.longPolling(type, url, data, successEvent, timeFrequency, errorEvent, timeoutEvent);
            }, timeFrequency);
          }
          ;
        },
        //如果走了error说明该接口有问题，没必要继续下去了
        errorEvent: errorEvent,
        timeoutEvent: function () {
          timeoutEvent();
          setTimeout(function () {
            tempObj.longPolling(type, url, data, successEvent, timeFrequency, errorEvent, timeoutEvent)
          }, timeFrequency);
        }
      };

      if (initParam.pool.isOpen) {
        tool.useRequestPool(ajaxParam)
      } else {
        tempObj.common(ajaxParam);
      }
    },
    /*
     *   ajax上传文件 -- level2的新特性，请保证你的项目支持新的特性再使用
     *       url                 文件上传地址
     *       fileSelector        input=file 选择器
     *       size                文件限制大小
     *       fileType            文件限制类型 mime类型
     *       successEvent             上传成功处理
     *       errorEvent               上传失败处理
     *       timeoutEvent             超时处理
     *
     *   return: status:  0      请选择文件
     *                    1      超出文件限制大小
     *                    2      非允许文件格式
     * */
    upload: function (url, file, size, fileType) {
      return new Promise(function (res, rej) {
        var formdata = new FormData(),
          fileCount = file.length, data = {},
          result = {};
        //以下为上传文件限制检查
        if (fileCount > 0) {
          tool.each(Array.prototype.slice.call(file), function (value) {
            //检查文件大小
            if (value.size > size) {
              result["status"] = 1;
              result["errMsg"] = "超出文件限制大小";
            } else {
              if (fileType != "*") {
                //检查文件格式.因为支持formdata，自然支持数组的indexof(h5)
                if (fileType.indexOf(value.type) === -1) {
                  result["status"] = 2;
                  result["errMsg"] = "非允许文件格式";
                } else {
                  formdata.append(value.name, value);
                }
                ;
              } else {
                formdata.append(value.name, value);
              }
            }
            ;
          });
        } else {
          result["status"] = 0;
          result["errMsg"] = "请选择文件";
        }
        ;

        if (result.status !== undefined) rej(result);   //如果有错误信息直接抛出去,结束运行

        return tempObj.postFormData(url, formdata).then(res, rej)
      })
    },
    /*
     *   ajax大文件切割上传(支持单个文件)  -- level2的新特性，请保证你的项目支持新的特性再使用
     *       url                 文件上传地址
     *       file                input=file选中的文件
     *       cutSize             切割文件大小
     *       fileType            文件限制类型 mime类型
     *       successEvent        上传成功处理
     *       progressEvent       上传进度事件
     *       errorEvent          上传失败处理
     *       timeoutEvent        超时处理事件
     *
     *   return: status:  0      请选择文件
     *                    1      非允许文件格式
     * */
    upload_big: function (url, file, cutSize, fileType, successEvent, progressEvent, errorEvent, timeoutEvent) {
      var result = {};
      //以下为上传文件限制检查
      if (file.length === 1) {
        if (fileType != "*") {
          if (fileType.indexOf(file.type) === -1) {
            result["status"] = 1;
            result["errMsg"] = "非允许文件格式";
          }
        }
      } else {
        result["status"] = 0;
        result["errMsg"] = "请选择文件/只能上传一个文件";
      }
      ;

      if (result.status !== undefined) return result;   //如果有错误信息直接抛出去,结束运行

      //判断上传文件是否超过需要切割的大小
      if (file[0].size > cutSize) {
        var fileArr = tool.cutFile(file[0], cutSize);  //切割文件
        cutFile_upload(fileArr);
      } else {
        var fileForm = new FormData();
        fileForm.append("name", file[0].name);
        fileForm.append("file".name, file[0]);
        fileForm.append("count", 1);
        fileForm.append("cutSize", cutSize);

        tempObj.postFormData(url, fileForm, function (data) {
          successEvent(data);
          progressEvent(1, 1);
        }, errorEvent, timeoutEvent)
      }
      ;

      /*
       *   切割文件上传，配合后台接口进行对接
       *       传输参数：
       *           count   -- 当前传输part的次数
       *           name    -- 做过处理的文件名称
       *           file    -- 上传的.part的切割文件
       *           isLast  -- 是否为最后一次切割文件上传（默认值："true"  字符串，只有最后一次才附加）
       * */
      function cutFile_upload(fileArr, count) {
        var formData = new FormData();
        if (count == undefined) {
          count = 0;
          formData.append("name", fileArr[0].name);
          formData.append("file".name, fileArr[0].file);
        } else {
          if (count === fileArr.length - 1) {
            formData.append("isLast", "true")
          }
          ;
          formData.append("name", fileArr[count].name);
          formData.append("file".name, fileArr[count].file);
        }
        formData.append("count", count);
        formData.append("cutSize", cutSize);
        ;

        tempObj.postFormData(url, formData, function (data) {
          /*
             *   data 参数设置  需要后台接口配合
             *       建议：如果后台成功保存.part文件，建议返回下次所需要的部分，比如当前发送count为0，则data返回下次为1。
             *             如果保存不成功，则可false，或者返回错误信息，可在successEvent中处理
             *
             * */
          progressEvent(count + 1, fileArr.length);   //上传进度事件，第一个参数：当前上传次数；第二个参数：总共文件数

          var currCount = Number(data);
          if (currCount) {
            if (currCount != fileArr.length) {
              cutFile_upload(fileArr, currCount);
            }
            ;
          }
          ;
          successEvent(data);  //成功处理事件
        }, errorEvent, timeoutEvent)
      }
    }
  };

  var outputObj = function () {
    //虽然在IE6、7上可以支持，但是最好升级你的浏览器，毕竟xp已经淘汰，面向未来吧，骚年，和我一起努力吧！！
    if (tool.getIEVersion() < 7) {
      //实在不想说：lowB，升级你的浏览器吧
      throw new Error("Sorry,please upgrade your browser.(IE8+)");
    }

    // 是否开启连接池
    if (initParam.pool.isOpen) {
      tool.createPool()
    }

    tool.each(tempObj, function (value, key) {
      root[key] = value
    })
  };

  new outputObj();

}.call(this));

{'repo_name': 'GerryIsWarrior/ajax', 'stars': '263', 'repo_language': 'HTML', 'file_name': 'test', 'mime_type': 'text/plain', 'hash': -695019175886475748, 'source_dataset': 'data'}


#
# Copyright © 2019 Keith Packard <keithp@keithp.com>
#
# This program 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 of the License, or
# (at your option) any later version.
#
# This program 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.
#
len, 1
print, -1
sys.stdout.flush, 0
end, -2
False, -2, 0
True, -2, 1
ord, 1
chr, 1
abs, 1
math.sqrt, 1
None, -2, SNEK_NULL

{'repo_name': 'keith-packard/snek', 'stars': '130', 'repo_language': 'C', 'file_name': 'make-step', 'mime_type': 'text/x-python', 'hash': -1187892299513603307, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="DP test suite" parallel="tests" thread-count="5">
    <test name="DP - 1">
        <classes>
            <class name="info.testing.automated.tests.DataProviderTests">
                <methods>
                    <include name="getFirstSampleData"/>
                </methods>
            </class>
        </classes>
    </test>

    <test name="DP - 2">
        <classes>
            <class name="info.testing.automated.tests.DataProviderTests">
                <methods>
                    <include name="getSecondSampleData"/>
                </methods>
            </class>
        </classes>
    </test>

    <test name="DP - 3">
        <classes>
            <class name="info.testing.automated.tests.DataProviderTests">
                <methods>
                    <include name="getThirdSampleData"/>
                </methods>
            </class>
        </classes>
    </test>

    <test name="DP - 4">
        <classes>
            <class name="info.testing.automated.tests.DataProviderTests">
                <methods>
                    <include name="saveFirstSampleData"/>
                </methods>
            </class>
        </classes>
    </test>

    <test name="DP - 5">
        <classes>
            <class name="info.testing.automated.tests.DataProviderTests">
                <methods>
                    <include name="saveSecondSampleData"/>
                </methods>
            </class>
        </classes>
    </test>
</suite>

{'repo_name': 'atinfo/at.info-knowledge-base', 'stars': '175', 'repo_language': 'Java', 'file_name': 'README.md', 'mime_type': 'text/plain', 'hash': -4489451358786980796, 'source_dataset': 'data'}